2008-06-11 Martin Baulig <martin@ximian.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-06-11  Martin Baulig  <martin@ximian.com>
2
3         * location.cs
4         (Location.LookupFile): Add `CompilationUnit' argument; when given
5         a relative file name, make it relative to the directory the .cs
6         file is located in instead of using the current directory.
7
8 2008-06-11  Martin Baulig  <martin@ximian.com>
9
10         * class.cs
11         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
12         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
13         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
14         (SourceMethod.SetCompilerGenerated): Likewise.
15
16 2008-06-11  Marek Safar  <marek.safar@gmail.com>
17
18         * codegen.cs, driver: Only write symbol file when it's asked for.
19
20 2008-06-11  Marek Safar  <marek.safar@gmail.com>
21
22         * codegen.cs: Don't use assembly writer error handling for symbol writer.
23
24 2008-06-10  Martin Baulig  <martin@ximian.com>
25
26         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
27
28 2008-06-09  Marek Safar  <marek.safar@gmail.com>
29
30         A fix for bug #316290
31         * expression.cs: Include decimal operators in predefined table.
32         
33         * parameters.cs: More readonlyness.
34
35 2008-06-09  Marek Safar  <marek.safar@gmail.com>
36
37         A fix for bug #397213
38         * cs-parser.jay: One more missing current_local_parameters reset.
39
40 2008-06-09  Marek Safar  <marek.safar@gmail.com>
41
42         A fix for bug #396633
43         * class.cs: Host backing field in partial container.
44
45 2008-06-09  Marek Safar  <marek.safar@gmail.com>
46
47         A fix for bug #397068
48         * expression.cs: Check both operand types when predefined operator is used.
49
50 2008-06-05  Martin Baulig  <martin@ximian.com>
51
52         Merged the `debugger-kahalo' branch.
53
54         * class.cs
55         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
56         we're an iterator method.
57         (SourceMethod): Reflect latest symbol writer changes;
58         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
59         now `start_row' and `end_row'.
60         (Constructor.Emit): Fix the logic whether to emit symbol information.
61
62         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
63         generated methods.
64
65         * location.cs
66         (CompilationUnit): New public class; derives from `SourceFile'.
67         (SourceFileEntry.DefineSymbolInfo): New public method.
68         (SourceFileEntry.SetChecksum): New public method.
69         (Location): Encode hidden line numbers by using `column == 255';
70         the .ctor now accepts `column == -1' to mark a hidden line number.
71         (Location.Hidden): New public property.
72         (Location.CheckPoint): Add `CompilationUnit'.
73         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
74         (Location.Push): Add `CompilationUnit compile_unit' argument.
75         (Location.CompilationUnit): New public property.
76
77         * statement.cs
78         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
79
80         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
81
82         * driver.cs: `SourceFile' -> `CompilationUnit'.
83
84         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
85
86         * namespace.cs: `SourceFile' -> `CompilationUnit'.
87
88         * cs-tokenizer.cs: Add support for `#pragma checksum' and
89         `#line hidden'.
90
91         * symbolwriter.cs
92         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
93         new symbol writer API to also pass the file.
94
95 2008-06-05  Marek Safar  <marek.safar@gmail.com>
96
97         * statement.cs: Emit catch variable assignment using variable expression.
98         
99 2008-06-05  Marek Safar  <marek.safar@gmail.com>
100
101         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
102         with other variable types.
103
104 2008-06-04  Marek Safar  <marek.safar@gmail.com>
105
106         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
107         GetLength method emit, it breaks resolve rules.
108         
109 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
110             Marek Safar  <marek.safar@gmail.com>
111                         
112         A fix for bug #395542
113         * cs-parser.jay: The trailing comma is allowed in anonymous type member
114         declaration.
115         
116 2008-06-02  Marek Safar  <marek.safar@gmail.com>
117
118         A fix for bug #395287
119         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
120
121 2008-05-31  Marek Safar  <marek.safar@gmail.com>
122
123         A fix for bug #395845
124         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
125         non-nullable parameter type.
126         
127 2008-05-31  Marek Safar  <marek.safar@gmail.com>
128
129         * class.cs: Handle contructor initializer as a statement in top-level block.
130
131 2008-05-30  Marek Safar  <marek.safar@gmail.com>
132
133         * attribute.cs: Don't mix old and new corlib types when emitting corlib
134         security attributes.
135
136 2008-05-24  Marek Safar  <marek.safar@gmail.com>
137
138         * ecore.cs, expression.cs: Small IVariable refactoring.
139
140 2008-05-22  Marek Safar  <marek.safar@gmail.com>
141
142         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
143
144 2008-05-21  Marek Safar  <marek.safar@gmail.com>
145
146         * cs-parser.jay: Removed redundant catch type check.
147
148 2008-05-21  Marek Safar  <marek.safar@gmail.com>
149
150         A fix for bug #390372
151         * nullable.cs: Set correct return type.
152
153 2008-05-21  Marek Safar  <marek.safar@gmail.com>
154
155         A fix for bug #391062
156         * typemanager.cs: Fixed crash when comparing null types.
157
158 2008-05-21  Marek Safar  <marek.safar@gmail.com>
159
160         A fix for bug #391871
161         * cs-parser.jay: Better error handling for invalid catch type.
162
163 2008-05-20  Marek Safar  <marek.safar@gmail.com>
164
165         A fix for bug #392155
166         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
167
168 2008-05-15  Marek Safar  <marek.safar@gmail.com>
169
170         A fix for bug #390666
171         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
172         expressions.
173
174 2008-05-15  Marek Safar  <marek.safar@gmail.com>
175
176         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
177         in getter.
178
179 2008-05-13  Marek Safar  <marek.safar@gmail.com>
180
181         A fix for bug #389625
182         * delegate.cs, generic.cs: Some progress on method group return type
183         inference.
184
185 2008-05-13  Marek Safar  <marek.safar@gmail.com>
186
187         A fix for bug #378419
188         * namespace.cs: Inspect also parent namespaces not only namespace entries.
189
190 2008-05-12  Marek Safar  <marek.safar@gmail.com>
191
192         * class.cs (Constructor): Added IsCompilerGenerated.
193
194 2008-05-12  Marek Safar  <marek.safar@gmail.com>
195
196         * expression.cs: Enum binary operators can accept non-enum operand only when
197         is implicitly convertible to underlying type.
198
199 2008-05-12  Marek Safar  <marek.safar@gmail.com>
200
201         A fix for bug #389272
202         * support.cs: Workaround System.InvalidOperationException for enums.
203
204 2008-05-12  Marek Safar  <marek.safar@gmail.com>
205
206         A fix for bug #389073
207         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
208
209 2008-05-10  Marek Safar  <marek.safar@gmail.com>
210
211         * driver.cs: Split Parse.
212         
213         * location.cs (LookupFile): Uses string.Empty.
214
215 2008-05-07  Marek Safar  <marek.safar@gmail.com>
216
217         * expression.cs, parameter.cs: Small ParameterReference clean up.
218
219 2008-05-07  Marek Safar  <marek.safar@gmail.com>
220
221         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
222         hack. Fixes #387502.
223
224 2008-05-06  Martin Baulig  <martin@ximian.com>
225
226         * class.cs (Constructor.Emit): Fix the logic whether to emit
227         symbol information.
228
229 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
230
231         Fix #385503
232         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
233         InvalidOperationException when the iterator is before the start or
234         after the end.
235
236 2008-05-06  Marek Safar  <marek.safar@gmail.com>
237
238         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
239         when left is nullable type.
240
241 2008-05-06  Marek Safar  <marek.safar@gmail.com>
242
243         A fix for bug #386628
244         * expression.cs (LocalVariableReference): Continue in resolving when
245         variable is not assigned.
246
247 2008-05-05  Marek Safar  <marek.safar@gmail.com>
248
249         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
250         nullable operations.
251
252 2008-05-04  Marek Safar  <marek.safar@gmail.com>
253
254         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
255         it saves many redundant temporary variables for nullable operations.
256
257 2008-05-03  Marek Safar  <marek.safar@gmail.com>
258
259         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
260         
261         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
262         method.
263         
264         * nullable.cs: Constant coalescing operator optimizations.
265
266 2008-05-03  Marek Safar  <marek.safar@gmail.com>
267
268         * constant.cs: Use unsigned conversion for values which are unsigned only.
269
270 2008-05-03  Marek Safar  <marek.safar@gmail.com>
271
272         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
273         coalescing operator as it should be.
274
275 2008-05-02  Marek Safar  <marek.safar@gmail.com>
276
277         A fix for bug #371016
278         * expression.cs: All predefined delegate operators require implicit method
279         group conversion.
280         
281 2008-05-02  Marek Safar  <marek.safar@gmail.com>
282
283         * constant.cs: Emit long constant as uint when fits the range.
284         
285         * convert.cs, expression.cs: Fixed few unsafe conversions.
286
287 2008-05-02  Marek Safar  <marek.safar@gmail.com>
288
289         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
290
291 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
292
293         Fix #385758
294         * convert.cs (ImplicitNumericConversion): Don't modify the type of
295         'expr'.
296         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
297
298 2008-05-01  Marek Safar  <marek.safar@gmail.com>
299
300         * constant.cs, literal.cs: IsLiteral property for error reporting.
301         
302         * ecore.cs, expression.cs: Implemented Property expression.
303
304 2008-05-01  Marek Safar  <marek.safar@gmail.com>
305
306         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
307         
308         * nullable.cs: Implemented nullable coalescing null operator.
309
310         * ecore.cs, expression.cs: Expression trees work.
311
312 2008-05-01  Marek Safar  <marek.safar@gmail.com>
313
314         * ecore.cs: CreateExpressionTree is finally abstract.
315
316         * expression.cs, linq.cs: Updated.
317
318 2008-05-01  Marek Safar  <marek.safar@gmail.com>
319
320         * expression.cs, ecore.cs: Block base access expression inside expression
321         tree.
322
323 2008-05-01  Marek Safar  <marek.safar@gmail.com>
324
325         A fix for bug #385058
326         * expression.cs: User-defined operator implementations always take
327         precedence over predefined operator implementations.
328
329 2008-04-30  Marek Safar  <marek.safar@gmail.com>
330
331         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
332         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
333         expression tree conversions.
334         
335 2008-04-30  Marek Safar  <marek.safar@gmail.com>
336
337         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
338         operators method details to Operator class.
339
340 2008-04-30  Marek Safar  <marek.safar@gmail.com>
341
342         * anonymous.cs: Pass unsafe flags to anonymous container.
343         
344         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
345         inside expression tree.
346
347 2008-04-29  Martin Baulig  <martin@ximian.com>
348
349         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
350         (Tokenizer.PopPosition): Also restore the `line'.
351
352 2008-04-29  Marek Safar  <marek.safar@gmail.com>
353
354         * delegate.cs: Implemented Invoke expression.
355
356 2008-04-29  Marek Safar  <marek.safar@gmail.com>
357
358         * expression.cs: Fixed equality reference comparison regression.
359
360 2008-04-29  Marek Safar  <marek.safar@gmail.com>
361
362         * ecore.cs: Clean up EmptyCast hack.
363         
364         * expression.cs, nullable.cs: Implemented enum binary and unary operations
365         using correct conversion rules. Also fixes #383993.
366
367 2008-04-28  Martin Baulig  <martin@ximian.com>
368
369         * class.cs (Constructor.Emit): Don't emit debugging information
370         for generated default .ctor's.
371
372 2008-04-28  Marek Safar  <marek.safar@gmail.com>
373
374         * convert.cs: Empty-cast ushort to int conversion.
375
376 2008-04-28  Marek Safar  <marek.safar@gmail.com>
377
378         A fix for bug #384191
379         * ecore.cs, expression.cs: Fixed expression cloning.
380
381 2008-04-28  Marek Safar  <marek.safar@gmail.com>
382
383         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
384
385 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
386
387         Fix #381559, test-638.cs, test-639.cs
388         * assign.cs (CompoundAssign.Helper): New wrapper.
389         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
390         access.
391         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
392         Pass unconverted expressions to the params array creation expression.
393         (FieldExpr.EmitAssign): Don't special-case StringConcat.
394         (PropertyExpr.EmitAssign): Likewise.
395         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
396         element if it is of kind CompoundAssign.Helper.
397         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
398         first before anything else.
399         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
400         (ArrayAccess.LoadArrayAndArguments): Simplify.
401
402 2008-04-27  Marek Safar  <marek.safar@gmail.com>
403
404         * expression.cs: Fixed cloning of typeof(void).
405
406 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
407
408         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
409         (Assign.Emit): Likewise.  Move it to ...
410         (CompoundAssign.DoResolve): ... here and ...
411         (CompoundAssign.Emit): ... here.
412         (EventAddOrRemove): New helper to handle += and -= on events, and
413         avoid the use of BinaryDelegates.
414         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
415         (EventExpr.EmitAddOrRemove): Improve.
416         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
417
418         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
419         create VarExprs for 'foo.bar.var'.
420         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
421         is a highly inappropriate name for its functionality.
422
423 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
424
425         Simplify handling of multiple assignments
426         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
427         inheritable-only.
428         (SimpleAssign): New.  Class to be used for normal assignments.
429         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
430         * expression.cs, parameter.cs, statement.cs: Likewise.
431
432 2008-04-25  Marek Safar  <marek.safar@gmail.com>
433
434         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
435         for incompatible underlying types, more to come, uff.
436
437 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
438
439         Fix gtest-388.cs
440         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
441         Handle 'leave_copy'.
442
443 2008-04-25  Marek Safar  <marek.safar@gmail.com>
444
445         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
446
447 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
448
449         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
450         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
451         * statement.cs (While, Do, For): Allow test to have side effects.
452         (For.DoEmit): Always emit InitStatement.
453
454         Fix test-635.cs
455         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
456         Always create SideEffectConstant.
457         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
458         of type EnumConstant.
459
460         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
461         Handle 'right' being SideEffectConstant of type 'bool'.
462
463         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
464         Use left.EmitBranchable instead of open coding it, so as to
465         improve optimization opportunities.
466
467         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
468
469         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
470         assumptions.
471         (Expression.EmitSideEffect): Document.
472
473 2008-04-23  Marek Safar  <marek.safar@gmail.com>
474
475         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
476
477 2008-04-23  Marek Safar  <marek.safar@gmail.com>
478
479         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
480
481 2008-04-23  Marek Safar  <marek.safar@gmail.com>
482
483         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
484         conversion to expression tree.
485
486 2008-04-23  Marek Safar  <marek.safar@gmail.com>
487
488         * ecore.cs: Removed unused expression.
489
490 2008-04-22  Marek Safar  <marek.safar@gmail.com>
491
492         * expression.cs: Implemented NegateChecked and New expressions.
493
494 2008-04-22  Marek Safar  <marek.safar@gmail.com>
495
496         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
497
498 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
499
500         Fix #351102
501         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
502         needing final 'ret' instruction.
503
504 2008-04-22  Marek Safar  <marek.safar@gmail.com>
505
506         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
507
508 2008-04-21  Marek Safar  <marek.safar@gmail.com>
509
510         * expression.cs: Emit ldnull and not null expression as an instance argument
511          of static method expression calls.
512
513 2008-04-21  Marek Safar  <marek.safar@gmail.com>
514
515         A fix for bug #378200
516         * expression.cs: Fixed crash when creating parameterless expression tree
517         method call.
518
519 2008-04-21  Marek Safar  <marek.safar@gmail.com>
520
521         A fix for bug #375297
522         * anonymous.cs: Fixed crash when inferring from null argument anonymous
523         method.
524
525 2008-04-21  Marek Safar  <marek.safar@gmail.com>
526
527         A fix for bug #377596
528         * decl.cs, class.cs: Emit delegate type argument attributes.
529
530 2008-04-21  Marek Safar  <marek.safar@gmail.com>
531
532         A fix for bug #365314
533         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
534         
535 2008-04-21  Marek Safar  <marek.safar@gmail.com>
536
537         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
538         only.
539
540 2008-04-21  Marek Safar  <marek.safar@gmail.com>
541
542         * generic.cs (TypeParameter): Removed redundant location.
543
544 2008-04-19  Marek Safar  <marek.safar@gmail.com>
545
546         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
547         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
548         FullNamedExpression in all declaration type expression, statements will come
549         later.
550
551 2008-04-18  Marek Safar  <marek.safar@gmail.com>
552
553         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
554         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
555
556 2008-04-18  Marek Safar  <marek.safar@gmail.com>
557
558         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
559         code.
560
561 2008-04-17  Marek Safar  <marek.safar@gmail.com>
562
563         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
564         constraints.
565
566 2008-04-17  Marek Safar  <marek.safar@gmail.com>
567
568         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
569         name expressions.
570         Also fixes #340463.
571
572 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
573
574         Hook up 'EmitSideEffect'
575         * constant.cs (Constant.EmitSideEffect): New.
576         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
577         (SideEffectConstant.EmitSideEffect): New.
578         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
579         unconditional branch in EmitBranchable.
580         (FieldExpr.EmitBranchable): New.
581         * expression.cs (Unary.EmitSideEffect): New.
582         (Binary.EmitSideEffect): New.
583         (VariableReference.EmitSideEffect): New.  Do nothing.
584
585 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
586
587         Introduce 'EmitSideEffect'
588         * ecore.cs (Expression.EmitSideEffect): New.
589         (TypeCast): Rename from EmptyCast.
590         (EmptyCast): New.
591         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
592         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
593         * convert.cs, nullable.cs: Update to changes.
594
595 2008-04-16  Marek Safar  <marek.safar@gmail.com>
596
597         * class.cs, cs-parser.jay: Early check for base types expression.
598
599 2008-04-16  Marek Safar  <marek.safar@gmail.com>
600
601         * decl.cs (MemberName): Declare PrettyName as obsolete.
602
603 2008-04-16  Marek Safar  <marek.safar@gmail.com>
604
605         * namespace.cs: Use MemberName comparison.
606
607 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
608
609         Fix build break
610         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
611         FullName.
612         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
613         (MemberName.FullyQualifiedName): New.  Provides the functionality
614         that users assume FullName would have.
615         * ecore.cs, namespace.cs: Update to changes.
616
617         * statement.cs (Using.assign): Make into ExpressionStatement.
618         (Using.EmitPreTryBody): Simplify.
619
620 2008-04-16  Marek Safar  <marek.safar@gmail.com>
621
622         * report.cs: ColorFormat is protected.
623         
624         * rootcontext.cs: Unused fields clean-up.
625         
626         * namespace.cs: Made UsingEntry name private.
627
628 2008-04-16  Marek Safar  <marek.safar@gmail.com>
629
630         * cs-tokenizer.cs, location.cs: Removed unused field.
631
632 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
633             Raja R Harinath  <harinath@hurrynot.org>
634
635         Fix #379822
636         * constant.cs (SideEffectConstant.value): Rename from 'left'.
637         (SideEffectConstant.side_effect): Rename from 'right'.
638         (SideEffectConstant..ctor): Normalize 'side_effect'.
639         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
640         value of this constant.
641         * cfold.cs: Update to changes.
642
643 2008-04-15  Marek Safar  <marek.safar@gmail.com>
644
645         * cs-paser.jay: Removed unused variable.
646         
647         * driver.cs: Made Compile instance method.
648
649 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
650
651         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
652
653 2008-04-15  Marek Safar  <marek.safar@gmail.com>
654
655         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
656
657 2008-04-13  Jb Evain  <jbevain@novell.com>
658
659         * namespace.cs: update the System.Core fullname for 2.1
660         * driver.cs: update the list of required assemblies for 2.1.
661         Merged from the Moonlight 2 branch.
662
663 2008-04-11  Marek Safar  <marek.safar@gmail.com>
664
665         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
666         types and user defined operators. User operators arguments has to be checked
667         for null value before invocation, which also means no operator is called
668         when any argument is not convertible to unwrapped nullable type.
669         
670 2008-04-09  Marek Safar  <marek.safar@gmail.com>
671
672         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
673         of Unary expressions to follow operator overloading rules precisely.
674         Also fixes #321794, #323794
675         
676 2008-04-08  Marek Safar  <marek.safar@gmail.com>
677
678         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
679         expression.
680         
681 2008-04-08  Marek Safar  <marek.safar@gmail.com>
682
683         * expression.cs, ecore.cs: Implemented MemberInit expression.
684         
685 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
686
687         Fix mono/tests/exception4.cs
688         * statement.cs (ExceptionStatement, TryCatch): Revert to using
689         ec.NeedReturnLabel () rather emitting a 'nop'.
690
691         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
692         simple heuristic.
693         (TryCatch.SomeCodeFollows): Likewise.
694         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
695         for 'break', 'continue' and 'return' statements inside a try.
696         We're fairly sure that the generated IL stream will have more
697         instructions textually following the try.
698         (FlowBranchingTryCatch): Likewise.
699
700         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
701         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
702         overrides.
703
704         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
705         wrapper -- forward everything to CollectionForeach.
706         (CollectionForeach.NonDisposableWrapper): New.
707         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
708         instead of a pop + branch to end.
709
710 2008-04-07  Marek Safar  <marek.safar@gmail.com>
711
712         A fix for bug #377485
713         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
714         Propagate location for extension method groups. Report conversion failure at
715         right place.
716
717 2008-04-07  Marek Safar  <marek.safar@gmail.com>
718
719         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
720         ListInit and Field expressions.
721
722 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
723
724         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
725         Since $PC is always -1 inside the body of MoveNext, the fault
726         handler is a no-op.
727         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
728         * statement.cs (ExceptionStatement.emit_finally): Likewise.
729         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
730
731         The denouement!  Fix #324708
732         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
733         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
734         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
735         'finally' inside the finally clause.
736
737         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
738         inside an iterator.  Don't emit the body of the 'finally' inside
739         the finally clause yet.
740
741         Use the ResumableStatement infrastructure for MoveNext ()
742         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
743         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
744         'old_resume_points'.  Move dispatcher upfront.
745         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
746         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
747         in an enumerator.  This encodes the main fix in this patch series
748         -- we can only jump into the first instruction of a try from the
749         outside, but we want to emit try/finally regions in iterators and
750         resume in the middle of them.
751
752 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
753
754         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
755         of NeedReturnLabel here.
756
757         Introduce a common point for emitting try/finally to IL
758         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
759         features of the various subclasses, which are now driven by ...
760         (ExceptionStatement.EmitPreTryBody): ... this and ...
761         (ExceptionStatement.EmitTryBody): ... this and the original
762         EmitFinallyBody.
763         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
764         Remove DoEmit and update to follow above protocol.
765
766         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
767         of the dispatcher are the same, skip emitting the 'switch'.
768         * iterator.cs (Iterator.EmitDispose): Update to changes.
769
770         Clean up handling of 'using' statement
771         * statement.cs (UsingTemporary): New.  Carved out of ...
772         (Using): ... this.  Simplify drastically.  Handle exactly
773         one variable.
774         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
775         or Using as appropriate.  If there are multiple variable declared,
776         create nested Using statements.
777         (resource_acquisition): Kill.
778
779         * statement.cs (ExceptionStatement.EmitForDispose): Use
780         EmitFinallyBody, not EmitFinally.
781
782         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
783         * iterator.cs: Update to changes.
784
785         Start using the ResumableStatement infrastructure
786         * statement.cs (ResumeableStatement.PrepareForDispose): New.
787         (ResumableStatement.EmitForDispose): New.
788         (ExceptionStatement): Override them.
789         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
790         EmitForDispose to create the body of the Dispose method.  Don't
791         use OldResumePoint.
792
793         * iterator.cs (Iterator.AddResumePoint): Move here from ...
794         * statement.cs (Toplevel.AddResumePoint): ... here.
795         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
796         * flowanalysis.cs (FlowBranchingIterator): New.
797         * codegen.cs (EmitContext): Update to changes.
798
799         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
800         (Iterator.old_resume_points): Rename from 'resume_points'.
801         (Iterator.MoveNextStatement): Remove unused class.
802
803         New infrastructure for try/finally in iterators (still unused)
804         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
805         (FlowBranchingToplevel.AddResumePoint): Hook into
806         ToplevelBlock.AddResumePoint.
807         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
808         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
809         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
810         resume points and assign program-counter values.
811         (ExceptionBlock.AddResumePoint): Collect resume points for
812         de-muxer at the top of try block.
813         * iterators.cs (Yield.CheckContext): Simplify.
814         (Yield.Resolve): Use FlowBranching.AddResumePoint.
815
816 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
817
818         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
819         argument to an ExitStatement.
820         (FlowBranchingException): Refactor saved origins code.
821         * statement.cs (ExitStatement): Update to cahges.
822         * iterator.cs (YieldBreak): Likewise.
823
824         * statement.cs (ResumableStatement): New.  Common base class for
825         YieldReturn and ExceptionStatement.
826         (ExitStatement): New.  Common base class for Return and YieldBreak.
827         (Return): Update to changes.
828         * iterator.cs (YieldBreak): Likewise.
829         * lambda.cs (ContextualReturn): Likewise.
830
831         Fix #377028
832         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
833         emit a meaningful error message.
834
835         Fix #324765, #319508
836         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
837         (VariableInfo.SetAssigned): Set it.
838         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
839         determine if CS0219 or CS0168 is appropriate.  Don't use
840         flow-analysis information.
841         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
842         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
843         (EmitContext.EndFlowBranching): ... this.
844
845 2008-04-03  Marek Safar  <marek.safar@gmail.com>
846
847         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
848
849 2008-04-03  Marek Safar  <marek.safar@gmail.com>
850
851         A fix for bug #376508
852         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
853         ImplicitConversionExists.
854
855 2008-04-03  Marek Safar  <marek.safar@gmail.com>
856
857         * expression.cs (Binary): Added remaining binary operators to expression
858         tree builder.
859
860         * nullable.cs: Optimize shift with null argument.
861
862 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
863
864         Fix minor IL regression
865         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
866         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
867         * cs-parser.jay (try_statement): Update to changes.
868
869         * statement.cs (TryFinally.need_exc_block): Delete.
870         (TryFinally): Update to changes.
871
872         Now all ExceptionStatements are unconditional
873         * statement.cs (CollectionForeach.DisposableWrapper): New.
874         Extract out the try/finally code into a new wrapper.
875         (CollectionForeach.Resolve): Use it to simplify the code.
876
877 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
878
879         Start at simplifying ExceptionStatement semantics a bit
880         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
881         * cs-parser.jay (try_statement): Update to changes.
882         (opt_catch_clauses): Remove.
883         * flowanalysis.cs: Update to changes.
884         (FlowBranching.BranchingType.TryCatch): New.
885         (FlowBranchingTryCatch): New.
886
887         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
888         (FlowBranching.CreateBranching): Update to changes.
889         (FlowBranchingBlock.AddSibling): Add sanity check.
890         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
891         Update to changes.
892
893         * iterators.cs (Iterator.MarkFinally): Remove.
894         * statement.cs (ExceptionStatement): Update to changes.
895
896         Add support for skipping over finally blocks at runtime.  First
897         in a series to fix #324708
898         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
899         (Iterator.EmitMoveNext): Initialize it.
900         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
901         branch over the body of the 'finally' clause.
902
903 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
904
905         Avoid lopsided use of Foo/DoFoo names
906         * statement.cs (ExpressionStatement.EmitFinallyBody):
907         Rename from EmitFinally.
908         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
909         * iterator.cs: Update to changes.
910
911 2008-04-02  Marek Safar  <marek.safar@gmail.com>
912
913         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
914         based on UserOperatorCall. More binary nullable operators clean up.
915
916 2008-04-02  Martin Baulig  <martin@ximian.com>
917
918         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
919
920 2008-04-02  Marek Safar  <marek.safar@gmail.com>
921
922         * nullable.cs: Merge user and empty conversions when lifting expression
923         trees.
924         
925         * expression.cs (StringConcat): Implemented expression tree representation.
926
927 2008-04-01  Marek Safar  <marek.safar@gmail.com>
928
929         * nullable.cs: When lifting null literal and a user operator exists, no call 
930         is made.
931         
932 2008-04-01  Marek Safar  <marek.safar@gmail.com>
933
934         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
935         null.
936
937 2008-04-01  Marek Safar  <marek.safar@gmail.com>
938
939         * nullable.cs, expression.cs: Use namespace instead heavily nested
940         monster abstract class.
941
942 2008-04-01  Marek Safar  <marek.safar@gmail.com>
943
944         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
945         lifting of null literal and user operators. Clean up of some temporary
946         nullable hacks.
947
948 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
949
950         Fix #368224, test-629.cs
951         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
952         if it crossed an unwind-protect boundary.
953         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
954         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
955         inside an unwind-protected region.
956         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
957         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
958         'leave' instead of a 'br' if unwind-protected.
959         (Iterator.EmitYieldBreak): Likewise.
960
961 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
962
963         * driver.cs: Only define versioninfo resources if no win32 resource
964         file was specified.
965
966 2008-03-28  Marek Safar  <marek.safar@gmail.com>
967
968         A fix for bug #372375
969         * convert.cs: Fixed boxing of nullable types.
970
971 2008-03-28  Marek Safar  <marek.safar@gmail.com>
972
973         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
974         type.
975
976 2008-03-28  Marek Safar  <marek.safar@gmail.com>
977
978         A fix for bug #374619
979         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
980         
981 2008-03-27  Marek Safar  <marek.safar@gmail.com>
982
983         * lambda.cs: Check return type only for invocation.
984         
985 2008-03-27  Marek Safar  <marek.safar@gmail.com>
986
987         A fix for bug #374214
988         * ecore.cs: Correctly report argument type mismatch.
989
990 2008-03-27  Marek Safar  <marek.safar@gmail.com>
991
992         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
993         and not rely on broken IsEnum.
994
995 2008-03-27  Marek Safar  <marek.safar@gmail.com>
996
997         * nullable.cs: New file, extracted from generic.cs.
998         
999         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1000
1001 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1002
1003         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1004         predefined comparison operators and null literals.
1005         
1006         * report.cs: New warning ID.
1007         
1008 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1009
1010         A fix for bug #370577
1011         * lambda.cs: Check return type too.
1012
1013 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1014
1015         A fix for bug #372846
1016         * class.cs: Automatic properties can be declared as unsafe.
1017
1018 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1019
1020         * location.cs: Use string based concatenation.
1021         
1022         * expression.cs: LiftedBinaryOperator is gmcs only.
1023         
1024 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1025
1026         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1027         conversions rules and expression trees.
1028
1029 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1030
1031         * delegate.cs: Use extension method source as delegate target.
1032
1033 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1034
1035         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1036         binary operations to be purely based on binary operations and optimized
1037         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1038         and other ET refactoring.
1039         
1040         * typemanager.cs: Fixed warning.
1041         
1042 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1043
1044         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1045         
1046         * symbolwriter.cs: Fixed.
1047
1048 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1049
1050         * anonymous.cs, driver.cs: Reset anonymous types counters.
1051
1052 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1053
1054         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1055         
1056         * class.cs: Use fullname for all type member definitions.
1057         
1058 2008-02-19  Martin Baulig  <martin@ximian.com>
1059
1060         * class.cs
1061         (IMethodData.EmitExtraSymbolInfo): New interface method.
1062         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1063         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1064         interface method here as an empty public virtual method.
1065
1066         * anonymous.cs
1067         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1068         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1069         CodeGen.SymbolWriter.SetRealMethodName().       
1070
1071 2008-02-18  Martin Baulig  <martin@ximian.com>
1072
1073         * anonymous.cs
1074         (ScopeInfo.EmitType): Override this and emit debugging
1075         information for captured variables.
1076         (RootScopeInfo.EmitType): Override this and emit symbol
1077         information for a captured `this'.
1078
1079 2008-02-15  Martin Baulig  <martin@ximian.com>
1080
1081         * iterators.cs: Emit debugging info.
1082
1083         * codegen.cs
1084         (EmitContext.Flags): Add `OmitDebuggingInfo'.
1085         (EmitContext.OmitDebuggingInfo): New public property.
1086
1087         * statement.cs
1088         (While): Override Emit() and don't emit symbol info there; do it
1089         inside DoEmit() instead.
1090         (Block.Emit): Omit symbol information while emitting the scope
1091         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
1092         block logic.
1093         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1094         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1095         .ctor to make `IsIterator' work.
1096
1097 2008-03-14  Martin Baulig  <martin@ximian.com>
1098
1099         * symbolwriter.cs: Added the new symbol writer function from the
1100         debugger's `terrania' branch; temporarily enclose them inside
1101         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1102         my vacations.
1103
1104 2008-03-14  Martin Baulig  <martin@ximian.com>
1105
1106         * symbolwriter.cs
1107         (SymbolWriter): Make this a public static class.
1108
1109         * codegen.cs
1110         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1111         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1112
1113 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1114
1115         A fix for bug #370577
1116         * statement.cs, lambda.cs: Added extra limitations when dealing with void
1117         return type.
1118         
1119 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1120
1121         * typemanager.cs (CSharpName): Made 250 times faster.
1122
1123 2008-03-13  Marek Safar  <marek.safar@gmail.com>
1124
1125         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1126         
1127 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1128
1129         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1130         crash when predefined field does not exist.
1131         
1132 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1133
1134         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1135         
1136 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1137
1138         * class.cs (FixedField): Don't crash when contructors are missing.
1139
1140 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1141
1142         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1143         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1144         check internal types accessibility for internal and external types.
1145         Replaced EnumToUnderlying by GetEnumUnderlyingType.
1146
1147 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1148
1149         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1150         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1151         attribute.cs, statement: Use corect instance of predefined types (work
1152         related to #364674).
1153
1154 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1155
1156         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1157         
1158 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1159
1160         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
1161         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1162         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1163         predefined types clean up, delayed predefined types members initialization
1164         (work related to #364674).
1165
1166 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1167
1168         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1169         
1170 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1171
1172         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1173         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1174         predefined types clean up (work related to #364674).
1175
1176 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1177
1178         * ecore.cs: Print an error message instead of throwing exception.
1179         
1180 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1181
1182         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1183         expression.cs, statement.cs: Unififed null literal representation.
1184
1185 2008-03-03  Marek Safar  <marek.safar@gmail.com>
1186
1187         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1188         expression.cs: Refactored binary operators resolve phase and improved speed.
1189         The nullable code is still missing and won't work correctly, more fixes
1190         required.
1191
1192         It also fixes #323726, #324312, #324248, and many other unreported issues.
1193
1194 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
1195
1196         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
1197         instead of 'gmcs'.
1198
1199 2008-02-27  Marek Safar  <marek.safar@gmail.com>
1200
1201         * ecore.cs: Clean-up and split BetterConversion.
1202         
1203 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
1204
1205         Fix #363791
1206         * enum.cs (EnumMember.Value): Only access 'value' if
1207         ResolveValue says it's ok.
1208         (EnumMember.DoResolveValue): Don't set prev_member.value.
1209         (Enum.GetDefinition): Reverse arguments of Equals --
1210         EnumMember.Value can return 'null'.
1211
1212         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1213
1214 2008-02-22  Marek Safar  <marek.safar@gmail.com>
1215
1216         * generic.cs, expression.cs: More ongoing work on expression trees.
1217         
1218 2008-02-21  Marek Safar  <marek.safar@gmail.com>
1219
1220         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1221         handle missing matches when mutiple operators exist.
1222         
1223 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1224
1225         A fix for bug #363218
1226         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1227         initializers.
1228         
1229 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1230
1231         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1232         update. This time to deal correctly with SideEffectConstant expression used
1233         as an argument for another constant folding.
1234
1235 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
1236
1237         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1238         MethodBuilder.
1239
1240 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1241
1242         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1243
1244 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1245
1246         A fix for bug #328136
1247         * expression.cs: Do not fold immediately LogicalAnd operators when the left
1248         side is a false constant, because we still need to evaluate the right-hand
1249         side.
1250
1251         * statement.cs (If): Emit two types of boolean constants (simple constant,
1252         side-effect constant).
1253
1254 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1255
1256         * constant.cs (SideEffectConstant): Don't emit boolean constant.
1257
1258         * expression.cs: Fold immediately LogicalAnd operators when both sides are
1259         constants.
1260
1261 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1262
1263         A fix for bug #361457
1264         * ecore.cs (IsApplicable): Params methods have lower priority.
1265
1266         * support.cs: Return correct parameter modifier for params types.
1267
1268 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1269
1270         * generic.cs (TypeParameter): Cache attribute target name.
1271
1272         * support.cs: Removed unused variable.
1273
1274         * typemanager.cs: Removed debugging leftover.
1275
1276         * ecore.cs: Use local type instead of a property;
1277
1278         * class.cs (VerifyMembers): Consider also parent to test whether type member
1279         is local or public.
1280
1281         * expression.cs (FullMethodDesc): Removed.
1282
1283         * attribute.cs (IsValidArgumentType): Made static.
1284
1285 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
1286
1287         Cleanup to be more readable.
1288         * Makefile (GMCS_PROFILE): Remove.
1289         (COMPILER_NAME): New helper.
1290
1291 2008-02-15  Miguel de Icaza  <miguel@novell.com>
1292
1293         * cs-tokenizer.cs: if a conditional expression happens inside a
1294         (...) this also means that we do not need to de-ambiguate between
1295         an parenthesized expression and a cast.
1296
1297         Fixes 346484.
1298
1299         * constant.cs (SideEffectConstant): a constant value that happens
1300         to have a side effect.
1301
1302         Fixes the build regressions introduced by the fix for #359789
1303
1304 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
1305
1306         * expression.cs (Conditional.Emit): when emitting the ternary
1307         operator, use local variables to generate code verifiable code.
1308
1309         The verifier cannot infer that the type on stack before the
1310         stloc.0 is executed is of type ParentB. This happens because the
1311         stack merge algorithm uses only parent types when deciding which
1312         is the common type.  This is described in Part III 1.8.1.3 of ECMA
1313         335.
1314
1315         This code compiled with mcs is not verifiable under MS. The MS
1316         verifier picks the first common interface of Foo and Bar, which is
1317         wrong, but doesn't use a full join type of the 2 interfaces.
1318
1319         CSC uses a clever hack to compile such code in a verifiable
1320         way. It stores the intermediate values in a local variable with
1321         the expected type.
1322
1323         Fixes: #358102
1324
1325 2008-02-14  Miguel de Icaza  <miguel@novell.com>
1326
1327         * expression.cs: Do not fold BitwiseAnd operators when the left
1328         side is a false constant, because we still need to evaluate the
1329         right-hand side.
1330
1331         Fixes #359789
1332
1333         * support.cs: Instead of throwing an InternalErrorException when
1334         the position of the stream is outside the boundary of our buffer,
1335         reset the state of the reader, and restart the reading from the
1336         beginning of the file.
1337
1338 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1339
1340         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1341
1342 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1343
1344         A fix for bug #361686
1345         * decl.cs: A protected types used inside a private class which parents
1346         derives from the protected class are accessible.
1347
1348 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1349
1350         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1351         the parameterless constructor.
1352
1353 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1354
1355         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1356         lookup methods to use standard member cache when doing member lookup.
1357
1358 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1359
1360         * driver.cs: Don't report full path for referenced module as assembly error.
1361
1362 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1363
1364         * Makefile: Fixed `qh' target to work on all machines.
1365
1366         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1367         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1368         and HasElementType with TypeManager implementation.
1369
1370 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1371
1372         A fix for bugs #325134, #359749
1373         * expression.cs, ecore.cs: Try to resolve an extension method even if the
1374         first binds point to non-method member expression.
1375
1376 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1377
1378         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1379
1380 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1381
1382         A fix for bugs #321394, #323028
1383         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1384         Reworked naive IsAccessibleAs implementation to handle nested types.
1385
1386 2008-02-05  Jb Evain  <jbevain@novell.com>
1387
1388         * class.cs: use generic type comparison for parameters
1389         as well.
1390
1391 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1392
1393         A fix for bug #325372
1394         * class.cs: Use generic type comparison when testing method signatures.
1395
1396 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1397
1398         A fix for bug #357047
1399         * ecore.cs: Applied C# 3.0 changes to better conversion.
1400
1401 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1402
1403         A fix for bug #358374
1404         * cs-parser.jay: Correctly set modifiers for all constructor types.
1405
1406 2008-02-04  Marek Safar  <marek.safar@gmail.com>
1407
1408         A fix for bug #355251
1409         * generic.cs: Added base class constraint based type inference.
1410
1411 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1412
1413         A fix for bug #357255
1414         * decl.cs: One more missing visibility check.
1415
1416 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1417
1418         * support.cs: Fixed broken return.
1419
1420 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1421
1422         * report.cs: Correctly reset warnings count after probing.
1423
1424 2008-01-25  Martin Baulig  <martin@ximian.com>
1425
1426         * namespace.cs
1427         (NamespaceEntry.SymbolFileID): Make this work again after
1428         MemberName.ToString() is gone.
1429
1430 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1431
1432         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1433         expressions.
1434
1435 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1436
1437         * generic.cs: Use full implicit conversion for type inference fixing.
1438
1439 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1440
1441         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1442         Fixed user operator conversions.
1443
1444 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1445
1446         * generic.cs: Do nullable type to null comparison optimization during
1447         resolve phase.
1448
1449 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1450
1451         A fix for bug #355163
1452         * generic.cs: Enabled l-value resolve on nullable expressions.
1453
1454 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1455
1456         A fix for bug #353986
1457         * class.cs: Ingore static ctors with parameters for any further checks.
1458
1459 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1460
1461         A fix for bug #354310
1462         * namespace.cs: Removed redundant check.
1463
1464 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1465
1466         A fix for bug #354928
1467         * expression.cs: ElementInitializers can be resolved only once.
1468
1469 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1470
1471         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1472         Condition expressions.
1473
1474 2008-01-23  Marek Safar  <marek.safar@gmail.com>
1475
1476         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1477
1478 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1479
1480         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1481         not allowed.
1482
1483         * generic.cs: Implemented coalesce expression.
1484
1485 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1486
1487         A fix for bug #355145
1488         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1489         expression tree type inference.
1490
1491 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
1492
1493         Fix #354663
1494         * expression.cs (Binary.IsUnsignedType): Fix typo.
1495
1496 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1497
1498         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1499
1500 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1501
1502         A fix for bug #355161
1503         * ecore.cs, expression.cs: Wider range of extension method supported
1504         expressions.
1505
1506 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
1507
1508         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1509         AssemblyBuilder to operate in compiler context. Fixes mcs part of
1510         bug #354970.
1511
1512 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1513
1514         A fix for bug #355148
1515         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1516
1517 2008-01-22  Miguel de Icaza  <miguel@novell.com>
1518
1519         * expression.cs (CreateExpressionTree): Add support for or and
1520         logical or, and indent following the coding conventions.
1521
1522         * typemanager.cs (LinqExpression): renamed from
1523         ExpressionTreeManager, for a shorter name.
1524
1525         Use TypeManager.CoreLookupType to lookup types from our core
1526         assemblies and turn those into "Type" variables.
1527
1528         Consumers that previously used "Namespace" and "Type" from this
1529         class should instead use the TypeExpression which is a type that
1530         is fully resolved (without involving the regular C# resolution
1531         rules). 
1532
1533         This typically looks like this:
1534
1535         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1536         new MemberAccess (texpr, name, type_arguments, loc)
1537
1538         This avoids the problem in: #355178
1539
1540 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1541
1542         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1543         feature in parser only as we do in other cases.
1544         
1545 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1546
1547         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1548         typemanager.cs: A refactoring of params arguments to reuse existing
1549         expressions (params -> array initializer) to emit params argument instead
1550         of specialized handling.
1551         It was required by expression tree implementation and it has other benefits
1552         as well, we now apply same optimization for params arguments as we do for
1553         array initializers.
1554         
1555 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1556
1557         A fix for bug #353526
1558         * generic.cs: A type inference of params arguments may not required any
1559         temporary array creation.
1560         
1561 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1562
1563         A fix for bug #353534
1564         * generic.cs, ecore.cs, expression.cs: A method group type inference is
1565         supported for delegates only.
1566         
1567 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1568
1569         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1570         type for more than 1 candidates.
1571         
1572 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1573
1574         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1575         expressions.
1576         
1577 2008-01-16  Marek Safar  <marek.safar@gmail.com>
1578
1579         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1580         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1581         operator) expressions. 
1582                 
1583 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
1584
1585         * statement.cs: Avoid declaring an IL variable for this_variable since it is
1586         not accessed from the generated IL.
1587
1588 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1589
1590         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1591         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1592         statement.cs: The first expression tree implementation drop, mostly
1593         infrastructure work.
1594
1595 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1596
1597         * ecore.cs (IsNestedChild): Refactored.
1598
1599 2008-01-11  Marek Safar  <marek.safar@gmail.com>
1600
1601         * lambda.cs: Don't use a cast on unknown expression statement.
1602
1603 2008-01-10  Geoff Norton  <gnorton@novell.com>
1604
1605         * cs-tokenizer.cs: One more token to distinguish between method and lambda
1606         arguments
1607
1608 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1609
1610         * doc.cs: Report better /doc crash details.
1611         
1612 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1613
1614         A fix for bug #352536
1615         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1616
1617 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1618
1619         A fix for bug #352287
1620         * ecore.cs, expression.cs: Do `this' access checking in all member access
1621         expressions.
1622         
1623 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1624
1625         * rootcontext.cs, driver.cs: Switch to linq mode by default.
1626         
1627         * report.cs: Reset message stacks.
1628         
1629 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1630
1631         * generic.cs (InferInPhases): Correctly calculate params position.
1632         
1633 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1634
1635         * cs-tokenizer.cs: No need to parse full string when parsing lambda
1636         arguments.
1637
1638 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1639
1640         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1641         
1642         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1643         
1644         * driver.cs: Updated --help option.
1645         
1646 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1647
1648         * generic.cs (InferParamsTypeArguments): Removed.
1649         (InferInPhases): Add params type inference.
1650         (LowerBoundInference): Fixed scoring mechanism.
1651         
1652         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1653         
1654 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
1655
1656         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1657         byte array for unsigned "baked" assemblies.
1658
1659 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
1660
1661         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1662         array for assemblies that are not strongnamed.
1663
1664 2008-01-04  Marek Safar  <marek.safar@gmail.com>
1665
1666         A fix for bug #351481
1667         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1668         declaring type for nested generic types.
1669         
1670 2008-01-04  Marek Safar  <marek.safar@gmail.com>
1671
1672         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
1673         instead of ToString.
1674         
1675 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1676
1677         A fix for bug #351047
1678         * expression.cs (Binary.ResolveOperator): Allow equality operators between
1679         null and structs only when equality and inequality operators are defined
1680         either as an user-operators or predefined operators.
1681         
1682 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1683
1684         A fix for bug #351047
1685         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
1686         
1687 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1688
1689         A fix for bug #351257
1690         * cs-tokenizer.cs: Advance line number for '\r' correctly.
1691         
1692 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1693
1694         A fix for bug #351157
1695         * class.cs (Using): Fixed yet another broken cloning.
1696         
1697         (Block): Put back more sensible default value for statements.
1698         
1699 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
1700
1701         * codegen.cs: Allow AssemblyVersion with only major version component.
1702         Fixes bug #351055.
1703
1704 2007-12-29  Marek Safar  <marek.safar@gmail.com>
1705
1706         A fix for bug #324654
1707         * class.cs: Use FullName property as member name.
1708
1709 2007-12-28  Marek Safar  <marek.safar@gmail.com>
1710
1711         A fix for bug #342117
1712         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
1713         constructor constraint.
1714
1715 2007-12-28  Marek Safar  <marek.safar@gmail.com>
1716
1717         A fix for bug #338273
1718         * class.cs (ProbertyBase): Access modifier checks are required for overrides
1719         only.
1720
1721 2007-12-28  Marek Safar  <marek.safar@gmail.com>
1722
1723         A fix for bug #350839
1724         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
1725
1726 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
1727
1728         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1729         GHOP:
1730         
1731         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
1732
1733         * statement.cs: Changed some Hashtables to use HybridDictionaries
1734         instead. It was observed that some HashTables only contained a few
1735         items in the vast majority of cases. Since HybridDictionary is
1736         more efficient on small sets (<10 elements), "known_variables"
1737         from class ExplicitBlock as well as "labels" and "constants " from
1738         class Block were changed to HybridDictionaries. 
1739
1740         Atsai results: (56216kb->54987kb)
1741
1742         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
1743
1744
1745 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
1746
1747         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1748         GHOP:
1749         
1750         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
1751         
1752         * expression.cs: foreach loop to for loop, saved on allocation of
1753         enumerator (59333kb->59141kb)
1754
1755         * statement.cs. Changed foreach loops to for loops, saved on
1756         allocation of enumerator (59141kb->59006kb)
1757
1758         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
1759         when constructed with no specified capacity. This was causing a
1760         few ArrayLists to allocate more memory than they would potentially
1761         need in the Block class and MemberCache class. Setting the
1762         ArrayLists to construct with a capacity of 1 saves some
1763         memory. (56216kb->55585kb)
1764
1765 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1766
1767         A fix for bug #347189 (2nd issue)
1768         * expression.cs (MemberAccess): Nested type can be found in base non-generic
1769         type.
1770
1771 2007-12-27  Miguel de Icaza  <miguel@novell.com>
1772         
1773         * report.cs: Do not use colors if stdout and stderr are not a
1774         terminal.
1775
1776 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1777
1778         A fix for bug #346998
1779         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
1780         overloads.
1781
1782 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1783
1784         A fix for bug #343465
1785         * class.cs: Explicit method name for nested types uses dots only.
1786
1787 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1788
1789         A fix for bug #343707
1790         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
1791
1792 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1793
1794         * ecore.cs: Report type inference errors only when arguments count matches
1795         parameter count.
1796         
1797         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
1798         
1799         * expression.cs, report.cs: New warning.
1800         
1801         * typemanager.cs: Catch anonymous method type too.
1802
1803 2007-12-23  Marek Safar  <marek.safar@gmail.com>
1804
1805         A fix for bug #346379
1806         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
1807
1808 2007-12-23  Marek Safar  <marek.safar@gmail.com>
1809
1810         A fix for bug #347359
1811         * expression.cs (Invocation): Don't resolve already resolved expression.
1812
1813 2007-12-23  Marek Safar  <marek.safar@gmail.com>
1814
1815         A fix for bug #347189
1816         * class.cs (FixedField): Use non-dependent code only in the define phase.
1817
1818 2007-12-23  Marek Safar  <marek.safar@gmail.com>
1819
1820         A fix for bug #348076
1821         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
1822
1823 2007-12-22  Marek Safar  <marek.safar@gmail.com>
1824
1825         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
1826         discovered extension methods.
1827
1828 2007-12-22  Marek Safar  <marek.safar@gmail.com>
1829
1830         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
1831         method.
1832
1833 2007-12-21  Miguel de Icaza  <miguel@novell.com>
1834
1835         * report.cs (ErrorMessage): Add support for using colors on
1836         terminals that support it. 
1837
1838 2007-12-21  Marek Safar  <marek.safar@gmail.com>
1839
1840         * ecore.cs: Use information about expanded params for error reporting.
1841
1842 2007-12-21  Marek Safar  <marek.safar@gmail.com>
1843
1844         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
1845         and logic for params overloads.
1846         
1847 2007-12-15  Miguel de Icaza  <miguel@novell.com>
1848
1849         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
1850         as this is also created from the parser.  Fixes #349034
1851
1852 2007-12-12  Miguel de Icaza  <miguel@novell.com>
1853
1854         * statement.cs (Throw.CloneTo): it is valid to have empty
1855         expressions for throw. 
1856
1857 2007-12-03  Marek Safar  <marek.safar@gmail.com>
1858
1859         * cs-parser.jay: Set delegate constraint parsing region correctly.
1860
1861 2007-12-03  Marek Safar  <marek.safar@gmail.com>
1862
1863         A fix for bug #345467
1864         * typemanager.cs (IsEqual): Compare generic parameters position only.
1865         
1866 2007-11-28  Marek Safar  <marek.safar@gmail.com>
1867
1868         * expression.cs (BaseAccess): Type arguments can be null.
1869
1870 2007-11-27  Raja R Harinath  <harinath@gmail.com>
1871
1872         * statement.cs (Block.Resolve): Ensure flow-branching tree is
1873         consistent even when an error has occured.
1874         (Switch.Resolve): Likewise.
1875
1876 2007-11-22  Marek Safar  <marek.safar@gmail.com>
1877
1878         A fix for bug #334505
1879         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
1880         overrides.
1881         
1882 2007-11-22  Marek Safar  <marek.safar@gmail.com>
1883
1884         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
1885         refactorings required to resolve extension methods correctly when mixing
1886         generics and non-generics members.
1887         
1888 2007-11-20  Marek Safar  <marek.safar@gmail.com>
1889
1890         A fix for bug #342584
1891         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
1892         conversion.
1893         
1894 2007-11-19  Marek Safar  <marek.safar@gmail.com>
1895
1896         A fix for bug #342512
1897         * delegate.cs: Use delegate argument expression when is available. Don't
1898         emit virtual call when class is sealed.
1899         
1900 2007-11-16  Marek Safar  <marek.safar@gmail.com>
1901
1902         A fix for bug #325423
1903         * assign.cs (FieldInitializer): Use resolved expression for emit.
1904         
1905         * class.cs: Print less confusing error message.
1906         
1907 2007-11-16  Marek Safar  <marek.safar@gmail.com>
1908
1909         * cs-tokenizer.cs: Removed GMCS ifdefs.
1910         
1911         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
1912         mcs.
1913         
1914         * cs-parser.jay: Disabled nullable check.
1915         
1916         * generic-mcs: Copied more generic stuff.
1917                 
1918 2007-11-16  Marek Safar  <marek.safar@gmail.com>
1919
1920         * gcs-parser.jay: Merged to cs-parser.jay.
1921         
1922         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
1923         * *.csproj, *.sources: Updated to use only jay parser file.
1924
1925 2007-11-16  Marek Safar  <marek.safar@gmail.com>
1926
1927         * gcs-parser.jay: Added nullable and default expression feature checks.
1928         
1929 2007-11-16  Marek Safar  <marek.safar@gmail.com>
1930
1931         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
1932         it fixes many TODOs and hidden bugs.
1933         
1934         * expression: Removed duplicate error check.
1935
1936 2007-11-15  Marek Safar  <marek.safar@gmail.com>
1937
1938         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
1939         implicitly type local variable only when it is used in a declaration.
1940
1941 2007-11-15  Marek Safar  <marek.safar@gmail.com>
1942
1943         * attribute.cs: Use CS0612 for empty strings.
1944
1945 2007-11-14  Marek Safar  <marek.safar@gmail.com>
1946
1947         * lambda.cs, statement.cs: Contextual return may act as a statement.
1948
1949 2007-11-14  Marek Safar  <marek.safar@gmail.com>
1950
1951         A fix for a regression cause by #324222
1952         * class.cs: Don't report unused even when it implements an interface.
1953         
1954 2007-11-13  Marek Safar  <marek.safar@gmail.com>
1955
1956         A fix for bug #341205
1957         * ecore.cs, expression.cs: Method group expression cannot do static
1958         method access with an instance reference check before overloading takes
1959         a place.
1960         
1961 2007-11-13  Marek Safar  <marek.safar@gmail.com>
1962
1963         A fix for bug #325359
1964         * class.cs: Use predictable name for automatically generated property.
1965         
1966 2007-11-12  Marek Safar  <marek.safar@gmail.com>
1967
1968         A fix for bug #324996
1969         * expression.cs (Is): Handle case where D is nullable and T is not
1970         correctly.
1971         
1972         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
1973         
1974 2007-11-12  Marek Safar  <marek.safar@gmail.com>
1975
1976         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
1977         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
1978         Flush small error reporting changes.
1979         
1980 2007-11-09  Marek Safar  <marek.safar@gmail.com>
1981
1982         A fix for bug #324996
1983         * expression.cs: Rewrote Is expression implementation to work with
1984         generics, nullable types, anonymous method. A const result expression 
1985         uses existing infrastructure instead of custom not fully-featured one.
1986         
1987 2007-11-08  Marek Safar  <marek.safar@gmail.com>
1988
1989         A fix for bug #340202
1990         * class.cs: Consider generics for volatile field.
1991
1992 2007-11-08  Marek Safar  <marek.safar@gmail.com>
1993
1994         A fix for bug #335594
1995         * expression.cs: Use conversion rules when handling string addition.
1996         
1997 2007-11-07  Marek Safar  <marek.safar@gmail.com>
1998
1999         A fix for bug #336651
2000         * expression.cs: Fixed a crash when probing is on.
2001         
2002 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2003
2004         A fix for bug #324242
2005         * covert.cs: Added a conversion from any nullable-type with an 
2006         underlying enum-type to the type System.Enum.
2007         
2008 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2009
2010         A fix for bug #324222
2011         * class.cs: Report all non-used event fields.
2012         
2013 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2014
2015         A fix for bug #325161
2016         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2017         qualifier for generic types.
2018         
2019 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2020
2021         A fix for bug #322971
2022         * expression.cs, ecore.cs: Added intermediate result value check for
2023         indexers. 
2024         
2025 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2026
2027         A fix for bug #324754
2028         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2029         when it was requested.
2030
2031 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2032
2033         A fix for bug #325101
2034         * expression.cs: Do type not value comparison for `is' expression.
2035
2036 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2037
2038         A fix for bug #320236
2039         * convert.cs: Don't apply user conversion on underlying target type.
2040
2041 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2042
2043         * expression.cs: Don't use unresolved expression for error reporting.
2044  
2045 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2046
2047         A fix for bugs #337712, #324490
2048         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2049         overloading resolution too.
2050         
2051         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2052         the process consistent and more robust.
2053         
2054         * expression.cs, linq.cs, report.cs: Update.
2055
2056 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2057
2058         A fix for bug #332909
2059         * attribute.cs: Resolve attributes in correct context using error
2060         handling procedure.
2061         
2062         * rootcontext.cs: Define Obsolete attribute members as core members.
2063         
2064 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2065
2066         * statement.cs: Removed unused methods.
2067         
2068 2007-10-31  Wade Berrier  <wberrier@novell.com>
2069
2070         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
2071         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2072         during 'make dist')
2073
2074 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2075
2076         A fix for bug #338102
2077         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2078         methods registered as non-generics.
2079         
2080 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2081
2082         A fix for bugs #337712, #324490
2083         * delegate.cs: Delegate covariance and contravariance is not allowed for
2084         value types.
2085         
2086 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2087
2088         A fix for bug #337719 
2089         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2090         `from' keyword.
2091         
2092 2007-10-30  Marek Safar  <marek.safar@gmail.com>
2093  
2094         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2095
2096 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2097  
2098         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2099         query expressions.
2100
2101 2007-10-29  Raja R Harinath  <rharinath@novell.com>
2102
2103         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2104
2105 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2106  
2107         A fix for bug #334652
2108         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2109         extension methods when we have not found the best candidate in normal
2110         container.
2111
2112 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2113
2114         * AssemblyInfo.cs: Keep up-to-date.
2115
2116 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2117
2118         * Makefile: Fixed generics compiler name.
2119         
2120 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2121
2122         * lambda.test: removed, lambda parsing is done differently.
2123         
2124         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2125
2126 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
2127
2128         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2129
2130 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2131
2132         * Makefile, *.sources : All C# compilers are in mcs folder.
2133         
2134         * *.cs: Use existing 2_1 define for smcs.
2135
2136 2007-10-26  Marek Safar  <marek.safar@gmail.com>
2137
2138         A fix for bug #335847
2139         * assign.cs, expression.cs: Couple of changes to avoid creating a
2140         temporary variable for each object initializer assignment statement. It
2141         simplifies struct initialization too, otherwise two temporary variables
2142         would be required.
2143         Implemented optimization of redundant default element initializers.
2144         
2145 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2146
2147         A fix for bug #336766
2148         * expression.cs (Class.CheckBase): Use generic name when method is
2149         generic.
2150         
2151 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2152
2153         A fix for bug #334737
2154         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2155         variable and not variable argument for prepared copies.
2156
2157 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2158
2159         A fix for bug #325110
2160         * class.cs, expression.cs, attribute.cs: Use open generic method when
2161         checking conditional attribute.
2162         
2163 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2164
2165         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
2166         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2167         FeatureIsNotAvailable.
2168
2169 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2170
2171         ** C# 3.0 Partial methods
2172         
2173         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2174         methods support. Because of member cache issue with generics only
2175         non-generics partial methods are fully supported.
2176         
2177 2007-10-23  Marek Safar  <marek.safar@gmail.com>
2178         
2179         * class.cs, decl.cs: Rewrote member overloads check to cope with 
2180         generics and to use member cache for member checking. It also improves
2181         performance and fixes remaining overloads issues.
2182         
2183 2007-10-20  Marek Safar  <marek.safar@gmail.com>
2184         
2185         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2186         roottypes.cs, typemanager.cs:
2187                 
2188         A member cache creation logic changed to add members immediately and
2189         not rely on fallback. The member cache is now only prefered way
2190         how to access and find type declaration members. It saves 5 MB of memory
2191         during MWF compilation and makes code ready for more optimizations and
2192         clean-ups, it's also a pre-requirement for partial methods.
2193         
2194 2007-10-18  Raja R Harinath  <harinath@gmail.com>
2195
2196         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2197         handling for generic parameters.
2198
2199 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2200         
2201         * class.cs (FixedField): Removed redundant volatile check.
2202         
2203 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2204         
2205         * class.cs, decl.cs: Fixed overload members verification to do only one
2206         check per possible collision.
2207         
2208 2007-10-13  Marek Safar  <marek.safar@gmail.com>
2209         
2210         A fix for bug #325478
2211         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2212         and create only one disposable flags container.
2213         
2214 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2215         
2216         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2217         * statement.cs (Fixed): Fixed variables cloning.
2218         
2219 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2220         
2221         A fix for bug #333342
2222         * class.cs (EventField): Don't mark value type event as synchronized. 
2223         
2224 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2225         
2226         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2227         inference to identify best candidate method correctly.
2228         (ProperyExpr): A range variable is read only and cannot be modified.
2229         
2230 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2231         
2232         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2233         logic to identify best candidate method correctly.
2234         
2235 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2236         
2237         * location.cs (Equals, GetHashCode): Removed.
2238         
2239 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2240         
2241         * report.cs: Implemented message recorder. It is used mainly for lambda
2242         expressions to capture otherwise swallowed error messages.
2243         
2244         * anonymous.cs, lambda.cs.cs: Do full parameters check.
2245
2246         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2247         and not at the top.
2248         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2249                 
2250         * expression.cs (MemberAccess): Always report lookup failure.
2251         
2252         * location.cs: Implemented Equals, GetHashCode.
2253         
2254         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2255         
2256 2007-10-10  Jb Evain  <jbevain@novell.com>
2257
2258         * codegen.cs: re-enable assembly version check.
2259
2260 2007-10-09  Marek Safar  <marek.safar@gmail.com>
2261         
2262         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2263         checks.
2264         
2265         * namespace.cs (UsingAlias): Do correct version check.
2266         
2267 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2268         
2269         * expresison.cs, ecore.cs: Issue extension method error message when
2270         appropriate.
2271         
2272         * rootcontext.cs: Added ISO_2 compiler mode option.
2273
2274 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2275         
2276         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2277          message.
2278         
2279 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2280         
2281         * attribute.cs (GetString, GetBoolean): Work with both literal and
2282         constant.
2283         
2284         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2285         Moved method overload specific methods to MethodGroupExpr.
2286         
2287         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2288         it should be less memory consuming.
2289         
2290 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2291
2292         * codegen.cs: remove the assembly version check until the buildbot is
2293         fixed.
2294
2295 2007-10-07  Jb Evain  <jbevain@novell.com>
2296
2297         * attribute.cs (Attribute.GetString): if the value
2298         expression is a StringConstant, return its string value.
2299
2300 2007-10-07  Jb Evain  <jbevain@novell.com>
2301
2302         * typemanager.cs: add `assembly_version_attribute_type`.
2303         * codegen.cs: on attribute emission, check that the
2304         AssemblyVersionAttribute doesn't overflow.
2305
2306 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2307         
2308         A fix for bug #324677
2309         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2310         parent container of a scope container with currently resolved one. 
2311         
2312 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2313         
2314         A fix for bug #325534
2315         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2316         only.
2317         
2318 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2319         
2320         A fix for bug #327504
2321         * class.cs (Operator.Define): Refactored implicit and explicit user
2322         operator conversion rules.
2323         
2324 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2325         
2326         A fix for bug #327520
2327         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2328         
2329 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2330         
2331         A fix for bug #328022
2332         * class.cs (MethodData.Define): Use correct method to check whether
2333         a method implementents an accessor.
2334         
2335 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2336         
2337         A fix for bug #330069
2338         * statement.cs (Fixed.Resolve): Read the first array element only when
2339         an array is instantiated. 
2340         
2341 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2342         
2343         * expression.cs, assign.cs, generics.cs: Print correct operator when
2344         compound assignment is used.
2345         
2346 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2347         
2348         A fix for bug #325841
2349         * expression.cs (ArrayAccess): Use full argument cloning only for
2350         string compound concatenation.
2351         
2352 2007-10-03  Marek Safar  <marek.safar@gmail.com>
2353         
2354         A fix for bug #328774
2355         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2356         assignment.
2357         (PropertyExpr.EmitAssign): Fixed string concatenation compound
2358         assignment.
2359
2360 2007-10-03  Raja R Harinath  <rharinath@novell.com>
2361
2362         Fix #328490
2363         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2364         Event accessibility checks here.  Remove some bogus code that
2365         accidently made GenericMethods work.
2366         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2367
2368 2007-09-25  Marek Safar  <marek.safar@gmail.com>
2369         
2370         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2371         
2372         * statement.cs (Block): Refactored AddVariable to allow error handling
2373         customization.
2374         
2375         * generic.cs: New stub.
2376         
2377 2007-09-23  Marek Safar  <marek.safar@gmail.com>
2378         
2379         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2380         flag.
2381         
2382 2007-09-17  Marek Safar  <marek.safar@gmail.com>
2383
2384         * class.cs: Use partial container to record whether any partial part
2385         contains static field initializer and therefore default contructor has
2386         to be defined.
2387         
2388 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2389
2390         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2391         mono-list when only one of two partial parts has defined accessibility
2392         modifier.
2393         
2394 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2395
2396         A fix for bug #82845
2397         
2398         * class.cs (TypeContainer): Set correct resolve context for all field
2399         initializers.
2400         
2401 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2402
2403         * assign.cs: Fixed a crash when field is resolved twice with an error.
2404         
2405         * codegen.cs: Changed InFieldInitializer to be flag.
2406         
2407         * anonymous.cs, ecore.cs, expression.cs: Update after
2408         IsInFieldInitializer rename.
2409         
2410         * const.cs: Removed unused parameter.
2411         
2412         * class.cs: Changed the way how we resolve and emit field initializers.
2413         The field initilizers have to have access to contructor block to emit
2414         compiler generated code.
2415
2416 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2417
2418         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2419         generics use TypeContainer instead.
2420         
2421 2007-09-12  Marek Safar  <marek.safar@gmail.com>
2422         
2423         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2424
2425         * lambda.cs (ResolveParameters): Use more powerful
2426         InflateGenericArgument.
2427         
2428         * parameters.cs: Better exception message.
2429                 
2430 2007-09-10  Marek Safar  <marek.safar@gmail.com>
2431
2432         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2433         correct expression block type. 
2434         
2435         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2436         
2437         * expression.cs (Invocation): Extracted method group resolve to
2438         DoResolveOverload.
2439         
2440 2007-09-07  Marek Safar  <marek.safar@gmail.com>
2441
2442         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2443         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2444         
2445         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2446         generic extension methods.
2447
2448 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2449
2450         A fix for bug #82676 (Do I get it right now?)
2451         * convert.cs (Binary.ResolveOperator): An interface is converted to the
2452         object before a standard conversion is applied.
2453         
2454 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2455
2456         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2457         #82676.
2458         
2459 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2460
2461         A fix for bug #82676
2462         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2463         non-generic interface types.
2464         
2465 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2466
2467         A fix for bug #82690
2468         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2469         
2470 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2471
2472         A fix for bug #82571
2473         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
2474         modifier for container based methods.
2475         
2476 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2477
2478         A fix for bug #82676
2479         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2480         any interface-type T means to any of interface type T.
2481
2482 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2483
2484         * namespace.cs: We have 2 versions of System.Core assembly.
2485
2486 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2487
2488         A fix for bug #82652
2489         * class.cs (Class.GetClassBases): Compare types and not expressions.
2490
2491 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2492
2493         A fix for bug #82620
2494         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2495         actually never worked before.
2496         (IndexerAccess): Emit prepared arguments before they are modified.
2497         
2498 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2499
2500         A fix for bug #82563
2501         * assign.cs: Revert wrong fix.
2502         
2503         * expression.cs (VariableReference.EmitAssign): Handle ref reference
2504         correctly.
2505         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2506         Instead of ldelema/stdind we have to use temporary variables to handle
2507         cases like String.Concat (params string[]).
2508         
2509 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2510
2511         * class.cs: EmitAttributes to Emit rename.
2512         
2513         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2514         null.
2515         (MemberCore.HasClsCompliantAttribute): Don't depend on 
2516         GetClsCompliantAttributeValue execution.
2517         
2518 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2519
2520         * anonymous.cs: Use shorter type prefix.
2521         
2522         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2523         when exist.
2524         
2525         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2526         variables when probing is on.
2527         
2528         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
2529         unresolved variables.
2530         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2531         handle transparent identifiers.
2532         
2533 2007-08-26  Marek Safar  <marek.safar@gmail.com>
2534
2535         * attribute.cs (IsClsCompliant): Add nullable types test.
2536         
2537 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2538
2539         * doc.cs : catch other types of exception than XmlException to
2540           report CS1570. Fixed bug #82565.
2541
2542 2007-08-23  Marek Safar  <marek.safar@gmail.com>
2543
2544         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
2545         The number of delegate parameters has to match.
2546         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2547         arrays.
2548
2549 2007-08-21  Marek Safar  <marek.safar@gmail.com>
2550
2551         * anonymous.cs (AnonymousMethod): Generate private anonymous method
2552         to fix problem with private arguments.
2553
2554 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2555
2556         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2557         
2558         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
2559         
2560         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2561         empty. Add cloning suport.
2562         
2563         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2564
2565 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2566
2567         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
2568         to create EmptyCast. It handles EmptyConstantCast specialization for
2569         constants.
2570         
2571 2007-08-18  Marek Safar  <marek.safar@gmail.com>
2572
2573         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2574         (EmitArrayArgument): One routine for array arguments.
2575         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
2576         
2577 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2578
2579         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2580
2581 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2582
2583         * anonymous.cs: MemberLookupFinal update.
2584
2585         * class.cs (ConstructorInitializer): Is expression based.
2586         
2587         * delegate.cs: MethodGroupExpr update.
2588         
2589         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
2590         messages.
2591         (Error_MemberLookupFailed): Customizable error override.
2592         (MethodGroupExpr): Keep queried type for later usage.
2593         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2594         resolve.
2595         
2596         * expression.cs: Error_MemberLookupFailed refactoring.
2597         (New.DoResolve): Resolve as much as possible.
2598         (ElementInitializer.Error_MemberLookupFailed): Object initializer
2599         customization for invalid member types.
2600
2601         * statement.cs: MethodGroupExpr update.
2602         
2603 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2604
2605         * modifier.cs (Check): Check all modifiers and not only accessibility
2606         ones.
2607
2608 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2609
2610         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2611         type and not an expression.
2612
2613 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2614
2615         * statement.cs (Catch.Clone): Type and variable can be null.
2616
2617 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2618
2619         A fix for bug #81979
2620         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2621         I am really not sure whether this is the best fix.
2622         
2623         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2624         only once.
2625         
2626 2007-08-14  Marek Safar  <marek.safar@gmail.com>
2627
2628         ** C# 3.0 Object and collection initializers (major re-write)
2629         
2630         * assign.cs (DoResolve): Initializers are not assign related.
2631         
2632         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2633         used during collection or object initialization.
2634         
2635         * expression.cs (Error_InvalidArguments): Add initializers specific
2636         messages. More will come later because it requires some general
2637         refactoring.
2638         (New.DoResolve): Better error handling for unsafe types.
2639         (EmptyExpressionStatement): New class.
2640         (ElementInitializer): An object initializer expression.
2641         (CollectionElementInitializer): A collection initializer expression.
2642         (CollectionOrObjectInitializers): A block of object or collection
2643         initializers.
2644         (NewInitialize): New expression with element/object initializers.
2645         
2646         * statement.cs: Reverted object/collection initializer hacks.
2647         
2648         * typemanager.cs (CSharpName): Filter __arglist type.
2649         
2650 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2651
2652         ** C# 3.0 Anonymous Types (update to the latest standard)
2653         
2654         * expression.cs (Binary.ResolveOperator): Threat all null based types
2655         same.
2656         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2657         (AnonymousTypeParameter): Updated.
2658         
2659         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2660         (AnonymousTypeClass): New anonymous type container.
2661         
2662         * class.cs (AddField): Return operation result.
2663         
2664         * generic.cs: Another empty TypeArguments overload.
2665         
2666         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2667         are stored at top of normal hierarchy.
2668         
2669         * typemanager.cs (CSharpName): Filter anonymous types.
2670         
2671 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2672
2673         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
2674         as single Concat call. How could we miss that :-(
2675         
2676 2007-08-08  Marek Safar  <marek.safar@gmail.com>
2677
2678         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
2679         
2680 2007-08-07  Miguel de Icaza  <miguel@novell.com>
2681
2682         * expression.cs: Fix the previous commit, the creation of the
2683         arguments array list needs also to be conditional on the arguments
2684         not being null.
2685
2686         * class.cs: Add a little bit of help to help narrow down problems.
2687
2688         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
2689         not try to copy in that case. 
2690
2691         * driver.cs: When building SMCS, include a new different set of
2692         default assemblies here.   Do this here so we can control whether
2693         to include the default assemblies with /noconfig.
2694
2695 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2696
2697         A fix for bug #81979
2698         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
2699         only.
2700
2701 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2702
2703         A fix for bug #82300
2704
2705         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
2706         we are in probing scope.
2707
2708 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2709
2710         A fix for bug #82301
2711
2712         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
2713         (Statement.CloneTo): Clone and not map children blocks.
2714
2715 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2716
2717         A fix for bug #82299
2718
2719         * expression.cs (LocalVariableReference.CloneTo): Remap local info
2720         variable too.
2721         
2722         * statement.cs (Statement.CloneTo): Clone variables before statements
2723         to allow remaping of local variables.
2724
2725 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2726
2727         A fix for bug #82296
2728
2729         * anonymous.cs,
2730         * report.cs: Log crash details for future clone problems.
2731         
2732         * statement.cs (Return.Clone): Don't clone non-existent expression.
2733
2734 2007-08-03  Raja R Harinath  <harinath@gmail.com>
2735
2736         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
2737         (Class.AddBasesForPart): Move CS0537 check here from ...
2738         * cs-parser.jay (class_declaration): ... here.  Move calling of
2739         'AddBasesForPart' to ...
2740         (class_bases): ... here.
2741         (struct_declaration, interface_declaration): Update to changes.
2742
2743 2007-08-02  Marek Safar  <marek.safar@gmail.com>
2744
2745         A fix for bug #81923
2746
2747         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
2748         conversion is allowed.
2749
2750 2007-08-02  Marek Safar  <marek.safar@gmail.com>
2751
2752         A fix for bug #81564
2753
2754         * ecore.cs (EventExpr): Add IsBase handling.
2755
2756         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
2757         too.    
2758         
2759 2007-08-02  Raja R Harinath  <harinath@gmail.com>
2760
2761         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
2762         * cs-parser.jay: Some whitespace cleanups.
2763         (current_delegate): New.
2764         (type_name): New.
2765         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
2766         a dummy code block, and use 'type_name' instead of 'member_name'.
2767         (interface_declaration, class_declaration): Likewise.
2768         (delegate_declaration): Likewise.  Rearrange slightly and use
2769         'current_delegate'.
2770         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
2771         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
2772
2773 2007-08-02  Marek Safar  <marek.safar@gmail.com>
2774
2775         A fix for bug #82039
2776
2777         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
2778         available.
2779
2780         * typemanager.cs (CSharpName): Split to string overload.
2781
2782 2007-08-02  Marek Safar  <marek.safar@gmail.com>
2783
2784         * expression.cs,
2785         * report.cs: Updated warning CS0472.
2786
2787 2007-08-01  Marek Safar  <marek.safar@gmail.com>
2788
2789         A fix for bug #82181
2790         * cs-parser.jay,
2791         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
2792
2793 2007-08-01  Marek Safar  <marek.safar@gmail.com>
2794
2795         A fix for bug #82277
2796         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
2797
2798 2007-08-01  Marek Safar  <marek.safar@gmail.com>
2799
2800         ** C# 3.0 Type Inference (major bits are working)
2801         
2802         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
2803         (.ImplicitStandardConversionExists): Uses compatible.
2804         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
2805         (.InferReturnType): New method.
2806         (.Compatible): Refactored.
2807         (.ResolveParameters): Uses factory to create resolved parameters.
2808         (.CompatibleMethod): Add probing mode support.
2809         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
2810         clearly distinguish between 2 different operations.
2811         (LambdaMethod): Moved to lambda.cs.
2812         (AnonymousMethod): Removed unused fields and methods.
2813         (AnonymousDelegate): Simplified.
2814         
2815         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
2816         
2817         * convert. cs (ImplicitConversionStandard): Compatible works differently.
2818         
2819         * delegate.cs (Delegate): New mehods to reduce code duplication.
2820         (.GetConstructor): New method.
2821         (.GetInvokeMethod): New method.
2822         (DelegateCreation): Updated.
2823         
2824         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
2825         does not exist.
2826         (OverloadResolve): Made probing little bit faster.
2827         
2828         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
2829         when probing is on.
2830         
2831         * generic.cs (TypeInferenceContext): Dummy implementation.
2832         
2833         * iterators.cs: Updated after Resolve/Define rename.
2834         
2835         * lambda.cs (LambdaExpression)
2836         (.ResolveParameters): Handles both type of arguments and type inference too.
2837         
2838         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
2839         (InflateTypes): Updated.
2840         
2841         * support.cs (InflateTypes): Changed signature and updated.
2842         
2843         * typemanager.cs (LookupMemberCache): Better dynamic type check.
2844         (MemberLookup_FindMembers): More MS tricks.
2845         (GetParameterData): Ditto.
2846         (GetDelegateParameters): Uses quick path for dynamic types.
2847         
2848 2007-08-01  Marek Safar  <marek.safar@gmail.com>
2849
2850         * class.cs (MethodData.Define): EmitContext is required for generic stuff
2851         only.
2852
2853 2007-07-31  Marek Safar  <marek.safar@gmail.com>
2854
2855         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
2856         syntax.
2857         
2858 2007-07-26  Jb Evain  <jbevain@novell.com>
2859
2860         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
2861         which takes a boolean 'report_errors', similar to the GetMethod.
2862         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
2863         in .net 2.1, do not report errors here.
2864
2865         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
2866         System.Runtime.CompilerServices.RequiredAttributeAttribute and
2867         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
2868         in .net 2.1.
2869
2870         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
2871         of the type InternalsVisibleToAttribute before the first call
2872         to CoreLookupType which is allowed to fail (third boolean parameter
2873         to true). Because, during the resolution for a type that is not
2874         immediately found, we try to check if the type is not defined in
2875         a friend assembly, and to do so, we need the
2876         InternalVisibleToAttribute.
2877
2878 2007-07-23  Miguel de Icaza  <miguel@novell.com>
2879
2880         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
2881         feature that allows structs to be compared against null and inline
2882         the result as true or false.
2883
2884         Notice that the same code is not permitted inside a generic block
2885         of code that would do:
2886
2887         class Foo<T> where T : struct {
2888             bool Eval (T x)
2889             {
2890                  return x == null;
2891             }
2892         }
2893
2894         It is only allowed if the type of T is not bound (no where
2895         clause).   In my opinion, this CSC 2 behavior is broken but people
2896         seem to be using it (IronRuby does, a few bug reports on bugzilla
2897         have it and some people have complained about it).
2898
2899         All of the users that depend on this behavior have code that is
2900         very likely broken. 
2901         
2902         * report.cs (Warning, Error): make these take object arguments,
2903         not strings, as that allows us to take advantage of Format.
2904
2905 2007-07-20  William Holmes  <billholmes54@gmail.com>
2906
2907         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
2908           Left member variable for the Count.
2909         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
2910           MemberName.CountTypeArguments to avoid a NRE. 
2911
2912         This code is contributed under the MIT X11 license
2913
2914 2007-07-18  Marek Safar  <marek.safar@gmail.com>
2915
2916         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
2917
2918 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
2919
2920         * doc.cs : generic method arguments are written as ``x while generic
2921           type arguments are `x. Combined with the previous change, fixed bug
2922           #79706.
2923
2924 2007-07-18  Raja R Harinath  <rharinath@novell.com>
2925
2926         Fix #82120
2927         * expression.cs (Binary.ResolveOperator): When converting
2928         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
2929
2930 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
2931
2932         * doc.cs : when T: or whatever x: is specified, it does not really
2933           check the doc comment's syntax correctness. Fixed bug #82006.
2934
2935 2007-07-18  Marek Safar  <marek.safar@gmail.com>
2936
2937         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
2938         LambdaExpression better.
2939         
2940         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
2941         
2942         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
2943         
2944         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
2945         as it can be generated.
2946         
2947         * expression.cs (Invocation.Error_InvalidArguments): Show correct
2948         modifiers.
2949         
2950         * lambda.cs (LambdaExpression): Refactored to share same code with
2951         AnonymousMethodExpression.
2952         
2953 2007-07-17  Marek Safar  <marek.safar@gmail.com>
2954
2955         * anonymous.cs (MakeName): Include host name for easier debugging.
2956         (LambdaMethod): New class for lambda spcecific stuff.
2957         
2958         * attribute.cs: Set EmitContext return type.
2959
2960         * class.cs: Set EmitContext return type.
2961         
2962         * codegen.cs (EmitContext): Return type cannot be null to stop messing
2963         with null/void meaning.
2964         
2965         * iterators.cs (ContainerType): Implemented.
2966         
2967         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
2968         
2969         * statement.cs (Return): Updated to lambda expressions.
2970         (Block.CloneTo): Parent can be null.
2971                 
2972 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2973
2974         A fix for bug #81917
2975         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
2976         
2977         * class.cs (FixedField): Check whether field is in unsafe scope.
2978
2979         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
2980         (FieldExpr.Emit): Fixed buffers cannot be volatile.
2981
2982         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
2983         FieldExpr.
2984         
2985         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
2986                 
2987 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2988
2989         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
2990         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
2991         from Report class.
2992
2993 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2994
2995         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
2996         
2997 2007-07-13  Marek Safar  <marek.safar@gmail.com>
2998
2999         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3000         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3001         
3002         * codegen.cs(EmitContext): Add ProbingMode flag.
3003         
3004         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3005         
3006         * driver.cs: For now set both warning values.
3007         
3008         * ecore.cs (SimpleName): Name is readonly.
3009         (MethodGroup.OverloadResolve): One quick path for probing.
3010         
3011         * expression.cs (Unary): Set Oper r/o.
3012         (Binary): Set Oper r/o.
3013         (ParameterReference): Set few instance variables as r/o.
3014         (ParameterReference.DoResolveBase): Don't capture aruments when 
3015         the probing is on.
3016         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3017         (Arglist): arguments are private.
3018         (SizeOf): type is private and r/o.
3019         (MemberAccess): arguments are private.
3020
3021         * report.cs: Enhanced reporting on/off capabilities.
3022         
3023         * lambda.cs: Uses ec.IsInProbingMode.
3024         (ContextualReturn): Derives from return.
3025         
3026         * rootcontext.cs: For now set both warning values.
3027         
3028         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3029         copy if one exists.
3030         (Return.Resolve): Don't die immediately.
3031         (Block.Resolve): Speed-up probing.
3032         (Block.CloneTo): Clone only child blocks.
3033
3034 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3035
3036         * iterators.cs: reverted Miguel's latest change (r81925) as it
3037         breaks the build in System.
3038
3039 2007-07-13  Miguel de Icaza  <miguel@novell.com>
3040
3041         * iterators.cs (Yield.CheckContext): Check for the iterator type
3042         also here as we can call into Yield even in codepaths that are not
3043         directly checked by
3044         (MethodOrOperator is the only path that was checked).
3045
3046         In addition to the standard check, use a more specific check for
3047         constructors to report a more verbose error. 
3048
3049 2007-07-12  Miguel de Icaza  <miguel@novell.com>
3050
3051         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3052         report the warning and continue 
3053
3054         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3055         values on the stack on the call to Emit.   Use EmitStatement if
3056         possible, or using Emit + Pop if not possible.   Fixes #82064
3057
3058 2007-07-12  Raja R Harinath  <rharinath@novell.com>
3059
3060         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3061         avoid try...finally in some cases.
3062
3063 2007-07-10  Marek Safar  <marek.safar@gmail.com>
3064
3065         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3066         
3067         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3068         instead of method. Re-use standard error handling.
3069         (ConstructorInitializer.Emit): Simplified.
3070         
3071         * delegate.cs: Updated after Invocation.EmitCall change.
3072         
3073         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3074         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3075         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3076         method and don't permanently changing input arguments.
3077         (MethodGroupExpr): Introduced resolved best_candidate, when method group
3078         is resolved it has one of the candidates is the best one which is later
3079         used to emit. Removed a few unused method.
3080         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3081
3082         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3083         (Binary.ResolveOperator): Ditto.
3084         (ConditionalLogicalOperator.DoResolve): Ditto.
3085         (Invocation): Uses method group.
3086         (Invocation.DoResolve): Simplified.
3087         (Invocation.EmitCall): Removed useless is_static.
3088         (Invocation.Emit): Delegate to method group.
3089         (Invocation.EmitStatement): Simplified.
3090         (New): Uses method group.
3091         (MemberAccess.DoResolve): Don't destroy original expression.
3092         
3093         * statement.cs (ForEach.Resolve): Use null for no method arguments.
3094         
3095 2007-07-04  Marek Safar  <marek.safar@gmail.com>
3096
3097         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3098         
3099         * anonymous.cs,
3100         * lambda.cs: Add custom error message type.
3101
3102 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3103
3104         * lambda.cs: Simplified little bit.
3105         
3106         * parameter.cs: Introduced ImplicitLambdaParameter.
3107         (Parameters.CreateFullyResolved): New factory instead of ctor.
3108         
3109         * anonymous.cs,
3110         * class.cs,
3111         * delegate.cs: Updated parameter creation.
3112         
3113 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3114
3115         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3116         arguments.
3117         
3118         * generic.cs: Synchronized with gmcs.
3119         
3120 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3121
3122         * class.cs (Indexer): Check return type as soon as possible.
3123         
3124         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3125         members too.
3126         
3127         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3128         
3129         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3130         
3131         * parameter.cs (Parameter): Use expression type when it is available.
3132         
3133         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3134         method modifier for the first parameter only.
3135
3136 2007-06-24  Marek Safar  <marek.safar@gmail.com>
3137
3138         A fix for bug #81938
3139         * typemanager.cs (ChangeType): Fixed couple of char conversions.
3140         
3141         * constant.cs: Tide up an exception message.
3142
3143 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3144
3145         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3146         an uninitialized variable is used.
3147         
3148         * expression.cs (LocalVariableReference.DoResolve): Ditto.
3149
3150 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3151
3152         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3153         not found error handling.
3154
3155         * expression.cs (ArrayCreation): Removed redundant fields and little bit
3156         simplified.
3157         (ArrayCreation.ResolveArrayElement): To be ready to customization.
3158         (ArrayCreation.DoResolve): Simplified.
3159         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3160         its own resolve process.
3161         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3162
3163 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3164
3165         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3166         more error details.
3167         
3168 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3169
3170         * cs-tokenizer.cs: Removed var related stuff.
3171         
3172         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3173         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3174         a type and a keyword at same time.
3175         
3176         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3177         matches to "var".
3178         
3179         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3180         implicitly typed arrays, more changes will follow.
3181         
3182         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3183         
3184 2007-06-19  Marek Safar  <marek.safar@gmail.com>
3185
3186         * ecore.cs (VarExpr): Removed Handled field.
3187         
3188         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3189         build-in assign functionality.
3190         (ForEach.Resolve): Removed all implicitly typed local variable code and
3191         simplified.
3192         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3193         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3194
3195 2007-06-18  Marek Safar  <marek.safar@gmail.com>
3196
3197         * assign.cs: Removed implicitly typed local variable check.
3198         
3199         * expression.cs (LocalVariableReference.DoResolve): Add check for self
3200         referencing implicitly typed local variable.
3201         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3202         variable here.
3203         
3204         * statement.cs (Fixed): Removed unsupported implicitly typed local
3205         variable code.
3206
3207 2007-06-15  Marek Safar  <marek.safar@gmail.com>
3208
3209         * decl.cs (MemberName): Moved all Unbound stuff to parser.
3210
3211 2007-06-14  Marek Safar  <marek.safar@gmail.com>
3212
3213         A fix for bugs #81855 and #76274
3214         * attribute.cs (AttachTo): Always set owner for global attributes to
3215         prefined owner.
3216         
3217         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3218         usefull too.
3219         
3220         * cs-parser.jay: Assembly and module attributes must precede all other
3221         elements except using clauses and extern alias declarations.
3222
3223 2007-06-13  Marek Safar  <marek.safar@gmail.com>
3224
3225         A fix for bug #81748
3226         * cs-tokenizer.cs,
3227         * expression.cs: More checks for non ISO-1 features.
3228
3229 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3230
3231         A fix for bug #81807
3232         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3233         present inside switch statement and it is required by nullable check.
3234
3235 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3236
3237         A fix for bug #81840
3238         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3239         when type matching fails.
3240         
3241         * namespace.cs: Tiny error message change.
3242
3243 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3244
3245         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3246         reporting. Added automatic property check.
3247         
3248         * class.cs: Updated after CheckAbstractAndExtern relocation.
3249         (AEventPropertyAccessor.GetSignatureForError): Customized.
3250         
3251 2007-06-11  Marek Safar  <marek.safar@gmail.com>
3252
3253         * class.cs (DefineBaseTypes): Base type can be undefined.
3254         
3255         * ecore.cs (TypeLookup): Minor refactoring.
3256         (DoResolveAsTypeStep): Removed redundant check.
3257
3258         * namespace.cs (Lookup): Removed redundant check.
3259                 
3260         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
3261         ResolveAsTypeTerminal step.
3262         (BootstrapCorlib_*): Simplified.
3263         (PopulateCoreType): Core types can be now external.
3264
3265 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3266
3267         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3268          verification only.
3269          (InferTypeArguments): Infers anonymous expression type arguments.
3270          (Compatible): Split to Compatible and InferTypeArguments. 
3271         
3272         * lambda.cs: Updated.
3273
3274 2007-06-08  Marek Safar  <marek.safar@gmail.com>
3275
3276         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3277
3278 2007-06-07  Raja R Harinath  <harinath@gmail.com>
3279
3280         Fix #80477, cs0135-2.cs, cs0135-3.cs
3281         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3282         names to the "known" variables list.
3283         (Block.CheckInvariantMeaningInBlock): Handle the fact the
3284         parameter names are also "known".
3285         (Block.CheckError136): Remove.
3286         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
3287         null.
3288
3289 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3290
3291         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3292
3293 2007-06-06  Marek Safar  <marek.safar@gmail.com>
3294
3295         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3296         internal error not an user error.
3297          
3298         * expression.cs (IsApplicable): Refactored to make debugging easier.
3299
3300         * support.cs: More tricks for non-mono runtimes.
3301         
3302         * typemanager.cs (CoreLookupType): Made public.
3303         (InitSystemCore): All linq specific stuff moved to linq.cs
3304
3305 2007-06-05  Marek Safar  <marek.safar@gmail.com>
3306
3307         * typemanager.cs (CSharpSignature): One more missing build-in types
3308         replacement.
3309         More tricks for non-mono runtime.
3310
3311 2007-06-05  Raja R Harinath  <harinath@gmail.com>
3312
3313         * statement.cs (Block.CheckError136_InParents): Remove.
3314         (Block.AddVariable): Use GetParameterInfo instead.
3315         (ToplevelBlock.ProcessArguments): Likewise.
3316
3317 2007-06-04  Raja R Harinath  <rharinath@novell.com>
3318
3319         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
3320         information too.
3321         (ToplevelBlock.GetParameterInfo): Split out of ...
3322         (ToplevelBlock.GetParameterRefernce): ... this.
3323         (ToplevelBlock.ParameterMap): Remove.
3324         * expression.cs (ParameterReference): Update to use
3325         ToplevelParameterInfo.
3326
3327         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3328         regression.
3329
3330         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3331         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3332
3333         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3334         (ToplevelBlock.ProcessParameters) ... here.
3335         (ToplevelBlock..ctor): Invoke it.
3336
3337         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3338         new parameters.
3339
3340         * statement.cs (IKnownVariable): New interface.
3341         (LocalInfo): Implement it.
3342         (ToplevelParameterInfo): New class.
3343         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3344         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
3345         GetKnownVariableInfo.
3346
3347 2007-06-03  Raja R Harinath  <harinath@gmail.com>
3348
3349         Partly speed up CS0136 error checks.
3350         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3351         'recurse' parameter.
3352         (Block.DoCheckError136): Only check errors in parameters.  Move
3353         local variable checks ...
3354         (Block.AddVariable): ... here, and ...
3355         (ToplevelBlock.ResolveMeta): ... here.
3356
3357 2007-06-02  Raja R Harinath  <harinath@gmail.com>
3358
3359         * statement.cs (Block.IsChildOf): Remove.
3360
3361         * statement.cs (Statement.Clone): Move special case code ...
3362         (Block.CloneTo): ... here.
3363
3364 2007-05-29  Raja R Harinath  <rharinath@novell.com>
3365
3366         * statement.cs (ToplevelBlock.container): Remove field.  It's
3367         redundant with 'Parent'.
3368         (ToplevelBlock.ContainerBlock): Remove accessor.
3369         (ToplevelBlock..ctor): Update to changes.  Register anonymous
3370         child with parent here, ...
3371         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
3372         current_block.
3373         (start_anonymous): Don't save current_block.
3374         (top_current_block): Remove.
3375
3376         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3377         (Block.Resolve): Update to changes.
3378         (Block..ctor): Move setting of "correct" 'Toplevel'
3379         and 'Explicit' fields to ...
3380         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3381
3382 2007-05-27  Raja R Harinath  <harinath@gmail.com>
3383
3384         Kill Block.Implicit
3385         * statement.cs (Block.Implicit): Remove.
3386         (Block): Update to changes.
3387         * flowanalysis.cs: Likewise.
3388
3389         Mildly speed up CheckInvariantMeaningInBlock
3390         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3391         Recursively call AddKnownVariable to all enclosing blocks.
3392         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3393         Remove recursive calls.
3394         (Block): Update to changes.
3395
3396         New ExplicitBlock invariants
3397         * statement.cs (Block.Explicit): New field.  It points to the
3398         immediately enclosing non-implicit block.
3399         (Block..ctor): Maintain the invariant.
3400         * cs-parser.jay: Take advantage of invariant.
3401
3402         Introduce ExplicitBlock
3403         * statement.cs (ExplicitBlock): New.
3404         (ToplevelBlock): Derive from it.
3405         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3406         sense of flag.
3407         (Block.Implicit): Update to changes.
3408         * cs-parser.jay: Update to changes.
3409
3410         Remove unused field
3411         * codegen.cs (EmitContext.IsLastStatement): Remove.
3412         * statement.cs (Block.DoEmit): Update to changes.
3413
3414 2007-05-25  Raja R Harinath  <rharinath@novell.com>
3415
3416         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3417         modifying current_block directly.
3418
3419 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
3420         
3421         * class.cs: Implemented automatic properties (C# 3.0)
3422           Thanks to Marek for the help.
3423
3424 2007-05-23  Raja R Harinath  <rharinath@novell.com>
3425
3426         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3427         variable as assigned, note also that all its components are
3428         assigned too.
3429         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
3430
3431 2007-05-19  Marek Safar  <marek.safar@gmail.com>
3432
3433         * anonymous.cs, class.cs: Emit Compiler generated attribute when
3434         member is marked as compiler generated.
3435         
3436         * decl.cs (MemberCore): Refactored ModFlags into property.
3437
3438         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3439         (Check): Check only accessibility modifiers.
3440
3441 2007-05-18  Raja R Harinath  <rharinath@novell.com>
3442
3443         Track all assignable slots in one bit array
3444         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3445         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
3446         logic from VariableMap constructor here.  Use the same 'offset'
3447         variable that's later used for computing offsets of local
3448         variables.
3449         * flowanalysis.cs (UsageVector.parameters): Remove.
3450         (UsageVector): Update to changes.
3451         (VariableMap): Remove.
3452
3453         Avoid creating ParameterMap in every block
3454         * statement.cs (Block.ParameterMap): Move ...
3455         (ToplevelBlock.ParameterMap): ... here.
3456         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3457         only once.
3458         * flowanalysis.cs (FlowBranching.param_map): Remove.
3459         (FlowBranching.UsageVector): Update to changes.
3460         (FlowBranchingToplevel.CheckOutParameters): Likewise.
3461
3462         * statement.cs (Block.CloneTo): Clone Toplevel field too.
3463
3464         * expression.cs (ParameterReference): Distinguish between block
3465         where parameter was referenced and declared.
3466
3467 2007-05-18  Marek Safar  <marek.safar@gmail.com>
3468
3469         * flowanalysis.cs, statement.cs: Put back improved error handling.
3470
3471 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
3472         
3473         * assign.cs:
3474         * expression.cs:
3475           Imporved object and collection initialization (C# 3.0).
3476
3477 2007-05-15  Marek Safar  <marek.safar@gmail.com>
3478
3479         A fix for bug #81380
3480         * expression.cs (Is.DoResolve): Only value types have constant `is'
3481         behaviour.
3482
3483 2007-05-15  Raja R Harinath  <rharinath@novell.com>
3484
3485         * statement.cs (ToplevelBlock.child): Remove.
3486
3487 2007-05-15  Raja R Harinath  <harinath@gmail.com>
3488
3489         Rationalize ResolveMeta: refactoring
3490         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
3491         out constant handling code into ...
3492         (Block.DoResolveConstants): ... this.
3493
3494         Rationalize ResolveMeta: kill local_map
3495         * statement.cs (Block.local_map, Block.LocalMap): Remove.
3496         (Block.AssignableSlots): New.
3497         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
3498         for locals -- move code from VariableMap here.  Avoid unnecessary
3499         allocations.
3500         * flowanalysis.cs (FlowBranching.local_map): Remove.
3501         (FlowBranching..ctor): Use Block.AssignableSlots.
3502         (VariableMap): Remove unused constructors.
3503
3504 2007-05-11  Raja R Harinath  <rharinath@novell.com>
3505
3506         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3507
3508 2007-05-11  Marek Safar  <marek.safar@gmail.com>
3509
3510         * typemanager.cs (IsFriendAssembly): Should not be called for building
3511         assembly.
3512
3513 2007-05-09  Marek Safar  <marek.safar@gmail.com>
3514
3515         * literal.cs (NullConstant): Print null in all cases.
3516         
3517         * expression.cs (Binary.ResolveOperator): Implemented delegate
3518          comparison based on C# 2.0 changes.
3519
3520 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
3521
3522         This code is contributed under the MIT X11 license
3523         
3524         The following enables support for several C# 3.0 language features:
3525         
3526         * cs-tokenizer.cs: Added support for the "var" keyword.
3527         
3528         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3529           Added VarExpr class to facilitate type inferencing.
3530         
3531         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3532           to support anonymous types.
3533         
3534         * assign.cs: Added support for type inferencing and initialization.
3535         
3536         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3537         
3538         * expression.cs: Added implicit array support to ArrayCreation.
3539           Added 5 types and 1 interface:
3540           
3541           IInitializable                Implementing classes can inject initializing
3542                                         statements after object instantiation.
3543           
3544           Initializer                   Stores data for object initialization.
3545           
3546           AnonymousType                 An expression for anonymous types.
3547           
3548           AnonymousTypeParameter        Stores data about an anonymous type's field.
3549           
3550           NewInitialize                 An expression for object initialization.
3551           
3552           CollectionInitialize          An expression for collection initialization.
3553         
3554         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3555           statements.
3556
3557 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3558
3559         A fix for bug #81500
3560         * cs-tokenizer.cs: Add special handling for coalescing operator.
3561
3562 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3563
3564         A fix for bug #81529
3565         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3566         its value from base class until it is redefined.
3567
3568 2007-05-02  Raja R Harinath  <rharinath@novell.com>
3569
3570         Fix regression in cs0631-3.cs
3571         * cs-parser.jay (operator_declarator): Add opt_attributes to error
3572         fallback.  Make error fallback catch more cases.
3573
3574 2007-05-01  Miguel de Icaza  <miguel@novell.com>
3575
3576         * cs-parser.jay: Allow parameters in operator declarations to have
3577         attributes. 
3578
3579 2007-04-27  Miguel de Icaza  <miguel@novell.com>
3580
3581         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3582         exists. 
3583
3584         * lambda.cs (ContextualReturn.Resolve): An expression is valid
3585         inside the ContextualReturn, it does not have to be an
3586         ExpressionStatement. 
3587
3588 2007-04-24  Miguel de Icaza  <miguel@novell.com>
3589
3590         * lambda.cs (ContextualReturn.Resolve): if the return type is not
3591         set, set it.
3592
3593 2007-04-23  Miguel de Icaza  <miguel@novell.com>
3594
3595         * anonymous.cs (AnonymousContainer): split the virtual Resolve
3596         method in two methods: ResolveNoDefine and Resolve.
3597
3598         ResolveNoDefine will stop just after ResolveTopBlock has been
3599         called.   
3600
3601         Resolve will then continue by creating a method and issuing the
3602         call to method.Define ().
3603
3604         (AnonymousMethod): Split and implement the new Resolve and
3605         ResolveNoDefine as well.
3606
3607         * lambda.cs (LambdaExpression): Split the anonymous method
3608         resolution code into a separate routine (CoreCompatibilityTest)
3609         from DoCompatibleTest.
3610
3611         (LambdaExpression.TryBuild): New method, this method tries to
3612         build the LambdaExpression with the given set of types to be used
3613         as the types for the various parameters of the lambda expression. 
3614
3615         If the compilation succeed with the given types, the infered type
3616         of the Anonymous method is returned, otherwise null is returned.
3617
3618 2007-04-23  Marek Safar  <marek.safar@gmail.com>
3619
3620         A fix for bug #81414
3621         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3622
3623 2007-04-22  Miguel de Icaza  <miguel@novell.com>
3624
3625         * cs-tokenizer.cs: Change various identifiers here from the
3626         camelCasing to the recommended Linux-like style for instance
3627         variables from the Coding Guidelines. 
3628
3629 2007-04-19  Martin Baulig  <martin@ximian.com>
3630
3631         * convert.cs
3632         (Convert.ImplicitReferenceConversionCore): Allow conversions from
3633         System.Enum to System.ValueType.
3634
3635 2007-04-13  Martin Baulig  <martin@ximian.com>
3636
3637         Rewrote implicit reference conversions.  We need to distinguish
3638         between implicit reference conversions (13.1.4) and implicit
3639         boxing conversions (13.1.5).
3640
3641         According to the spec, there's an an implicit conversion
3642         "From a one-dimensional array-type S[] to IList<T> and base
3643         interfaces of this interface, provided there is an implicit
3644         reference conversion from S to T."  Note that this does not
3645         include boxing conversions.
3646
3647         * convert.cs
3648         (Convert.ImplicitTypeParameterBoxingConversion): New method.
3649         (Convert.ImplicitReferenceConversion): Split into
3650         ImplicitReferenceConversionCore() and
3651         ImplicitBoxingConversionExist().
3652         (Convert.ImplicitReferenceConversionExists): Use the new
3653         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3654
3655 2007-04-12  Martin Baulig  <martin@ximian.com>
3656
3657         * convert.cs (Convert.ImplicitReferenceConversion): Move the
3658         `TypeManager.null_type' checks up to the top of the method.
3659
3660 2007-04-11  Marek Safar  <marek.safar@gmail.com>
3661
3662         A fix for bug #81350
3663         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3664         extension methods.
3665
3666 2007-04-11  Martin Baulig  <martin@ximian.com>
3667
3668         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3669         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
3670         to make this work for generic classes; fixes #79561.
3671
3672 2007-04-11  Martin Baulig  <martin@ximian.com>
3673
3674         * expression.cs (As): Add support for nullable types; fixes #79371.
3675
3676 2007-04-11  Martin Baulig  <martin@ximian.com>
3677
3678         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
3679         `type.FullName' is null; fixes #80243.
3680
3681 2007-04-11  Martin Baulig  <martin@ximian.com>
3682
3683         * expression.cs (Invocation.IsApplicable): Don't modify the method
3684         if type inference succeeded, but the method was not applicable.
3685         Fixes #81250.
3686
3687 2007-04-10  Marek Safar  <marek.safar@gmail.com>
3688
3689         A fix for bug #81324
3690         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
3691         internal and external namespaces containers.
3692
3693 2007-04-10  Martin Baulig  <martin@ximian.com>
3694
3695         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
3696         TypeManager.DropGenericMethodArguments() so we also call
3697         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
3698
3699 2007-04-10  Martin Baulig  <martin@ximian.com>
3700
3701         * iterators.cs (Iterator.CreateIterator): Don't crash if
3702         `method.ReturnType' is null.  This happens if something went wrong
3703         while resolving that typ (we already reported an error in this case).
3704
3705 2007-04-10  Martin Baulig  <martin@ximian.com>
3706
3707         * expression.cs (New.DoResolve): Don't call CheckComImport() on
3708         generic interfaces; report the CS0144 directly.
3709
3710 2007-04-10  Martin Baulig  <martin@ximian.com>
3711
3712         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
3713         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
3714
3715 2007-04-10  Martin Baulig  <martin@ximian.com>
3716
3717         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
3718
3719 2007-04-09  Raja R Harinath  <rharinath@novell.com>
3720
3721         A better fix
3722         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
3723         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
3724
3725         Fix #81338
3726         * statement.cs (For.Resolve): If resolution fails, use
3727         KillFlowBranching.
3728
3729 2007-04-08  Marek Safar  <marek.safar@gmail.com>
3730
3731         * anonymous.cs (MakeName): Make faster and zero-based.
3732         (VerifyExplicitParameterCompatibility): Back to mode where generic
3733         parameter is ignored.
3734         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
3735
3736         * class.cs (EmitType): Method can emit another new method.
3737
3738         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
3739
3740         * driver.cs: Updated.
3741
3742         * lambda.cs: Reuse predefined empty parameters.
3743
3744         * parameter.cs: Updated
3745
3746         * support.cs: Implemented InflateTypes.
3747
3748         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
3749         (InitSystemCore): Introduced to isolate 3.0 dependencies.
3750
3751 2007-04-03  Martin Baulig  <martin@ximian.com>
3752
3753         Fix #80632.
3754
3755         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
3756         version of TypeManager.IsOverride() which also works with generic
3757         types.  
3758
3759 2007-04-03  Martin Baulig  <martin@ximian.com>
3760
3761         Fix #81044.
3762
3763         * convert.cs
3764         (Convert.ExplicitReferenceConversion): We need to cast when
3765         converting from IList<T> to S[].
3766
3767 2007-04-01  Marek Safar  <marek.safar@gmail.com>
3768
3769         * decl.cs (FindExtensionMethods): Consider all candidates with same name
3770         at this level.
3771         
3772         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
3773
3774 2007-03-31  Marek Safar  <marek.safar@gmail.com>
3775
3776         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
3777         argument and return type inferring.
3778
3779         * codegen.cs (InferReturnType): Flag whether return can be inferred.
3780         (ReturnType): Turned to property.
3781
3782         * statement.cs (Return): Implemented return type inferring.
3783
3784         * support.cs (ReflectionParameters): Use local types if possible.
3785
3786 2007-03-30  Raja R Harinath  <rharinath@novell.com>
3787
3788         * flowanalysis.cs (FlowBranching.Reachability): Remove.
3789         (FlowBranching.UsageVector): Update to changes.
3790
3791         Prepare to kill 'Reachability'
3792         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
3793         argument of constructor.
3794
3795 2007-03-29  Raja R Harinath  <rharinath@novell.com>
3796
3797         Prepare to kill 'Reachability'
3798         * flowanalysis.cs (UsageVector.is_unreachable): New.
3799         (UsageVector): Update to maintain 'is_unreachable' in parallel to
3800         'reachability', and verify they're consistent.
3801
3802         Fix #81121
3803         * expression.cs (New.EmitStatement): Handle type parameters here too.
3804
3805 2007-03-29  Martin Baulig  <martin@ximian.com>
3806
3807         Fix #79148.
3808
3809         * anonymous.cs
3810         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
3811         CompilerGeneratedClass.
3812         (ScopeInfo.EmitScopeInstance): Make this protected.
3813         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
3814         `ec.CurrentAnonymousMethod.Scope == Scope'.
3815
3816         * statement.cs (Block.ScopeInfo): Make this a property.
3817
3818 2007-03-27  Raja R Harinath  <harinath@gmail.com>
3819
3820         Prepare to kill 'Reachability'
3821         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
3822         (FlowBranching.UsageVector.Reachability): Remove property.
3823         (FlowBranching.UsageVector.IsUnreachable): New property.
3824         (FlowBranching.UsageVector.ResetBarrier): New.
3825         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
3826         * codegen.cs, statement.cs: Update to changes.
3827
3828 2007-03-27  Martin Baulig  <martin@ximian.com>
3829
3830         Fix #81209.
3831
3832         * decl.cs
3833         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
3834         generic types.
3835
3836 2007-03-26  Raja R Harinath  <rharinath@novell.com>
3837
3838         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
3839         instead of TriState.  Remove all mention of TriState.
3840
3841         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
3842         replaced by a boolean.  Add boolean 'is_unreachable' field, check
3843         and maintain invariants.
3844
3845 2007-03-25  Marek Safar  <marek.safar@gmail.com>
3846
3847         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
3848
3849 2007-03-25  Marek Safar  <marek.safar@gmail.com>
3850
3851         * expression.cs: Stop using obsolete 2.0 opcodes.
3852
3853 2007-03-25  Marek Safar  <marek.safar@gmail.com>
3854
3855         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
3856         one of the latests Martin's fixes.
3857
3858 2007-03-23  Miguel de Icaza  <miguel@novell.com>
3859
3860         * expression.cs: On BigEndian systems, swap the bytes, temporary
3861         solution until we get a new bitconverter class.
3862
3863 2007-03-23  Martin Baulig  <martin@ximian.com>
3864
3865         Fix #81158.
3866
3867         * decl.cs (MemberCache.AddMembers): Add generic methods both as
3868         "Method" and "Method`1".  Normally, a cache lookup is done on the
3869         "Method" form (ie. without the generic arity), but this one makes
3870         lookups on the full form work as well.
3871
3872 2007-03-22  Raja R Harinath  <rharinath@novell.com>
3873
3874         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
3875         unused properties.
3876
3877 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
3878         * class.cs: 
3879         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
3880         ordered_member_list, to TypeBuilder to store members to be defined
3881         in the order they were parsed in.
3882         - ordered_explicit_member_list contains all properties indexers
3883           and methods that are defined as explicit implementation of an
3884           interface or base class.
3885         - ordered_member_list contains all properties indexers and methods
3886           that are not defined as explicit implementation of an interface
3887           or base class.
3888
3889         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
3890         functionality in these removed classes has been replaced with 
3891         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
3892         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
3893
3894         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
3895         to CheckForDuplications inside GetMethod and SetMethod Define Method
3896         to handle method property and indexer name conflicts.
3897
3898         Fixes #79434
3899
3900         All code is contributed under the MIT/X11 license.
3901
3902 2007-03-20  Martin Baulig  <martin@ximian.com>
3903
3904         * class.cs (TypeContainer.Interfaces): Removed; they're now
3905         included in `TypeContainer.Types'.
3906
3907 2007-03-20  Martin Baulig  <martin@ximian.com>
3908
3909         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
3910
3911         * class.cs (TypeContainer.CreateType): New public method.  This is
3912         now called before DefineType() to create the TypeBuilders.
3913         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
3914         has already been created by CreateType().
3915         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
3916         don't resolve our base classes here; this has been moved into
3917         DefineBaseTypes().  We're now called from CreateType().
3918         (TypeContainer.DefineBaseTypes): New private method; resolve our
3919         base classes here.  We're now called from DefineType().
3920
3921         * rootcontext.cs
3922         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
3923         our types first to create all the TypeBuilders.  After that, call
3924         TypeContainer.DefineType() on all the types which'll resolve their
3925         base classes and setup the resolve order.
3926
3927 2007-03-20  Martin Baulig  <martin@ximian.com>
3928
3929         * class.cs (TypeContainer.Enums): Removed; they're now included in
3930         `TypeContainer.Types'.  
3931
3932 2007-03-20  Martin Baulig  <martin@ximian.com>
3933
3934         * class.cs
3935         (TypeContainer.DefineType): Don't call ResolveMembers() here.
3936         (TypeContainer.DoResolveMembers): Call DefineType() on our
3937         `compiler_generated' classes; moved here from DefineNestedTypes().
3938
3939         * rootcontext.cs
3940         (RootContext.ResolveTree): Call ResolveMembers() on all
3941         TypeContainer's in the `type_container_resolve_order'.
3942
3943 2007-03-19  Marek Safar  <marek.safar@gmail.com>
3944
3945         * class.cs: Use corlib to handle InternalMethodImplAttribute.
3946
3947 2007-03-17  Marek Safar  <marek.safar@gmail.com>
3948
3949         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
3950         implementation flags.
3951
3952 2007-03-17  Marek Safar  <marek.safar@gmail.com>
3953
3954         * class.cs: More optimizations for type parameters.
3955
3956 2007-03-15  Marek Safar  <marek.safar@gmail.com>
3957
3958         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
3959
3960         * ecore.cs, parameter.cs: More common code for both corlibs.
3961
3962         * typemanager.cs (IsGenericMethod): Simplified.
3963
3964 2007-03-15  Raja R Harinath  <rharinath@novell.com>
3965
3966         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
3967         'returns'.
3968         * statement.cs, iterators.cs, lambda.cs: Update to changes.
3969
3970         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
3971         unconditionally.  Simplify explanation.
3972         (Try.Resolve, Using.Resolve): Likewise.
3973
3974 2007-03-15  Martin Baulig  <martin@ximian.com>
3975
3976         Fix #80731.
3977
3978         * decl.cs (DeclSpace): If we're a partial class, use our
3979         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
3980
3981 2007-03-15  Raja R Harinath  <rharinath@novell.com>
3982
3983         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
3984         'throws'.
3985         (FlowBranching.UsageVector): Update to changes.
3986         (FlowBranching.MergeSiblings): Likewise.
3987         * statement.cs: Likewise.
3988
3989 2007-03-15  Martin Baulig  <martin@ximian.com>
3990
3991         Fix #79302.
3992
3993         * decl.cs
3994         (MemberCache): Added a special .ctor for type parameters.
3995
3996         * typemanager.cs
3997         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
3998         `MemberCache'.  
3999
4000 2007-03-09  Martin Baulig  <martin@ximian.com>
4001
4002         * enum.cs (Enum): Make this a TypeContainer.
4003         (EnumMember): Derive from `Const'.
4004
4005         * const.cs
4006         (Const.DoResolveValue): New protected virtual method; move most of
4007         the functionality of ResolveValue() here so we can override it in
4008         `EnumMember'.
4009         (Const.CreateConstantReference): Make this virtual.
4010
4011         * class.cs (Kind): Add `Kind.Enum'.
4012         (TypeContainer.Emit): Don't emit the enums here; they're already
4013         in the `RootContext.typecontainer_resolve_order'.
4014
4015         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4016         here; they're already in the `typecontainer_resolve_order'.
4017
4018         * ecore.cs (EnumConstant.ConvertImplicitly): Add
4019         TypeManager.DropGenericTypeArguments().
4020
4021         * typemanager.cs
4022         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4023         (TypeManager.IsEnumType): Likewise.
4024         (TypeManager.EnumToUnderlying): Likewise.
4025         (TypeManager.IsEqual): Add support for enums.
4026
4027 2007-03-12  Raja R Harinath  <rharinath@novell.com>
4028
4029         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4030         DefaultParameterValueAttribute to be undefined, say if System.dll
4031         is not referenced.
4032
4033 2007-03-11  Marek Safar  <marek.safar@gmail.com>
4034
4035         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4036         any mscorlib.
4037
4038 2007-03-10  Marek Safar  <marek.safar@gmail.com>
4039
4040         * class.cs, parameter.cs: Unified parameters verification.
4041
4042 2007-03-08  Martin Baulig  <martin@ximian.com>
4043
4044         * cs-parser.jay (constructor_header): Pass the location to the
4045         newly created TopLevelBlock.
4046
4047 2007-03-07  Martin Baulig  <martin@ximian.com>
4048
4049         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4050
4051 2007-03-06  Miguel de Icaza  <miguel@novell.com>
4052
4053         * convert.cs (ExplicitReferenceConversionExists): Sync this method
4054         with the changes from David, fixes the build.
4055
4056 2007-03-05  David Mitchell  <dmitchell@logos.com>
4057
4058         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4059         and its base interfaces to a one-dimensional array type S[],
4060         provided there is an implicit or explicit reference conversion
4061         from S to T.
4062
4063 2007-03-03  Marek Safar  <marek.safar@gmail.com>
4064
4065         * cs-tokenizer.cs: Implemented basic linq grammar.
4066
4067         * driver.cs: Set linq lang version on demand.
4068
4069 2007-02-26  Marek Safar  <marek.safar@gmail.com>
4070
4071         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4072
4073 2007-02-25  Marek Safar  <marek.safar@gmail.com>
4074
4075         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4076         (Fixes #80455)
4077
4078         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4079         here.
4080         Check property and event extern attributes.
4081
4082         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4083         charset.
4084
4085 2007-02-24  Marek Safar  <marek.safar@gmail.com>
4086
4087         A fix for bug #80407
4088         * ecore.cs: Don't report ambiguity error when methods have same parent.
4089
4090 2007-02-23  Marek Safar  <marek.safar@gmail.com>
4091
4092         A fix for bug #80878
4093         * class.cs, cs-parser.jay: Event property can host anonymous methods.
4094
4095 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4096
4097         * attribute.cs: Enable ExtensionAttribute presence test.
4098
4099 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4100
4101         * class.cs: Warn about missing GetHashCode only when Equals is override.
4102
4103         * decl.cs: Check accessibility of type arguments.
4104
4105         * typemanager.cs: Correctly report nullable array.
4106
4107 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4108
4109         * class.cs, report.cs: Capture more details when things go wrong.
4110
4111 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4112
4113         A fix for bug #80650
4114         * cs-parser.jay: Anonymous container starts at constructor declaration
4115         and not at block beginning because it has to be usable in constructor
4116         initializer.
4117
4118         * statement.cs: Use context location and not block one for error reporting.
4119
4120 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4121
4122         A fix for bug #78712
4123         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4124         too.
4125
4126 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4127
4128         A fix for bug #80493 by Atsushi Enomoto
4129         * cs-parser.jay: Ignore invalid attribute target.
4130
4131 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4132  
4133         * cs-tokenizer.cs: Ignore '\0' as white space character.
4134
4135 2007-02-17  Miguel de Icaza  <miguel@novell.com>
4136
4137         * cs-parser.jay: Add support for lambda expressions to the mcs
4138         compiler as well.
4139
4140         * lambda.cs: Only clone when we are probing, not on the final call
4141         (Compatible is the final call). 
4142
4143         * statement.cs (CloneContext): Introduce class to provide block
4144         remapping during clone.
4145
4146         All statements Clone themselves now.
4147
4148         (Clone): special handling for blocks, when we clone a block, we
4149         register the block inside this routine, as children of the block
4150         might trigger a lookup. 
4151         
4152         * expression.cs: Add support for CloneContext in all expressions. 
4153         
4154 2007-02-17  Marek Safar  <marek.safar@gmail.com>
4155  
4156         A fix for bug #80493
4157         * statement.cs: Report ambiguous warning when interfaces are not related.
4158
4159 2007-02-15  Marek Safar  <marek.safar@gmail.com>
4160
4161         C# 3.0 extension methods.
4162
4163         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4164         cannot be used directly.
4165
4166         * class.cs (Class.Emit): Emit extension attribute if any class method
4167         is extension method.
4168         (Method.Define): Add basic extension method validation conditions.
4169         (Method.Emit): Emit extension attribute for method.
4170
4171         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4172         extension method exists. Currently we follow same approach as Microsoft
4173         does, emit even if a method or a class are private but this can change
4174         later.
4175
4176         * cs-parser.jay: Add handling of `this' keyword in method parameters
4177         context.
4178
4179         * decl.cs (DeclSpace.IsStaticClass): New property.
4180         (MemberCache.FindExtensionMethods): Looks for extension methods with
4181         defined name and extension type.
4182
4183         * doc.cs: Updated after OverloadResolve changes.
4184
4185         * driver.cs: Add new soft reference to System.Core.dll.
4186
4187         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4188         (ExtensionMethodGroupExpr): Represents group of extension methods.
4189
4190         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4191         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4192         to MethodGroupExpr and made non-static for easier customization.
4193         (Invocation.DoResolve): Add extension method lookup when no standard
4194         method was found.
4195         (MemberAccess.DoResolve): Try extension methods if no member exists.
4196
4197         * modifiers.cs: Add METHOD_EXTENSION modifier.
4198
4199         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4200         as well as candidate extension type.
4201         (ComputeNamespaces): When assembly constains extension methods registers
4202         them.
4203         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4204         extension method lookup.
4205         (Namespace.LookupExtensionMethod): Looks for extension method in this
4206         namespace.
4207         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4208         find a method which matches name and extensionType.
4209
4210         * parameter.cs (Parameter): Add This modifer.
4211         (HasExtensionMethodModifier): New property.
4212         (Resolve): Add extension parameter check.
4213         (ModFlags): turned to property to exclude this modifier as it is not real
4214         parameter modifier.
4215         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4216
4217         * support.cs (ParameterData): Add ExtensionMethodType.
4218         (ReflectionParameters): Implemented ExtensionMethodType interface property.
4219
4220         * typemanager.cs: Add type and ctor extension attribute type.
4221
4222 2007-02-15  Miguel de Icaza  <miguel@novell.com>
4223
4224         * report.cs (DisableErrors, EnableErrors): used to prevent error
4225         output when we are "trying" to compile various methods with
4226         different types. 
4227
4228         * ecore.cs (Expression): Add Clone method that calls the virtual
4229         CloneTo method.  The current CloneTo method in Expression throws
4230         an exception so we can track down all the places where this must
4231         be implemented (not using abstract, because that would be a lot of
4232         up-front-work before we can start testing the implementation
4233         idea). 
4234
4235         Important: we only need Clone capabilities for expressions created
4236         by the parser, as the expressions we will be cloning are
4237         expressions in the pre-resolved state.   This vastly simplifies
4238         the work required. 
4239         
4240         (SimpleName): Add CloneTo that does nothing.
4241         (EmptyCast): Add CloneTo.
4242         
4243         * expression.cs (Binary): Implement CloneTo.
4244         (Invocation.IsApplicable): Store the current ec in
4245         EmitContext.TempEc and restore it on return.  This is used so we
4246         do not have to sprinkle hundres of methods with an extra
4247         EmitContext, we know that the only user is the lambda expression
4248         ImplicitConversionExists code. 
4249         
4250         (Argument): Add Cloning capabilities.
4251         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4252         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4253         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4254         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4255         IndexerAccess): Add Clone capability.
4256
4257         (LocalVariableReference, This): TODO: needs cloned Block mapping.
4258
4259         (Argument): Add cloning capability.
4260
4261         * assign.cs (Assign): Implement CloneTo.
4262
4263         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4264         
4265         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4266         version by calling Convert with the EmitContext (that we are
4267         currently storing in ec, this is not great, but will do for now,
4268         to avoid passing EmitContext parameters to hundreds of functions
4269         that do not need them now).
4270
4271         (SetExpression): Remove, it is not needed.
4272         
4273         (ContextualReturn): Implement CloneTo.
4274
4275         * statement.cs (Statement): Implement cloning infrastructure,
4276         similar to expressions.
4277
4278         (Block): Partial implementation of Clone for statements.
4279
4280         (Return): Implement clone.
4281         
4282         * constant.cs (Constant.CloneTo): New method, does nothing.
4283
4284         * codegen.cs (TempEc): Add a static EmitContext as a temporary
4285         solution, until we decide how to exactly do this.  
4286         
4287 2007-02-14  Marek Safar  <marek.safar@gmail.com>
4288  
4289         A fix for bug #80493
4290         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4291         a property is override we need to use second accessor.
4292
4293 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4294  
4295         A fix for bug #80418
4296         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4297         methods.
4298
4299 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4300
4301         Another fix for bug #80749
4302         * pending.cs: Abstract class has priority over interfaces.
4303
4304 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4305
4306         Another fix for bug #80749
4307         * pending.cs: Abstract class has priority over interfaces.
4308
4309 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4310
4311         Another fix for bug #80749
4312         * pending.cs: Abstract class has priority over interfaces.
4313
4314 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4315
4316         Another fix for bug #80749
4317         * pending.cs: Abstract class has priority over interfaces.
4318
4319 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4320
4321         * class.cs Better error message.
4322
4323         * driver.cs: Add shorter versions of -optimize option.
4324
4325 2007-02-13  Martin Baulig  <martin@ximian.com>
4326
4327         * class.cs (Constructor.Emit): Check the return value of
4328         ec.ResolveTopBlock() and return on error.
4329
4330 2007-02-13  Raja R Harinath  <rharinath@novell.com>
4331
4332         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4333         message to fix error message regression.
4334
4335 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4336
4337         * delegate.cs: Delegate creation expression cannot be of Nullable type.
4338
4339 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4340
4341         A fix for bug #80749
4342         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4343         its parent container.
4344
4345         * class.cs (DefineFieldInitializers): Each initializer can has different
4346         resolve context.
4347
4348         * const.cs: Updated.
4349
4350 2007-02-11  Miguel de Icaza  <miguel@novell.com>
4351
4352         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4353         now all the heavy lifting to check that embedded statements or
4354         expressions have the right form is done in the ContextualReturn.
4355
4356         (ContextualReturn): New class.  
4357
4358         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4359         method that can be invoked to report 201, so we do not replicate
4360         this everywhere.
4361
4362         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4363         
4364         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4365         treating tabs as spaces. 
4366
4367 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4368
4369         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4370         * assign.cs: Use full implicit conversion for right side check.
4371
4372 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4373
4374         * statement.cs (Switch): Switch over boolean type is not standardized.
4375
4376 2007-02-08  Marek Safar  <marek.safar@gmail.com>
4377
4378         A fix for bug #80755
4379         * decl.cs (FindBaseEvent): Don't use method cache for events.
4380
4381 2007-02-07  Marek Safar  <marek.safar@gmail.com>
4382
4383         * cs-parser.jay: Better syntax error handling.
4384
4385         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4386         instead of underlying type value.
4387
4388 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4389
4390         * driver.cs: Check define identifier before is registered.
4391
4392         * namespace.cs: Use existing error message.
4393
4394         * report.cs: New warning.
4395
4396 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4397
4398         A fix for bug #80742
4399         * expression.cs: Delegate Invoke method can be called directly.
4400
4401 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4402
4403         A fix for bug #80676
4404         * class.cs (IsEntryPoint): The Main method can have params modifier.
4405
4406 2007-02-04  Miguel de Icaza  <miguel@novell.com>
4407
4408         * parameter.cs (Parameter, Parameters): Add Clone method.
4409
4410         * anonymous.cs (Compatible): Turn method into virtual method, so
4411         LambdaExpression can implement a different behavior.
4412
4413         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4414         out the basic checking here, so it can be used by
4415         LambdaExpressions.
4416         
4417         * lambda.cs: Introduce "Compatible" function that will do the
4418         heavy lifting.
4419
4420 2007-02-02  Marek Safar  <marek.safar@gmail.com>
4421
4422         * attribute.cs: Unified one error message.
4423
4424         * class.cs (Class): Use type attributes and not properties to test static
4425         class.
4426         (IsEntryPoint): Don's pass local variable.
4427
4428         * convert.cs: Removed duplicate check.
4429
4430         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4431
4432         * driver.cs: Don't crash when soft reference does not exist.
4433
4434         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4435         (UsingEntry): Removed redundant allocation.
4436
4437         * parameter.cs: Add fast path for type parameters.
4438
4439         * support.cs: Don't allocate attribute when it's not used.
4440
4441 2007-01-30  Miguel de Icaza  <miguel@novell.com>
4442
4443         * anonymous.cs
4444         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4445         this into a virtual method, so we can override it in LambdaExpression.
4446
4447         * driver.cs: Improve diagnostics in case of failure. 
4448
4449         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4450         write a function that is slightly more complex and that parses:
4451
4452         type identifier [, type identifier]* )
4453
4454         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4455         this expression:
4456
4457                 (canEmpty ? i >= 0 : i > 0)
4458
4459 2007-01-30  Raja R Harinath  <rharinath@novell.com>
4460
4461         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4462         exception on possibly valid code.
4463
4464 2007-01-29  Raja R Harinath  <rharinath@novell.com>
4465
4466         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4467         Push/PopPosition.
4468         (parse_opt_type_arguments): Remove.  It's almost the same as
4469         parse_less_than.
4470         (parse_namespace_or_typename): Use parse_less_than.
4471
4472 2007-01-28  Miguel de Icaza  <miguel@novell.com>
4473
4474         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4475         this bug took a few hours to find, because the state saved and
4476         restored by PushPosition and PopPosition was ignoring the state of
4477         parse_generic_less_than.
4478
4479         I can also now remove the handling of OP_LT and OP_GT, this solves
4480         the big mistery.
4481         
4482         * cs-tokenizer.cs: store the location for the ARROW token, we use
4483         that in the parser.
4484
4485         (PushPosition, PopPosition): save/restore also `current_token',
4486         restore `parse_generic_less_than' (was missing).
4487
4488         (parse_opt_type_arguments): use parse_type, not
4489         parse_namespace_or_typename to parse types.
4490
4491         * lambda.cs: Empty new file, will eventually have the lambda
4492         expression implementation.
4493
4494         * lambda.test: used to test the internal tokenizer. 
4495
4496         * report.cs (FeatureIsNotISO1): Rename from
4497         FeatureIsNotStandardized, because it was about the language level
4498         (1 vs 2) it was not about standarization.
4499
4500         (FeatureRequiresLINQ): New.
4501
4502         * support.cs (SeekableStreamReader): Only require that the reader
4503         is a TextReader, not a StreamReader, so we can plug StringReader. 
4504
4505         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4506         given position in the input stream the following tokens can be
4507         parsed as a type followed by an identifier.
4508
4509         (is_punct): after a '(' if parse_type_and_parameter returns true,
4510         then return a special token OPEN_PARENS_LAMBDA which is used to
4511         avoid reduce/reduce errors in the grammar for the
4512         lambda_expression rules.
4513
4514         (parse_type): implement a type parser inside the
4515         tokenizer, the parser only returns true or false depending on
4516         whether the input at a given position can be parsed as a type.
4517
4518         (peek_token): new method used during type parsing.
4519
4520 2007-01-28  Raja R Harinath  <rharinath@novell.com>
4521
4522         Fix #80531
4523         * anonymous.cs (ScopeInfo.InflateParameters): New.
4524         (AnonymousContainer.Resolve): Use it to redirect types of
4525         delegate parameters.
4526
4527 2007-01-27  Raja R Harinath  <rharinath@novell.com>
4528
4529         Fix #80530
4530         * expression.cs (Error_InvalidArguments): Don't use two different
4531         messages for CS1503.  Use ExtraInformation and
4532         SymbolRelatedToPreviousError instead.
4533
4534         Fix #80358
4535         * decl.cs (DeclSpace.initialize_type_params): Don't access
4536         'type_params' of a partial class directly.
4537
4538 2007-01-26  Miguel de Icaza  <miguel@novell.com>
4539
4540         * constant.cs: Removed a handful of out-of-range checks that were
4541         not necessary. 
4542
4543 2007-01-25  Marek Safar  <marek.safar@gmail.com>
4544
4545         * expression.cs (CheckUselessComparison): Add additional check for char
4546         constants.
4547
4548         * namespace.cs: Fixed typo.
4549
4550 2007-01-23  Miguel de Icaza  <miguel@novell.com>
4551
4552         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4553         gone, instead we inline the test, preventing the needless casts to
4554         longs, ulongs and doubles for the parameters, avoiding calls to
4555         methods that overchecked stuff, and instead inlined things
4556         nicely. 
4557
4558 2007-01-20  Marek Safar  <marek.safar@gmail.com>
4559
4560         * cs-parser.jay: Better parameter error handling.
4561
4562 2007-01-17  Marek Safar  <marek.safar@gmail.com>
4563
4564         A fix for bug #80368, #80522
4565         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4566         whether array initializer contains constants only.
4567         (ArrayCreation.Emit): Use better formula to decide when
4568         are array initializers for static initialization.
4569         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4570         have to emit even constants otherwise they are pre-initialized.
4571
4572 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
4573             Raja R Harinath  <rharinath@novell.com>
4574
4575         Fix emit order of 'get' vs. 'set'.
4576         * support.cs (Accessors): New.
4577         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4578         Note the order in which accessors are declared in the source.
4579         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4580         Refactored from Property.Define and Indexer.Define.
4581         (PropertyBase.DefineAccessors): New helper that calls the above in
4582         appropriate order as noted by the parser.
4583         (Property.Define, Indexer.Define): Update to changes.
4584         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4585
4586 2007-01-17  Raja R Harinath  <rharinath@novell.com>
4587
4588         Fix cs0029-6.cs and gcs0029-2.cs (regression)
4589         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4590         there's an implicit conversion from the current type to the target
4591         type before converting the underlying constant.
4592
4593 2007-01-16  Marek Safar  <marek.safar@gmail.com>
4594
4595         * const.cs (ResolveValue): Updated after constant conversion was made more
4596         generic.
4597
4598         * constant.cs (GetAttributableValue): constant to object conversion is
4599         used for attributes only.
4600         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4601         constant conversions.
4602         (LongConstant.ConvertImplicitly): Ditto.
4603
4604         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4605         (ImplicitConversionStandard): Handle constant conversion as extra step.
4606         It solves the issue when constant conversion was called indirectly like
4607         inside array initializer and constant folding was skipped.
4608
4609         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4610         this change.
4611
4612         * statement.cs(ImplicitConversionStandard): Updated after constant
4613         conversion was made more generic.
4614
4615 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
4616
4617         * expression.cs (As.DoResolve): Use GenericConstraints instead of
4618         Constraints, solves the problem where the compiler incorrectly
4619         reported that a type parameter was not constrained to a class (Bug
4620         80518)
4621
4622 2007-01-14  Marek Habersack  <grendello@gmail.com>
4623
4624         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4625
4626 2007-01-14  Marek Safar  <marek.safar@gmail.com>
4627
4628         A fix for bug #80368
4629         * assign.cs (FieldInitializer): New class implements field
4630         initializer statement.
4631
4632         * attribute.cs: Update after FieldMember rename.
4633
4634         * class.cs (PropertyBasedMember): New common class for property based
4635         types.
4636         (InterfaceMemberBase): New base class for all members which can be used as
4637         an interface members.
4638         (MethodCore): Moved really common code to InterfaceMemberBase.
4639         (Method.Define): Equal and GetHasCode detection is relevant for methods
4640         only.
4641         (MethodData.Define): Don't assume that public event implements an
4642         interface automatically.
4643         (MethodData.DefineMethodBuilder): Issue an error even if only extern
4644         modifier is used.
4645         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4646         (FieldMember): Merged with FieldBase.
4647         (EventProperty.AEventPropertyAccessor): New specialization to check whether
4648         event extern modifier can be used.
4649         (EventField.EventFieldAccessor): Moved event field specific code here.
4650         (Event.AllowedModifiers): Even event can be extern.
4651         (Event.FindOutBaseMethod): New override specific to events.
4652         (Indexer.parameters): Reintroduce parameters because base class holds
4653         only properties common data.
4654         (Indexer.CheckForDuplications): Indexers are threated as methods so we
4655         need do extra parameters check.
4656
4657         * const.cs: Update after FieldMember rename.
4658
4659         * decl.cs (MemberCache.FindBaseEvent): New method.
4660
4661         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4662         to reflect that indexer is now derived from PropertyBased.
4663
4664         * ecore.cs (GetMemberType): Made public.
4665         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4666         obsolete event.
4667
4668         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
4669         
4670         * typemanager.cs (CSharpSignature): Correctly print event accessors.
4671         (RegisterEvent): Removed.
4672         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
4673         (GetPrivateFieldOfEvent): Renamed to GetEventField.
4674
4675 2007-01-11  Raja R Harinath  <rharinath@novell.com>
4676
4677         Fix #80249
4678         * statement.cs (CollectionForeach.TryType): Prefer generic
4679         GetEnumerator over non-generic variant.  Fix code to follow comments.
4680
4681 2007-01-09  Raja R Harinath  <rharinath@novell.com>
4682
4683         Fix #80446
4684         * support.cs (ReflectionParameter): Don't use an invalid index on
4685         the generic parameter data.
4686
4687 2007-01-08  Miguel de Icaza  <miguel@novell.com>
4688
4689         * driver.cs: Just add a tiny bit of infrastructure.
4690
4691 2007-01-02  Marek Safar  <marek.safar@gmail.com>
4692
4693         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
4694         where field type is struct from current assembly.
4695         
4696         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
4697         it is possible.
4698
4699 2007-01-02  Marek Safar  <marek.safar@gmail.com>
4700
4701         A fix for bug #80381
4702         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
4703         the core types.
4704
4705         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
4706         messages.
4707         (Namespace.LookupType): Always use core types from corlib when speficied.
4708
4709         * report.cs: A new warning.
4710
4711         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
4712         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
4713         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
4714
4715         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
4716         (InitCoreTypes): Set expression type of object_type and value_type
4717         immediately after lookup.
4718
4719 2007-01-01  Miguel de Icaza  <miguel@novell.com>
4720
4721         * cs-tokenizer.cs: Accept Pc class characters (Connector
4722         Punctuation) as valid identifiers.  Fixes #78259
4723
4724         * expression.cs (Invocation.DoResolve): Moved the check for the
4725         use of `this' for doing method calls to the Invocation resolution
4726         step, after overload resolution has taken place instead of doing
4727         the check at the low-level `This.DoResolve' level.
4728
4729         The `This.DoResolve'(appens before overload resolution, so it has
4730         no way of knowing if the method that will be called will be
4731         instace or static, triggering an erroneous report for cs0188 (Bug
4732         78113).
4733
4734         We now do the check for instance method invocations after we know
4735         what method will be called.
4736
4737         (This.CheckThisUsage): Move the actual use of this structure
4738         checking into its own method and expose it. 
4739
4740         * Everywhere that called Error_ValueCannotBeConverted: pass a new
4741         EmitContext.
4742
4743         Exceptions: Null.ConvertImplicitly,
4744         Constant.ImplicitConversionRequired as there are too many call
4745         sites for passing the ec. 
4746
4747         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
4748         EmitContext, if the value is null, then we do not try to provide
4749         the extra information from the error (If a userdefined conversion
4750         exists, as UserDefinedConversion requires a non null-EmitContext).
4751
4752         Fixes: #80347
4753
4754 2006-12-30  Raja R Harinath  <rharinath@novell.com>
4755
4756         * flowanalysis.cs (MyBitVector): Document some invariants.
4757         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
4758         introduced below, and add a couple of others, 
4759
4760 2006-12-30  Marek Safar  <marek.safar@gmail.com>
4761
4762         * attribute.cs (GetMethodObsoleteAttribute): Uses new
4763         GetPropertyFromAccessor and GetEventFromAccessor.
4764         
4765         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
4766         overrides non-obsolete one.
4767         (Indexer.Define): Error message has been moved to the parser.
4768
4769         * cs-parser.jay: Better syntax errors handling.
4770
4771         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
4772         when an invocation has no arguments.
4773
4774         * ecore.cs: Removed not used caching.
4775
4776         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
4777         implementation.
4778
4779         * report.cs: Add a new warning.
4780
4781         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
4782
4783         * typemanager.cs (enumeration_type): Removed.
4784         (CSharpSignature): Reuses IsSpecialMethod.
4785         (IsEqual): Hack for MS BCL.
4786         (GetPropertyFromAccessor): New method.
4787         (GetEventFromAccessor): New method.
4788         (IsSpecialMethod): Fixed to handle more cases.
4789
4790 2006-12-30  Marek Safar  <marek.safar@gmail.com>
4791
4792         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
4793         Made white spaces array static.
4794
4795         * ecore.cs (RemoveGenericArity): Optimized.
4796
4797         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
4798         10 times faster).
4799         (MyBitVector.initialize_vector): Simplified.
4800
4801 2006-12-22  Miguel de Icaza  <miguel@novell.com>
4802
4803         * ecore.cs: Am not entirely happy with this hack, but it seems to
4804         address the issue in 80257 (a small test case for
4805         CreativeDocs.NET). 
4806
4807         I set the MethodGroupExpr.Type to an internal compiler type
4808         (itself in this case) to force the resolution to take place.   Why
4809         it does not take place with a null is beyond me.
4810
4811 2006-12-20  Marek Safar  <marek.safar@gmail.com>
4812
4813         A fix for bug #80288
4814         * expression.cs (ResolveOperator): Consider user defined conversion for
4815         logical and operator too.
4816         (EmitBranchable): Optimization for logical and when full constant folding
4817         could not be applied but one operand is constant.
4818
4819 2006-12-19  Marek Safar  <marek.safar@gmail.com>
4820
4821         * class.cs (GetClassBases): Write 5 times every day, will never use
4822         FullName for error reporting.
4823
4824         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
4825
4826 2006-12-19  Martin Baulig  <martin@ximian.com>
4827
4828         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
4829         the symbol file info here.
4830
4831 2006-12-18  Marek Safar  <marek.safar@gmail.com>
4832
4833         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
4834         of `elseif' is taking then following sections are not taking.
4835         Fixes an issue reported on mono mailing list.
4836
4837 2006-12-18  Marek Safar  <marek.safar@gmail.com>
4838
4839         A fix for bug #80300
4840         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
4841         a caller is not taking.
4842
4843 2006-12-18  Raja R Harinath  <rharinath@novell.com>
4844
4845         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
4846         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
4847         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
4848         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
4849         * class.cs: Update to changes.
4850
4851 2006-12-17  Marek Safar  <marek.safar@gmail.com>
4852
4853         A fix for bug #79934
4854         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
4855         partial container.
4856
4857         * class.cs (ResolveMembers): Register an iterator in current container and
4858         not in shared one.
4859
4860 2006-12-16  Raja R Harinath  <rharinath@novell.com>
4861
4862         Fix test-543.cs
4863         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
4864         satisfy a params annotated parameter.
4865
4866 2006-12-16  Marek Safar  <marek.safar@gmail.com>
4867
4868         A fix for bug #77014
4869         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
4870         paramters correctly and not rely on hacks in Parameters class.
4871         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
4872         at any possition.
4873         (Invocation.VerifyArgumentsCompat): Ditto.
4874         (Invocation.EmitArguments): Changed to correctly emit params arguments at
4875         any possition.
4876
4877         * parameter.cs (HasParams): Don't assume that params is the last one.
4878
4879         * support.cs (ReflectionParameters.ctor): Look for params attribute
4880         correctly.
4881         (ReflectionParameters.ParameterType): Removed hack when we returned last
4882         parameter for out of range parameters.
4883         (ParameterName, ParameterModifier): Ditto.
4884
4885 2006-12-14  Marek Safar  <marek.safar@gmail.com>
4886
4887         A fix for bug #79987
4888         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
4889         when assembly is not CLS compliant but type is. I have no idea why is this
4890         allowed.
4891
4892         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
4893
4894 2006-12-13  Miguel de Icaza  <miguel@novell.com>
4895
4896         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
4897         in struct constructors, they are basically no-ops.
4898
4899 2006-12-12  Marek Safar  <marek.safar@gmail.com>
4900
4901         * cs-tokenizer.cs (Position): Save preprocessor status too.
4902
4903 2006-12-12  Marek Safar  <marek.safar@gmail.com>
4904
4905         A fix for bug #77794
4906         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
4907
4908 2006-12-12  Marek Safar  <marek.safar@gmail.com>
4909
4910         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
4911         Fixes #69299.
4912         (pp_expr): Report error for an invalid expression.
4913         (handle_preprocessing_directive): Simplified; add more error checking.
4914
4915 2006-12-11  Marek Safar  <marek.safar@gmail.com>
4916
4917         A fix for bug #74939
4918         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
4919         directives handling.
4920
4921 2006-12-10  Marek Safar  <marek.safar@gmail.com>
4922
4923         A fix for bugs #80093, and #75984
4924         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
4925         logic, it seems to me as it worked before "by coincidence".
4926         (xtoken): Simplified to use reworked handle_preprocessing_directive.
4927         (cleanup): Enabled endif check.
4928
4929 2006-12-09  Marek Safar  <marek.safar@gmail.com>
4930
4931         A fix for bug #80162
4932         * statement.cs (CollectionForeach.TryType): Generics and non-generics
4933         enumerators are never ambiguous.
4934
4935 2006-12-08  Raja R Harinath  <rharinath@novell.com>
4936
4937         Fix #80060
4938         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
4939
4940 2006-12-06  Marek Safar  <marek.safar@gmail.com>
4941
4942         A fix for bug #80144
4943         * class.cs (EventProperty.Define): Explicit implementation means
4944         that an even is used.
4945
4946 2006-12-06  Marek Safar  <marek.safar@gmail.com>
4947
4948         Fixes the operators implementation (part II)
4949
4950         * cfold.cs (DoConstantNumericPromotions): Renamed to
4951         DoBinaryNumericPromotions and simplified.
4952         (BinaryFold): Couple of conversion fixes; simplified.
4953
4954         * constant.cs, ecore.cs, literal.cs
4955         (ToType): Renamed to ConvertImplicitly.
4956         (Reduce): Renamed to ConvertExplicitly.
4957
4958         * class.cs, convert.cs: Updated.
4959
4960         * expression.cs: TryReduce doesn't throw an exception.
4961
4962 2006-12-01  Marek Safar  <marek.safar@gmail.com>
4963
4964         A fix for bug #80108
4965         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
4966         compatible.
4967
4968 2006-11-30  Marek Safar  <marek.safar@gmail.com>
4969
4970         Fixes unary operators implementation (part I)
4971         Also fixes #80026
4972
4973         * cfold.cs (Error_CompileTimeOverflow): Made internal
4974
4975         * const.cs (IConstant): Changed to use reference to constant and
4976         not constant itself.
4977         Updated IConstant implementations.
4978
4979         * constant.cs (CreateConstant): New factory method.
4980         Updated IConstant implementation.
4981
4982         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
4983
4984         * ecore.cs: Updated to use CreateConstantReference.
4985
4986         * enum.cs: Reflects IConstant changes.
4987
4988         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
4989
4990         * literal.cs (NullConstant): Change to be independently usable.
4991
4992 2006-11-29  Martin Baulig  <martin@ximian.com>
4993
4994         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
4995         we need to emit the scope initializer before calling the base .ctor.
4996
4997         * anonymous.cs: Merged back from the new anonymous methods branch.
4998         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
4999
5000         * expression.cs (ParameterReference.DoResolveBase): Create a
5001         "normal" ScopeInfo when capturing parameters rather than using the
5002         root scope; this makes things work with anonymous methods having
5003         parameters.
5004
5005         * statement.cs
5006         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5007
5008 2006-11-22  Marek Safar  <marek.safar@gmail.com>
5009
5010         A fix for bug #79987
5011         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5012         check to a base class.
5013         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5014         only when assembly has missing attribute.
5015         * report.cs: Update.
5016
5017 2006-11-21  Marek Safar  <marek.safar@gmail.com>
5018
5019         * cs-tokenizer.cs: Merged with gmcs version.
5020
5021 2006-11-20  Marek Safar  <marek.safar@gmail.com>
5022
5023         * cs-tokenizer.cs,
5024         * cs-parser.jay: Better error message when partial keyword is misplaced.
5025
5026 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
5027
5028         A fix for bug #79810
5029         report.cs: CS1058 only applies to 2.0 profile (gmcs).
5030         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5031         a RuntimeWrappedException by default.
5032
5033 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5034
5035         A fix for bug #79843
5036         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5037         implementation.
5038         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5039
5040 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5041
5042         * driver.cs, namespace.cs: Uses faster IndexOf version.
5043
5044 2006-11-17  Marek Safar  <marek.safar@gmail.com>
5045
5046         A fix for bug #79941
5047         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5048         operators.
5049         (Operator.Define): Implicit/Explicit operator of same type is duplicate
5050         even if internal name is different.
5051         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5052         (UserDefinedConversion): Simplified as the operators cannot be internal.
5053         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5054         conversions.
5055         (MethodLookup): Replaced EmitContext with parentType.
5056         * expression.cs: Updated.
5057
5058 2006-11-09  Raja R Harinath  <rharinath@novell.com>
5059
5060         * driver.cs (BadAssembly): Handle all the ugliness of
5061         DefineDynamicAssembly.
5062
5063 2006-11-08  Raja R Harinath  <rharinath@novell.com>
5064
5065         Address parts of #58244 -- most of what's left is in the runtime
5066         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
5067         CS1509 error checks, and handle them for all assembly loads, not
5068         just the first invocation.
5069         (LoadModule): Likewise.  Move handling of 'adder_method' ...
5070         * codegen.cs (AssemblyClass.AddModule): ... here.
5071
5072 2006-11-02  Marek Safar  <marek.safar@gmail.com>
5073
5074         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5075         IEnumerable<T> is ambiguous.
5076
5077 2006-10-31  Marek Safar  <marek.safar@gmail.com>
5078
5079         A fix for bug #67689
5080         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5081         GetEnumerator is ambiguous.
5082
5083         * report.cs: Add new warning.
5084
5085 2006-10-29  Marek Safar  <marek.safar@gmail.com>
5086
5087         A fix for bug #78602
5088         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5089         to protected member can be nested type.
5090
5091 2006-10-28  Marek Safar  <marek.safar@gmail.com>
5092
5093         A fix for bug #78965
5094         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5095         to protected member must derive from current type.
5096
5097 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5098
5099         assign.cs: Reuses error method.
5100
5101         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5102         instead of type for constants.
5103         (Expression.Error_ValueAssignment): Common error method.
5104
5105         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5106         for any assignment.
5107
5108 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5109
5110         A fix for bug #79081
5111         * expression.cs (MemberAccess.DoResolve): Check nested type
5112         accessibility.
5113
5114 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
5115
5116         * doc.cs : nested delegates were not handled. Fixed bug #79754.
5117
5118 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5119
5120         A fix for bug #76591
5121         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5122
5123 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5124
5125         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5126         type forwarder of the same type multiple times.
5127
5128 2006-10-26  Raja R Harinath  <rharinath@novell.com>
5129
5130         Fix #78820
5131         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5132         instance as an rvalue, even when we later resolve as an lvalue.
5133
5134 2006-10-25  Martin Baulig  <martin@ximian.com>
5135
5136         * anonymous.cs: Fix #79673.
5137
5138 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
5139
5140         A fix for bug #79666
5141         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5142         ignored when is optimized (= default value) as its value is already set.
5143
5144 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5145
5146         A fix for bug #79724
5147         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5148         TypeContainer for type lookup.
5149
5150 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5151
5152         A fix for bug #79231
5153         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5154         * expression.cs (OverloadResolve): Always convert type name for
5155         an error message.
5156         (ResolveNamespaceOrType): Don't confuse a nested type with any 
5157         other member.
5158
5159 2006-10-18  Martin Baulig <martin@ximian.com>
5160
5161         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5162
5163 2006-10-17  Miguel de Icaza  <miguel@novell.com>
5164
5165         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5166         an int32, but requesting an int64 from the conversion
5167
5168 2006-10-12  Martin Baulig  <martin@ximian.com>
5169
5170         * anonymous.cs
5171         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
5172         
5173 2006-10-12  Martin Baulig  <martin@ximian.com>
5174
5175         * statement.cs
5176         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5177
5178 2006-10-11  Miguel de Icaza  <miguel@novell.com>
5179
5180         * convert.cs: Remove broken code: I was doing the "Existance"
5181         tests for Implicit conversions.
5182
5183 2006-10-10  Miguel de Icaza  <miguel@novell.com>
5184
5185         * convert.cs: Added one missing case in
5186         ImplicitStandardConversionExists uint64 to intptr.
5187
5188         Fixes #59800
5189         
5190         * typemanager.cs (uintptr_type): another core known type.   
5191
5192         * ecore.cs (OperatorCast): routine used to do cast operations that
5193         depend on op_Explicit.  We could change some of the Decimal
5194         conversions to use this.
5195
5196         This one has a probe mechanism that checks both types for an op_
5197         which it coudl be used to eliminate two classes: CastToDecimal
5198         and CastFromDecimal.
5199
5200         * convert.cs: Implement the conversions documented in #59800
5201         
5202 2006-10-10  Martin Baulig  <martin@ximian.com>
5203
5204         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5205         before RootScope.ResolveMembers().
5206
5207         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5208         `CurrentType' if appropriate.
5209
5210 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
5211
5212         A fix for bug #78568
5213         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5214         when contains binary operators.
5215         * cs-parser.jay: Updated.
5216
5217 2006-10-09  Martin Baulig  <martin@ximian.com>
5218
5219         * delegate.cs
5220         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5221         moved that into Define() and also do the other type parameter
5222         checks there.  Fixes #79094.  Added gtest-292.cs.
5223
5224         * expression.cs
5225         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5226         since that doesn't include type parameters; don't use `Ldelema'
5227         for type parameters.  Fixes #78980.  Added gtest-293.cs.
5228
5229 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
5230
5231         A fix for #77796
5232         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5233         conversion is allowed.
5234
5235 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5236
5237         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5238         error reporting when no error occurs.
5239
5240 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5241
5242         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5243         does not exist.
5244
5245 2006-10-06  Raja R Harinath  <rharinath@novell.com>
5246
5247         Fix #79584
5248         * class.cs (DefineTypeBuilder): Check circular dependencies before
5249         setting the parent of the TypeBuilder.
5250         (CheckRecursiveDefinition): Don't use 'BaseType', since
5251         it may not be valid until after DefineTypeBuilder.  Use
5252         'base_type' instead.
5253
5254 2006-10-04  Martin Baulig  <martin@ximian.com>
5255
5256         Merged the Anonymous Methods patch.
5257
5258         * anonymous.cs, iterators.cs: The new anonymous methods code.
5259
5260         * statement.cs (Variable): New public abstract class.
5261         (LocalInfo.Variable): New public property.
5262         (LocalInfo.ResolveVariable): New public method.
5263         (Block.Flags): Add `IsIterator'.
5264         (Block.AddVariable): Improved the CS0136 check.
5265         (Block.AnonymousChildren): New public property.
5266         (Block.AddAnonymousChild): New public method.
5267         (ToplevelBlock): Update to use the new anonymous method framework.
5268         (ToplevelBlock.ctor): `container' is now a `Block' and not a
5269         `ToplevelBlock'; this is required to correctly implement the
5270         CS0136 check.
5271         (Fixed, Using): Use `TemporaryVariable' instead of directly
5272         creating the `LocalBuilder'.
5273
5274         * parameter.cs (Parameter.ResolveVariable): New public method.
5275         (Parameters.ResolveVariable): Likewise.
5276
5277         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5278
5279         * class.cs (TypeContainer): Replaced the `iterators' list and
5280         corresponding methods with a list of `CompilerGeneratedClass'es.
5281         (TypeContainer.ResolveMembers): New public method.
5282         (Method): `IIteratorContainer' has been replaced by
5283         `IAnonymousHost'.
5284
5285         * expression.cs (VariableReference): New public abstract base
5286         class for `LocalVariableReference', `ParameterReference' and
5287         `This'.
5288
5289         * codegen.cs (EmitContext): Removed `capture_context',
5290         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5291         (EmitContext.EmitThis): Removed.
5292
5293         * cs-parser.jay: Replace `iterator_container' with
5294         `anonymous_host'.       
5295
5296 2006-10-04  Martin Baulig  <martin@ximian.com>
5297
5298         * generic.cs (GenericMethod): Don't make this abstract.
5299         (Constraints.Clone): Added dummy implementation.
5300
5301 2006-10-04  Raja R Harinath  <harinath@gmail.com>
5302
5303         Fix #79577
5304         * namespace.cs (LookForAnyGenericType): Avoid nullref on
5305         'declspaces'.  Avoid allocating arrays willy-nilly.
5306
5307         Fix #79553
5308         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5309         cases out of the switch.
5310
5311 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5312
5313         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5314         message when non-generic type is used with the type arguments.
5315         * expression.cs: Updated.
5316
5317 2006-09-28  Raja R Harinath  <rharinath@novell.com>
5318
5319         Fix #79013
5320         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5321         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5322         Change semantics slightly.  Don't insist on having only one
5323         temporary EmptyExpression -- just throttle the creation of new ones.
5324
5325         Fix #79451
5326         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5327         non-interfaces too.  If no methods are found, don't try to create
5328         a MethodGroupExpr.
5329
5330 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5331
5332         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5333         generic type.
5334
5335         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5336         us produce better error message.
5337
5338 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
5339
5340         * expression.cs (Binary.ResolveOperator): Warn about a side effect
5341         of the `|' operator.
5342
5343         * report.cs: A new warning added.
5344
5345 2006-09-27  Martin Baulig  <martin@ximian.com>
5346
5347         * generic.cs (GenericMethod): Don't make this abstract.
5348
5349 2006-09-27  Martin Baulig  <martin@ximian.com>
5350
5351         * report.cs
5352         (InternalErrorException): Added overloaded ctor taking a params array.
5353
5354 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
5355
5356         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5357         Fixed the cases when same error was reported twice.
5358
5359         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5360         now report symbol information.
5361
5362 2006-09-25  Martin Baulig  <martin@ximian.com>
5363
5364         * class.cs: Completely unified with the gmcs version.
5365
5366 2006-09-25  Martin Baulig  <martin@ximian.com>
5367
5368         * typemanager.cs (TypeManager.IsNullableType): New public function.
5369         (TypeManager.IsNullableTypeOf): Likewise.
5370         (TypeManager.IsNullableValueType): Likewise.
5371
5372         * class.cs (MethodCore): Added the `GenericMethod' argument from
5373         gmcs and also unified all classes derived from `MethodCore' with gmcs.
5374
5375 2006-09-24  Raja R Harinath  <harinath@gmail.com>
5376
5377         * convert.cs: Unify with gmcs version.
5378
5379 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5380
5381         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5382         verify them as well.
5383
5384         * report.cs: New warning.
5385
5386 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5387
5388         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5389         for anonymous block with out argument.
5390
5391 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5392
5393         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5394         not used private events only.
5395
5396 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
5397
5398         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5399
5400         * const.cs (Const.Define): Check for constant type.
5401         (Const.IsConstantTypeValid): Looks for valid constant types.
5402
5403         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5404
5405         * ecore.cs (EmptyConstantCast): New common class for all constant based
5406         EmptyCast(s).
5407
5408         * expression.cs (Is.DoResolve): Handle null constant especially.
5409         (New.DoResolve): Check for new void().
5410         (MemberAccess.DoResolve): Cope with all kind of nulls.
5411
5412         * literal.cs (NullConstant): Uses EmptyConstantCast.
5413         (NullDefault): Based on EmptyConstantCast.
5414         (NullLiteral): Uses EmptyConstantCast.
5415
5416         * statement.cs (Block.ResolveMeta): Check for constant type.
5417
5418 2006-09-22  Martin Baulig  <martin@ximian.com>
5419
5420         * delegate.cs, attribute.cs: Merged with the gmcs versions.
5421
5422 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5423
5424         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5425         not the null type.
5426
5427         Fix part of #79451
5428         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5429         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
5430         code slightly.
5431
5432 2006-09-22  Martin Baulig  <martin@ximian.com>
5433
5434         * ecore.cs: Merged with the gmcs version.
5435
5436         * generic.cs (ConstructedType): New dummy class.
5437         (TypeArguments): Don't make this abstract.
5438
5439         * typemanager.cs
5440         (TypeManager.IsGenericTypeDefinition): New method.
5441         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5442
5443 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5444
5445         * expression.cs (ComposedCast): Check for arrays of TypedReference
5446         before creating the type, not after.
5447
5448 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
5449
5450         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5451         after ToType change.
5452
5453         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5454         when constant must be implicitly convertible.
5455
5456         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5457
5458         * ecore.cs (NullCast): Derives from NullConstant.
5459
5460         * expression.cs (Is.DoResolve): Removed useless variables.
5461         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5462         (New.Constantify): Add enum support.
5463         (MemberAccess.DoResolve): Add warning when accessing null constant or
5464         variable.
5465
5466         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5467         property.
5468
5469         * literal.cs (NullConstant): New abstract class with common
5470         functionality for all null specializations.
5471         (NullDefault): Represents default(X) when result can be
5472         reduced to null.
5473         (NullLiteral): Updated.
5474
5475         * report.cs: Add new warning.
5476
5477 2006-09-21  Martin Baulig  <martin@ximian.com>
5478
5479         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5480
5481 2006-09-21  Martin Baulig  <martin@ximian.com>
5482
5483         * generic.cs (GenericConstraints): New dummy class.
5484         (Constraints): Likewise.
5485         (TypeParameter): Likewise.
5486         (TypeParameterName): Likewise.
5487         (GenericMethod): Likewise.
5488
5489         * typemanager.cs (TypeManager.GetGenericArguments): New method.
5490
5491         * decl.cs: Merged with the gmcs version.
5492
5493 2006-09-21  Raja R Harinath  <rharinath@novell.com>
5494
5495         * generic.cs (TypeParameter): Implement IMemberContainer.
5496         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
5497
5498         * rootcontext.cs: Unify with gmcs version.
5499
5500         * report.cs: Unify with gmcs version.
5501         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5502         from gmcs/generics.cs.
5503         * generics.cs (TypeParameter): New dummy class.
5504
5505         * support.cs: Unify with gmcs version.
5506
5507 2006-09-20  Raja R Harinath  <rharinath@novell.com>
5508
5509         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5510         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5511
5512         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5513         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5514         * mcs.exe.sources: Add generic.cs.
5515
5516         * codegen.cs: Unify with gmcs version.
5517
5518         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5519         (EmitContext): Add GenericDeclContainer implementation.
5520         * decl.cs (MemberCore, DeclSpace): Likewise.
5521         * namespace.cs: Remove #ifdef GMCS_SOURCE.
5522
5523         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5524         MCS TypeManager has a corresponding dummy method.
5525
5526 2006-09-19  Martin Baulig  <martin@ximian.com>
5527
5528         * expression.cs: Completely merged with the gmcs version.
5529
5530 2006-09-19  Martin Baulig  <martin@ximian.com>
5531
5532         * expression.cs (Invocation): Merged with the gmcs version.
5533         (ArrayAccess.GetStoreOpcode): Likewise.
5534
5535 2006-09-19  Martin Baulig  <martin@ximian.com>
5536
5537         * typemanager.cs
5538         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5539         (TypeManager.IsGenericMethodDefinition): Likewise.
5540
5541 2006-09-19  Martin Baulig  <martin@ximian.com>
5542
5543         * typemanager.cs
5544         (TypeManager.IsEqual): Moved the gmcs implementation here.
5545         (TypeManager.DropGenericTypeArguments): Likewise.
5546         (TypeManager.DropGenericMethodArguments): Likewise.
5547         (TypeManager.GetTypeArguments): Moved here from gmcs.
5548         (TypeManager.HasGenericArguments): Likewise.
5549
5550 2006-09-19  Martin Baulig  <martin@ximian.com>
5551
5552         * expression.cs (Binary): Merged with the gmcs version.
5553
5554 2006-09-19  Martin Baulig  <martin@ximian.com>
5555
5556         * expression.cs (Probe, As, Is): Merged with the gmcs version.
5557
5558 2006-09-19  Martin Baulig  <martin@ximian.com>
5559
5560         * typemanager.cs: Merged with the gmcs version.
5561
5562 2006-09-16  Raja R Harinath  <rharinath@novell.com>
5563
5564         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5565         * driver.cs: Likewise.
5566
5567 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
5568
5569         A fix for #79401
5570         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5571         only if parent type is class.
5572         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5573         update.
5574
5575 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
5576
5577         * cs-parser.jay,
5578         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5579         keywords are used.
5580         * typemanager.cs(CSharpName): Converts NullType to null.
5581
5582 2006-09-15  Martin Baulig  <martin@ximian.com>
5583
5584         * typemanager.cs
5585         (TypeManager.GetMethodName): Added mcs implementation.
5586         (TypeManager.IsEqual): Likewise.
5587
5588         * ecore.cs
5589         (SimpleName.RemoveGenericArity): Added dummy implementation.
5590
5591         * pending.cs: Merged with the gmcs version.     
5592
5593 2006-09-15  Martin Baulig  <martin@ximian.com>
5594
5595         * statement.cs: Merge with the gmcs version.
5596
5597 2006-09-15  Martin Baulig  <martin@ximian.com>
5598
5599         * statement.cs (Switch): Merge with the gmcs implementation
5600         (without nullables), which is newer.
5601
5602 2006-09-15  Martin Baulig  <martin@ximian.com>
5603
5604         * statement.cs (Block.Variables): Make this public.
5605         (ToplevelBlock.Parameters): Make this a property.
5606         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5607
5608 2006-09-15  Martin Baulig  <martin@ximian.com>
5609
5610         * namespace.cs: Merge with the gmcs version.
5611
5612 2006-09-15  Martin Baulig  <martin@ximian.com>
5613
5614         * decl.cs (MemberName): Minor code cleanups.
5615
5616 2006-09-15  Martin Baulig  <martin@ximian.com>
5617
5618         * parameter.cs: Merge with the gmcs version.
5619
5620 2006-09-15  Martin Baulig  <martin@ximian.com>
5621
5622         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5623         and an error in mcs.
5624
5625 2006-09-15  Martin Baulig  <martin@ximian.com>
5626
5627         * flowanalysis.cs: Merged from GMCS; added the generics code into
5628         a `GMCS_SOURCE' conditional so we can share this file.
5629
5630 2006-09-08  Martin Baulig  <martin@ximian.com>
5631
5632         * typemanager.cs (TypeManager.interlocked_type): New public field.
5633         (TypeManager.int_interlocked_compare-exchange): New public field.
5634         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5635         enumerator types here and call InitGenericCoreTypes().
5636         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5637         after calling InitEnumUnderlyingTypes().
5638
5639         * rootcontext.cs
5640         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5641         `classes_second_stage'. 
5642
5643 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
5644
5645         * assign.cs, ecore.cs, expression.cs: Share error message text.
5646         * class.cs (FieldMember.Define): Check for varible of static type.
5647         * driver.cs (LoadAssembly): Uses error output for errors.
5648         * statement.cs: Updated.
5649
5650 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
5651
5652         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5653         type instance.
5654
5655 2006-09-07  Martin Baulig  <martin@ximian.com>
5656
5657         * driver.cs
5658         (MainDriver): Revert r62663 from Marek; see #70506 for details.
5659
5660 2006-08-29  Miguel de Icaza  <miguel@novell.com>
5661
5662         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5663         
5664 2006-08-17  Miguel de Icaza  <miguel@novell.com>
5665
5666         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5667         #52019 and #79064, the use of the \uXXXX sequence in source code
5668         to represent unicode characters.
5669
5670 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
5671
5672         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
5673         support.
5674         * class.cs, ecore.cs, statement.cs: Merged to one error message.
5675
5676 2006-08-13  Miguel de Icaza  <miguel@novell.com>
5677
5678         * assign.cs: Catch attempts to assign to a method groups in += and
5679         report as 1656
5680
5681 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
5682
5683         A fix for #79056
5684         * cs-parser.jay: Don't destroy current array type by typeof of array's.
5685
5686 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
5687
5688         * class.cs (Method.Define): Issue a warning when generic method looks like
5689         an entry point.
5690         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
5691         as well.
5692
5693 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
5694  
5695         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
5696         looking for ctor.
5697         * decl.cs (MemberCache.FindMembers): When container is interface we need to
5698         search all base interfaces as a member can be ambiguous.
5699         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
5700         Constructor member type filter. 
5701         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
5702         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
5703         reporting for returned memberinfos.
5704         * report.cs: Updated.
5705         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
5706         version to work on all runtimes.
5707         (TypeManager.RealMemberLookup): Removed members filtering.
5708
5709 2006-08-08  Raja R Harinath  <rharinath@novell.com>
5710
5711         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
5712         (PropertyExpr.EmitAssign): Likewise.
5713         * expression.cs (Indirection.EmitAssign): Likewise.
5714         (LocalVariableReference.EmitAssign): Likewise.
5715         (ParameterReference.EmitAssign): Likewise.
5716         (Invocation.EmitArguments): Likewise.
5717         (ArrayAccess.EmitAssign): Likewise.
5718         (IndexerAccess.EmitAssign): Likewise.
5719         (This.EmitAssign): Likewise.
5720         (ConditionalLogicalOperator.Emit): Likewise.
5721
5722         Fix #79026
5723         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
5724         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
5725         leave it in after returning it.
5726         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
5727
5728 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
5729
5730         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
5731         message.
5732
5733 2006-08-03  Raja R Harinath  <rharinath@novell.com>
5734
5735         Fix cs0146-3.cs and cs0146-4.cs.
5736         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
5737         enclosing types don't depend on the current type.
5738
5739 2006-08-02  Raja R Harinath  <rharinath@novell.com>
5740
5741         Fix #77963
5742         * class.cs (TypeContainer.DoDefineMembers): Use
5743         FindBaseMemberWithSameName on Parent, since we're interested in
5744         whether we hide inherited members or not.
5745         (FindBaseMemberWithSameName): Make slightly more robust.
5746
5747         Fix the non-generic testcase from #77396
5748         * decl.cs (DeclSpace.DeclContainer): Remove override.
5749
5750         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
5751         declspaces for doppelgangers too.
5752         (UsingEntry): Implement IResolveContext.
5753         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
5754         'this' as the resolve context.
5755         (LocalAliasEntry): Likewise.
5756
5757         Implement parts of #77403
5758         * roottypes.cs (RootDeclSpace): New.  Used to represent the
5759         toplevel declaration space.  Each namespace declaration introduces
5760         a "partial" root declaretion space.
5761         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
5762         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
5763         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
5764         from 'current_namespace.SlaveDeclSpace'.
5765         (namespace_declaration): Likewise.
5766         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
5767         check.  It can't happen now.
5768         * decl.cs (DeclSpace.LookupType): Likewise.
5769         * driver.cs (MainDriver): Sanity check.
5770
5771 2006-08-01  Raja R Harinath  <rharinath@novell.com>
5772
5773         * decl.cs (DeclSpace.FindNestedType): Remove.
5774         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
5775         LookupTypeContainer to get the container of the nested type.
5776         * class.cs (TypeContainer.FindNestedType): Make non-override.
5777
5778 2006-07-31  Raja R Harinath  <rharinath@novell.com>
5779
5780         * decl.cs (DeclSpace.PartialContainer): Move field from ...
5781         * class.cs (TypeContainer.PartialContainer): ... here.
5782         (TypeContainer.AddBasesForPart): New helper.
5783         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
5784         instead.
5785         * cs-parser.jay (current_class): Convert to DeclSpace.
5786         (struct_declaration, interface_declaration, class_declaration):
5787         Use AddBasesForPart instead of .Bases directly.
5788         * const.cs, iterators.cs: Update to changes.
5789
5790 2006-07-28  Raja R Harinath  <rharinath@novell.com>
5791
5792         * class.cs (TypeContainer.AddMemberType): Rename from
5793         AddToTypeContainer.
5794         (TypeContainer.AddMember): Rename from AddToMemberContainer.
5795         (AddTypeContainer): New.  Combine AddClassOrStruct and
5796         AddInterface.
5797         (AddPartial): Update.  Add 'is_partial' argument.
5798         * roottypes.cs: Update to changes.
5799         * cs-parser.jay (push_current_class): New helper for handling
5800         current_container and current_class.
5801         (struct_declaration, interface_declaration, class_declaration):
5802         Use it.
5803
5804 2006-07-26  Raja R Harinath  <rharinath@novell.com>
5805
5806         * roottypes.cs: Rename from tree.cs.
5807
5808         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
5809         * tree.cs (Tree, ITreeDump): Remove types.
5810         * rootcontext.cs (tree, Tree): Remove fields.
5811         (root, ToplevelTypes): New.
5812         * *.cs: Update to rename.
5813
5814         * tree.cs (Tree.RecordDecl): Remove.
5815         (RootTypes.AddToTypeContainer): Record the toplevel type in its
5816         namespace here.
5817         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
5818
5819 2006-07-23  Raja R Harinath  <harinath@gmail.com>
5820
5821         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
5822         DoFlowAnalysis and OmitStructFlowAnalysis here.
5823         (ec.With): Rename from WithUnsafe and generalize.
5824         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
5825         (ec.WithFlowAnalyis): New.
5826         * ecore.cs, expression.cs, statement.cs: Update.
5827
5828 2006-07-22  Raja R Harinath  <harinath@gmail.com>
5829
5830         * statement.cs (Block.ResolveMeta): Simplify slightly.
5831
5832         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
5833         multiple boolean fields.  Convert InUnsafe, constant_check_state,
5834         check_state to flags.
5835         (CheckState, ConstantCheckState): Update.
5836         (InUnsafe): New read-only property.
5837         (FlagsHandle): Rename from CheckStateHandle and convert to handle
5838         arbitrary flags.
5839         (WithUnsafe): New helper similar to WithCheckState.
5840         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
5841         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
5842
5843 2006-07-21  Raja R Harinath  <rharinath@novell.com>
5844
5845         Make comparisons use the same IL irrespective of whether they're
5846         in a 'checked' or 'unchecked' context: one of the issues in #78899
5847         * codegen.cs (EmitContext.CheckState): Make read-only property.
5848         (EmitContext.ConstantCheckState): Likewise.
5849         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
5850         helper that implement a save/restore stack for CheckState
5851         values.  This is the only way to change check-state.
5852         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
5853         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
5854         (CheckedExpr.EmitBranchable): New forwarding method.
5855         (UnCheckedExpr): Likewise.
5856         * statement.cs (Block.ResolveMeta): Use WithCheckState.
5857         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
5858         (Checked.Resolve, checked.DoEmit): Likewise.
5859
5860 2006-07-20  Miguel de Icaza  <miguel@novell.com>
5861
5862         * anonymous.cs: Cache the resolved anonymous delegate, and return
5863         this so that the ResolveTopBlock is only triggered once, not
5864         twice.
5865
5866         Currently we trigger ResolvetopBlock twice due to a first pass of
5867         argument check compatibility, and a second pass that does the
5868         actual resolution.   
5869         
5870 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
5871
5872         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
5873         modifiers.
5874         * rootcontext.cs (Reset): Add helper_classes.
5875
5876 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
5877
5878         A fix for #78860
5879         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
5880         correctly.
5881
5882 2006-07-13  Miguel de Icaza  <miguel@novell.com>
5883
5884         * statement.cs (Lock): Handle expressions of type
5885         TypeManager.null_type specially.  Fixes #78770
5886
5887 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
5888
5889         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
5890         to an event.
5891
5892 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
5893
5894         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
5895         for accessors as well.
5896         * ecore.cs (EventExpr): Add AccessorTable.
5897
5898 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
5899
5900         A fix for #78738
5901         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
5902         for CS0122 where appropriate.
5903         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
5904         level attributes.
5905         (Filter): Assembly can be null in the case of top level attributes.
5906
5907 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
5908
5909         A fix for #78690
5910
5911         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
5912         is done at global level.
5913
5914 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
5915
5916         A fix for #77002, Implemented TypeForwarder support.
5917
5918         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
5919         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
5920         * typemanager.cs (): Add type_forwarder_attr_type.
5921
5922 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
5923
5924         * report.cs: Add CS0469 warning.
5925
5926 2006-06-21  Martin Baulig  <martin@ximian.com>
5927
5928         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
5929         the `try'-block, so we also report CS0016 etc. there.
5930
5931 2006-06-21  Martin Baulig  <martin@ximian.com>
5932
5933         * delegate.cs
5934         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
5935
5936 2006-06-21  Martin Baulig  <martin@ximian.com>
5937
5938         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
5939         also report CS1686 for parameters.
5940
5941 2006-06-21  Martin Baulig  <martin@ximian.com>
5942
5943         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
5944         instead of an error if the value is not implicitly convertible to
5945         the switch types; fixes #77964.
5946
5947 2006-06-21  Raja R Harinath  <rharinath@novell.com>
5948
5949         Fix #78673
5950         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
5951         FieldBuilder is null.
5952
5953         Fix #78662
5954         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
5955         'left' and 'right' before error-checking.
5956
5957 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
5958
5959         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
5960         Fixed bug #78601.
5961         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
5962         (FieldExpr.DoResolve): likewise.
5963         (PropertyExpr.InstanceResolve): likewise.
5964         (EventExpr.InstanceResolve): likewise. 
5965
5966 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
5967
5968         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
5969         attribute applicable tests for attribute argument.
5970
5971 2006-06-02  Raja R Harinath  <rharinath@novell.com>
5972
5973         Fix #78079
5974         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
5975         (Binary.OverloadResolve_PredefinedIntegral): New.
5976         (Binary.OverloadResolve_PredefinedFloating): New.
5977         (Binary.OverloadResolve_PredefinedString): New.
5978         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
5979         Follow the standard more closely, and treat numeric promotions in
5980         terms of overload resolution.
5981         (Binary.CheckShiftArguments): Simplify.
5982
5983 2006-06-01  Raja R Harinath  <rharinath@novell.com>
5984
5985         * flowanalysis.cs (MyBitVector): Simplify representation.
5986         (MyBitVector.Clone): Avoid allocating BitArray.
5987         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
5988         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
5989         (*): Update.  Change all references to MyBitVector.And and
5990         MyBitVector.Or to &= and |=.
5991
5992 2006-05-29  Raja R Harinath  <rharinath@novell.com>
5993
5994         Fix cs0231-[34].cs.
5995         * cs-parser.jay (formal_parameter_list): Extend the pattern below
5996         to param arguments too.
5997
5998 2006-05-26  Miguel de Icaza  <miguel@novell.com>
5999
6000         * cs-parser.jay: Catch another parsing form for arglist being
6001         followed by other arguments.  Fixes #78313.
6002
6003 2006-05-24  Raja R Harinath  <rharinath@novell.com>
6004
6005         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6006         checking of out parameters to ...
6007         (FlowBranchingToplevel.Merge): ... here.
6008         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6009         set, propagate the origin upward, and only complain if there was
6010         no other error.
6011         (FlowBranchingException.AddContinueOrigin): Likewise.
6012         (FlowBranchingException.AddReturnOrigin): Likewise.
6013         (FlowBranchingException.AddGotoOrigin): Likewise.       
6014
6015 2006-05-23  Raja R Harinath  <rharinath@novell.com>
6016
6017         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6018         unreachable, skip it.
6019         (FlowBranchingException.Merge): Always propagate jumps, even if
6020         the finally block renders subsequent code unreachable.
6021
6022 2006-05-18  Raja R Harinath  <rharinath@novell.com>
6023
6024         Fix #77601
6025         * statement.cs (Goto.Resolve): Move responsibility for resolving
6026         'goto' to FlowBranching.AddGotoOrigin.
6027         (Goto.SetResolvedTarget): New.  Callback to set the
6028         LabeledStatement that's the target of the goto.
6029         (Goto.DoEmit): Use Leave instead of Br when crossing an
6030         unwind-protect boundary.
6031         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6032         LookupLabel and adjust to new semantics.
6033         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6034         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6035         Goto.SetResolvedTarget to update target.
6036         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6037         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6038         AddBreakOrigin & co.  Delay propagation until ...
6039         (FlowBranchingException.Merge): ... this.
6040
6041         * statement.cs (Block.Resolve): Always depend on flow-branching to
6042         determine unreachability.  Kill workaround that originally emitted
6043         only one statement after an "unreachable" label (see infloop in
6044         test-515.cs).
6045
6046         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6047         This is still "wrong", but anything better would probably need a
6048         multi-pass algorithm.
6049         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6050         usage vector.  Force current usage vector to be reachable, to
6051         optimistically signify backward jumps.
6052         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6053         detected.
6054         (FlowBranchingLabeled.Merge): New.  If no backward jump was
6055         detected, return the original salted-away usage vector instead,
6056         updated with appropriate changes.  Print unreachable warning if
6057         necessary.
6058         * statement.cs (Block.Resolve): Don't print unreachable warning on
6059         a labeled statement.
6060
6061 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
6062
6063         * driver.cs: Pass filename without path to AssemblyBuilder's 
6064         AddResourceFile. Fixes bug #78407.
6065
6066 2006-05-17  Raja R Harinath  <rharinath@novell.com>
6067
6068         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6069         * flowanalysis.cs (FlowBranchingLabeled): ... here.
6070         (FlowBranching.MergeChild): Overwrite
6071         reachability information from Labeled branchings too.
6072
6073 2006-05-16  Raja R Harinath  <rharinath@novell.com>
6074
6075         * statement.cs (Goto.Resolve): Merge jump origins here ...
6076         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6077
6078         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6079         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
6080         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
6081         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6082         here, ...
6083         * statement.cs (Goto.Resolve): ... not here.
6084         (Goto.Emit): Remove CS1632 check.
6085
6086 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
6087
6088         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6089         error message.
6090
6091 2006-05-11  Raja R Harinath  <rharinath@novell.com>
6092
6093         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6094         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6095         (FlowBranchingException.Label): Likewise.
6096
6097         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
6098         given value.
6099         (MyBitVector.Or): Use it to avoid losing information (Count).
6100         (FlowBranching.MergeOrigins): Likewise.
6101
6102         * flowanalysis.cs (UsageVector.IsDirty): Remove.
6103         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6104         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6105         (UsageVector.ToString): Simplify.
6106         (UsageVector.MergeSiblings): Move here from ...
6107         (FlowBranching.Merge): ... here.
6108         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6109         not a MyBitVector.
6110
6111 2006-05-10  Raja R Harinath  <rharinath@novell.com>
6112
6113         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6114         null bitvector is treated as all-true.
6115
6116         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6117         (MyBitVector): Rationalize invariants.  'vector != null' implies
6118         that we have our own copy of the bitvector.  Otherwise,
6119         'InheritsFrom == null' implies all inherited bits are true.
6120
6121 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
6122
6123         * statement.cs (LocalInfo): Add IsConstant.
6124         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6125         local variable for constants.
6126
6127 2006-05-09  Raja R Harinath  <rharinath@novell.com>
6128
6129         * flowanalysis.cs (MyBitVector.Empty): New.
6130         (MyBitVector): Don't allow InheritedFrom to be null.
6131         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6132         (UsageVector, FlowBranching): Update to changes.
6133
6134         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6135         recursion.  The 'Parent == null' condition isn't sufficient for
6136         anonymous methods.
6137         (FlowBranching.AddBreakOrigin): Likewise.
6138         (FlowBranching.AddContinueOrigin): Likewise.
6139         (FlowBranching.AddReturnOrigin): Likewise.
6140         (FlowBranching.StealFinallyClauses): Likewise.
6141         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6142         (FlowBranching.CheckOutParameters): Likewise.
6143         (FlowBranchingToplevel): Terminate all the above recursions here.
6144         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6145         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6146
6147         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
6148         toplevel block.
6149         (FlowBranchingToplevel): New.  Empty for now.
6150         (FlowBranching.MergeTopBlock): Update.
6151         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6152         branching for the anonymous delegate.
6153         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6154
6155         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6156         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6157         information at the start of the merge.  Reorganize.
6158
6159 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6160
6161         * class.cs (MethodData.Define): Method cannot implement interface accessor.
6162
6163 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6164
6165         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6166         to newly introduced ctor.
6167
6168         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6169         message to one place.
6170         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6171         global namespace.
6172
6173 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6174
6175         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6176
6177         * ecore.cs (Expression.ResolveAsConstant): Updated.
6178
6179         * statement.cs (ResolveMeta): Updated.
6180
6181 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6182
6183         * cs-parser.jay: __arglist cannot be used in initializer.
6184
6185 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6186
6187         A fix for #77879
6188         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6189         private types.
6190
6191 2006-05-05  Raja R Harinath  <rharinath@novell.com>
6192
6193         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6194         (LabeledStatement): Add 'name' parameter.
6195         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6196         (Block.AddLabel): Update to changes.
6197         * cs-parser.jay (labeled_statement): Likewise.
6198
6199         * flowanalysis.cs (BranchingType.Labeled): New.
6200         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6201         (FlowBranchingLabeled): New.  Does nothing for now, but will
6202         eventually handle 'goto' flows.
6203         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6204         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6205         that's terminated ...
6206         (Block.Resolve): ... here.
6207
6208         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6209         (UsageVector.MergeFinallyOrigins): Likewise.
6210         (FlowBranching.InTryOrCatch): Likewise.
6211         (FlowBranching.AddFinallyVector): Likewise.
6212         (FlowBranchingException): Update to changes.
6213
6214         Fix #78290
6215         * statement.cs (Return.Resolve): Move error checking to ...
6216         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6217         (FlowBranchingException): Handle return origins like break and
6218         continue origins.
6219         (FlowBranching.UsageVector.CheckOutParameters): Remove.
6220
6221 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6222
6223         A fix for #76122
6224         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6225         filter.
6226
6227 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6228
6229         A fix for #77543
6230         * class.cs (MethodData.Define): Do public accessor check only when method
6231         implements an interface.
6232
6233 2006-05-04  Raja R Harinath  <rharinath@novell.com>
6234
6235         Remove special handling of 'break'
6236         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6237         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
6238         (UsageVector.Break): Remove.
6239         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6240         reachability.
6241         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6242
6243         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6244         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
6245
6246 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6247
6248         A fix for #75726
6249         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6250         be the interface member.
6251
6252 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6253
6254         A fix for #60069
6255         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6256         for emitting small (int) values.
6257
6258 2006-05-03  Raja R Harinath  <rharinath@novell.com>
6259
6260         Fix #59427
6261         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6262         control-flow passes through the 'finally' after merging-in all the
6263         control-flows from 'try' and the 'catch' clauses.
6264
6265         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6266         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
6267         always true at the only non-recursive entry point.
6268         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6269         FlowBranchingBreakable.
6270         (FlowBranchingLoop): Remove.
6271         * statement.cs (Return.DoResolve): Update to changes.
6272
6273         Fix #76471, #76665
6274         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6275         (FlowBranching.CreateBranching): Handle it: create a
6276         FlowBranchingContinuable.
6277         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6278         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6279         except that it handles the 'continue' command.
6280         (FlowBranching.UsageVector.MergeOrigins): Rename from
6281         MergeBreakOrigins.
6282         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6283         except that it overrides AddContinueOrigin.
6284         (FlowBranchingException): Override AddContinueOrigin, similar to
6285         AddBreakOrigin.
6286         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6287         Create a new branching around the embedded statement.
6288         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
6289         control flow after the embedded statement.
6290         (Continue.Resolve): Move all error checking to AddContinueOrigin.
6291
6292         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6293         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6294         FlowBranchingBreakable.
6295         (FlowBranchingSwitch): Remove.
6296
6297         Fix test-503.cs
6298         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
6299         error reporting to ...
6300         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6301         Rename from 'AddBreakVector'.  Add new location argument.  Return
6302         a bool indicating whether the 'break' crosses an unwind-protect.
6303         (FlowBranchingException.AddBreakOrigin): Add.
6304         (FlowBranchingException.Merge): Propagate 'break's to surrounding
6305         flowbranching after updating with the effects of the 'finally'
6306         clause.
6307         (FlowBranchingBreakable): New common base class for
6308         FlowBranchingLoop and FlowBranchingSwitch.
6309
6310         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6311         embedded statement.
6312         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6313
6314 2006-05-02  Raja R Harinath  <rharinath@novell.com>
6315
6316         * statement.cs (Do.Resolve): If the loop is infinite, set the
6317         barrier.
6318         (While.Resolve, For.Resolve): Set a barrier after the embedded
6319         statement.  There's no direct control flow that goes from the end
6320         of the embedded statement to the end of the loop.
6321         * flowanalysis.cs (FlowBranching.Infinite): Remove.
6322         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
6323         above ensure that the reachability is correctly computed.
6324
6325         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6326         (UsageVector.MergeBreakOrigins): If the current path is
6327         unreachable, treat it as if all parameters/locals are initialized.
6328         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
6329         infinite loops before merging-in break origins.
6330
6331         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6332         (Reachability.Reachable): Split part into ...
6333         (Reachability.Unreachable): ... this.  Simplify.
6334         (Reachability.IsUnreachable): Use 'Unreachable' instead.
6335
6336         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6337         (Reachability.SetThrowsSometimes): Likewise.
6338         (FlowBranchingBlock.MergeTopBlock): Don't compare against
6339         TriState.Always, use corresponding property.
6340         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6341         (Block.Resolve): Likewise.  Remove some redundant checks.
6342
6343 2006-05-02  Raja R Harinath  <harinath@gmail.com>
6344
6345         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6346         (Reachability.Meet): Don't bother checking AlwaysThrows --
6347         barrier is always set.
6348         (FlowBranchingBlock.Merge): Likewise.
6349
6350 2006-05-01  Raja R Harinath  <harinath@gmail.com>
6351
6352         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6353         checks for unreachable.
6354
6355 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
6356
6357         A fix for #77980
6358         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6359
6360         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6361         whether field is really assigned.
6362
6363 2006-04-30  Raja R Harinath  <harinath@gmail.com>
6364
6365         * flowanalysis.cs (Reachability): Make 4-argument constructor
6366         private.
6367         (Reachability.Meet): Rename from 'And'.  Remove static variant.
6368         (Reachability.Always): Rename from the highly misleading
6369         'Reachability.Never'.
6370         (FlowBranching.Merge): Update to changes.  Mark an impossible
6371         situation with a 'throw'.
6372         (*): Update to changes.
6373
6374 2006-04-29  Raja R Harinath  <harinath@gmail.com>
6375
6376         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6377         Remove 'Undefined'.
6378         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6379         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6380         (*): Update to changes.
6381         * statement.cs: Update to changes.
6382
6383 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
6384
6385         A fix for #78049
6386         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6387
6388 2006-04-28  Raja R Harinath  <harinath@gmail.com>
6389
6390         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6391         dummy UsageVector.
6392
6393         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6394         argument to two arguments: an usage-vector and a bool.  Move call
6395         to FlowBranching.Merge () ...
6396         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6397
6398         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6399         handling of loop and switch reachability to ...
6400         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6401
6402 2006-04-27  Raja R Harinath  <harinath@gmail.com>
6403
6404         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6405         handling to FlowBranchingLoop.InLoop.
6406         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6407
6408 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
6409
6410         A fix for #78115
6411         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6412         anonymous method is allowed from AnonymousContainer here.
6413
6414         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6415
6416 2006-04-24  Raja R Harinath  <rharinath@novell.com>
6417
6418         Fix #78156
6419         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6420
6421 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
6422
6423         A fix for #49011.
6424         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6425         (DoubleConstant.Reduce): Ditto.
6426
6427 2006-04-23  Raja R Harinath  <rharinath@novell.com>
6428
6429         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6430         Remove 'lvalue_right_side' argument.  Move parts to ...
6431         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6432         (LocalVariable.DoResolveLValue): ... these.
6433
6434 2006-04-21  Raja R Harinath  <rharinath@novell.com>
6435
6436         Fix cs1655.cs
6437         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6438         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6439         (LocalVariableReference.DoResolveBase): Use it to implement new
6440         CS1655 check.
6441         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6442         (Argument.Resolve): Simplify.  Move CS1510 check ...
6443         * ecore.cs (Expression.ResolveLValue): ... here.
6444         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6445         (PropertyExpr.DoResolveLValue): Likewise.
6446         (FieldExpr.Report_AssignToReadonly): Likewise.
6447         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
6448         LValueMemberAccess or LValueMemberOutAccess on instance depending
6449         on it.
6450         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6451         DoResolve as appropriate.
6452
6453 2006-04-20  Raja R Harinath  <rharinath@novell.com>
6454
6455         Fix #75800
6456         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6457         implicit conversions on 'out' and 'ref' arguments.
6458
6459         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6460         improve clarity.  Remove dead code.
6461
6462         Fix #66031
6463         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6464         (Catch.Resolve): Resolve VarBlock if it exists.
6465
6466 2006-04-19  Miguel de Icaza  <miguel@novell.com>
6467
6468         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6469         twice, this was some residual code, the enumerator was emitted
6470         properly in the two branche of if later.
6471
6472 2006-04-19  Raja R Harinath  <rharinath@novell.com>
6473
6474         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
6475         cast is never an lvalue.
6476         (Cast.DoResolve, Cast.ResolveRest): Combine.
6477         (Argument.Emit): Simplify slightly.  Move 'Expr is
6478         IMemoryLocation' check ...
6479         (Argument.Resolve): ... here.
6480         (Argument.Error_LValueRequired): Remove.  Inline into only user.
6481
6482         Simplifications.  Fix cs0191-2.cs
6483         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6484         CS1649 and CS1651 to ...
6485         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
6486         the actual selection of the error code and message to a lookup
6487         table.  Add a dummy return value to simplify callsites.
6488         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6489         readonly fields of other instances of the same type.  Move CS0197
6490         warning from ...
6491         * expression.cs (Argument.Resolve): ... here.  Simplify code.
6492         Ensure that ec.InRefOutArgumentResolving is only set during LValue
6493         resolution of an out or ref argument.  The code simplification
6494         above uses this invariant.
6495
6496 2006-04-18  Raja R Harinath  <rharinath@novell.com>
6497
6498         Possibly fix #77752.  Fix cs1690-[4-7].cs.
6499         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6500         CheckMarshallByRefAccess.  Drop parameter.
6501         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
6502         warning.
6503         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6504         InstanceExpression.
6505         * report.cs (AllWarnings): Add CS1690.
6506         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6507         for ref access too.
6508         (LocalVariableReference.DoResolveBase): Update.
6509
6510 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6511
6512         * class.cs (MethodOrOperator): Moved common parts from method class.
6513         detect obsolete attributes.
6514         (Method.Define): Simplified as it reuses code from base.
6515         (Constructor.ValidAttributeTargets): Fixed issue found during
6516         refactoring.
6517         (Destructor.ValidAttributeTargets): Fixed issue found during
6518         refactoring.
6519         (Operator): Finished refactoring set off by #78020. Operator class is now
6520         ordinary method class.
6521
6522         * anonymous.cs: Updated.
6523
6524         * decl.cs (DeclSpace): Add IsGeneric
6525
6526 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6527
6528         * class.cs (Constructor.Emit): Don't emit the attributes twice.
6529
6530 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6531
6532         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6533         detect obsolete attributes.
6534         (Method.CreateEmitContext): Moved to MethodOrOperator.
6535
6536 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6537
6538         A fix for #78048.
6539         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6540         customized exception to make crash detection easier.
6541         (MethodOrOperator): Started to work on new base class for methods and
6542         operators.
6543         (Method): Derives from MethodOrOperator.
6544         (Constructor.Emit): Emits its own attributes.
6545         (AbstractPropertyEventMethod.Emit): Ditto.
6546         (Operator): Derives from MethodOrOperator, will refactor fully in extra
6547         patch.
6548         (Operator.Emit): It's temporary more tricky than should be.
6549         
6550         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6551
6552         * report.cs (InternalErrorException): Add ctor with inner exception.
6553
6554 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
6555
6556         A fix for #76744.
6557         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6558         only not visible.
6559
6560 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
6561
6562         A fix for #77916.
6563         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6564         array.
6565
6566 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6567
6568         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6569         attribute is present and Guid not.
6570         (Interface.ApplyAttributeBuilder): Ditto.
6571
6572         * attribute.cs: Add error message.
6573
6574 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6575
6576         A fix for #78020.
6577
6578         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6579         sources (it's composite) so hold them in extra array as they are used in
6580         Emit phase only. It worked in the previous versions by mistake.
6581         (Attribute.Emit): Emit attribute for more owners when exist.
6582
6583         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6584         it has now different behaviour.
6585
6586 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
6587
6588         * constant.cs (Constant.IsDefaultInitializer): New method.
6589
6590         * class.cs: Updated.
6591
6592         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6593         re-initialize default values. It saves KBs almost for every assembly.
6594         Thanks Zoltan for the idea.
6595         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6596         (ArrayCreation.DoResolve): Resolve only once.
6597         (ArrayCreation.Emit): Emit static initializer only when it is faster.
6598         (ArrayCreation.GetAttributableValue): Cope with optimized values.
6599
6600 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
6601
6602         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6603         From #77961.
6604
6605 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6606
6607         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6608         in an embedded statement too.
6609
6610 2006-04-01  Raja R Harinath  <rharinath@novell.com>
6611
6612         Fix #77958
6613         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6614
6615 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6616
6617         A fix for #77966.
6618
6619         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6620         was not specified.
6621
6622         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6623
6624 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
6625
6626         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6627         phase.
6628
6629         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6630         LocalTemporary change.
6631
6632         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6633         TypeContainer.
6634         (ClassOrStruct.DefineFieldInitializers): Implemented static field
6635         initializers optimization.
6636         (ClassOrStruct.TypeAttr): Moved from modifiers.
6637         (Constructor.CheckBase): Don't crash when static ctor has parameters.
6638         (FieldBase.ResolveInitializer): Resolves initializer.
6639         (FieldBase.HasDefaultInitializer): New property.
6640
6641         * cs-parser.jay: Removed message.
6642
6643         * expression.cs (CompilerGeneratedThis): New specialization.
6644
6645         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6646
6647 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
6648
6649         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6650
6651 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6652
6653         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6654         be now EnumConstants only.
6655
6656 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6657
6658         * attribute.cs, driver.cs: Reset more caches.
6659
6660 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6661
6662         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6663
6664 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6665
6666         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6667         for easier reuse. Updated all overrides.
6668         (IntegralConstant): New base class for all integral constants.
6669         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
6670         of the constant range, report custom error.
6671         (UIntConstant.Reduce): Fixed uint conversion.
6672
6673         * ecore.cs, literal.cs: Reduce updates.
6674
6675 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6676
6677         A fix for #75813.
6678
6679         * class.cs (Constructor.Define): Removed extra if for default ctors.
6680         A patch from Atsushi Enomoto.
6681
6682 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6683
6684         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
6685         GetAttributableValue.
6686
6687         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
6688         when required.
6689
6690         * convert.cs (ImplicitConversionRequired): Error message moved to
6691         DoubleLiteral.
6692
6693         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
6694         automatic implicit conversion of an output value.
6695         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
6696
6697         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
6698         conversion.
6699         (TypeOf.GetAttributableValue): Add extra handling for object type.
6700
6701         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
6702         special error message.
6703
6704 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
6705
6706         * class.cs (Constructor.Emit): Don't crash when struct ctor is
6707         InternalCall.
6708         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
6709         compatible with MS runtime.
6710
6711 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
6712
6713         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
6714         attribute arguments here.
6715
6716         * class.cs (Indexer.Define): The check was moved to attribute class.
6717
6718 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
6719
6720         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
6721         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
6722         easier.
6723
6724 2006-03-22  Raja R Harinath  <rharinath@novell.com>
6725
6726         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
6727         mcs to keep code differences small.
6728         * attribute.cs (Attribute.GetParameterDefaultValue): New.
6729         * typemanager.cs (parameter_default_value_attribute_type): New.
6730         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
6731         CS1908 check.
6732
6733 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
6734
6735         * expression.cs (StringConcat.Append): Reverted back to no warning state.
6736
6737 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
6738
6739         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
6740
6741         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
6742         the blocks too.
6743
6744 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
6745
6746         * doc-bootstrap.cs : fix build.
6747
6748 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
6749
6750         * expression.cs (StringConcat.Append): Issue a warning when empty string
6751         is going to append.
6752
6753 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
6754
6755         * assign.cs (CompoundAssign.ResolveSource): Removed.
6756
6757         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
6758         clean up.
6759
6760         * class.cs (TypeContainer.FindMethods): Removed.
6761         (TypeContainer.CheckMemberUsage): Made static.
6762
6763         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
6764
6765         * constant.cs (CheckRange): Removed unused type argument.
6766         (CheckUnsigned): Removed unused type argument.
6767
6768         * cs-parser.jay: Updated after MemberAccess clean up.
6769         Uses Length for empty string test.
6770
6771         * cs-tokenizer.cs: Uses Length for empty string test.
6772         (IsCastToken): Made static.
6773         (is_hex): Made static.
6774         (real_type_suffix): Made static.
6775
6776         * decl.cs (SetupCache): Made static.
6777         (OnGenerateDocComment): Removed unused ds argument.
6778
6779         * delegate.cs (VerifyDelegate): Removed unused argument.
6780
6781         * doc.cs: Uses Length for empty string test.
6782
6783         * driver.cs: Uses Length for empty string test.
6784
6785         * enum.cs (IsValidEnumType): Made static
6786
6787         * expression.cs (EnumLiftUp): Removed unused argument.
6788         (ResolveMethodGroup): Ditto.
6789         (BetterConversion): Ditto.
6790         (GetVarargsTypes): Ditto.
6791         (UpdateIndices): Ditto.
6792         (ValidateInitializers): Ditto.
6793         (MemberAccess.ctor): Ditto.
6794         (GetIndexersForType): Ditto.
6795
6796         * flowanalysis.cs: (MergeFinally): Removed unused argument.
6797
6798         * iterators.cs: Updated after MemberAccess clean up.
6799
6800         * location.cs: Uses Length for empty string test.
6801
6802         * namespace.cs: Uses Length for empty string test.
6803
6804          * report.cs (CheckWarningCode): Made static.
6805
6806         * statement.cs (LabeledStatement): Removed unused argument.
6807
6808         * typemanager.cs (FilterNone): Removed.
6809
6810 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
6811
6812         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
6813         obsolete.
6814
6815         * class.cs: Updated.
6816
6817 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
6818
6819         * cs-parser.jay.cs: __arglist is not allowed for delegates.
6820
6821 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
6822
6823         A fix for #77822.
6824
6825         * expression.cs (VerifyArgumentsCompat): Reverted to double error
6826         reporting, it's more tricky than I thought.
6827
6828 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
6829
6830         A fix for #77816.
6831
6832         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
6833         host container.
6834         (AnonymousMethod.ImplicitStandardConversionExists): New method.
6835         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
6836         Add more error reporting; Fixed issue with params.
6837
6838         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
6839
6840         * cs-parser.jay: AnonymousMethod requires host container.
6841
6842         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
6843
6844 2006-03-18  Raja R Harinath  <harinath@gmail.com>
6845
6846         * class.cs: Change 'TypeContainer ds' constructor argument to
6847         'DeclSpace parent'.  Some classes were missed below due to
6848         different naming convention.
6849
6850         * class.cs (MemberCore.Parent): Delete.  This makes the
6851         ParentContainer changes below enforceable by the compiler.
6852
6853         Treat pointers to enclosing declaration space as 'DeclSpace', not
6854         'TypeContainer'.
6855         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
6856         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
6857
6858         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
6859         of TypeContainer.
6860         (Block.AddThisVariable): Likewise.
6861         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
6862         (AbstractPropertyEventMethod.Emit): Likewise.
6863         (AbstractPropertyEventMethod.EmitMethod): Likewise.
6864         (GetMethod.Define, SetMethod.Define): Likewise.
6865         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
6866         (DelegateMethod.EmitMethod): Likewise.
6867
6868         Fix regression test-partial-13.cs.
6869         Rationalize use of PartialContainer.  Ensure that the partial
6870         class semantics can be tied to type-correctness, i.e., any
6871         violation will cause a compile error.
6872         * class.cs, const.cs: Access all fields that belong to class
6873         TypeContainer via ParentContainer.  Arguments of EmitContexts and
6874         Resolve()-like functions still use 'Parent'.
6875
6876         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
6877         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
6878         (PropertyMethod.CheckModifiers): Remove unused argument.
6879         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
6880         DeclSpace.
6881
6882 2006-03-17  Raja R Harinath  <harinath@gmail.com>
6883
6884         Make semantics of PartialContainer simpler.
6885         * decl.cs (DeclSpace.IsPartial): Remove.
6886         * class.cs (TypeContainer.IsPartial): Likewise.
6887         (TypeContainer..ctor): Set PartialContainer to point to self.
6888         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
6889         (TypeContainer.FindNestedType): Likewise.
6890         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
6891
6892 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
6893
6894         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
6895
6896 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
6897
6898         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
6899         classes.
6900
6901 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
6902
6903         * class.cs (Operator.Define): An error for base conversion was not
6904         reported correctly.
6905
6906 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
6907
6908         * iterator.cs : yield break is allowed in try statement which has
6909           catch clauses. Fixed bug #77767.
6910
6911 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
6912
6913         A fix for #77593, #77574.
6914
6915         * class.cs (MethodCore.CheckBase): Another if for operator.
6916
6917 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
6918
6919         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
6920         were not resolved
6921
6922         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
6923         (DelegateCreation.ImplicitStandardConversionExists): New method for just
6924         conversion test.
6925         
6926         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
6927         not needed.
6928
6929         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
6930         Updated after another emitcontext usage was clean up. It should help us to
6931         synchronize with gmcs easier.
6932
6933 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
6934
6935         A fix for #77353.
6936
6937         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
6938         (Event.Define): ditto
6939         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
6940
6941         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
6942         Removed redundant code and set NewSlot for Invoke method too.
6943
6944         * parameter.cs (Parameters.ctor): Add custom, type ctor.
6945         (Parameters.MergeGenerated): New method. Use this method when you merge
6946         compiler generated argument with user arguments.
6947
6948 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
6949
6950         * attribute.cs (ResolveAsTypeTerminal): Removed.
6951
6952         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
6953         specialization for predefined types; 30% speed up.
6954         Finally placed obsolete check to right place.
6955         (Expression.ResolveType): Removed.
6956
6957         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
6958         Updated after ResolveType was removed.
6959
6960         * expression.cs (Cast.ctor): Check void cast.
6961         (Binary.ResolveAsTypeTerminal): Is never type.
6962         (Conditional.ResolveAsTypeTerminal): Is never type.
6963
6964         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
6965
6966 2006-03-01  Raja R Harinath  <rharinath@novell.com>
6967
6968         Fix #77679.
6969         * expression.cs (ParameterReference.DoResolveBase): Change return
6970         type to bool.
6971         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
6972         Update.
6973
6974         Fix #77628.
6975         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
6976
6977         Fix #77642.
6978         * typemanager.cs (GetFullNameSignature): Don't nullref on
6979         protected accessors.
6980
6981 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
6982
6983         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
6984         these two separated members to simplify the code.
6985         (Attribute.Resolve): Refactored to use new fields and methods.
6986         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
6987         implemented obsolete attribute checking.
6988         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
6989         implemented obsolete checking again. It look line never ending quest ;-)
6990         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
6991
6992         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
6993
6994         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
6995
6996         *class.cs (Property.Define): Add RegisterProperty call.
6997
6998         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
6999         argument groups (only 2).
7000
7001         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7002         encoding expression to arguments.
7003         (Expression.ExprClassToResolveFlags): Just turned to property.
7004
7005         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7006         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7007         optimized as well as implemented support for zero-length attributes.
7008
7009         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7010         Add caching of PropertyInfo's.
7011
7012 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7013
7014         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7015         error multiple times.
7016
7017 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7018
7019         New partial class implementation.
7020         A fix for #77027, #77029, #77403
7021
7022         * attribute.cs (Attributable): Made attributes protected.
7023
7024         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7025         the replacements of ClassPart and PartialContainer.
7026         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7027         (TypeContainer.AddInterface): Ditto.
7028         (TypeContainer.AddPartial): The main method for partial classes. It checks
7029         for errors and merges ModFlags and attributes. At the end class is added to
7030         partial_parts list.
7031         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7032         required here.
7033         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7034         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7035         from the rest of partial classes.
7036         (TypeContainer.GetClassBases): Simplified.
7037         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7038         DefineType.
7039         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7040         (TypeContainer.HasExplicitLayout): Uses Flags now.
7041         (PartialContainer): Removed.
7042         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7043         (StaticClass): Was merged with Class.
7044         (Class.GetClassBases): class and static class bases are verified here.
7045         (Class.TypeAttr): Added static attributes when class is static.
7046         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7047         (MemberBase): In some cases we need to call parent container for partial
7048         class. It should be eliminated but it's not easy now.
7049
7050         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7051
7052         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7053         partial classed to accumulate class comments.
7054         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7055
7056         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7057
7058         * driver.cs (MainDriver): Tree.GetDecl was removed.
7059
7060         * modifiers.cs (Modifiers): Add partial modifier.
7061
7062         * tree.cs (Tree.decl): Removed.
7063         (RootTypes): Started to use this class more often for root types
7064         specializations.
7065
7066 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7067
7068         A fix for #77615
7069
7070         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7071         external interface does not have an attribute.
7072
7073 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7074
7075         Another prerequisites for new partial classs implementation.
7076         
7077         * attribute.cs (Attribute.Equal): Implemented.
7078         (Attribute.Emit): Changed as attributes can be applied more than twice.
7079         (Attributes.Emit): Check for duplicate attributes here.
7080
7081         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7082         as a parameter, clean-up.
7083
7084 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7085
7086         A fix for #77485
7087
7088         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7089         contains obsolete attribute check which can in some cases look for base
7090         type of current class which is not initialized yet.
7091         (TypeContainer.BaseType): Replacement of ptype.
7092
7093         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7094
7095 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7096
7097         First of prerequisites for new partial classs implemention.
7098         
7099         * attribute.cs (Attributable): Extended by ResolveContext;
7100         Attributes finally have correct context for resolving in all cases.
7101         (AttachTo): Attribute owner is assigned here.
7102
7103         * codegen.cs (IResolveContext): Introduce new interface to hold
7104         all information needed in resolving phase.
7105         (EmitContext): Implements IResolveContext; more clean-up needed here.
7106         
7107         * decl.cs (MemberCore): Implemented IResolveContext.
7108
7109         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7110         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7111         parameter.cs, statement.cs, tree.cs, typemanager.cs:
7112         Refactored to use new IResolveContext instead of EmitContext; cleanup
7113
7114 2006-02-06  Miguel de Icaza  <miguel@novell.com>
7115
7116         * codegen.cs (EmitScopeInitFromBlock): check here the
7117         capture_context, there is no need to make two calls to the
7118         EmitContext. 
7119
7120         * anonymous.cs: Add some debugging messages that might help me
7121         track other instances of this problem in the future (the
7122         regression of test 467).
7123
7124         * cs-parser.jay: track the variable block, as we need to initalize
7125         any captured variables declared in this block for the "catch"
7126         portion of the "Try" statement.
7127
7128         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7129         scope initialization for captured variables. 
7130
7131         Also, move the emit for the variables after the block location has
7132         been marked.
7133
7134 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
7135
7136         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7137
7138 2006-02-02  Miguel de Icaza  <miguel@novell.com>
7139
7140         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7141         commit yesterday, the initialization for the roots is necessary.
7142         What is not necessary is the scope activation.
7143
7144 2006-02-02  Raja R Harinath  <rharinath@novell.com>
7145
7146         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7147         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7148         CS0206 checks.
7149         (Argument.Resolve): Remove CS0206 checks.
7150
7151 2006-02-01  Miguel de Icaza  <miguel@novell.com>
7152
7153         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7154         scopes for all the roots, the scopes will now be emitted when the
7155         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
7156
7157         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7158         code.  This reduces a lot of existing cruft.
7159         
7160         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7161         that the ScopeInfo is generated as we enter the scope, not at the
7162         time of use, which is what we used to do before.
7163
7164         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7165         every time a Block is about to be emitted if we have a
7166         CaptureContext. 
7167
7168 2006-02-01  Raja R Harinath  <rharinath@novell.com>
7169
7170         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7171         (Reset): Update.
7172         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7173
7174         * typemanager.cs (cons_param_array_attribute): Make private.
7175         (Reset): Set it to null.
7176         (InitCoreHelpers): Don't initialize it.
7177         (ConsParamArrayAttribute): New.  Initialize it as needed.
7178         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7179
7180 2006-01-31  Miguel de Icaza  <miguel@novell.com>
7181
7182         * expression.cs: There might be errors reported during the
7183         selection of applicable methods.  If there are errors, do not
7184         continue execution as it will lead the compiler to crash.
7185
7186 2006-01-30  Miguel de Icaza  <miguel@novell.com>
7187
7188         * expression.cs: Member access is not allowed on anonymous
7189         methods.  Fixes #77402.
7190
7191 2006-01-30  Raja R Harinath  <rharinath@novell.com>
7192
7193         Fix #77401
7194         * cs-parser.jay (VariableDeclaration): Don't set
7195         current_array_type to null.
7196         (field_declaration, event_declaration, declaration_statement):
7197         Set it to null here.
7198
7199 2006-01-28  Raja R Harinath  <harinath@gmail.com>
7200
7201         * typemanager.cs (GenericParameterPosition): New.
7202         * doc.cs: Use it.
7203
7204 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
7205
7206         * doc.cs : To process "include" elements, first we should create
7207           another list than XmlNodeList, because it could result in node
7208           removal, which could result in that the XmlNodeList gives up
7209           yielding next node.
7210
7211           (Also made code identical to gmcs again.)
7212
7213 2006-01-25  Miguel de Icaza  <miguel@novell.com>
7214
7215         * ecore.cs: Introduce an error report that we were not catching
7216         before, if not silent, we must report the error.  Gonzalo ran into
7217         it.
7218
7219 2006-01-23  Miguel de Icaza  <miguel@novell.com>
7220
7221         A fix for bug: #76957
7222         
7223         * iterators.cs (MoveNextMethod.CreateMethodHost): call
7224         ComputeMethodHost before creating the method, this is a new
7225         requirement. 
7226
7227         * anonymous.cs (AnonymousContainer): Now we track all the scopes
7228         that this method references (RegisterScope).  The actual scope
7229         where the method is hosted is computed with the ComputeMethodHost
7230         before we create the method.
7231
7232         Moved the Deepest routine here.
7233
7234         (AnonymousContainer.ComputeMethodHost): New routine used to
7235         compute the proper ScopeInfo that will host the anonymous method.
7236
7237         (ScopeInfo): Deal with multiple roots.  The problem was that we
7238         did not have a unique root where all ScopeInfos could be hanged
7239         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
7240         of roots.  
7241
7242         Remove AdjustMethodScope which is now computed at the end.  Remove
7243         LinkScope which did a partial link, instead link all ScopeInfos
7244         before code generation from the new "LinkScopes" routine. 
7245
7246         Simplify all the Add* routines as they no longer need to maintain
7247         the tree, they just need to record that they are using variables
7248         from a ScopeInfo.
7249
7250         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7251         routines to produce the forest of ScopeInfo trees.
7252
7253         * class.cs (TypeContainer.AppendMethod): This is just like
7254         AddMethod, but ensures that an interface implementation method
7255         (IEnumerable.XXX) is not inserted at the beginning of the queue of
7256         methods, but at the end.
7257
7258         We use this functionality to ensure that the generated MoveNext
7259         method in the iterator class is resolved/emitted before the
7260         enumerator methods created.   
7261
7262         This is required because the MoveNext method computes the right
7263         ScopeInfo for the method.  And the other methods will eventually
7264         need to resolve and fetch information computed from the anonymous
7265         method. 
7266
7267 2006-01-21  Raja R Harinath  <harinath@gmail.com>
7268             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
7269
7270         Fix rest of #76995.
7271         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7272         the 'aliases' hash.
7273         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7274         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7275
7276 2006-01-18  Raja R Harinath  <rharinath@novell.com>
7277
7278         Fix #76656, cs0231-2.cs.
7279         * cs-parser.jay (formal_parameter_list): Make error case catch
7280         more issues.
7281         (parenthesized_expression_0): Add CS1026 check.
7282         (invocation_expression): Remove unused { $$ = lexer.Location }.
7283
7284 2006-01-17  Raja R Harinath  <rharinath@novell.com>
7285
7286         Fix #76824.
7287         * cs-parser.jay (statement_expression): Don't list out the
7288         individual statement-expressions.  Convert syntax error into
7289         CS0201 check.
7290
7291 2006-01-16  Raja R Harinath  <rharinath@novell.com>
7292
7293         Fix #76874.
7294         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7295         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
7296         CheckIntermediateModification.
7297         (FieldExpr.DoResolve): Add new two-argument version that
7298         allows us to resolve the InstanceExpression as an lvalue.
7299         The one-argument variant is now just a wrapper.
7300         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7301         Resolve the lhs as an lvalue if the it has a value type.
7302         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7303         from Assign.DoResolve.
7304         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7305         resolved as an lvalue.
7306         (PropertyExpr.DoResolve): Update.
7307         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7308         has a value type.  Move CS1612 check here from
7309         CheckIntermediateModification.
7310         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7311         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
7312         'right_side' of a ResolveLValue on an 'out' argument.
7313         (EmptyExpression.LValueMemberAccess): New.  Used as the
7314         'right_side' of a propagated ResolveLValue on a value type.
7315         (LocalVariableReference.DoResolveBase): Recognize
7316         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7317         Add CS1654 check.
7318         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7319         EmptyExpression.Null.
7320
7321 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
7322
7323         * typemanager.cs : added IsGenericParameter(). In mcs it always
7324           return false.
7325         * doc.cs : for generic parameters, use GenericParameterPosition,
7326           not FullName.
7327
7328 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
7329
7330         * expression.cs: Fix Console.WriteLine ((this = x).foo);
7331
7332 2006-01-12  Miguel de Icaza  <miguel@novell.com>
7333
7334         This fixes the problem where we used ldfld instead of ldflda to
7335         load the "THIS" pointer on captured parameters, when THIS is a
7336         value type.  See bug #77205.
7337         
7338         * iterators.cs (CapturedThisReference.Emit): Pass false to
7339         EmitThis (we do not need the address).
7340
7341         * codegen.cs (EmitThis): it needs to know whether we need the
7342         address of `this' or not.  This is used by value types.  
7343
7344         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7345         every other call passes false.
7346
7347 2006-01-12  Raja R Harinath  <rharinath@novell.com>
7348
7349         Fix #77221.
7350         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7351         GetOverride.
7352         * expression.cs (Invocation.OverloadResolve): Update.
7353         (Invocation.DoResolve): Avoid double resolution of invocation.
7354
7355 2006-01-11  Raja R Harinath  <rharinath@novell.com>
7356
7357         Fix #77180.
7358         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7359         unary negation of floating point types as 0-expr; negation cannot
7360         overflow in floating point types.
7361
7362         Fix #77204.
7363         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7364         on operands of 'void' type.
7365
7366         Fix #77200.
7367         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7368         and ExclusiveOr for boolean constants too.
7369
7370 2006-01-09  Raja R Harinath  <rharinath@novell.com>
7371
7372         Fix #75636.
7373         * expression.cs (Invocation.OverloadResolve): Replace reflected
7374         override methods with their base virtual methods, rather than
7375         skipping over them.
7376         * typemanager.cs (TypeManager.GetOverride): New.
7377
7378 2006-01-05  Jb Evain  <jbevain@gmail.com>
7379
7380         * class.cs (Property.Define, Indexer.Define): do not tag the
7381         properties as SpecialName | RTSpecialName.
7382
7383 2006-01-04  Miguel de Icaza  <miguel@novell.com>
7384
7385         * class.cs (MethodCore.IsDuplicateImplementation): This method was
7386         doing a low-level comparission of parameter types.  It was lacking
7387         a check for __argslist. 
7388
7389 2005-12-30  Miguel de Icaza  <miguel@novell.com>
7390
7391         * expression.cs (ParameterReference.DoResolveBase): Allow
7392         reference parameters if they are local to this block. 
7393
7394         This allows the ref and out parameters of a delegate to be used in
7395         an anonymous method, for example:
7396
7397         delegate void set (out int x);
7398
7399         set s = delegate (out int x){
7400                 x = 0;
7401         };
7402
7403         This is used by functionality introduced late in the C# language.
7404         
7405         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7406         method that take ref and out parameters. 
7407
7408         Fixes #77119 which was a late change in the spec.
7409
7410 2005-12-23  Miguel de Icaza  <miguel@novell.com>
7411
7412         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7413         parent if its the same scope.  Fixes #77060.
7414
7415 2005-12-21  Miguel de Icaza  <miguel@novell.com>
7416
7417         * driver.cs: Report the case of no source files and no -out:
7418         argument provided.
7419
7420 2005-12-20  Raja R Harinath  <rharinath@novell.com>
7421
7422         Fix #77035.
7423         * expression.cs (ComposedCast.GetSignatureForError): Define.
7424
7425 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7426
7427         Fix #76995
7428
7429         * namespace.cs (NamespaceEntry): Add extern_aliases as a
7430         ListDictionary, to contain the ExternAliasEntry entries (in
7431         addition to the NamespaceEntry.aliases hashtable). This field is
7432         shared between the original entry and its doppelganger (bodyless 
7433         copy of it).
7434         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7435         extern_aliases field.
7436         (NamespaceEntry.Lookup): Move the IsImplicit check after the
7437         lookup in extern_aliases.
7438
7439 2005-12-16  Raja R Harinath  <rharinath@novell.com>
7440
7441         Fix #77006.
7442         * class.cs (TypeContainer.Mark_HasEquals): New.
7443         (TypeContainer.Mark_HasGetHashCode): New.
7444         (ClassPart): Override them.
7445         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7446
7447         Fix #77008.
7448         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7449         'parent' argument to the base constructor.
7450
7451         Remove all mention of TypeContainer from decl.cs.
7452         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7453         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7454         (DeclSpace.DeclSpace): Likewise.
7455         (DeclSpace.DefineMembers): Remove unused argument.
7456         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
7457         debugging check -- we don't care if the debug code throws an
7458         InvalidCastException instead of an InternalErrorException.
7459         * class.cs (TypeContainer.DefineMembers): Update to changes.
7460         (TypeContainer.DoDefineMembers): Likewise.
7461         (TypeContainer.GetMethods): Likewise.
7462         (PropertyMember.Define): Likewise.
7463         (MemberBase.Parent): New property that forwards to
7464         MemberCore.Parent, but ensures that we get a TypeContainer.
7465         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7466         (RootContext.PopulateTypes): Likewise.  Remove special case code
7467         for !RootContext.StdLib: DefineMembers is idempotent.
7468
7469 2005-12-14  Miguel de Icaza  <miguel@novell.com>
7470
7471         * convert.cs (ExplicitConversionCore): Check the return value from
7472         ExplicitConversionCore which can return null on failure.  Fixes #76914
7473
7474 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
7475
7476         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7477
7478 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
7479
7480         * doc.cs : The search for referenced namespace was insufficient to
7481           get global one as it used to do. Fixed bug #76965.
7482
7483 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
7484
7485         * doc.cs : check name in cref in the last phase that whether it is
7486           namespace or not.
7487
7488 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7489
7490         * cs-tokenizer.cs : reverted the latest change: it somehow broke
7491           Mono.C5.
7492
7493 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7494
7495         * doc.cs : so it turned out that we cannot skip override check for 
7496           interface members. Fixed bug #76954.
7497
7498 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7499
7500         * cs-tokenizer.cs : fixed bug #75984:
7501           - #warning and #error should not be handled when the source line
7502             is disabled.
7503           - #line is not checked strictly when the source line is disabled.
7504           - #define and #undef is on the other hand checked strictly at any
7505             state.
7506
7507 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
7508
7509         * cs-tokenizer.cs : missing Location (actually, filename) in one of
7510           CS1027 report.
7511
7512 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7513
7514         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7515
7516         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7517         event initializers.
7518         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7519         (FieldBase.Initializer): Initializer is now optional.
7520         (EventField.Define): Only event field can have initializer.
7521
7522         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7523
7524         * const.cs (Const): Reuse initializer.
7525
7526         * cs-parser.jay: Updated after FieldBase changes.
7527         Added current_array_type to simplify array initializers.
7528
7529         * ecore.cs (NullCast.IsDefaultValue): Implemented.
7530
7531         * expression.cs, iterators.cs: Updated.
7532
7533         * namespace.cs (NamespaceEntry): Made UsingFound private.
7534
7535 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7536
7537         * parameterCollection.cs: Obsolete, removed.
7538         * parser.cs: Obsolete, removed.
7539
7540 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7541
7542         Fix #76849.
7543         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7544
7545         * enum.cs (Enum.Define): Set obsolete context here.
7546
7547 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7548
7549         * doc.cs :
7550           - FindDocumentedMember() now expects 1) paramList as null
7551             when "we don't have to check the number of parameters" and
7552             2) Type.EmptyTypes when "there is no arguments".
7553           - Introduced FoundMember struct to hold the exact type which was
7554             used to find the documented member (the above change broke
7555             test-xml-044; it might be better just to use DeclaringType than
7556             what MS does, like this change does, but it depends on usage.)
7557
7558 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7559
7560         * doc.cs : documented member might be from DeclaringType for nested
7561           types. Fixed bug #76782.
7562
7563 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
7564
7565         * anonymous.cs: Have the param code handle leaving copies on the
7566         stack etc. Allows anonymous params to take part in the assignment
7567         code (++, +=, etc). Fixes bug #76550
7568
7569         * expression.cs: Handle the prepare_for_load/leave_copy by passing
7570         it down to the anon code.
7571
7572         * iterators.cs: Use dummy var here
7573
7574         * codegen.cs: Handle new vars
7575
7576 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7577
7578         Fix #76849.
7579         * class.cs (MethodData.Define): Set proper Obsolete context.
7580
7581         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7582         obsolete context.
7583         (FieldExpr.DoResolve): Ditto.
7584
7585 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7586
7587         Fix #76849.
7588         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7589         parent is not obsolete.
7590
7591 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
7592
7593         * doc.cs : (FindDocumentedMember) find parameterless members first
7594           and get CS0419 in the early stage. Fixed first case of bug #76727.
7595
7596 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
7597
7598         Fix #76859.
7599         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7600         no error was reported.
7601
7602         *expression.cs (Binary.DoResolve): left can be null.
7603
7604 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
7605
7606         Fix #76783.
7607         * class.cs (MethodData.Emit): Parameters should be labeled first.
7608
7609 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
7610
7611         Fix #76761.
7612         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7613
7614 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
7615
7616         * attribute.cs (AreParametersCompliant): Moved to Parameter.
7617
7618         * class.cs (MethodCore): Parameter clean up.
7619         (IMethodData): Added ParameterInfo.
7620         (MethodData): Parameter clean up.
7621         (Indexer.Define): Parameter clean up.
7622
7623         * anonymous.cs,
7624         * codegen.cs,
7625         * cs-parser.jay,
7626         * decl.cs,
7627         * doc.cs,
7628         * ecore.cs,
7629         * flowanalysis.cs,
7630         * iterators.cs,
7631         * pending.cs,
7632         * statement.cs,
7633         * typemanager.cs: Parameter clean up.
7634
7635         * delegate.cs (Define): Get rid of duplicated code.
7636
7637         * expression.cs (ParameterReference): Removed useless parameters
7638         and simplified.
7639         (Invocation): Ditto.
7640
7641         * parameter.cs (ParamsParameter): New class, params specialization.
7642         (ArglistParameter): Attemp to separate arglist.
7643         (Parameter): Refactored to be reusable and faster.
7644         (Parameter.Modifier): Made understandable.
7645         (Parameters): Changed to be used as a class for `this' assembly
7646         parameters. Refactored to use new specialized classes.
7647
7648         * support.cs (ParameterData): Added Types property.
7649         (InternalParameters): Deleted.
7650
7651 2005-08-20  Martin Baulig  <martin@ximian.com>
7652
7653         Merging this patch from GMCS to fix #75867.
7654
7655         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7656         scope if we don't already have it.
7657
7658 2005-11-17  Martin Baulig  <martin@ximian.com>
7659
7660         * anonymous.cs
7661         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7662         inherit the scope from our parent.  Fixes #76653.
7663
7664 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7665
7666         * doc.cs : the previous patch does not actually fix the bug.
7667           PropertyInfo override check is now implemented and really fixed it.
7668         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
7669
7670 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7671
7672         * doc.cs : apply "override filter" also to properties.
7673           Fixed bug #76730.
7674
7675 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7676
7677         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
7678           no need to check overrides. For classes, omit those results from 
7679           interfaces since they must exist in the class. Fixed bug #76726.
7680
7681 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7682
7683         * typemanager.cs : (GetFullNameSignature) differentiate indexers
7684           with different parameters. Fixed the second problem in #76685.
7685
7686 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7687
7688         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
7689           get expected 'protected' access in CheckValidFamilyAccess()).
7690           Fixed bug #76692.
7691
7692 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7693
7694         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
7695           Fixed bug #76705.  CS1569 was incorrectly commented out.
7696
7697 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
7698
7699         * doc.cs : use Invocation.IsOverride() to do real override check.
7700         * expression.cs : made Invocation.IsOverride() internal.
7701
7702 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
7703
7704         * doc.cs : use TypeManager.FindMembers() instead of (possible)
7705           TypeBuilder.FindMembers() and filter overriden base members out.
7706           Fixed bug #76990.
7707
7708 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7709
7710         * doc.cs : ref/out parameters are represented as '@' (instead of
7711           '&' in type FullName). Fixed bug #76630 (additionally crefs).
7712
7713 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7714
7715         * doc.cs : when there was no '.' in cref to methods in doc comment,
7716           then parameters were missing in the output. Fixed bug #76691.
7717
7718 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7719
7720         * driver.cs : don't output docs when there is an error.
7721           Fixed bug #76693.
7722
7723 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7724
7725         * doc.cs :
7726           Now it should detect indexers. Fixed primary concern in bug #76685.
7727           Fixed CS0419 message to not show the identical member signature in
7728           the message.
7729
7730 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7731
7732         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
7733           instead of Type.FindMembers() since it does not handle events.
7734           Fixed bug #71604.
7735
7736 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
7737
7738         * codegen.cs: Fixed typo (speficied -> specified).
7739
7740 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
7741
7742         Fix #76369.
7743         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
7744
7745 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
7746
7747         * attribute.cs: Changed error message.
7748
7749         * cs-tokenizer.cs: One more check.
7750
7751 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
7752
7753         * statement.cs (Block.Resolve): Ignore empty statement.
7754
7755 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
7756
7757         * report.cs: Made error/warning methods more strict to avoid
7758         their misuse.
7759
7760         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
7761         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
7762         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
7763         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
7764
7765 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
7766
7767         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
7768         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
7769
7770         * class.cs (TypeContainer.IsComImport): New property.
7771         (Constructor.Define): Create proper ctor for ComImport types.
7772
7773         * expression.cs (New.CheckComImport): Fixed.
7774
7775 2005-11-07  Miguel de Icaza  <miguel@novell.com>
7776
7777         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
7778         that a parameter has been captured does not mean that we do not
7779         have to do the rest of the processing.  This fixes the second part
7780         of #76592.  If there was another anonymous method capturing
7781         values in the past, the Scope would never be set for the second
7782         method that captured the same parameter.
7783
7784         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
7785         properly manipulate the stack.   Second part of fix for #76592.
7786
7787         * expression.cs (New): Add support for invoking "new" on
7788         interfaces that have been flagged with the ComImport attribute and
7789         the CoClass.  Fixes #76637 
7790
7791         * statement.cs (Try.DoEmit): When a variable is captured, do not
7792         try to emit the vi.LocalBuilder variable as it has been captured.
7793         Create a temporary variable and store the results on the
7794         FieldBuilder.  Fixes #76642
7795
7796 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
7797
7798         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
7799
7800         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
7801
7802         * expression.cs (Binary.DoResolve): Added && optimalization.
7803     
7804         * typemanager.cs (AddUserType): Removed useless argument.
7805
7806 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
7807
7808         * statement.cs (Block.variables): Uses ListDictionary.
7809
7810 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
7811
7812         Fix #75969.
7813         * class.cs (PartialContainer.EmitType): Customized to emit
7814         security attributes.
7815         (ClassPart.ApplyAttributeBuilder): Transform security attribute
7816         for partial classes.
7817
7818 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
7819
7820         Fix #76599.
7821         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
7822         access has to be fixed.
7823         
7824         * typemanager.cs (IsUnmanagedType): Wrong common field type.
7825
7826 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
7827
7828         Fix #76590.
7829         * ecore.cs (NullCast.Reduce): Implemented.
7830
7831         * expression.cs (ArrayCreation.CheckIndices): Correcly check
7832         constant type.
7833         
7834         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
7835         properly.
7836         (Foreach.Resolve): Catch null properly.
7837
7838 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
7839  
7840         * cs-tokenizer.cs: Warning text fix.
7841
7842         * driver.cs: AllWarningNumbers exposed on public interface.
7843
7844         * report.cs (): Reviewed warning numbers.
7845         (IsValidWarning): Use binary search.
7846
7847 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
7848  
7849         * driver.cs: Implemeted resource visibility.
7850         (Resources): New class for code sharing between /res: and
7851         /linkres:
7852  
7853 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
7854
7855         Fix #76568.
7856         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
7857         folding.
7858         
7859         * convert (Convert.ImplicitReferenceConversion): NullCast holds
7860         contants only.
7861         
7862         * ecore.cs (NullCast): Child is contant only.
7863         
7864         * literal.cs (NullLiteral.Reduce): null can be converted to any
7865         reference type.
7866
7867 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
7868
7869         * driver.cs: Use Encoding.Default as default code page instead
7870           of ISO-28591.
7871
7872 2005-10-27  Raja R Harinath  <rharinath@novell.com>
7873
7874         Fix #76085.
7875         * expression.cs (Invocation.Error_InvalidArguments): Handle
7876         __arglist parameters.
7877         (Invocation.VerifyArgumentsCompat): Likewise.
7878         * support.cs (ReflectionParameters.GetSignatureForError): Print
7879         __arglist parameters.
7880         (InternalParamters.GetSignatureForError): Likewise.
7881         * parameter.cs (Parameters.GetSignatureForError): Likewise.
7882
7883 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
7884
7885         * attribute.cs (GetPropertyValue): Made public.
7886
7887         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
7888         Resolve.
7889         Add new property WrapNonExceptionThrows to handle 2.0 assembly
7890         attribute.
7891         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
7892         is not defined.
7893         
7894         * driver.cs: Reflect method name change.
7895         
7896         * statement.cs (Try.Resolve): Warn when try has both general
7897         exception handlers.
7898         
7899         * typemanager.cs: runtime_compatibility_attr_type new predefined
7900         type.
7901
7902 2005-10-26  Raja R Harinath  <harinath@gmail.com>
7903
7904         Fix #76419.
7905         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
7906         treat it as an empty parameter list.
7907
7908 2005-10-26  Raja R Harinath  <rharinath@novell.com>
7909
7910         Fix #76271.     
7911         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
7912         ResolveAsTypeStep silent.
7913         * statement.cs (Block.AddConstant): Mark block as used.
7914         (Block.ResolveMeta): Avoid piling on error messages
7915         if a constant initializer resolution fails.
7916
7917 2005-10-25  Raja R Harinath  <rharinath@novell.com>
7918
7919         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
7920         Remove.
7921         (NamespaceEntry.VerifyAllUsing): New.
7922         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
7923         behaviour.  Delegates actual resolution of alias to ...
7924         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
7925         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
7926         Update.
7927         * driver.cs (Driver.MainDriver): Update.
7928         
7929         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
7930         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
7931         property.
7932         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
7933         Remove.
7934         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
7935         RootNamespace.DefineNamespacesForAll.
7936
7937 2005-10-24  Raja R Harinath  <harinath@gmail.com>
7938
7939         * typemanager.cs (assemblies, external_aliases, modules)
7940         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
7941         (ComputeNamespaces, GetRootNamespace): Remove extra staging
7942         overhead.  Move resposibility ...
7943         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
7944         * driver.cs, attribute.cs, codegen.cs: Update to changes.
7945
7946 2005-10-23  Raja R Harinath  <harinath@gmail.com>
7947
7948         * namespace.cs (RootNamespace.all_namespaces): Renamed from
7949         cached_namespaces.  Improve usage.
7950         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
7951         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
7952         Move from GlobalRootNamespace and simplify.
7953         (RootNamespace.Global): Make instance variable.
7954         (RootNamespace.RootNamespace): Add "alias name" parameter.
7955         (GlobalRootNamespace): Simplify drastically.
7956         (Namespace.Lookup): Don't use GetNamespace.
7957         * typemanager.cs (GetRootNamespace): Rename from
7958         ComputeNamespaceForAlias.
7959         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
7960
7961 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
7962
7963         * anonymous.cs (AnonymousContainer): Don't crash when container
7964         doesn't exist.
7965
7966 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
7967
7968         * expression.cs (Binary.DoResolve): Warn when comparing same
7969         values.
7970
7971 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
7972
7973         Fix #76486.
7974         * expression.cs (Binary.DoResolve): It looks like there are no
7975         convetsion rules in enum context.
7976
7977 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7978
7979         Add support for extern alias qualifiers.
7980         * typemanager.cs: Move some LookupTypeReflection code
7981         to namespace.cs, to have cleaner code. Added some methods
7982         to help us keep track of the extern aliased references.
7983         * driver.cs: Add suport for extern alias assemblies on command
7984         line and check for their warnings/errors. Also keep track of the
7985         extern aliased assemblies.
7986         * namespace.cs: Move the global functionality of Namespace
7987         to GlobalRootNamespace/RootNamespace. Now the global namespace
7988         is GlobalRootNamespace.Globa. Also the code moved from 
7989         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
7990         Finally added LocalAliasEntry (AliasEntry before) and
7991         ExternAliasEntry, to handle alias statements.
7992         * cs-parser.jay: Add support in the grammar for extern alias
7993         statement.
7994         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
7995         Update callings to Namespace (now in GlobalRootNamespace).
7996
7997 2005-10-18  Raja R Harinath  <rharinath@novell.com>
7998
7999         Fix #76371.
8000         * class.cs (TypeContainer.DefineType): Move updating of
8001         topological sort earlier in the code.
8002         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8003
8004 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
8005
8006         Fix #76273.
8007         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8008         
8009         * constant.cs (Constant.TryReduce): Moved from Cast class.
8010         (Reduce): Made little bit more OO and fixed missing conversions.
8011         
8012         * ecore.cs (Reduce): Implemented.
8013         (Binary.EnumLiftUp): New method to upgrade values to enum values.
8014         
8015         * literal.cs (Reduce): Implemented.
8016         
8017         * class.cs: Reverted Miguel's wrong commit.
8018
8019 2005-10-14  Miguel de Icaza  <miguel@novell.com>
8020
8021         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8022
8023 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
8024
8025         * cs-parser.jay, expression.cs : CS0214 was missing error location
8026           for constants. Fixed bug #76404.
8027
8028 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
8029
8030         Fix #76370.
8031         * convert.cs (ExplicitConversionCore): Fixed object->enum
8032         conversion.
8033
8034 2005-10-10  Raja R Harinath  <rharinath@novell.com>
8035
8036         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8037         InstanceExpression.
8038         (PropertyExpr.EmitCall): Likewise.
8039         * expression.cs (Invocation.EmitArguments): Handle case where
8040         arguments == null.
8041         (Invocation.EmitCall): Avoid allocating temporary variable if
8042         there are no arguments.
8043
8044 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8045
8046         Fix #76323.
8047         * convert.cs (ImplicitConversionStandard): Move conversion of
8048         void* to arbitrary pointer types ...
8049         (ExplicitConversionStandard): .. here.
8050         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8051         error to always print typenames.
8052
8053 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8054
8055         * convert.cs (GetConversionOperator): Rename from
8056         GetConversionOperators.  Move operator selection code from ...
8057         (UserDefinedConversion): ... here.
8058
8059 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
8060
8061         * convert.cs (ExplicitConversionCore): Removed duplicate enum
8062         conversion.
8063
8064 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
8065
8066         * assign.cs (Assign.DoResolve): Error method changed.
8067
8068         * cfold.cs (DoConstantNumericPromotions): Error method changed.
8069         
8070         * const.cs (ResolveValue): Reset in_transit immediately.
8071         
8072         * constant.cs: Error method changed.
8073         
8074         * convert.cs: Removed useless location parameter.
8075         (ExplicitNumericConversion): Don't do double enum check.
8076         (ExplicitConversionCore): Renamed from ExplicitConversion.
8077         (ExplicitUnsafe): Extracted from ExplicitConversion.
8078         (ExplicitConversion): Uses for error reporting.
8079         
8080         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8081         error messages.
8082         (ResolveBoolean): Uses common error method.
8083         (CastToDecimal): Get rid of ec.
8084         (CastFromDecimal): Optimized.
8085         (ConvCast): Get rid of ec.
8086         
8087         * enum.cs (ResolveValue): Reset in_transit immediately.
8088         (Emit): Return after first error.
8089         
8090         * expression.cs: Convert changes.
8091         
8092         * literal.cs: Error method changed.
8093         
8094         * statement.cs: Error method changed.
8095
8096 2005-10-03  Raja R Harinath  <rharinath@novell.com>
8097
8098         * support.cs (SeekableStreamReader.Position): Don't error out when
8099         the requested position is just beyond the end of the current
8100         buffered data.
8101
8102 2005-09-28  Raja R Harinath  <rharinath@novell.com>
8103
8104         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
8105         try to keep in sync with the byte count of the underlying Stream.
8106         However, this limits us to a window size of 2048 characters: i.e.,
8107         the maximum lookahead of our lexer/parser can be 2048 characters.
8108
8109 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
8110
8111         Fix #76255.
8112         * driver.cs: Fix compilation files with full root path.
8113
8114 2005-09-25  Miguel de Icaza  <miguel@novell.com>
8115
8116         * report.cs (SymbolRelatedToPreviousError): Format the output so
8117         it does not use an open parenthesis that is never closed. 
8118
8119         * driver.cs: Follow coding guidelines
8120
8121 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8122
8123         Fix #72930.
8124         * const.cs (Const.ResolveValue): Check for assigning non-null
8125         value to reference type.
8126
8127 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8128
8129         * anonymous.cs: Implemented ExprClassName.
8130         
8131         * assign.cs (Assign.DoResolve): Don't chrash when type is not
8132         delegate.
8133         
8134         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8135         check.
8136         
8137         * class.cs (StaticClass.DefineContainerMembers): Report protected
8138         members as error.
8139         
8140         * codegen.cs: if(ed) PRODUCTION.
8141         
8142         * convert.cs (Error_CannotImplicitConversion): Better error
8143         distinction.
8144         
8145         * cs-parser.jay: More error checks.
8146         
8147         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8148         
8149         * driver.cs (CSCParseOption): Enabled wrong option check.
8150         
8151         * ecore.cs (Expression.ExprClassName): Turned to property.
8152         (MemberExpr.CheckIntermediateModification): For checking boxed
8153         value types     modification.
8154         
8155         * statement.cs (Fixed.Resolve): Expression type must be
8156         convertible to fixed type.
8157         (CollectionForeach.GetEnumeratorFilter,TryType):
8158         Small refactoring for easier error checking.
8159
8160 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
8161
8162         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8163         attributes.
8164         
8165         * class.cs (GeneratedBaseInitializer): New class for customization
8166         compiler generated initializers.
8167         (MemberBase.DoDefine): Check Obsolete attribute here.
8168         (FieldMember.DoDefine): Ditto.
8169         
8170         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8171         constants.
8172         
8173         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8174         (MemberCore.GetObsoleteAttribute): Removed argument.
8175         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8176         (MemberCore.CheckObsoleteType): New helper.
8177         
8178         * delegate.cs,
8179         * enum.cs,
8180         * statement.cs: Updates after MemberCore changes.
8181         
8182         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8183         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8184         
8185         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8186         obsolete attribute for compiler construct.
8187         (As.DoResolve): Cache result.
8188         
8189         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8190
8191 2005-09-26  Raja R Harinath  <rharinath@novell.com>
8192
8193         Fix #76133.
8194         * expression.cs (This.VerifyFixed): In a value type T, the type of
8195         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
8196         value type R, 'this' is treated as a value parameter.
8197
8198 2005-09-22  Miguel de Icaza  <miguel@novell.com>
8199
8200         * statement.cs (Lock): Use the TemporaryVariable class instead of
8201         manually using local variables as those do not work when variables
8202         are captured.
8203
8204         * ecore.cs: Moved the TemporaryVariable class from being a nested
8205         class inside Foreach to be a public class that can be employed in
8206         other places. 
8207
8208 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
8209
8210         * cs-parser.jay: interface_accessors replaced by
8211         accessor_declarations.
8212
8213         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8214         location.
8215         
8216         * statement.cs (GotoCase.Resolve): Convert null constant to
8217         null case.
8218         (SwitchLabel.ResolveAndReduce): Ditto.
8219         (SwitchLabel.NullStringCase): Custom null stamp.
8220         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8221         
8222         typemanager.cs (CSharpSignature): Don't skip first argument
8223         for full names.
8224
8225 2005-09-18  Miguel de Icaza  <miguel@novell.com>
8226
8227         * driver.cs: Set InEmacs based on the environment variable EMACS. 
8228
8229         * location.cs (InEmacs): in this mode, do not report column
8230         location as it confuses Emacs.
8231
8232 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
8233
8234         * cfold.cs, constant.cs, convert.cs, ecore.cs,
8235         expression.cs, iterators.cs, literal.cs: Store constants and
8236         literals location.
8237         
8238         * class.cs (MemberBase.ShortName): Pass location.
8239         
8240         * cs-parser.jay: Some location fixes.
8241         
8242         * ecore.cs (Expression.Location): Made virtual.
8243
8244 2005-09-05  Miguel de Icaza  <miguel@novell.com>
8245
8246         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8247         if the underlying types are the same, otherwise we need to produce
8248         code that will do the proper cast.
8249
8250         This was exposed by Marek's constant rewrite which produced
8251         invalid code for the call site:
8252
8253         enum X : long { a }
8254         void Method (X v) {}
8255
8256         Method ((X) 5)
8257
8258         This fixes test-49.cs
8259
8260 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8261
8262         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8263           Type/Object should be allowed as well. Fixed bug #75968.
8264
8265 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8266
8267         * expression.cs : (Binary.DoResolve): when one is enum constant and
8268           another is constant 0, then return enum one *as enum type*.
8269           Fixed bug 74846.
8270
8271 2005-09-02  Raja R Harinath  <rharinath@novell.com>
8272
8273         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8274         internal.
8275
8276         Fix #75941.
8277         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8278         flow-branching for LocalVariableReferences in case we were invoked
8279         from a MemberAccess.
8280         * expression.cs (LocalVariableReference.VerifyAssigned): New.
8281         Carved out of ...
8282         (LocalVariableReference.DoResolveBase): ... this.
8283         (MemberAccess.Resolve): Do the check that was disabled during
8284         SimpleNameResolve.
8285
8286 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8287
8288         * class.cs :
8289           (PartialContainer.Create): check abstract/sealed/static strictly
8290           but abstract/sealed can exist only at one side. Fixed bug #75883.
8291
8292 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
8293
8294         Fix #75945.
8295         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8296         specified, don't default to UnmanagedType.I4.
8297
8298 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8299
8300         * expression.cs : conditional operator should check possibly
8301           incorrect assign expression. Fixed bug #75946.
8302
8303 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8304
8305         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8306           Reverting the change. gmcs is much complex than mcs on this matter.
8307
8308 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8309
8310         * cs-tokenizer.cs : To read another token ahead of the actual 
8311           consumption, use new SavedToken and cache token instead of moving
8312           back the stream with SeekableStreamReader (it seemed problematic).
8313         * cs-parser.jay,
8314           driver.cs : Thus use StreamReader directly.
8315         * support.cs : Thus removed SeekableStreamReader.
8316
8317 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8318
8319         Fix #75934.
8320         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8321         (ScopeInfo.EmitScopeType): Use it to construct field names from
8322         names of captured locals.
8323
8324         Fix #75929.
8325         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8326         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8327         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
8328         (ExplicitConversion): Remove enum cases already handled by
8329         implicit conversion.  Move implicit conversion check to the beginning.
8330         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8331         * expression.cs (ArrayCreation.EmitDynamicInitializers):
8332         Don't treat System.Enum as a struct.
8333
8334 2005-08-30  Jb Evain  <jbevain@gmail.com>
8335
8336         * attribute.cs: handles as expression in parameters.
8337
8338 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8339
8340         Fix #75802.
8341         * class.cs (TypeContainer.VerifyClsName): Don't use a
8342         PartialContainer when verifying CLS compliance.
8343         (AbstractPropertyEventMethod): Set Parent here, ...
8344         (PropertyMethod): ... not here.
8345
8346 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
8347
8348         * attribute.cs : escaped attribute name should not be allowed to be
8349           resolved (e.g. @class as classAttribute). Fixed bug #75930.
8350
8351 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8352
8353         Fix #75927.
8354         * convert.cs (ImplicitStandardConversionExists): Allow zero also
8355         when converting a long constant to unsigned long.
8356         * expression.cs (Invocation.OverloadResolve): Add sanity check to
8357         detect where IsApplicable and VerifyArgumentsCompat disagree.
8358
8359 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8360         and Carlos Alberto Cortez  <carlos@unixmexico.org>
8361
8362         Fix #75848.
8363         * class.cs (TypeContainer.CanElideInitializer): New helper.
8364         (TypeContainer.EmitFieldInitializers): Use it to determine if we
8365         can safely emitting the initializer of a field.
8366
8367 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8368
8369         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8370           allowed inside a switch (without loop). Fixed bug #75433.
8371
8372 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
8373
8374         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8375         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8376
8377 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8378
8379         * driver.cs : kinda reverting the default encoding changes (not exact 
8380           revert since I noticed that "codepage:reset" might not work fine).
8381
8382 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8383
8384         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8385           Location. Now getter and setter store location correctly.
8386           (errors/cs0111-12.cs now reports the expected location.)
8387
8388 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8389
8390         * driver.cs : Use default encoding on the environment.
8391           Removed (now that) extra parameter for SeekableStreamReader.
8392         * support.cs : (SeekableStreamReader) third .ctor() argument for
8393           StreamReader is not required (always true). preamble size could
8394           be acquired in simpler and safe way.
8395
8396 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
8397
8398         * cs-parser.jay: report CS0642 at warning level 3
8399           and report CS0642 for an if else statement also
8400           fixes bug #74745. Patch by John Luke (and a bit
8401           modified by me).
8402           Removed extra CS0642 warning check for "while",
8403           "for" and "fixed".
8404         * statement.cs: In Block.Resolve(), CS0642 check
8405           is reimplemented to check a sequence of an empty
8406           statement and a block.
8407
8408           Both fix bug #66777.
8409
8410 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
8411
8412         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8413         detection until I fix it.
8414         
8415         * cs-tokenizer.cs: Changed error message.
8416         
8417         * cs-parser.jay: Fixed 2 error locations.
8418         
8419         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8420         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8421         properties.
8422         
8423         * enum.cs (GetSignatureForError): Fixed.
8424         
8425         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8426         method detection.
8427         
8428         * class.cs,
8429         * typemanager.cs (RegisterProperty): Removed.
8430         
8431         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8432
8433 2005-08-24  Raja R Harinath  <rharinath@novell.com>
8434
8435         Fix #75874.
8436         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8437         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8438
8439 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8440
8441         * expression.cs : tiny fix is required for not warning positive ulong.
8442           See test-441.cs.
8443
8444 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8445
8446         * expression.cs : add CS0652 check for constant and integral
8447           expression. Fixed bug #53974.
8448
8449 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8450
8451         * expression.cs : in DoNumericPromotions(), check if there is implicit
8452           conversion overload for string (to check CS0034). Fixed bug #52492.
8453
8454 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8455
8456         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8457
8458 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8459
8460         * ecore.cs : report location when it is *not* Null.
8461
8462 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8463
8464         * codegen.cs,
8465           ecore.cs,
8466           flowanalysis.cs,
8467           expression.cs:
8468           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8469           correctly. Fixed bug #75721.
8470
8471 2005-08-23  Raja R Harinath  <rharinath@novell.com>
8472
8473         * support.cs (SeekableStreamReader.Position): Avoid an expensive
8474         loop that performs 'min (pos, char_count)'.
8475
8476         Fix #75862.
8477         * expression.cs (Unary.ResolveOperator): Don't discard implicit
8478         converted value in Operator.OnesComplement.
8479
8480 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
8481
8482         * anonymous.cs: If the anon method is pulled into a helper class,
8483         it needs to be `internal' not `private'. Fixes runtime behavior on
8484         msft. bug #75704
8485
8486 2005-08-20  Martin Baulig  <martin@ximian.com>
8487
8488         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8489         scope if we don't already have it.
8490
8491         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8492         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8493         fixes #75867.
8494
8495 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
8496
8497         Fix #75803
8498         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8499         is a partial class.
8500
8501 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
8502
8503         The big constants rewrite
8504         Fix #75746, #75685 and more
8505         As a side effect saved 1MB for MWF ;-)
8506         
8507         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8508         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8509         enum based for corlib compilation.
8510         
8511         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8512         subtractions.
8513         
8514         * class.cs (FixedField.Define): Use ResolveAsConstant.
8515         
8516         * const.cs (IConstant): Interface constants and enums.
8517         (Const.ResolveValue): New method for constant resolvning.
8518         (ExternalConstant): Constants from imported assemblies.
8519         
8520         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8521         conversion; like enums.
8522         (Constant.ToType): Converts this constant to different type.
8523         (Constant.Increment): Adds 1.
8524         
8525         * convert.cs (ImplicitConversionRequired): Simplified.
8526         
8527         * cs-parser.jay: Create EnumMember directly.
8528         
8529         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8530         
8531         * doc.cs (GenerateEnumDocComment): Removed.
8532         
8533         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8534         (ConvertIntLiteral): Removed.
8535         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8536         
8537         * enum.cs (EnumMember): Implement IConstant.
8538         (Enum.IsValidEnumConstant): Removed.
8539         (Enum.GetNextDefaultValue): Removed.
8540         (Enum.FindMembers): Updated.
8541         (Enum.GenerateDocComment): Iterate enum members.
8542         
8543         * expression.cs (Cast.TryReduce): Handle enums correctly.
8544         (New.Constantify): Made public.
8545         (MemberAccess.DoResolve): Removed contant specific if(s).
8546         
8547         * literal.cs (NullLiteral): Implement new abstract methods.
8548         
8549         * statement.cs (GotoCase.Resolve): Use new constant methods.
8550         (SwitchLabel.ResolveAndReduce): Use new constant methods.
8551         
8552         * typemanager.cs (LookupEnum): Removed.
8553         (IsEnumType): Fixed to work with corlib.
8554         (RegisterConstant): Removed.
8555         (LookupConstant): Removed.
8556         (GetConstant): Changed to work with IConstant.
8557
8558 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
8559
8560         * location.cs : Fixed overflown (>255) column number.
8561
8562 2005-08-03  Raja R Harinath  <rharinath@novell.com>
8563
8564         First cut of the qualified-alias-member feature.
8565         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8566         token.
8567         * cs-parser.jay (DOUBLE_COLON): New token.
8568         (namespace_or_type_name): Add rule for recognizing
8569         qualified-alias-members.
8570         (primary_expression): Likewise.
8571         (element_access): Allow QualifiedAliasMember as a possible
8572         type-bearing expression.
8573         (local_variable_type, local_variable_pointer_type): Likewise.
8574         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
8575         aliases in the current and enclosing namespace declarations.
8576         (NamespaceEntry.UsingAlias): Add CS0440 warning.
8577         * decl.cs (MemberName.is_double_colon): New.
8578         (MemberName.MemberName): Add new constructor for alias-member.
8579         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8580         * expression.cs (QualifiedAliasMember): New expression type.
8581
8582 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8583
8584         * location.cs : it borked when no argument was specified.
8585
8586 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8587
8588         * location.cs : tiny ToString() format fix.
8589
8590 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8591
8592         * statement.cs : oops, it was missing.
8593
8594 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8595
8596         A set of fixes for precise line/column location.
8597
8598         * location.cs :
8599           "token" field now holds a file/line "delta", a line number offset 
8600           from the segment, and a column number. See also:
8601           http://lists.ximian.com/pipermail/mono-devel-list/2004-
8602           December/009508.html
8603           Removed static IsNull. Use instance IsNull property instead.
8604         * cs-tokenizer.cs :
8605           For some tokens it stores Location. For Identifier it stores
8606           LocatedToken which is a pair of string name and location.
8607           Column numbers are adjusted only at getChar().
8608         * report.cs :
8609           Use Location.ToString() for reporting (it now contains column).
8610         * cs-parser.jay :
8611           Largely modified to use LocatedToken instead of
8612           string (IDENTIFIER), and to acquire Location from some tokens.
8613         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8614           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8615           codegen.cs :
8616           Now MemberName holds Location. DeclSpace.ctor() receives Location
8617           as a parameter. Removed extra parameters to all derived classes.
8618           Replaced Location.IsNull() with instance property.
8619         * assign.cs, expression.cs :
8620           Added .ctor() overload that omits Location.
8621         * attribute.cs :
8622           Added "nameEscaped" flag that indicates the identifier was escaped
8623           in the source file. This fixes bug #57047.
8624
8625 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
8626
8627         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8628         New method, looking for lo-case imported cls type.
8629
8630         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8631         here.
8632
8633         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8634
8635         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8636
8637         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8638         all_imported_types.
8639         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8640
8641         Optimized to save 3.5 MB for SWF compilation.
8642
8643 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8644
8645         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8646         (PartialContainer.Create): Moved logic AddToContainer.
8647         (PartialContainer.MarkForDuplicationCheck): Shares name.
8648         
8649         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8650         place.
8651         
8652         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8653         initialization.
8654         (Namespace.GetSignatureForError): New method.
8655         
8656         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8657         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8658
8659 2005-08-01  Raja R Harinath  <rharinath@novell.com>
8660
8661         Fix #75669.
8662         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8663         member lookup rather than qualifier_type, since qualifier_type can
8664         be null.
8665
8666 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8667
8668         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
8669         enum member.
8670
8671 2005-07-31  Miguel de Icaza  <miguel@novell.com>
8672
8673         * statement.cs: Copy the local exception into the exception
8674         captured local.  Fixes 75674
8675
8676 2005-07-31  Raja R Harinath  <harinath@gmail.com>
8677
8678         Fix #75658.
8679         * expression.cs (Invocation.OverloadResolve): Don't report error
8680         CS1501 if error CS1502 has been reported.
8681         (New.DoResolve): Delegate CS1501 reporting to
8682         Invocation.OverloadResolve.
8683
8684         Fix #75656.
8685         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
8686         invariant-meaning-in-block property in an enclosing block if
8687         necessary.
8688
8689 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
8690
8691         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
8692         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
8693         (Switch.CheckSwitch): Just save 50kb for SWF.
8694
8695 2005-07-27  Martin Baulig  <martin@ximian.com>
8696
8697         * anonymous.cs (CaptureContext.AddField): Added
8698         `AnonymousContainer am' argument; compute its toplevel scope if
8699         it's not already computed.  Fixes #75649.
8700
8701 2005-07-26  Raja R Harinath  <rharinath@novell.com>
8702
8703         Fix #75628.
8704         * class.cs (Constructor.Emit): Reset block to null if the block
8705         resolve fails.
8706
8707 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
8708
8709         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
8710
8711 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
8712
8713         * class.cs (MethodData.Define): Check whether accessor implementing
8714         interface is public.
8715
8716         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
8717
8718 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
8719
8720         Fix #57245
8721         * namespace.cs (LookupType): Moved same type check to...
8722         
8723         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
8724         with the same name.
8725
8726 2005-07-21  Raja R Harinath  <rharinath@novell.com>
8727
8728         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
8729         already found a typebuilder.
8730         * class.cs (MethodCore.IsDuplicateImplementation): Compare
8731         MemberNames, not strings.
8732
8733         * const.cs (Error_ExpressionMustBeConst): 
8734         Rename from Error_EpressionMustBeConst.
8735         * const.cs, class.cs, statement.cd: Update.
8736
8737 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
8738
8739         Fix #65573
8740
8741         * const.cs (Const.LookupConstantValue): Report missing contant expression
8742         everytime.
8743         (Error_EpressionMustBeConstant): Only one error method.
8744
8745         * class.cs, statement.c: Updated.
8746
8747 2005-07-20  Raja R Harinath  <rharinath@novell.com>
8748
8749         * statement.cs (Block.Flags): Add back HasVarargs.
8750         (Block.flags): Make protected.
8751         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
8752
8753         * typemanager.cs (types, typecontainers, user_types): Remove.
8754         (UserTypes, TypeContainers): Likewise.
8755         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
8756         (CleanUp, Reset): Update.
8757         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
8758         (GetNestedType): Use Type.GetNestedType.
8759         (CoreLookupType): Take two arguments, the namespace and the
8760         basename of the type.  Update to use the Namespace.Lookup
8761         mechanism.
8762         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
8763         (RealMemberLookup): Use IsNestedChildOf instead of playing with
8764         string concatenation and substring matches.
8765         * class.cs, enum.cs, delegate.cs: Update to changes.
8766
8767 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
8768
8769         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
8770         Expression and made virtual.
8771
8772         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
8773         (ImplicitStandardConversionExists): Fixed `byte' typo ?
8774
8775         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
8776
8777         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
8778         error message.
8779
8780         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
8781         change.
8782
8783 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
8784
8785         Fix #57707
8786         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
8787         AssemblyCultureAttribute is not used on executable.
8788
8789         * rootcontext.cs,
8790         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
8791
8792 2005-07-16  Raja R Harinath  <rharinath@novell.com>
8793
8794         Fix #60638.
8795         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
8796         New.  Reports CS0252/CS0253.
8797         Mostly taken from preliminary patch by Duncak Mak.
8798         (Binary.DoResolveOperator): Store results of operator lookup.
8799         Use them to detect if we need to warn about unintended reference
8800         comparisons.
8801
8802 2005-07-15  Raja R Harinath  <rharinath@novell.com>
8803
8804         Fix #72969.
8805         * namespace.cs (Namespace.Lookup): Add back location parameter.
8806         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
8807         * delegate.cs, ecore.cs, expression.cs: Update to changes.
8808
8809         * codegen.cs (EmitContext.DeclSpace): Make readonly.
8810         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
8811         (Namespace.LookupType): ... this.
8812         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
8813         of namespaces.
8814         * typemanager.cs (LookupTypeReflection): Remove buggy code that
8815         purported to handle pointers.
8816         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
8817         CoreLookupType.
8818
8819 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
8820
8821         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
8822         type as namespace.
8823
8824 2005-07-15  Raja R Harinath  <rharinath@novell.com>
8825
8826         * namespace.cs (Namespace.Lookup): Drop location parameter.
8827         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
8828         (NamespaceEntry.Lookup): ... this.
8829         (NamespaceEntry.Error_AmbiguousTypeReference):
8830         Move here from DeclSpace.
8831         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
8832         names ...
8833         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
8834         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
8835         Move to NamespaceEntry.
8836         * delegate.cs, expression.cs: Update to changes.
8837
8838 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
8839
8840         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
8841         CheckAttributeType and refactored.
8842         (Attribute.ResolvePossibleAttributeType): Changed to reuse
8843         ResolveAsTypeTerminal error handling.
8844         (ResolveAsTypeTerminal): Introduced because of global attributes extra
8845         handling.
8846         (GetSignatureForError): Print errors in same way.
8847
8848         * class.cs,
8849         * codegen.cs: Reflect attribute GetSignatureForError change.
8850
8851         * ecore.cs,
8852         * expression.cs: Add silent parameter to ResolveAsTypeStep.
8853
8854         * namespace.cs (UsingEntry): Refactored to make fields private.
8855
8856         * assign.cs,
8857         statement.cs: Error_UnexpectedKind has extra parameter.
8858
8859 2005-07-14  Raja R Harinath  <rharinath@novell.com>
8860
8861         * ecore.cs (IAlias): Remove.
8862         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
8863         that implement the interface.
8864         * namespace.cs (Namespace): Likewise.
8865         (Namespace.declspaces): Renamed from 'defined_names'.
8866         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
8867         DeclSpace instead of an IAlias.
8868         * tree.cs (Tree.AddDecl): Update.
8869
8870 2005-07-12  Raja R Harinath  <rharinath@novell.com>
8871
8872         * statement.cs (Block.Flags); Remove HasVarargs.
8873         (Block.HasVarargs): Move to ToplevelBlock.
8874         (Block.ThisVariable, Block.AddThisVariable): Likewise.
8875         (Block.Variables): Make protected.  Initialize variable hashtable
8876         if necessary.
8877         (Block.AddVariable): Update.
8878         (Block.Resolve): Update to changes.
8879         (ToplevelBlock.HasVarargs): New boolean.
8880         (ToplevelBlock.ThisVariable): Move here from Block.
8881         (ToplevelBlock.AddThisVariable): Likewise.
8882         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
8883         * expression.cs (This.ResolveBase): Update to changes.
8884         (ArglistAccess.DoResolve): Likewise.
8885
8886 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
8887
8888         Fix #75321
8889         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
8890
8891         * class.cs (TypeContainer.VerifyMembers): Distinguish between
8892         not used and not used & assigned.
8893         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
8894
8895 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
8896
8897         Fix #75053
8898         * expression.cs (Is.DoResolve): null is never provided type.
8899
8900 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
8901
8902         Fix #52496
8903         * cs-parser.jay: Less strict event error rule to catch more errors.
8904
8905 2005-07-08  Martin Baulig  <martin@ximian.com>
8906
8907         Fix test-iter-10.cs - distinguish whether we `yield' in a property
8908         gettter (allowed) or setter (not allowed).
8909
8910         * class.cs (Accessor): Implement IIteratorContainer.
8911         (Accessor.Yields): New public field.
8912         (PropertyBase.PropertyMethod.Define): Handle iterators on a
8913         per-accessor basis.
8914
8915         * cs-parser.jay
8916         (get_accessor_declaration, set_accessor_declaration): Set the
8917         `yields' flag on the accessor, not the property.
8918         (property_declaration): Do the iterators check on a per-accessor
8919         basis and not for the whole property.
8920
8921 2005-07-08  Martin Baulig  <martin@ximian.com>
8922
8923         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
8924         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
8925
8926 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
8927
8928         Fix #74975
8929         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
8930         (ExtractSecurityPermissionSet): Cope with self referencing security
8931         attributes properly.
8932
8933         * driver.cs (SetOutputFile): Made public property OutputFile.
8934
8935 2005-07-07  Raja R Harinath  <rharinath@novell.com>
8936
8937         Fix #75486.
8938         * class.cs (TypeContainer.first_nonstatic_field): Rename from
8939         has_nonstatic_fields.  Make into a FieldBase pointer.
8940         (TypeContainer.AddField): Add CS0282 check.
8941         (TypeContainer.EmitType): Update.
8942
8943 2005-07-06  Miguel de Icaza  <miguel@novell.com>
8944
8945         * cs-tokenizer.cs (consume_identifier): Do not create strings to
8946         compare if they start with __.
8947
8948 2005-07-06  Raja R Harinath  <rharinath@novell.com>
8949
8950         * statement.cs (Switch.SwitchGoverningType): Only look at
8951         UserCasts that don't need implicit standard conversions to one of
8952         the allowed switch types (Fixes test-322.cs).
8953         (LocalInfo.Resolve): Re-enable sanity-test.
8954
8955 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
8956
8957         * cs-tokenizer.cs (consume_identifier): Detect double undescores
8958         
8959         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
8960         
8961         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
8962
8963 2005-07-06  Raja R Harinath  <rharinath@novell.com>
8964
8965         Fix #75472.
8966         * ecore.cs (SimpleName.GetSignatureForError): Add.
8967         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
8968         (MemberAccess.GetSignatureForError): Add.
8969
8970 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
8971  
8972         The big error and warning messages review.
8973         
8974         * anonymous.cs,
8975         * assign.cs,
8976         * attribute.cs,
8977         * class.cs,
8978         * codegen.cs,
8979         * convert.cs,
8980         * cs-parser.jay,
8981         * cs-tokenizer.cs,
8982         * decl.cs,
8983         * delegate.cs,
8984         * doc.cs,
8985         * driver.cs,
8986         * ecore.cs,
8987         * enum.cs,
8988         * expression.cs,
8989         * flowanalysis.cs,
8990         * iterators.cs,
8991         * literal.cs,
8992         * location.cs,
8993         * modifiers.cs,
8994         * namespace.cs,
8995         * parameter.cs,
8996         * pending.cs,
8997         * report.cs,
8998         * rootcontext.cs,
8999         * statement.cs,
9000         * support.cs,
9001         * tree.cs,
9002         * typemanager.cs: Updated.
9003         
9004         * class.cs: (MethodCore.SetYields): Moved here to share.
9005         (PropertyMethod.Define): Moved iterator setup here.
9006         
9007         * iterators.cs: Add orig_method to have full access to parent
9008         container.
9009
9010 2005-07-05  Raja R Harinath  <rharinath@novell.com>
9011
9012         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9013         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9014         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9015         variable of struct type.
9016         * expression.cs (Unary.ResolveOperator): Update to change.
9017         (Indirection.VerifyFixed): Likewise.
9018         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9019         (ParameterReference.VerifyFixed): Value parameters are fixed.
9020         (This.VerifyFixed): Treat 'this' as a value parameter.
9021         * statement.cs (LocalInfo.IsFixed): Remove.
9022
9023 2005-07-01  Martin Baulig  <martin@ximian.com>
9024
9025         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9026         `ec.EmitThis ()' to get the correct scope.
9027
9028 2005-07-01  Martin Baulig  <martin@ximian.com>
9029
9030         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9031         instance is a ParameterReference; fixes #75299.
9032
9033 2005-07-01  Martin Baulig  <martin@ximian.com>
9034
9035         Reverted Marek's latest patch (r46725):
9036         - it contains structural changes which are neither mentioned in
9037           the ChangeLog nor explained anywhere; for example the additional
9038           argument of EmitContext's and Iterator's .ctor's and the
9039           TypeContainer.DefineMembers() change.
9040         - structural changes like this should go in in seperate patches
9041           and not be hidden in a huge patch which just seems to affect
9042           warnings and errors.
9043           a big and hard to understand patch.
9044         - it breaks iterators and causes regressions, for instance in
9045           test-iter-03.cs.      
9046
9047 2005-06-30  Raja R Harinath  <rharinath@novell.com>
9048
9049         Fix #75412.
9050         * expression.cs (Indexers.map): Remove.
9051         (Indexers.Append): Filter out inaccessible setters and getters.
9052         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9053
9054         Fix #75283.
9055         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
9056         Refactored from ...
9057         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9058         (FieldExpr.Emit, PropertyExpr.Emit): Update.
9059         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9060         * expression.cs (Invocation.EmitCall): Add CS0120 check.
9061
9062 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
9063
9064         Fix #75322
9065         * class.cs (FieldBase.GetInitializerExpression): One more field
9066         for backup.
9067
9068 2005-06-28  Miguel de Icaza  <miguel@novell.com>
9069
9070         * pending.cs: Do not define a proxy if the base method is virtual,
9071         it will be picked up by the runtime (bug 75270).
9072
9073 2005-06-08  Martin Baulig  <martin@ximian.com>
9074
9075         The big Iterators rewrite :-)
9076
9077         * iterators.cs: Rewrite this to use the anonymous methods framework.
9078
9079         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9080         before the TypeContainers; see 2test-21.cs.
9081
9082         * class.cs
9083         (TypeContainer.DefineType): Don't create a new EmitContext if we
9084         already have one (this only happens if we're an Iterator).
9085         (TypeContainer.Define): Also call Define() on all our iterators.
9086         (Method.CreateEmitContext): Added support for iterators.
9087
9088         * anonymous.cs
9089         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9090         (AnonymousContainer.CreateMethodHost): Moved here from
9091         AnonymousMethod and made abstract.
9092         (AnonymousContainer.CreateScopeType): New abstract method.
9093         (AnonymousContainer.IsIterator): New public property.
9094         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9095         get the ScopeTypeBuilder rather than manually defining it here. 
9096         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9097         iterators here.
9098
9099         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9100         before RootContext.DefineTypes().
9101
9102         * codegen.cs (EmitContext.RemapToProxy): Removed.
9103         (EmitContext.CurrentAnonymousMethod): Changed type from
9104         AnonymousMethod -> AnonymousContainer.
9105         (EmitContext.ResolveTopBlock): Protect from being called twice.
9106         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9107         (EmitContext.EmitThis): Removed the iterators hacks; use the
9108         anonymous methods framework for that.
9109
9110         * statement.cs
9111         (ToplevelBlock.Container): Make this a property, not a field.
9112         (ToplevelBlock.ReParent): New public method; move the
9113         ToplevelBlock into a new container.
9114         (Foreach.TemporaryVariable): Simplify.
9115
9116 2005-06-05  Martin Baulig  <martin@ximian.com>
9117
9118         * statement.cs (LocalInfo.CompilerGenerated): New flag.
9119         (Block.AddTemporaryVariable): New public method; creates a new
9120         `LocalInfo' for a temporary variable.
9121         (Block.EmitMeta): Create the LocalBuilders for all the temporary
9122         variables here.
9123         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9124         non-iterator variables.
9125
9126 2005-06-05  Martin Baulig  <martin@ximian.com>
9127
9128         * statement.cs (Foreach.TemporaryVariable): Create the
9129         LocalBuilder in the Emit phase and not in Resolve since in some
9130         situations, we don't have an ILGenerator during Resolve; see
9131         2test-19.cs for an example.
9132
9133 2005-06-04  Martin Baulig  <martin@ximian.com>
9134
9135         **** Merged r45395 from GCS ****
9136
9137         The big Foreach rewrite - Part II.
9138
9139         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9140         with `PropertyInfo ienumerator_getcurrent'.
9141
9142         * codegen.cs (VariableStorage): Removed.
9143
9144         * statement.cs
9145         (Foreach): Derive from Statement, not ExceptionStatement.
9146         (Foreach.CollectionForeach): New nested class.  Moved all the code
9147         dealing with collection foreach here.
9148         (Foreach.ForeachHelperMethods): Removed.
9149         (Foreach.TemporaryVariable): Implement IMemoryLocation.
9150
9151 2005-05-23  Martin Baulig  <martin@ximian.com>
9152
9153         * statement.cs (Try.DoResolve): Don't create a `finally' if we
9154         don't need to.  Fix #75014.
9155
9156 2005-05-20  Martin Baulig  <martin@ximian.com>
9157
9158         Merged r44808 from GMCS.
9159
9160         * class.cs (TypeContainer.CircularDepException): Removed.
9161         (TypeContainer.DefineType): Removed the `InTransit' stuff.
9162         (TypeContainer.CheckRecursiveDefinition): Check for circular class
9163         (CS0146) and interface (CS0529) dependencies here.
9164
9165 2005-06-21  Raja R Harinath  <rharinath@novell.com>
9166
9167         * expression.cs (Invocation.EmitCall): Fix initialization
9168         'this_call' to reflect current behaviour.  Fix indentation.
9169
9170         * convert.cs (FindMostEncompassedType): Add two trivial special
9171         cases (number_of_types == 0 || number_of_types == 1).
9172         (FindMostEncompasingType): Likewise.
9173
9174 2005-06-17  Raja R Harinath  <rharinath@novell.com>
9175
9176         Some cleanups preparing for the fix of #75283.
9177         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9178         error testing.
9179         (EventExpr.InstanceResolve): Likewise.
9180         (EventExpr.DoResolve): Remove redundant checks.
9181
9182 2005-06-10  Duncan Mak  <duncan@novell.com>
9183
9184         * cs-tokenizer.cs (process_directives): New flag for controlling
9185         the processing of preprocessor directives.
9186         (x_token): After seeing a '#', return Token.NONE instead of going
9187         to handle_preprocessing_directive() when not processing
9188         directives. This avoids unnecessary processing during the token peek in
9189         is_punct().
9190
9191         This fixes #74939.
9192
9193         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9194         the existing error reporting methods instead of Report.Error.
9195
9196         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9197         after Raja's rewrite.
9198
9199 2005-06-08  Miguel de Icaza  <miguel@novell.com>
9200
9201         * class.cs: Small fix.
9202
9203 2005-06-08  Raja R Harinath  <rharinath@novell.com>
9204
9205         Fix #75160.
9206         * class.cs (GetPartialBases): Fix return value check of
9207         part.GetClassBases.
9208
9209 2005-06-07  Raja R Harinath  <rharinath@novell.com>
9210
9211         Ensure that partial classes are registered in their enclosing
9212         namespace.  Initial part of fix of #75160.
9213         * tree.cs (Tree.RecordDecl): Add new namespace argument.
9214         Register declspace with namespace here, not in
9215         DeclSpace.RecordDecl.
9216         * cs-parser.jay: Pass namespace to RecordDecl.
9217         * class.cs (PartialContainer.Create): Likewise.
9218         (ClassPart.DefineType): New sanity-check.  Throws an exception if
9219         called.
9220         * decl.cs (Declspace.RecordDecl): Remove.
9221         * namespace.cs (NamespaceEntry.DefineName): Remove.
9222
9223 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
9224
9225         * rootcontext.cs: Reset TargetExt as well.
9226
9227 2005-06-03  Raja R Harinath  <rharinath@novell.com>
9228
9229         * ecore.cs (Expression.Resolve): Emit CS0654 error when
9230         -langversion:ISO-1.
9231
9232 2005-06-02  Raja R Harinath  <rharinath@novell.com>
9233
9234         Fix #75080, cs0119.cs.
9235         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
9236         of ...
9237         (Expression.Resolve): ... this.  Use it.  Remove bogus code
9238         allowing ExprClass.Type and ExprClass.Namespace for
9239         ResolveFlags.VariableOrValue.
9240         (Expression.Resolve) [1-argument variant]: Change default resolve
9241         flags based on language version.
9242         (Expression.Error_UnexpectedKind): Use a simple string array
9243         rather than an ArrayList.
9244         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9245         not ExprClass.Type.
9246         (TypeOfVoid.DoResolve): Likewise.
9247         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
9248         flags argument -- it always has the same value.
9249
9250 2005-05-31  Raja R Harinath  <rharinath@novell.com>
9251
9252         Fix #75081.
9253         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9254         Use it in the error message.
9255         * assign.cs, expression.cs, statement.cs: Update.
9256
9257 2005-05-30  Raja R Harinath  <rharinath@novell.com>
9258
9259         Fix #75088.
9260         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9261         the "almostMatchedMember" case too.
9262         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9263         that failed the accessibility checks to 'almost_match'.
9264
9265 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
9266
9267         * attribute.cs: Use internal MethodBuilder methods to set
9268         ExactSpelling and SetLastError on PInvoke methods, instead
9269         of passing them via charset.  Fixes #75060.
9270
9271 2005-05-27  Raja R Harinath  <rharinath@novell.com>
9272
9273         * parameter.cs (Parameter): Remove TODO comment.
9274         (Parameter.DefineParameter): Remove Location parameter.
9275         (Parameters.LabelParameters): Likewise.
9276         * class.cs (Constructor.Emit): Update to change.
9277         (MethodData.Emit): Likewise.
9278         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
9279         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9280
9281 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
9282
9283         * parameter.cs,
9284           Removed Parameters.Location and added Parameter.Location instead.
9285           Removed Location parameter from Emit() and GetSignature().
9286         * anonymous.cs,
9287           class.cs,
9288           cs-parser.jay,
9289           delegate.cs,
9290           iterators.cs,
9291           statement.cs :
9292           Modified all related calls.
9293
9294 2005-05-26  Raja R Harinath  <rharinath@novell.com>
9295
9296         Improve user-defined conversion handling.
9297         * convert.cs (GetConversionOperators): Rewrite.  Return only the
9298         applicable operators.
9299         (AddConversionOperators): New.  Helper for GetConversionOperators.
9300         (FindMostEncompassedType, FindMostEncompassingType): Verify that
9301         there is only one most encompassed/encompassing type.
9302         (FindMostSpecificSource, FindMostSpecificTarget): Remove
9303         "applicable operator" handling.
9304         (UserConversion): Move cache here from GetConversionOperators.
9305         Directly cache the chosen operator, rather than the whole
9306         MethodGroup.
9307         (ExplicitNumericConversion): Fix buggy implementation of Decimal
9308         case.  Allow conversion of decimal to sbyte and byte too.
9309         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9310         New static methods.  Used to avoid allocating EmptyExpressions in
9311         convert.cs.
9312
9313 2005-05-24  Duncan Mak  <duncan@novell.com>
9314
9315         * ecore.cs (CastFromDecimal): New class for casting a decimal to
9316         another class, used in Convert.ExplicitNumericConversion.
9317         (CastToDecimal): New class, similar to above, but casts to
9318         System.Decimal, used in Convert.ImplicitNumericConversion and also
9319         in explicit convesion from double/float to decimal.
9320
9321         * convert.cs (ImplicitNumericConversion): Handle implicit
9322         conversions to System.Decimal.
9323         (ExplicitNumericConversion): handle explicit conversions to
9324         System.Decimal.
9325
9326         This fixes #68711.
9327         
9328 2005-05-20  Miguel de Icaza  <miguel@novell.com>
9329
9330         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9331         know the type at this stage, just break through.   Fixes #75008 
9332
9333 2005-05-19  Martin Baulig  <martin@ximian.com>
9334
9335         * delegate.cs
9336         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9337         to disable error reporting.
9338
9339         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9340         here since we don't want to report an error; see the new test-336.cs.
9341
9342 2005-05-19  Raja R Harinath  <rharinath@novell.com>
9343
9344         * statement.cs (ToplevelBlock.GetParameterReference)
9345         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9346         Move here from class Block.
9347         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9348         * expression.cs (ParameterReference.DoResolveBase): Likewise.
9349
9350 2005-05-18  Martin Baulig  <martin@ximian.com>
9351
9352         Fix #74978.
9353
9354         * flowanalysis.cs
9355         (FlowBranching.Reachability): Add non-static public And() and Or()
9356         methods.
9357         (FlowBranchingSwitch): New class; do the `break_origins' thing
9358         like in FlowBranchingLoop.
9359         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9360         reachability, not just locals and parameters.
9361         (FlowBranching.MergeChild): Remove some of the hacks for loop and
9362         switch; MergeBreakOrigins() now takes care of that.
9363
9364 2005-05-18  Martin Baulig  <martin@ximian.com>
9365
9366         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9367         a loop and may leave it, reset the barrier; fixes #74974.
9368
9369 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
9370         
9371         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9372         is back.
9373         
9374         * cs-parser.jay: Catch more lexical errors.
9375         
9376         * report.cs: Add one more Error method.
9377         
9378         * rootcontext.cs,
9379         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9380
9381 2005-05-17  Martin Baulig  <martin@ximian.com>
9382
9383         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9384         #70970. 
9385
9386 2005-05-16  Raja R Harinath  <rharinath@novell.com>
9387
9388         Fix test-382.cs.  Emit values of decimal constants.
9389         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9390         Carved out of ...
9391         (TypeContainer.AddField): ... this.
9392         (TypeContainer.EmitFieldInitializers): Allow the list of fields
9393         with initializers to include 'Const's.
9394         (ClassPart.RegisterFieldForInitialization): Forward to
9395         PartialContainer.
9396         * const.cs (Const.Const): Pass initializer to base class.
9397         (Const.Define): In case of decimal constants, register them for
9398         initialization in a static constructor.
9399
9400 2005-05-14  Martin Baulig  <martin@ximian.com>
9401
9402         * statement.cs (Block.Resolve): Correctly handle unreachable code;
9403         do not call ResolveUnreachable() on unreachable statements in
9404         here, see the comment in the source code.
9405
9406 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9407
9408         Fix #74934.
9409         * expression.cs (BinaryResolveOperator): If one of the operands of
9410         an equality comparison is 'null' and the other is a pointer type,
9411         convert the null to a NullPointer.
9412         * convert.cs (ImplicitReferenceConversion): If the expression is a
9413         NullLiteral and the target type is a pointer type, return a
9414         NullPointer instead.
9415         (ImplicitConversionStandard): Likewise.
9416
9417 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
9418         
9419         * cs-parser.jay: Set readonly context based on special constructs.
9420         
9421         * expression.cs (LocalVariableReference.DoResolveBase): Improved
9422         readonly variable error handling.
9423         
9424         * rootcontext.cs (EmitCode): Don't verify members when error
9425         occurred.
9426         
9427         * statement.cs (LocalInfo): Add reaodnly context information.
9428         (SetReadOnlyContext, GetReadOnlyContext): New methods.
9429
9430 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9431
9432         * statement.cs (Block.Resolve): Revert change below.  Modify fix
9433         for #74041 to initialize 'resolved' to false only for explicit
9434         blocks.  Fixes #74873.
9435
9436 2005-05-12  Raja R Harinath  <harinath@gmail.com>
9437
9438         Fix #74920.
9439         * typemanager.cs (unmanaged_enclosing_types): New.
9440         (IsUnmanagedType): Avoid infloops by using
9441         'unmanaged_enclosing_types' to talk with recursive invocations.
9442
9443 2005-05-13  Martin Baulig  <martin@ximian.com>
9444
9445         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9446         instance variable, not a local.  Fix #74873.
9447         (Block.ResolveUnreachable): Set it to true here.
9448
9449 2005-05-11  Duncan Mak  <duncan@novell.com>
9450
9451         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9452         continuing to process for 'arg'.
9453         (handle_preprocessing_directive): Check the argument of the #endif
9454         directive and report error CS1025 if there are any trailing
9455         characters.
9456
9457         According to the C# spec, having even whitespace after the #endif
9458         directive is illegal; however, because we call arg.TrimEnd ()
9459         beforehand, we have the same behavior as csc, allowing whitespace
9460         after the directive.
9461
9462         Fixes #74892.
9463
9464 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
9465
9466         Fix #74863.
9467         
9468         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9469         (Constructor.GetObsoleteAttribute): Implemented correctly.
9470
9471 2005-05-10  Martin Baulig  <martin@ximian.com>
9472
9473         * support.cs (ReflectionParameters.ParameterModifier): Use
9474         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9475         and `ParameterAttributes.In'.  Fixes #74884.
9476
9477 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
9478
9479         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9480         
9481         * expression.cs (Argument.GetParameterModifier): Turned to property.
9482         (Invocation.Error_InvalidArguments): Add more descriptive errors.
9483         
9484         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9485         its C# equivalent.
9486         
9487 2005-05-09  Raja R Harinath  <rharinath@novell.com>
9488
9489         Fix #74852.
9490         * decl.cs (MemberCache.AddMethods): Register override methods,
9491         rather than non-override methods.
9492         * typemanager.cs (RegisterOverride): New.
9493         (IsOverride): Update.
9494
9495 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
9496
9497         Fix #73105.
9498         
9499         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9500         recursive declaration.
9501         
9502         * statement.cs (Block.ResolveMeta): Report any error in resolving.
9503         
9504 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
9505
9506         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9507         
9508         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9509
9510 2005-05-05  Raja R Harinath  <rharinath@novell.com>
9511
9512         Fix #74797.
9513         * decl.cs (DeclSpace.FamilyAccessible): 
9514         Use TypeManager.IsNestedFamilyAccessible.
9515
9516         Fix reopened #64812.
9517         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9518         internal'.
9519
9520 2005-05-04  Raja R Harinath  <rharinath@novell.com>
9521             Abin Thomas  <projectmonokochi@rediffmail.com>
9522             Anoob V E  <projectmonokochi@rediffmail.com>
9523             Harilal P R  <projectmonokochi@rediffmail.com>
9524
9525         Fix #64812.
9526         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9527         allow access to all static members.
9528
9529 2005-05-04  Martin Baulig  <martin@ximian.com>
9530
9531         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9532
9533 2005-05-04  Martin Baulig  <martin@ximian.com>
9534
9535         Fix #74655.
9536
9537         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9538         section at the end; make things work if `default' is not the last
9539         section.        
9540
9541 2005-05-04  Martin Baulig  <martin@ximian.com>
9542
9543         Fix #70400.
9544
9545         * statement.cs (Switch): Replaced the `got_default' field with a
9546         `default_section' one.
9547         (Switch.CheckSwitch): Set `default_section' here.
9548         (Switch.Resolve): If we're a constant switch and the constant is
9549         not found, use the default section.
9550
9551 2005-05-03  Martin Baulig  <martin@ximian.com>
9552
9553         * expression.cs (ArrayAccess.EmitGetLength): New public method.
9554
9555         * statement.cs (Foreach.ArrayForeach): New nested class.
9556         (Foreach.TemporaryVariable): New nested class.
9557         (Foreach.EmitArrayForeach): Removed; this is now in the new
9558         ArrayForeach class.
9559
9560 2005-05-03  Raja R Harinath  <rharinath@novell.com>
9561
9562         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
9563         more conservative.
9564         (VerifyPendingMethods): Revert change below.
9565
9566         * typemanager.cs (IsOverride, RegisterNonOverride): New.
9567         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9568         that used to trigger warning -28.  Remove warning -28.
9569         * expression.cs (Invocation.OverloadResolve): Use
9570         TypeManager.IsOverride to distinguish override methods.
9571
9572         Fix #74773.
9573         * pending.cs (VerifyPendingMethods): If a base type implements the
9574         requested interface, don't bother checking individual methods of
9575         the base type.  As a side-effect, this prevents the creation of
9576         unnecessary proxies.
9577
9578 2005-05-02  Martin Baulig  <martin@ximian.com>
9579
9580         Fix #70182.
9581
9582         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9583         Also `And' the locals if the old vector is null.
9584         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9585         null; in this case we basically reset all the variables.        
9586
9587 2005-05-02  Martin Baulig  <martin@ximian.com>
9588
9589         Fix #74529.
9590
9591         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9592         Added `FlowBranching branching' argument; always `and' the
9593         variables instead of `or'ing them unless we're an infinite loop.
9594
9595         * statement.cs (While.Resolve): Create a new sibling unless we're
9596         infinite.       
9597
9598 2005-05-02  Martin Baulig  <martin@ximian.com>
9599
9600         Fix #70140.
9601
9602         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9603         arguments; use it instead of creating a new TopLevelBlock.
9604         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9605         our ConstructorInitializer.
9606
9607         * statement.cs
9608         (TopLevelBlock.TopLevelBranching): New public property.
9609         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9610         and create our `TopLevelBranching'.
9611
9612         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9613         anonymous method host, use `block.TopLevelBranching' rather than
9614         creating a new branching.
9615
9616 2005-04-20  Miguel de Icaza  <miguel@novell.com>
9617
9618         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9619         a ScopeInfo, if any of the current children is a child of the new
9620         entry, move those children there.
9621
9622 2005-04-30  Martin Baulig  <martin@ximian.com>
9623
9624         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9625         at the beginning of a SwitchSection.  Fix #73335.
9626
9627 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
9628
9629         Fix #74378
9630         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9631         
9632         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9633         (FieldExpr.DoResolve): Obsolete members are ignored for field
9634         initializers.
9635         
9636 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
9637
9638         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9639         of arrays detection.
9640
9641         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9642         verification.
9643         (Field.VerifyClsCompliance): Volatile fields are not compliant.
9644
9645         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9646         arrays report.
9647
9648 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
9649
9650         * cs-parser.jay: Use the prefered version of -unsafe in error
9651         message.
9652
9653 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
9654
9655         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9656         circumstances.
9657
9658 2005-04-20  John Luke  <john.luke@gmail.com>
9659
9660         * driver.cs: fix typo in error message, --outout to --output
9661
9662 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
9663
9664         * codegen.cs (InRefOutArgumentResolving): New field.
9665         
9666         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9667         fields outside contructor.
9668         
9669         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
9670         
9671 2005-04-19  Miguel de Icaza  <miguel@novell.com>
9672
9673         * anonymous.cs (CaptureContext.EmitParameterInstance): The
9674         parameter code was not completed ever, so it was not as up-to-date
9675         as local variables.  Must finish it.
9676
9677         The bug fix was to compare the Toplevel of the block, not the
9678         current block.  Thanks for Ben for pointing this out. 
9679
9680 2005-04-19  Raja R Harinath  <rharinath@novell.com>
9681
9682         * decl.cs (AddMethods): Use the declaring type of the problem
9683         method to determine if we want to squash a warning.
9684
9685 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
9686
9687         * attribute.cs: Removed debug output.
9688
9689         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
9690         
9691         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
9692         Report.Stderr.
9693         
9694 2005-04-18  Raja R Harinath  <rharinath@novell.com>
9695
9696         Fix #74481.
9697         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
9698         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
9699         all null comparisons against reference types.
9700
9701 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
9702
9703         Fix# 74565
9704         * class.cs (TypeContainer.CircularDepException) New nested
9705         exception class.
9706         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
9707         (TypeContainer.DefineType): Removed error, reset InTransit before
9708         exit.
9709         (Class.DefineType): Throw exception when is in Transit.
9710         Catch exception and report error.
9711         (Struct.DefineType): Throw exception when is in Transit.
9712         Catch exception and report error.
9713         (Interface.DefineType): Throw exception when is in Transit.
9714         Catch exception and report error.
9715
9716         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
9717         handle nested exception handlers.
9718
9719         * flowanalysis.cs (InTryWithCatch): New method, search for try with
9720         a catch.
9721
9722         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
9723         InFinally and InCatch storage.
9724
9725         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
9726         (Catch.Resolve): Set and Restore ec.InCatch.
9727         (Try.Resolve): Set and Restore ec.InFinally.
9728         (Try.HasCatch): True when try has catch.
9729
9730 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
9731
9732         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
9733           for the same event member, so exclude such cases from warning 419.
9734           Fixed bug #74633.
9735
9736 2005-04-16  Miguel de Icaza  <miguel@novell.com>
9737
9738         * expression.cs (Binary.ResolveOperator): Apply patch from John
9739         Luke to fix bug 59864: operators &, | and ^ on enumerations
9740         require that the same enum type on both sides.
9741
9742         * driver.cs: Add warnings to old flag usage, this is to assist
9743         people who produce Makefiles and hope that the Makefiles will be
9744         used on Windows.
9745
9746         * class.cs (TypeContainer.EmitType): Moved the definition of the
9747         special $PRIVATE$ field from the resolve phase to the Emit phase.
9748         During resolve we do not know if we are a struct with
9749         HasExplicitLayout, we know this only after the attributes for the
9750         type are emitted.
9751
9752         Set the FieldOffset to zero on the dummy field that we create for
9753         the class.   Fixes 74590.
9754
9755 2005-04-16  Raja R Harinath  <rharinath@novell.com>
9756
9757         Fix #73834.
9758         * ecore.cs (PropertyExpr.resolved): New.
9759         (DoResolve): Use it to handle a case of double resolution here.
9760         Handle a case of identical-name-and-type-name.
9761         * expression.cs (ArrayCreation.CheckIndices): Avoid double
9762         resolution by storing the results of expression resolution back
9763         into the "probes" array.
9764
9765 2005-04-15  Raja R Harinath  <rharinath@novell.com>
9766
9767         Fix cs0208-7.cs and cs0208-8.cs.
9768         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
9769         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
9770         error reporting to point out the reason a struct is not unmanaged.
9771
9772 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
9773
9774         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
9775           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
9776
9777 2005-04-13  Raja R Harinath  <rharinath@novell.com>
9778
9779         Fix #74528.
9780         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
9781         IdenticalNameAndTypeName here.
9782         (EventExpr.InstanceResolve): Likewise.
9783
9784 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
9785
9786         C# 2.0 DefaultCharSetAttribute implementation
9787         
9788         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
9789         which allows us to set GlobalNamespace for every resolve.
9790         (Attribute.ResolveArguments): Cut from Resolve.
9791         (Attribute.GetCharSetValue): Returns CharSet named argument.
9792         (Attribute.DefinePInvokeMethod): Gets default charset from
9793         module settings.
9794         (GlobalAttribute.ResolveAsTypeStep): Override.
9795         (GlobalAttribute.ResolveArguments): Override.
9796         
9797         * class.cs (TypeAttr): Is protected.
9798         
9799         * codegen.cs (ModuleClass.DefaultCharSet): New member.
9800         (ModuleClass.DefaultCharSetType): New memeber.
9801         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
9802         
9803         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
9804         charset from module.
9805         
9806         * delegate.cs (TypeAttr): Override.
9807         (Delegate.DefineType): Use this TypeAttr.
9808         
9809         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
9810         at very early stage (before types are defined) to resolve model
9811         module attributes. It will probably not work with corlib but it
9812         should be ok.
9813         
9814         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
9815         charset from module.
9816         
9817         * typemanager.cs (default_charset_type): New type.
9818
9819 2005-04-13  Raja R Harinath  <rharinath@novell.com>
9820
9821         * decl.cs (MemberCache.AddMethods): Don't warn if
9822         System.Object.Finalize has buggy MethodAttributes.
9823
9824         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
9825         removed below.
9826
9827 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
9828
9829         * doc.cs : detect ambiguous reference to overloaded members.
9830           Fixed bug #71603. MS 1.1 csc does not detect it.
9831
9832 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
9833
9834         * doc.cs : delegates must not be referenced with parameters.
9835           Fixed bug #71605.
9836
9837 2005-04-12  Miguel de Icaza  <miguel@novell.com>
9838
9839         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
9840
9841 2005-04-10  Miguel de Icaza  <miguel@novell.com>
9842
9843         * driver.cs (MainDriver): Stop processing if the CLS stage found
9844         errors. 
9845
9846         (CompilerCallableEntryPoint.InvokeCompiler): Always
9847         reset after execution;   Take a TextWriter argument for the
9848         output.
9849
9850         * report.cs: Use the error stream instead of hardcoding stderr. 
9851
9852 2005-04-09  Miguel de Icaza  <miguel@novell.com>
9853
9854         * class.cs: Reduce code paths to test, too small of an
9855         optimization to make it worth the extra testing.  Always perform
9856         it. 
9857
9858 2005-04-08  Raja R Harinath  <rharinath@novell.com>
9859
9860         Fix #74510.
9861         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
9862         operators that had errors reported on them.
9863
9864 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
9865
9866         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
9867         argument types.
9868         (Attribute.Resolve): Add named argument type checking.
9869         
9870         * class.cs (FixedField.Define): Use IsPrimitiveType
9871         
9872         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
9873         
9874         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
9875         unsafe parameter types.
9876         
9877         * statement.cs (Using.ResolveExpression): Add better error description.
9878         
9879         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
9880         
9881 2005-04-08  Raja R Harinath  <rharinath@novell.com>
9882
9883         Fix #74484.
9884         * attribute.cs (Attribute.GetAttributeUsage): Resolve
9885         AttributeUsageAttribute in the emitcontext of the attribute class,
9886         not in the emitcontext of the attributable entity it was attached to.
9887         * cs-parser.jay: Use 'current_class', not 'current_container',
9888         when creating a GlobalAttribute.
9889
9890 2005-04-08  Alp Toker  <alp@atoker.com>
9891
9892         * pending.cs: The fix to #58413 failed to compile methods implementing
9893         interfaces with/without params modifiers and vice versa, even though
9894         params modifiers aren't part of the signature. Make the modifier check
9895         less strict as in csc.
9896
9897 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
9898             Anoob V E  <projectmonokochi@rediffmail.com>
9899             Harilal P R  <projectmonokochi@rediffmail.com>
9900
9901         Fix #58413.
9902         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
9903         modifiers of pending methods.
9904         (PendingImplementation.PendingImplementation): Initialize it.
9905         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
9906         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
9907         with ParameterData.  Add check for modifiers.
9908         * class.cs (MethodData.Define): Update to changes.
9909
9910 2005-04-07  Raja R Harinath  <rharinath@novell.com>
9911
9912         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
9913
9914 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
9915
9916         * class.cs (PropertyMethod.Define): Check private accessor in abstract
9917         property.
9918         
9919         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
9920         
9921         * rootcontext.cs,
9922         * typemanager.cs: Registered RequiredAttributeAttribute.
9923         
9924 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
9925
9926         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
9927         Warning CS0169 is back at level 3.
9928         (IMethodData.SetMemberIsUsed): New method.
9929         
9930         * decl.cs (IsUsed): New value; moved from FieldBase.Status
9931         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
9932         
9933         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
9934
9935         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
9936         contants.
9937         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
9938         is used.
9939         
9940         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
9941         is used.
9942         
9943         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
9944         to avoid the problems with nested types.
9945
9946 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
9947             Anoob V.E  <projectmonokochi@rediffmail.com>
9948             Harilal P.R  <projectmonokochi@rediffmail.com>
9949             Raja R Harinath  <rharinath@novell.com>
9950
9951         Fix #73820.
9952         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
9953         attribute.
9954         * typemanager (GetConstructor): Make public.
9955
9956 2005-04-05  John Luke  <john.luke@gmail.com>
9957             Raja R Harinath  <rharinath@novell.com>
9958
9959         Fix #62232.
9960         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
9961         struct too.  Return false quicker in a few cases.
9962         (VerifyUnManaged): Use it.
9963
9964 2005-04-05  Raja R Harinath  <rharinath@novell.com>
9965
9966         Fix #74041.
9967         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
9968         not 'unreachable_seen'.
9969
9970 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
9971
9972         * attribute.cs (Attribute.GetValue): Removed unused.
9973         
9974         * codegen.cs (CodeGen.TrimExt): Removed unused.
9975         
9976         * cs-parser.jay (output): Removed unused.
9977         
9978         * cs-tokenizer.cs (hex_digits): Removed unused.
9979         
9980         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
9981         
9982         * expression.cs (Indirection.LoadExprValue): Removed unused.
9983         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
9984         
9985         * iterators.cs (Iterator.param_types): Removed unused.
9986         
9987         * statement.cs (Goto.block): Removed unused.
9988         (ToplevelBlock.did): Removed unused.
9989         (Switch.ResolveConstantSwitch): Removed unused.
9990
9991 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
9992
9993         * rootcontext.cs: Allow mcs to bootstrap with the compilation
9994         resetting thingy.
9995
9996 2005-04-01  Raja R Harinath  <rharinath@novell.com>
9997
9998         Fix #74232 and cs0208-3.cs.
9999         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10000         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10001         unmanaged type.  Don't use FieldBuilders when 't' is a
10002         TypeBuilder.  Use ModFlags and MemberType fields.
10003         * class.cs (MemberBase.member_type): Rename from MemberType.
10004         (MemberBase.MemberType): New property.  Determines member_type on
10005         demand.
10006         (MemberBase.DoDefine): Don't initialize MemberType here.
10007         (FieldMember.Define): Likewise.
10008
10009 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
10010
10011         Fix #74241
10012         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10013         Attributes are emitted there.
10014         
10015 2005-04-01  Raja R Harinath  <rharinath@novell.com>
10016
10017         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10018         keyword in 'partial enum' too.
10019         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10020         is not allowed).
10021         Report from Kamil Skalski <nazgul@omega.pl>.
10022
10023         Fix #74309.
10024         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10025         have partial containers too.
10026
10027         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10028         in block' checks to Block.CheckInvariantMeaningInBlock.
10029         * statement.cs (Block.GetKnownVariableInfo): Make private.
10030         (Block.IsVariableUsedInChildBlock): Remove.
10031         (Block.IsVariableUsedInBlock): Likewise.
10032         (Block.CheckInvariantMeaningInBlock): New.  Show location of
10033         conflicting declaration.
10034         (Block.AddVariable): Make error messages less long-winded and more
10035         specific.  Show location of conflicting declaration.
10036         * parameter.cs (Parameters.Location): New readonly property.
10037
10038 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10039
10040         Clean up semantics of invoking ResolveMemberAccess.
10041         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10042         can have an instance, ensure that we pass in a non-TypeExpression
10043         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
10044         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10045         argument.  Update to changes and simplify.
10046         (FieldExpr.Emitinstance): Remove CS0120 check.
10047         (PropertyExpr.EmitInstance): Likewise.
10048         * expression.cs (Argument.Resolve): Likewise.
10049         (Invocation.DoResolve): Update to changes in semantics of
10050         InstanceExpression.
10051
10052 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
10053
10054         Fix #74241
10055         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10056         customization.
10057         
10058         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10059
10060 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10061
10062         Fix difference in behaviour with commandline invocation.
10063         * driver.cs (Driver.Reset): New.
10064         (CompilerCallableEntryPoint): Call it.
10065
10066         * statement.cs (If.Resolve): Avoid spurious "uninitialized
10067         variable" warnings if the boolean expression failed to resolve.
10068
10069 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
10070
10071         * attribute.cs: Fix the union of several permissions when some of them
10072         are unrestricted (so the result isn't an unrestricted permission set).
10073         Fix #74036.
10074
10075 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10076
10077         * ecore.cs (MemberExpr): New class.  Convert from interface
10078         IMemberExpr.
10079         (MemberExpr.ResolveMemberAccess): Refactor and move here from
10080         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
10081         error checks.
10082         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10083         (MethodGroupExpr.IsExplicitImpl): Remove.
10084         (Expression.GetFieldFromEvent): Remove.
10085         (SimpleName.MemberStaticCheck): Remove.
10086         (SimpleName.DoSimpleNameResolve): Update to changes.
10087         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10088         (MemberAccess.IdenticalNameAndTypeName): Remove.
10089         (MemberAccess.error176): Move to MemberExpr.
10090         (MemberAccess.DoResolve): Update to changes.
10091         (BaseAccess.DoResolve): Likewise.
10092
10093 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
10094
10095         C# 2.0 Conditional attribute class implementation
10096         
10097         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10098         Analyzes class whether it has attribute which has ConditionalAttribute
10099         and its condition is not defined.
10100         
10101         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10102         (Class.IsExcluded): New method. Search for at least one defined
10103         condition in ConditionalAttribute of attribute class.
10104
10105 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10106
10107         * ecore.cs (PropertyExpr): Derive from Expression, not
10108         ExpressionStatement.
10109         (PropertyExpr.EmitStatement): Remove.
10110
10111 2005-03-29  Raja R Harinath  <rharinath@novell.com>
10112
10113         Fix #74060.
10114         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10115         internal field "value__" of an enum be private.  The examples for
10116         "value__" that I found on MSDN all used FieldAttributes.Private.
10117
10118         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10119         Don't mention IL method attribute names.
10120
10121         Fix #47991.  Remove a TODO.
10122         * statement.cs (Block.Toplevel): Make into a field.
10123         (Block.Parameters): Move into ToplevelBlock.
10124         (Block.known_variables): Rename from child_variable_names.
10125         (Block.Block): Remove variants that take Parameters.  Initialize
10126         'Toplevel' with the immediately surrounding toplevel block.
10127         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
10128         LocalInfo parameter.
10129         (Block.GetKnownVariableInfo): New.
10130         (Block.IsVariableNameUsedInChildBlock): Update.
10131         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
10132         the block, even though it may not be in scope.
10133         (Block.AddVariable): Remove Parameters parameter.  Use
10134         Toplevel.Parameters instead.
10135         (Block.AddConstant): Remove Parameters parameter.
10136         (Block.GetParameterReference): Update to use Toplevel.Parameters.
10137         (Block.IsParamaterReference): Likewise.
10138         (Block.IsLocalParameter): Likewise.  Simplify a lot.
10139         (ToplevelBlock.Parameters): New.  Moved from Block.
10140         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
10141         initialize Parameters to a non-null value.
10142         * cs-parser.jay: Update to changes.
10143         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10144         simple names that mean different things in the same block.  Use
10145         Block.IsVariableNameUsedInBlock.
10146
10147 2005-03-28  Raja R Harinath  <rharinath@novell.com>
10148
10149         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10150         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10151         GetTypeHandle.  It is possible for a reflected type to derive from
10152         a TypeBuilder (e.g., int[] derives from the TypeBuilder
10153         System.Array during mscorlib compilation).
10154         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10155         contain a method_hash, don't create one either.  Don't create a
10156         deep copy of the base cache's method_hash.
10157         (MemberCache.SetupCache): Rename back from DeepCopy.
10158         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10159         already initialized.  If we see an override function, add its
10160         underlying base virtual function to the member_hash too.
10161
10162         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10163
10164 2005-03-26  Raja R Harinath  <harinath@acm.org>
10165
10166         Fix #73038.
10167         * assign.cs (Assign.DoResolve): When the RHS of an assignment
10168         fails to resolve, ensure that the LHS is still resolved as an
10169         lvalue.
10170
10171 2005-03-25  Raja R Harinath  <harinath@acm.org>
10172
10173         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10174         ec.ContainerType.
10175         (Enum.current_ec): Remove.
10176         (Enum.LookupEnumValue): Remove EmitContext argument.
10177         Just uses the one created during DefineType.
10178         (Enum.FindMembers): Update.
10179         * expression.cs (MemberAccess.DoResolve): Update.
10180
10181 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
10182
10183         * assign.cs (Assign.DoResolve): Check for CS1717 when
10184         source and target are same (uses Equals).
10185
10186         * expression.cs (LocalVariableReference, ParameterReference,
10187         This): Implemented Equals, GetHashCode.
10188
10189         * statement.cs (Block.GetParameterReference): Removed useless
10190         local variable.
10191
10192 2005-03-22  Raja R Harinath  <rharinath@novell.com>
10193
10194         Fix cs0128.cs
10195         * statement.cs (Block.AddVariable): Ensure that we skip implicit
10196         blocks before deciding whether the error is cs0136 or cs0128.
10197
10198         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10199         (using_alias_directive, using_namespace_directive): Pass
10200         MemberName, not an expression to Namespace.UsingAlias and
10201         Namespace.Using.
10202         (MakeName): Use the MemberName of the namespace.
10203         * namespace.cs (Namespace.MemberName): New.
10204         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10205         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10206         Likewise.
10207         * decl.cs (MemberName.Name): Make readonly.
10208         (MemberName.FromDotted): New "constructor".
10209         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10210         (MemberCore.Name): Compute from MemberName on demand.
10211         (MemberCore.SetMemberName): Provide a way to change the
10212         MemberName.
10213         (MemberCore.AddToContainer): Don't take a fullname parameter.
10214         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10215         fully qualified name of the container to the member name.
10216         (TypeContainer.AddToTypeContainer): Use a fully qualified name
10217         only if the type is a member of the root container.
10218         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10219         MemberName.Left rather than searching for an embedded ".".
10220         (PartialContainer.CreatePart): Update to changes in RootContext.
10221         (MemberBase.ShortName): Turn into a property.  Use
10222         MemberCore.SetMemberName.
10223         (MemberBase.ExplicitInterfaceName): Remove.
10224         (MemberBase.UpdateMemberName): Remove.
10225         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10226         (PropertyBase.SetMemberName): New override.
10227         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10228         (Tree.GetDecl): New.
10229         (Tree.AllDecls): Rename from Decls.
10230         * attribute.cs, enum.cs, report.cs: Update to changes.
10231         * driver.cs (MainDriver): Use MemberName.FromDotted on
10232         RootContext.MainClass.
10233
10234 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
10235
10236         * class.cs (FixedField.Define): Check for CS1664 and more sanity
10237         checks.
10238
10239         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10240
10241 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
10242
10243         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10244         property accessor modifiers.
10245
10246         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10247         fixed buffer attribute (CS1716).
10248         (PropertyMethod.HasCustomAccessModifier): When property accessor
10249         has custom modifier.
10250
10251         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10252         modifiers.
10253         (PropertyExpr.DoResolveLValue): Add CS0272.
10254
10255 2005-03-17  Miguel de Icaza  <miguel@novell.com>
10256
10257         * convert.cs: When converting to a pointer, use the proper Conv.U
10258         or Conv.I depending on the source data type.
10259
10260         * cs-tokenizer.cs: Make the size for large decimal constants,
10261         fixes #72957.
10262
10263 2005-03-17  Martin Baulig  <martin@ximian.com>
10264
10265         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10266         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
10267
10268 2005-03-17  Martin Baulig  <martin@ximian.com>
10269
10270         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10271         to bool so we can return an error condition.
10272         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10273         returned an error.
10274
10275 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
10276
10277         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10278         attributes.
10279
10280 2005-03-16  Raja R Harinath  <rharinath@novell.com>
10281
10282         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10283         Refactor to avoid traversing the list of assemblies, and to avoid
10284         string concatenation.
10285         * typemanager.cs (guid_attr_type): Remove.
10286         (negative_hits, pointers, references): Remove hashes.
10287         (type_hash): New.
10288         (GetConstructedType): New.  Uses type_hash to handle constructed
10289         types (arrays, references, pointers).
10290         (GetReferenceType, GetPointerType): Use it.
10291         (GetNestedType): New.  Uses type_hash to handle nested types of
10292         reflected types.
10293         (LookupType, LookupTypeDirect): Remove.
10294         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
10295         'types' hash and LookupTypeReflection directly.
10296         (params_string, params_object): Use GetConstructedType.
10297         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
10298         top-level types.
10299         (Namespace.Lookup): Use cached_types.
10300         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10301         provided by old TypeManager.LookupType.
10302         * rootcontext.cs (MakeFQN): Remove.
10303         * decl.cs (DeclSpace.MakeFQN): Likewise.
10304         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10305         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10306         TypeManager.GetConstructedType.
10307         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10308
10309 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
10310
10311         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10312         indexers.
10313
10314         * cs-parser.jay: Reports CS1527 for any namespace element.
10315
10316         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10317         Added CS0407.
10318
10319         * expression.cs (ParameterReference.IsAssigned): Changed error to
10320         CS0269.
10321         (Error_WrongNumArguments): Moved CS0245 detection here.
10322
10323         * statement.cs (Return.Resolve): Add CS1622 report.
10324
10325 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
10326
10327         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10328
10329 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
10330
10331         * attribute.cs expression.cs: Get rid of some allocations.
10332
10333 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
10334
10335         * doc.cs : just eliminate the latest change.
10336
10337 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10338
10339         * doc.cs : commented out the latest change. It breaks xml-030.cs
10340
10341 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10342
10343         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10344           fail. So invoke CreateType() in FindDocumentedType().
10345
10346 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10347
10348         * cs-tokenizer.cs : added IsKeyword().
10349         * doc.cs : Detect keyword incorrectly used as identifier.
10350           Allow identifiers prefixed by @.
10351
10352 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
10353
10354         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10355         It caused exception in namespace resolving (again!).
10356         
10357         * class.cs (Class.ctor): Removed exit.
10358         (PropertyMethod.ctor): ditto.
10359         
10360         * codegen.cs (Codegen.Reset): Reset static data.
10361         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10362         
10363         * cs-tokenizer.cs (Cleanup): Removed.
10364         
10365         * driver.cs (GetSystemDir): Rewrote to one line command.
10366         It caused problem with unloaded dynamic modules.
10367         (UnixParseOption): Removed Exit.
10368         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10369         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10370         Now can be mcs used as library.
10371         
10372         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10373         empty location.
10374         
10375         * location.cs (Reset): Reset static data.
10376         
10377         * namespace.cs (Reset): Reset static data.
10378         
10379         * report.cs (Report.Reset): Reset static data.
10380         
10381         * rootcontext.cs (RootContext.Reset): Reset static data.
10382         
10383         * tree.cs (RootTypes.ctor): Use Location.Null
10384         
10385         * typemanager.cs (TypeManager.Reset): Reset static data.
10386         (CoreLookupType): Removed Exit.
10387         (TypeHandle.Reset): Reset static data.
10388         
10389 2005-03-10  Raja R Harinath  <rharinath@novell.com>
10390
10391         Fix #73516.
10392         * typemanager.cs (ComputeNamespaces): Import namespaces from
10393         referenced modules too.
10394
10395 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10396
10397         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10398         than '.'.
10399
10400 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10401
10402         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10403         enclosing DeclSpace.  This ensures that a name-lookup populates
10404         more caches and there are fewer 'TypeExpression's.  Carve out
10405         nested type lookup into ...
10406         (LookupNestedTypeInHierarchy): ... this.
10407
10408 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10409
10410         Clean up a few partial-class semantics.  
10411         Fixes test-357.cs and cs1618-2.cs.
10412         * cs-parser.jay (struct_declaration): Use 'current_class' as
10413         parent of newly-created struct.  Remove call to Register ().
10414         Use 'pop_current_class' to complete handing the current struct.
10415         (interface_declaration): Likewise.
10416         (class_declaration): Likewise.
10417         (enum_declaration): Use 'current_class' as parent of newly created
10418         enum.
10419         (delegate_declaration): Likewise.
10420         (pop_current_class): New function.  This is used to handle closing
10421         up the 'current_class' and 'current_container', and pointing them
10422         to the enclosing class/container.
10423         (CSharpParser): Initialize 'current_class' too.
10424         * decl.cs (MemberCore): Add check for invariant: a partial
10425         container is not a parsed entity, and thus does not enclose any
10426         parsed members.
10427         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10428         (DeclSpace.BaseTypeExpr): Use it.
10429         (DeclSpace.LookupType): Add check for invariant.
10430         * class.cs (TypeContainer): Add check for invariant: a nested
10431         class should have the same NamespaceEntry as its enclosing class.
10432         (TypeContainer.EmitFieldInitializers): Make virtual.
10433         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10434         MemberCore.
10435         (TypeContainer.Register): Remove.
10436         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10437         null.  Use TypeResolveEmitContext for resolving base types and
10438         interfaces.  Move initialization of Parts.TypeBuilder here from
10439         ...
10440         (TypeContainer.DefineNestedTypes): ... here.
10441         (PartialContainer): Take a Namespace not a NamespaceEntry.
10442         (PartialContainer.Create): Don't use Register.  Call the
10443         appropriate Add... function directly.
10444         (ClassPart): Take both the PartialContainer and the enclosing
10445         class as constructor arguments.
10446         (ClassPart.EmitFieldInitializers): Override.
10447         (ClassPart.PartFindNestedTypes): Remove.
10448         (FieldBase.GetInitializerExpression): Resolve the initializer
10449         expression in the emit context of the enclosing class.
10450         * tree.cs (RootTypes): Remove Register ().
10451         
10452 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
10453
10454         * cs-parser.jay: Removed CS0134.
10455         
10456         * driver.cs: Removed CS1901.
10457         
10458         * expression.cs (SizeOf.DoResolve): Don't report CS0233
10459         for predefined types.
10460
10461 2005-03-07  Duncan Mak  <duncan@novell.com>
10462
10463         * codegen.cs (Save):  Catch UnauthorizedAccessException as
10464         well. Fixes bug #73454.
10465
10466 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
10467
10468         * cs-tokenizer.cs (xtoken): Add CS1035.
10469         
10470         * class.cs (MethodData.Define): Add CS0683.
10471         (FieldMember.ctor): Add CS0681.
10472
10473 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10474
10475         * ecore.cs (SimpleName.DoResolve): Rename from
10476         SimpleName.DoResolveAllowStatic.
10477         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10478         Pass 'intermediate' flag to MemberStaticCheck.
10479         (SimpleName.MemberStaticCheck): Skip "static check" only in case
10480         of "intermediate" lookups via MemberAccess.
10481         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
10482         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10483
10484 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10485
10486         Fix #73394.
10487         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10488         slipped in because of variable names that are identical to a
10489         builtin type's BCL equivalent ('string String;', 'int Int32;').
10490         (PropertyExpr.EmitInstance): Likewise.
10491
10492 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
10493
10494         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10495         
10496         * report.cs (warning_ignore_table): Made public.
10497
10498 2005-03-04  Raja R Harinath  <rharinath@novell.com>
10499
10500         Fix #73282.
10501         * class.cs (MethodData.Emit): Pass 'container' to
10502         container.GetObsoleteAttribute instead of 'container.Parent'.
10503
10504 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
10505
10506         * cs-parser.jay: Add 1534 error test.
10507
10508         * iterators.cs (Yield.CheckContext): Add error 1629.
10509         (Iterator.ctor): Save unsafe modifier.
10510         (MoveNextMethod.DoEmit): Restore unsafe context.
10511
10512         * namespace.cs (UsingAlias): Better error message.
10513
10514 2005-03-03  Dan Winship  <danw@novell.com>
10515
10516         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10517         the warning message [#73219]
10518
10519 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10520
10521         Fix compile with MCS 1.0.0.0.
10522         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10523         w_restore to not depend on string constant folding.
10524
10525 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10526
10527         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
10528         CS0246 check to users who passed 'silent = false'.
10529         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10530         check.
10531         (SimpleName.SimpleNameResolve): Update.
10532         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10533         (MemberAccess.IdenticalNameAndTypeName): Update.
10534         * doc.cs (FindDocumentedTypeNonArray): Update.
10535
10536 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
10537
10538         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10539         * parameters.cs (ComputeAndDefineParameters): Remove.
10540         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10541         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10542         Use GetParameterInfo.
10543
10544 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
10545
10546         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10547
10548 2005-03-02  Raja R Harinath  <rharinath@novell.com>
10549
10550         Unify DeclSpace.LookupType and DeclSpace.FindType.
10551         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
10552         is in charge of defining nested types on demand.
10553         (DeclSpace.LookupType): Use it when the current_type is a
10554         TypeBuilder.  Use LookupTypeDirect for reflected types.
10555         (DeclSpace.FindType): Remove.
10556         (DeclSpace.LookupInterfaceOrClass): Likewise.
10557         (DeclSpace.DefineTypeAndParents): Likewise.
10558         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10559         DeclSpace.LookupType.
10560         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10561         * typemanager.cs (LookupType): Simplify.
10562         (AddUserType): Remove type from negative_hits.
10563         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10564         * class.cs (TypeContainer.FindMembers): Move handling of nested
10565         types ...
10566         (TypeContainer.FindMembers_NestedTypes): ... here.
10567         (TypeContainer.FindNestedType): Implement override.
10568         (ClassPart.FindNestedType): Delegate to PartialContainer.
10569         (ClassPart.PartFindNestedType): Looks up the nested types of the
10570         part alone.
10571
10572 2005-03-02  Martin Baulig  <martin@ximian.com>
10573
10574         * class.cs (TypeContainer.DoDefineMembers): We also need a default
10575         static constructor in static classes.
10576
10577 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
10578
10579         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10580         sizeParamIndex is not specified.
10581
10582 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
10583
10584         Fix #73117
10585         * report.cs (WarningMessage.IsEnabled): Missing null check.
10586
10587 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10588
10589         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10590         in the fields and not in the properties.
10591
10592 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
10593
10594         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
10595         fields as well.
10596
10597 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10598
10599         * attribute.cs: Small refactoring (improved robustness).
10600         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10601         (ValidateGuid): Removed.
10602         (Resolve): Removed referenced to above mentioned.
10603         (GetAttributeUsage): Made private and changed to work without
10604         class assistance.
10605         (GetIndexerAttributeValue): Don't crash.
10606         (GetConditionalAttributeValue): Ditto.
10607         (GetClsCompliantAttributeValue): Ditto.
10608         (ExtractSecurityPermissionSet): All attributes exceptions are
10609         error 648.
10610         (GetPropertyValue): New helper.
10611         (GetMethodImplOptions): New method.
10612         (DefinePInvokeMethod): Reuse common code. Implemented handling of
10613         some missing properties.
10614         
10615         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10616         (Method.ApplyAttributeBuilder): Updated.
10617         
10618         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10619         exception.
10620
10621 2005-02-28  Raja R Harinath  <rharinath@novell.com>
10622
10623         Fix #73052.
10624         * report.cs (Report.SymbolRelatedToPreviousError): Handle
10625         non-simple types (array, pointer, reference).
10626
10627 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10628
10629         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10630
10631         * class.cs (MethodCore.IsDuplicateImplementation): Special error
10632         for operators.
10633         (Method.CheckBase): Catch wrong destructor here.
10634         (MethodData.Define): Add errors 550, 668.
10635
10636         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10637
10638         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10639
10640         * pending.cs (VerifyPendingMethods): Add error 551.
10641
10642         * typemanager.cs (CSharpName): Next error report helper.
10643
10644 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
10645
10646         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10647         attributes. Removed useless attribute double check.
10648         It saves almost 2MBs for corlib.
10649
10650 2005-02-25  Raja R Harinath  <rharinath@novell.com>
10651
10652         Fix #72924.
10653         * statement.cs (ExpressionStatement.Resolve): Make robust to being
10654         called twice in case of error.
10655
10656 2005-02-23  Chris Toshok  <toshok@ximian.com>
10657
10658         Fix compiler portions of #72827.
10659         * statement.cs (Block.Emit): call Begin/EndScope on the
10660         EmitContext instead of the ILGenerator.
10661
10662         * codegen.cs (EmitContext.BeginScope): new method, call
10663         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10664         we have one.)
10665         (EmitContext.BeginScope): same, but EndScope and CloseScope
10666
10667         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10668         offset and call the superclass's OpenScope(int) with it.
10669         (SymbolWriter.CloseScope): get the current il
10670         offset and call superclass's CloseScope(int) with it.
10671
10672 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
10673
10674         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
10675         CS1677 for out and ref as well.
10676
10677         * class.cs (Method.Define): Add error CS1599 detection.
10678         
10679         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
10680         
10681         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
10682         
10683         * delegate.cs (Delegate.Define): Add error CS1599 detection.
10684         
10685         * support.cs.cs (ModifierDesc): New helper method.
10686
10687 2005-02-23  Raja R Harinath  <rharinath@novell.com>
10688             Abin Thomas  <projectmonokochi@rediffmail.com>
10689             Anoob V E  <projectmonokochi@rediffmail.com>
10690             Harilal P R  <projectmonokochi@rediffmail.com>
10691
10692         Fix #57851, #72718.
10693         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
10694         MemberLookup (used for error reporting) actually returns a result.
10695         Fix error report number (122, not 112).
10696
10697 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
10698             Anoob V E  <projectmonokochi@rediffmail.com>
10699             Harilal P R  <projectmonokochi@rediffmail.com>
10700
10701         Fix #71134.
10702         * pending.cs (PendingImplementation.GetAbstractMethods):
10703         Find NonPublic members too.
10704
10705 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
10706
10707         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
10708         Fixed error 217.
10709         
10710         * class.cs (MethodCore.CheckMethodAgainstBase):
10711         Add error 239 report.
10712
10713 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10714
10715         Fix #68955.
10716         * expression.cs (Invocation.IsApplicable): Make public.
10717         (Invocation.IsParamsMethodApplicable): Likewise.
10718         * delegate.cs (Delegate.VerifyApplicability): Don't use
10719         Invocation.VerifyArgumentCompat for parameter applicability
10720         testing.  Use Invocation.IsApplicable and
10721         Invocation.IsParamsMethodApplicable.
10722
10723 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
10724
10725         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
10726         
10727         * class.cs (Operator.Define): Add error 217 report.
10728         
10729 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10730
10731         * namespace.cs (UsingEntry.Resolve): Undo change below.
10732
10733 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10734
10735         Fix #72756.
10736         * ecore.cs (Expression.MemberLookupFailed): Add argument to
10737         disable the error message when the extended MemberLookup also
10738         fails.
10739         (Expression.MemberLookupFinal): Update.
10740         (SimpleName.DoSimpleNameResolve): Update.
10741         * expression.cs (MemberAccess.ResolveNamespaceOrType):
10742         Don't use MemberLookupFinal.
10743         (New.DoResolve): Update.
10744         (BaseAccess.CommonResolve): Update.
10745
10746 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10747
10748         Fix #72732.
10749         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
10750         occured previously, don't resolve again.
10751
10752 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
10753
10754         Fix #69949
10755         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
10756         argument. Call ResolveAttributeUsage for unresolved.
10757         when types doesn't match ctor arguments.
10758         
10759         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
10760         for nested attribute classes.
10761         (Class.attribute_usage): Removed.
10762         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
10763         for attribute class.
10764         
10765         * ecore.cs (IsAttribute): Removed.
10766         
10767         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
10768         
10769         * rootcontext.cs (RegisterAttribute): Removed, attributes are
10770         now normal types.
10771         (attribute_types): Removed.
10772         (EmitCode): Global attributes are emited as the latest.
10773
10774 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
10775
10776         * class.cs (EmitFieldInitializers): Don't emit field initializer
10777         for default values when optimilization is on.
10778         
10779         * constant.cs (Constant.IsDefaultValue): New property.
10780         
10781         * driver.cs: Add /optimize handling.
10782         
10783         * constant.cs,
10784         * ecore.cs,
10785         * literal.cs: Implement new IsDefaultValue property.
10786         
10787         * rootcontext.cs (Optimize): New field, holds /optimize option.
10788
10789 2005-02-18  Raja R Harinath  <rharinath@novell.com>
10790
10791         Fix crasher in re-opened #72347.
10792         * namespace.cs (Namespace.Lookup): Return null if
10793         DeclSpace.DefineType returns null.
10794
10795         Fix #72678.
10796         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
10797
10798 2005-02-18  Raja R Harinath  <rharinath@novell.com>
10799
10800         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
10801         now returns null if it cannot resolve to an lvalue.
10802         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
10803         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
10804         returned null.  Remove check for SimpleName.
10805         (EventExpr.DoResolveLValue): New.
10806         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
10807         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
10808         error from ...
10809         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
10810         avoid CS0131 error.
10811         (Unary.ResolveOperator): Move CS0211 check ...
10812         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
10813         CS0131 error.
10814         (Unary.DoResolveLValue): Simplify.
10815         (AddressOf.DoResolveLValue): New.
10816         (ArrayAccess.DoResolveLValue): New.
10817
10818 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
10819
10820         * attribute.cs (Attribute.Resolve): Add arguments casting for
10821         when types doesn't match ctor arguments.
10822
10823 2005-02-16  Raja R Harinath  <rharinath@novell.com>
10824
10825         Fix parts of #63202.
10826         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
10827         lookup of operator in base type.  Ensure that all checks happen
10828         when the operator resolves to an "op_..." method.
10829
10830 2005-02-15  Raja R Harinath  <rharinath@novell.com>
10831
10832         Fix #71992.
10833         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
10834         'ignore_cs0104' parameter.  Pass it to ...
10835         (NamespaceEntry.Lookup): ... this.
10836         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
10837         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
10838         (TypeLookupExpression.DoResolveAsTypeStep): Update.
10839         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
10840         Update.  Request that cs0104 errors be ignored.
10841         (ComposedCast.ResolveAsTypeStep): Update.
10842
10843 2005-02-14  Raja R Harinath  <rharinath@novell.com>
10844
10845         Fix #59209.
10846         * expression.cs (Invocation.BetterFunction): Remove support for
10847         comparing virtual functions and their overrides.
10848         (Invocation.IsOverride): New.
10849         (Invocation.OverloadResolve): Don't consider 'override' functions
10850         during candidate selection.  Store them in a lookaside list.
10851         If the selected method is a 'virtual' function, use the list to
10852         find any overrides that are closer to the LHS type.
10853
10854 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
10855
10856         * expression.cs (New.DoResolve): Add complex core type reduction.
10857         (New.Constantify): Converts complex core type syntax like 'new int ()'
10858         to simple constant.
10859         
10860 2005-02-14  Raja R Harinath  <rharinath@novell.com>
10861
10862         * decl.cs (EntryType.EntryType): New constructor to create an
10863         updated copy of a cache entry.
10864         (MemberCache.AddMethods): Use it.
10865         (MemberCache.ClearDeclaredOnly): Remove.
10866         (MemberCache.MemberCache): Update.
10867
10868 2005-02-11  Miguel de Icaza  <miguel@novell.com>
10869
10870         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
10871         variable.  This one is represents the actual low-level declaration
10872         of the method, as opposed to the semantic level `IsStatic'.   
10873
10874         An anonymous method which is hosted into a static method might be
10875         actually an instance method.  IsStatic would reflect the
10876         container, while MethodIsStatic represents the actual code
10877         generated.
10878
10879         * expression.cs (ParameterReference): Use the new MethodIsStatic
10880         instead of IsStatic.
10881
10882         * anonymous.cs (AnonymousMethod.Compatible): Pass the
10883         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
10884         set on the current EmitContext. 
10885
10886         * expression.cs (Cast): Overload DoResolveLValue so we can pass
10887         resolve our casted expression as an LValue.  This triggers the
10888         proper LValue processing that is later required by Assign.
10889
10890         This fixes 72347.
10891
10892         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
10893
10894 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
10895
10896         C# 2.0 Fixed buffer implementation
10897
10898         * anonymous.cs: Update after RegisterHelperClass renaming.
10899
10900         * attribute.cs (AttributeTester.fixed_buffer_cache):
10901         Cache of external fixed buffers.
10902         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
10903         implementation if field is fixed buffer else null.
10904
10905         * class.cs
10906         (TypeContainer.AddField): Accept FieldMember instead of Field.
10907         (FieldBase.IsFieldClsCompliant): Extracted code from
10908         VerifyClsCompliance descendant customization.
10909         (FixedField): New class handles fixed buffer fields.
10910         (FixedFieldExternal): Keeps information about imported fixed
10911         buffer.
10912         (IFixedField): Make access to internal or external fixed buffer
10913         same.
10914
10915         * cs-parser.jay: Add fixed buffer parsing.
10916
10917         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
10918         buffer.
10919
10920         * expression.cs (Indirection): Extended implementation to accept
10921         fixed buffer field.
10922         (PointerArithmetic.Emit): Get element from fixed buffer as well.
10923         (ElementAccess.MakePointerAccess): Get type as parameter.
10924         (DoResolve): Add fixed buffer field expression conversion.
10925         (DoResolveLValue): Ditto.
10926         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
10927         (ArrayPtr): Derives from FixedBufferPtr.
10928         (ArrayPtr.Emit): Add extra emit for array elements.
10929
10930         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
10931
10932         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
10933         for compiler generated types.
10934         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
10935
10936         * statement.cs (Fixed): Refactored to be easier add fixed buffer
10937         and consume less memory.
10938         (Fixed.Resolve): Add fixed buffer case.
10939
10940         * typemanager.cs (compiler_generated_attr_ctor,
10941         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
10942         (HasElementType): Add our own implementation to work on every
10943         runtime.
10944
10945 2005-02-11  Miguel de Icaza  <miguel@novell.com>
10946
10947         * anonymous.cs (CaptureContext): Track whether `this' has been
10948         referenced.   
10949
10950         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
10951         only captured `this' if it was implicitly done (instance
10952         methods/variables were used). 
10953
10954         * codegen.cs (EmitContext.CaptureThis): New method to flag that
10955         `this' must be captured.
10956
10957 2005-01-30  Miguel de Icaza  <miguel@novell.com>
10958  
10959         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
10960         is null it means that there has been no need to capture anything,
10961         so we just create a sibling.
10962
10963         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
10964
10965         Just a partial fix.  The other half is fairly elusive.
10966         
10967 2005-02-10  Raja R Harinath  <rharinath@novell.com>
10968
10969         Fix #52586, cs0121-4.cs.
10970         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
10971         and return a hashtable.
10972         (MemberCache.ClearDeclaredOnly): New.
10973         (MemberCache.MemberCache): Update to change.  Make a deep copy of
10974         the method_hash of a base type too.
10975         (MemberCache.AddMethods): Adapt to having a deep copy of the base
10976         type methods.  Overwrite entries with the same MethodHandle so
10977         that the ReflectedType is correct.  The process leaves in base
10978         virtual functions and their overrides as distinct entries.
10979         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
10980         matters since it was boxed in a ArrayList before.
10981         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
10982         modifier.
10983         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
10984         case of a virtual function and its override (choose the overload
10985         as better).
10986         (Invocation.OverloadResolve): Avoid 'override' members during
10987         'applicable_type' calculation.
10988
10989 2005-02-09  Raja R Harinath  <rharinath@novell.com>
10990
10991         Combine two near-redundant caches.
10992         * typemanager.cs (method_params): Rename from method_internal_params.
10993         (TypeManager.GetParameterData): New.  Replace
10994         Invocation.GetParameterData.
10995         (TypeManager.LookupParametersByBuilder): Remove.
10996         * expression.cs (Invocation.method_parameter_cache): Remove.
10997         (Invocation.GetParameterData): Remove.
10998         Update to changes.
10999         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11000         Update to changes.
11001
11002 2005-02-08  Raja R Harinath  <rharinath@novell.com>
11003
11004         Fix #72015.
11005         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11006         TypeManager.multicast_delegate_type is null, resolve it by looking
11007         up "System.MulticastDelegate".
11008         * rootcontext.cs (RootContext.ResolveCore): Simplify.
11009
11010 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
11011             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
11012             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
11013
11014         Fix cs0164.cs.
11015         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11016         (LabeledStatement.AddReference): New.  Set 'referenced'.
11017         (Goto.Resolve): Use it.
11018
11019 2005-02-05  John Luke  <john.luke@gmail.com>
11020
11021         * driver.cs: remove duplicate -doc line in Usage ()
11022
11023 2005-02-04  Raja R Harinath  <rharinath@novell.com>
11024
11025         * location.cs (Location.AddFile): Fix CS2002 error report.
11026
11027 2005-02-02  Martin Baulig  <martin@ximian.com>
11028
11029         * delegate.cs (Delegate.DefineType): Report an internal error if
11030         TypeManager.multicast_delegate_type is null.  See bug #72015 for
11031         details.        
11032
11033 2005-02-02  Raja R Harinath  <rharinath@novell.com>
11034
11035         Fix a crasher in a variant of #31984.
11036         * const.cs (Constant.CheckBase): New override that defers the
11037         new-or-override check in case the base type hasn't been populated
11038         yet.
11039         (Constant.Define): Ensure the new-or-override check is performed.
11040
11041 2005-02-01  Duncan Mak  <duncan@ximian.com>
11042
11043         * const.cs (LookupConstantValue): Check that `ce' is not null
11044         before calling GetValue ().
11045
11046 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11047
11048         Fix test-334.cs (#69519).
11049         * cs-parser.jay (using_alias_directive): Pass in an expression to
11050         NamespaceEntry.UsingAlias.
11051         (using_namespace_directive): Pass in an expression to
11052         NamespaceEntry.Using.
11053         (namespace_name): Don't flatten to a string.
11054         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11055         (NamespaceEntry.AliasEntry.Resolve): Lookup using
11056         ResolveAsTypeStep.
11057         (NamespaceEntry.UsingEntry): Likewise.
11058         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11059         changes.
11060         (NamespaceEntry.LookupForUsing): Remove.
11061         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11062         names.
11063         (NamespaceEntry.Lookup): Remove support for dotted names.
11064
11065 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11066
11067         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11068         split into two.
11069         (NamespaceEntry.ImplicitParent): Compute on demand.
11070         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11071         parallels the current.
11072         (NamespaceEntry.LookupForUsing): Use it.
11073         (NamespaceEntry.Lookup): If the current namespace-entry is
11074         implicit, don't search aliases and using tables.
11075
11076 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11077
11078         Fix #31984.
11079         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11080         BaseCache here.
11081         (TypeContainer.BaseCache): Compute on demand.
11082         (TypeContainer.FindMembers): Define constants and types if they're
11083         not already created.
11084         (FieldMember.Define): Move resetting of ec.InUnsafe before error
11085         check.
11086         * const.cs (Constant.Define): Make idempotent.
11087
11088 2005-01-29  Miguel de Icaza  <miguel@novell.com>
11089
11090         * pending.cs: Produce better code (no nops produced by using Ldarg
11091         + value).
11092         
11093         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11094         i - 1' it should be arg + 1.
11095
11096         Fixes bug #71819.
11097
11098 2005-01-28  Raja R Harinath  <rharinath@novell.com>
11099
11100         * attribute.cs (Attribute.CheckAttributeType): Make private
11101         non-virtual.
11102         (Attribute.ResolveType): Make virtual.
11103         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11104         handling of RootContext.Tree.Types.
11105
11106 2005-01-27  Raja R Harinath  <rharinath@novell.com>
11107
11108         Update attribute-handling to use the SimpleName/MemberAccess
11109         mechanisms.
11110         * cs-parser.jay (attribute): Pass in an expression to the
11111         constructors of Attribute and GlobalAttribute.
11112         * attribute.cs (Attribute): Take an expression for the name.
11113         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
11114         passed in attribute name expression.
11115         (Attribute.CheckAttributeType): Use it.
11116         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11117         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11118         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
11119         argument to prevent error messages if the lookup fails.
11120
11121 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
11122
11123         * expression.cs (Indirection): Implemented IVariable interface
11124         to support indirection in AddressOf operator.
11125         (PointerArithmetic.Emit): Add optimalization for case where
11126         result can be precomputed.
11127
11128 2005-01-26  Martin Baulig  <martin@ximian.com>
11129
11130         * class.cs (TypeContainer.AttributeTargets): Return the correct
11131         AttributeTargets depending on our `Kind' instead of throwing an
11132         exception; fixes #71632.
11133
11134 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
11135
11136         Fix #71257
11137         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11138         constant members.
11139
11140 2005-01-25  Raja R Harinath  <rharinath@novell.com>
11141
11142         Fix #71602.
11143         * expression.cs (MemberAccess.DoResolve): Don't complain with
11144         cs0572 when the LHS of a member access has identical name and type
11145         name.
11146
11147 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
11148
11149         Fix #71651, #71675
11150         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11151         CreatePermission.
11152         Create custom PermissionSet only for PermissionSetAttribute.
11153
11154 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
11155
11156         Fix #71649
11157         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11158         delegates in static class.
11159
11160 2005-01-24  Martin Baulig  <martin@ximian.com>
11161
11162         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11163         merging an implicit block, just use its reachability.
11164
11165         * statement.cs (Block.Resolve): Make the unreachable code check
11166         work wrt. implicit blocks; see test-337 from #63842.
11167
11168 2005-01-21  Alp Toker  <alp@atoker.com>
11169  
11170         * cs-parser.jay: destructor_declaration's container is PartialContainer
11171         not Class when partial types are used, so use Kind prop instead of
11172         'is'.
11173         
11174 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
11175
11176         * cs-parser.jay: Improve error reporting when an interface
11177         declares new types.
11178
11179 2005-01-20  Dick Porter  <dick@ximian.com>
11180
11181         * support.cs: SeekableStreamReader fix from Sandor Dobos
11182         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11183         chars are read.  Fixes bug 70369.
11184
11185 2005-01-20  Raja R Harinath  <rharinath@novell.com>
11186
11187         * cs-parser.jay (catch_clause): Simplify current_block handling
11188         somewhat.
11189
11190 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
11191
11192         * convert.cs (ImplicitStandardConversionExists): Synchronize the
11193         code with ImplicitStandardConversion to handle the implicit
11194         conversion of method groups into valid delegate invocations. 
11195
11196         The problem is that in parameter handling we were using this code
11197         path.  Fixes bug #64698
11198
11199 2005-01-19  Raja R Harinath  <rharinath@novell.com>
11200
11201         * cs-parser.jay: Fix several infelicities.
11202         - Avoid assigning to the parser value stack.  Code like 
11203           '$3 = null' is unclean.  Synthesize a value for the code block
11204           instead. 
11205         - Avoid using oob_stack for storing location information.  Use ...
11206         (_mark_): ... this.  New (empty) rule.  Saves the current location
11207         in $$.
11208         (foreach_statement): Avoid using oob_stack for current_block
11209         handling.  Use technique used in for_statement and
11210         using_statement.  Synthesize a value for the code block to store
11211         additional intermediate information.
11212
11213 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
11214
11215         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11216         of a different type is only allowed to private fields of a
11217         containing type, not on fields of a base class.
11218
11219         See test-174.cs and error cs0122-9.cs
11220
11221 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11222
11223         Fix test-335.cs (bug #58126).
11224         * cs-parser.jay (argument): Split out non-expression parts of the
11225         rule into 'non_simple_argument'.
11226         (invocation_expression): Support parenthesized invocations with
11227         multiple arguments, and with single non-simple arguments.
11228
11229 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11230
11231         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11232         places.
11233
11234 2005-01-12  Raja R Harinath  <rharinath@novell.com>
11235
11236         Fix cs0038-1.cs, cs1640-6.cs.
11237         * ecore.cs (Expression.Resolve): Remove special-case for
11238         SimpleName in error-handling.
11239         (Expression.almostMatchedMembers): Relax access permission to
11240         protected.
11241         (Expression.MemberLookupFailed): Handle duplicates in
11242         almostMatchedMembers list.
11243         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11244         * expression.cs (New.DoResolve): Report CS1540 for more cases.
11245         * typemanager.cs (GetFullNameSignature): Use the MethodBase
11246         overload if the passed in MemberInfo is a MethodBase.
11247
11248 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
11249
11250         Fix #70749
11251         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11252         for non-CAS & merge permission sets properly.
11253
11254 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11255
11256         Improve standard-compliance of simple name and member access 
11257         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
11258         * ecore.cs (FullNamedExpression): New abstract base class 
11259         for Namespaces and TypeExpressions.
11260         (ResolveFlags.SimpleName): Remove.
11261         (SimpleName): Remove support for dotted names.
11262         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
11263         DeclSpace.FindType and DeclSpace.LookupType.
11264         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11265         (Expression.ExprClassName): Make member function.
11266         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11267         a namespace.  Remove creation of dotted "SimpleName"s.
11268         (MemberAccess.DoResolve): Likewise.
11269         * decl.cs (DeclSpace.Cache): Make private.
11270         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11271         (DeclSpace.FindType): Update.
11272         (DeclSpace.LookupType): Move here from RootContext.  Return a 
11273         FullNamedExpression.
11274         * namespace.cs (Namespace): Derive from FullNamedExpression
11275         so that it can be part of expression resolution.
11276         (Namespace.Lookup): Return an FullNamedExpression.
11277         (NamespaceEntry.LookupAlias): Lookup aliases only in current
11278         namespace.
11279         * rootcontext.cs (NamespaceLookup): Remove.
11280         (LookupType): Move to DeclSpace.
11281         * attribute.cs (CheckAttributeType): Update.
11282         * doc.cs (FindDocumentedType): Remove allowAlias argument.
11283         (FindDocumentedTypeNonArray): Likewise.
11284
11285 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11286
11287         Fix cs0509.cs, cs1632.cs.
11288         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11289         is the same as IsInterface.
11290         (TypeContainer.GetClassBases): Likewise.
11291         * statement.cs (LabeledStatement.ig): New field.
11292         (LabeledStatement.LabelTarget): Save ILGenerator which created the
11293         label.
11294         (LabeledStatement.DoEmit): Check that the label was created with
11295         the same ILGenerator.
11296
11297 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11298
11299         Fix #71058
11300         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11301         accessors to its properties.
11302
11303         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11304         from accessors to property.
11305         
11306 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11307
11308         Fix #70722
11309         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11310         only for overrides.
11311         
11312 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
11313
11314         * attribute.cs: Check for null and empty strings.  
11315
11316         I have lost another battle to Paolo.
11317
11318 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
11319
11320         Fix #70942
11321         * class.cs (PropertyMethod): Set Parent field in ctors.
11322         (SetMethod.InternalParameters): Add unsafe switch hack.
11323         Override MarkForDuplicationCheck where it is appropriate.
11324
11325         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11326         It says whether container allows members with the same name.
11327         Base default is no.
11328         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11329         Removed is_method parameter.
11330
11331 2005-01-06  Duncan Mak  <duncan@ximian.com>
11332
11333         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11334         because the previous change led to incorrect reporting of CS1032
11335         ("Cannot define/undefine preprocessor symbols after first token in
11336         file"). Instead of using `tokens_seen' as the only flag that
11337         triggers CS1040, introduce `comments_seen'. This new flag is used
11338         to signify having seen comments on the current line, so it is
11339         unset after a newline.
11340
11341 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11342
11343         * doc.cs : When searching for a type, find nested type too.
11344           This fixes bug #71040.
11345
11346 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11347
11348         * doc.cs :
11349           - Warn missing member comment on those classes which also does not
11350             have doc comments. Fixed bug #71041.
11351           - Don't warn missing doc comment on default constructor.
11352             Fixed bug #71042.
11353
11354 2005-01-06  Duncan Mak  <duncan@ximian.com>
11355
11356         * cs-tokenizer.cs (xtoken): After handling traditional C-style
11357         comments, set `tokens_seen' to true. This allows us to detect
11358         misplaced preprocessor directives (i.e. not at the beginning of
11359         the a line, nor after whitespaces). In that case, report error
11360         CS1040. This fixes bug #56460.
11361
11362         * cs-parser.jay (interface_member_declaration): Add checks for
11363         IsExplicitImpl, and report CS0541 error if an interface member is
11364         defined as an explicit interface declaration.
11365
11366 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
11367
11368         Fix #70817
11369         * class.cs (PropertyMethod): Set Parent field in ctors.
11370         (SetMethod.InternalParameters): Add unsafe switch hack.
11371         
11372         * decl.cs (MemberCore.Parent): Cannot be readonly.
11373
11374 2005-01-06  Raja R Harinath  <rharinath@novell.com>
11375
11376         * decl.cs (DeclSpace.ResolveType): Remove.
11377         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11378         Merge in code from ...
11379         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
11380         * class.cs, enum.cs: Update to changes.
11381
11382 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
11383
11384         * anonymous.cs: Ensure that we init the scope of our parent if it
11385         has not been initialized yet.
11386
11387 2004-12-30  Duncan Mak  <duncan@ximian.com>
11388
11389         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11390         if field.FieldBuilder is null. Fixes #70758.
11391
11392         * convert.cs: Fixed some typos and updated some of the comments.
11393         (ImplicitStandardConversionExists):
11394         (TryImplicitIntConversion): If `target_type' is an interface and
11395         the type of `ic' implements this interface, return true or a new
11396         BoxedCast instead of null. This fixes #70468.
11397
11398 2004-12-29  Duncan Mak  <duncan@ximian.com>
11399
11400         * expression.cs (Argument.Emit): Check that Expr is
11401         IMemoryLocation before casting to it, and report CS1510 otherwise.
11402
11403         This fixes #70402.
11404
11405 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
11406
11407         * statement.cs (Block.ThisVariable): remove the recursion here, to
11408         make the --profile more sane.
11409
11410 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
11411
11412         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11413         assembly, by JB Evain.
11414
11415 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11416
11417         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
11418           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11419         "parent" refers to enclosing type/class.  "base" refers to superclass.
11420
11421 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11422
11423         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11424         Ensure that we only have GlobalAttributes.
11425         * attribute.cs (Attribute.Emit): Make non-virtual.
11426         (GlobalAttribute.Emit): Remove.
11427         (Attribute.Resolve): Make virtual.
11428         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
11429         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11430         the argument. Don't create one.
11431         (Attribute.GetObsoleteAttribute): Likewise.
11432         (Attribute.GetClsCompliantAttributeValue): Likewise.
11433         * class.cs, decl.cs: Update to changes.
11434
11435 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
11436
11437         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11438         
11439         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11440         
11441         * statement.cs (Foreach.Resolve): Add error 186 report.
11442
11443 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
11444
11445         * expression.cs (Conditional.DoResolve): Add warning 429.
11446         
11447         * statement.cs (If.Resolve): Add warning 665.
11448
11449 2004-12-16  Raja R Harinath  <rharinath@novell.com>
11450
11451         New invariant: RootContext.Tree.Types.NamespaceEntry == null
11452         except when in the parser, and in GlobalAttribute.
11453         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11454         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11455         RootContext.Tree.Types.NamespaceEntry once work is done.
11456         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
11457         and resets RootContext.Tree.Types.NamespaceEntry.
11458
11459 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
11460
11461         * cs-parser.jay: Don't create a block for every variable.
11462
11463 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
11464
11465         * location.cs: Provide extra information.
11466
11467         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11468         variables from the captured environment, it is the ldarg_0.
11469
11470 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11471
11472         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11473         find a conclusion.
11474         
11475         * class.cs: Changed warning level for 169 to avoid developer
11476         displeasure from warning flooding. It will be changed back when they
11477         fix most of current BCL warnings.
11478         
11479         * RootContext.cs: Pushed default WarningLevel to 3.
11480         
11481         * statement.cs: Removed unused variable.
11482
11483 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11484
11485         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11486         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11487         Add error 502 report.
11488         (StaticClass.DefineType): Add error 441 report.
11489         (Class.AllowedModifiersProp): New virtual property as temporary
11490         extension to AllowedModifiers.
11491         (Class.DefineType): Add error 418 report. Moved ModFlags check here
11492         to share implementation with StaticClass and don't call virtual
11493         methods from ctor.
11494         
11495         * driver.cs (MainDriver): Add error 1558 test.
11496
11497         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11498         report. Moved error 36 test here.
11499
11500         * statement.cs (Throw.Resolve): Add error 724 report.
11501
11502         * typemanager.cs: Add out_attribute_type core type.
11503         
11504 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
11505
11506         * class.cs (TypeContainer.VerifyClsCompliance): Add error
11507         3018 report.
11508         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11509
11510         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11511         3017 report.
11512         
11513         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11514
11515         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
11516         Add error 3023 report.
11517         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11518
11519         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11520         implementation.
11521
11522 2004-12-12  John Luke  <john.luke@gmail.com>
11523
11524         * driver.cs (AddArgs): take -- into account when
11525         adding arguments, fixes bug 65710 
11526
11527 2004-12-12  Martin Baulig  <martin@ximian.com>
11528
11529         * expression.cs (Unary.TryReduceNegative): Added support for
11530         SByteConstant and ByteConstant.
11531         (Unary.Reduce): Check error values from TryReduceNegative().
11532
11533 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
11534
11535         * attributes.cs (Attribute.Resolve): Avoid multiple error report
11536         and report exception as error 182.
11537
11538 2004-12-10  Raja R Harinath  <rharinath@novell.com>
11539
11540         * driver.cs (Main): Fix message when there are warnings.
11541
11542 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
11543
11544         * delegate.cs: Fixed my fix from yesterday, sorry about that.
11545
11546 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
11547
11548         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
11549         Reduced number of warnings.
11550         
11551         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11552
11553 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
11554
11555         * driver.cs: Removed message.
11556
11557         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11558
11559 2004-12-08    <vargaz@freemail.hu>
11560
11561         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11562
11563 2004-12-08  Martin Baulig  <martin@ximian.com>
11564
11565         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11566         instead of a CS3002 for properties and indexer.
11567
11568 2004-12-08  Martin Baulig  <martin@ximian.com>
11569
11570         * decl.cs (MemberName.ToString): Make this work again.
11571
11572 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
11573
11574         * attribute.cs (Resolve): Add error 591 detection.
11575
11576         * class.cs (FieldMember.Define): Add error 1547 detection.
11577         (Indexer.Define): Add error 620 detection.
11578         (Operator.Define): Add error 590 detection.
11579
11580         * ecore.cs: Missing argument for error 79.
11581
11582         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11583         detection.
11584
11585 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
11586
11587         Fix #70106
11588         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11589         only.
11590
11591 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
11592
11593         * cs-parser.jay : handle doc comments on implicit/explicit operators.
11594           Some operator comments were suppressed.
11595         * doc.cs : Implicit/explicit operator name in doc comments are like
11596           "op_Explicit(type)~returnType", so added suffix handling.
11597
11598 2004-12-07  Martin Baulig  <martin@ximian.com>
11599
11600         * decl.cs
11601         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11602         (MemberCore.GetClsCompliantAttributeValue): Likewise.
11603         (DeclSpace.ec): New protected field; store the EmitContext here.
11604         (DeclSpace.EmitContext): New public property; moved here from
11605         `TypeContainer'.
11606         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11607         EmitContext.
11608
11609         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11610         (Enum.Emit): Don't create a new EmitContext.
11611
11612         * delegate.cs (Delegate.DefineType): Always create the
11613         EmitContext.
11614
11615         * iterators.cs (Iterators.DefineIterator): Create a new
11616         EmitContext and store it in `ec'.
11617
11618 2004-08-24  Martin Baulig  <martin@ximian.com>
11619
11620         * typemanager.cs
11621         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11622         this for accessibility checks.
11623         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11624         IsNestedFamilyAccessible.
11625         (TypeManager.IsSubclassOf): New method, do what the name actually
11626         says.   
11627
11628 2004-12-06  Raja R Harinath  <rharinath@novell.com>
11629
11630         Fix crash on cs0657-17.cs.
11631         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11632         Use RootContext.Tree.Types, not 'new RootTypes ()'.
11633         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11634         the case where the NamespaceEntry gets overwritten.
11635
11636 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
11637
11638         Fixed #69195, #56821
11639         * ecore.cs (ResolveBoolean): Tiny refactoring.
11640
11641         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11642         of right expression resolving when left is false constant and
11643         operator is LogicalAnd OR true constant and operator is LogicalOr.
11644
11645         * statement.cs (ResolveUnreachable): Always reports warning.
11646
11647 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
11648
11649         * class.cs: Distinguish between 1721 and 1722 (just a little help
11650         for the programmer).
11651
11652 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
11653
11654         * delegate.cs: Only allow this on new versions of the language. 
11655
11656 2004-12-02  Duncan Mak  <duncan@ximian.com>
11657
11658         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11659         Expression class.
11660         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11661         here as a static method. Take an additional bool out parameter
11662         `must_do_cs1540_check' for signaling to InstanceResolve.
11663         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11664         member field from PropertyExpr class and made it an argument of
11665         the method instead.
11666         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11667         check for MarshalByRefObject, and report CS0122 instead of CS1540.
11668         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11669         and `remove_accessor' as well as InstanceResolve: report CS0122
11670         where applicable.
11671
11672         Fixes #70129.
11673
11674 2004-12-03  Raja R Harinath  <rharinath@novell.com>
11675
11676         Fix test-327.cs, test-328.cs, and put in early infrastructure
11677         for eventually fixing #52697.
11678         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
11679         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
11680         from other methods.
11681         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
11682         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
11683         (VerifyUsing, error246): Update.
11684         * rootcontext.cs (RootContext.NamespaceLookup): Just use
11685         'NamespaceEntry.LookupNamespaceOrType'.
11686
11687 2004-12-03  Martin Baulig  <martin@ximian.com>
11688
11689         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11690         method as our child, call AnonymousMethod.Compatible() on it.
11691
11692 2004-12-03  Raja R Harinath  <rharinath@novell.com>
11693
11694         Disable XML documentation support in 'basic' profile.
11695         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
11696         Redirect XmlElement to System.Object.
11697         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
11698         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
11699         * mcs.exe.sources: Add doc-bootstrap.cs.
11700         * doc-bootstrap.cs: New file.  Contains empty stub implementation
11701         of doc.cs.
11702
11703 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
11704
11705         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
11706           comments are allowed.
11707
11708 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11709
11710         * delegate.cs: Add checks for subtypes in paramaters and return values
11711         in VerifyMethod () to add support for Covariance/Contravariance
11712         in delegates.
11713         
11714 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
11715
11716         * report.cs: Remove extra closing parenthesis.
11717
11718         * convert.cs (Error_CannotImplicitConversion): If the name of the
11719         types are the same, provide some extra information.
11720
11721         * class.cs (FieldBase): Use an unused bit field from the field to
11722         encode the `has_offset' property from the FieldMember.  This saves
11723         a couple of Ks on bootstrap compilation.
11724
11725         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11726         method as our child, return the AnonymousMethod resolved
11727         expression.
11728
11729         * expression.cs (New.DoResolve): Allow return values from
11730         NewDelegate to also include AnonymousMethods.
11731
11732         Fixes #70150.
11733
11734 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
11735
11736         Fix bug #70102
11737         * attribute.cs (Resolve): Improved implementation of params
11738         attribute arguments.
11739
11740         * support.cs (ParameterData): Add HasParams to be faster.
11741
11742 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
11743
11744         all things are for /doc support:
11745
11746         * doc.cs: new file that supports XML documentation generation.
11747         * mcs.exe.sources: added doc.cs.
11748         * driver.cs:
11749           Handle /doc command line option.
11750           Report error 2006 instead of 5 for missing file name for /doc.
11751           Generate XML documentation when required, after type resolution.
11752         * cs-tokenizer.cs:
11753           Added support for picking up documentation (/// and /** ... */),
11754           including a new XmlCommentState enumeration.
11755         * cs-parser.jay:
11756           Added lines to fill Documentation element for field, constant,
11757           property, indexer, method, constructor, destructor, operator, event
11758           and class, struct, interface, delegate, enum.
11759           Added lines to warn incorrect comment.
11760         * rootcontext.cs :
11761           Added Documentation field (passed only when /doc was specified).
11762         * decl.cs:
11763           Added DocComment, DocCommentHeader, GenerateDocComment() and
11764           OnGenerateDocComment() and some supporting private members for
11765           /doc feature to MemberCore.
11766         * class.cs:
11767           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
11768         * delegate.cs:
11769           Added overriden DocCommentHeader.
11770         * enum.cs:
11771           Added overriden DocCommentHeader and GenerateDocComment().
11772
11773 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
11774
11775         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
11776         unwrapping the enumeration values, chain to
11777         DoConstantNumericPromotions again, so we can promote things to the
11778         fundamental types (takes care of enums that are bytes, sbytes).
11779
11780         Fixes bug #62054.
11781
11782 2004-12-01  Raja R Harinath  <rharinath@novell.com>
11783
11784         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
11785         Fix long-standing bug in type-lookup.  Use FindType instead of
11786         LookupType when ec.ResolvingTypeTree.
11787         (Attribute.ResolveType, Attribute.Resolve)
11788         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
11789         Update to changes.
11790         (Attributes.Search): Remove internal version.  Update.
11791         (Attributes.SearchMulti): Update.
11792         (Attributes.GetClsCompliantAttribute): Remove.
11793         (Attributes.GetIndexerNameAttribute): Remove.
11794         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
11795         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
11796         * class.cs (Indexer.Define): Likewise.
11797
11798 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
11799
11800         Fix bug #68790
11801         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
11802         MarshallByReference members access.
11803
11804         * expression.cs: Use CheckMarshallByRefAccess;
11805         Better error CS0197 message.
11806
11807         * report.cs: Print whole related error message.
11808
11809 2004-11-30  Raja R Harinath  <rharinath@novell.com>
11810
11811         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
11812         the current directory to help debugging.
11813
11814 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
11815
11816         * class (GetClassBases): Better error 60 report.
11817         (EventProperty): Disabled warning 67 detection.
11818
11819 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
11820
11821         Fix bug #60324
11822         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
11823
11824         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
11825         precise values.
11826
11827 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
11828
11829         Fix bug #49488
11830         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
11831
11832         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
11833
11834 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
11835
11836         * attribute.cs (Attribute.Resolve): Refine error reporting and
11837         report a cs0117 if the identifier does not exist, to distinguish
11838         from 0617 which is a miss-use of the actual identifier.
11839
11840         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
11841         between cs0070 and cs0079.
11842
11843         * class.cs (MemberBase.DoDefine): When reporting a wrong
11844         accessibility level, we use MethodCore to compare instead of
11845         Method (this was a regression in some refactoring effort).
11846
11847         So now we correctly report cs0056 again.
11848
11849         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
11850         testing the target_type (which was known to be object_type) and
11851         not the source type (which is anonymous_method).
11852
11853         Fixed reporting of error cs1660.
11854
11855         * expression.cs (UserCast.Source): Expose the underlying cast.
11856
11857         * statement.cs (Switch.SwitchGoverningType): Sort the list of
11858         allowed types to find a match to int32 first (most common).
11859
11860         In addition, it ignores any ImplicitUserConversions that did an
11861         internal implicit conversion (as the switch statement allows only
11862         one integral conversion to exist).
11863
11864         * class.cs (PartialContainer.Create): rename `name' to
11865         `member_name' for clarity.  Then replace the string calls with a
11866         call to MemberName.GetPartialName, as now using
11867         MemberName.ToString is an error (this is due to the side effects
11868         it had, that were fixed in the past).
11869
11870         This will restore the error reporting on a number of partial class
11871         errors that were missusing this (and getting an exception as a
11872         results, which is now just a plain textual warning, because
11873         yyparse debug output would crash otherwise).
11874
11875 2004-11-26  Raja R Harinath  <rharinath@novell.com>
11876
11877         * Makefile (PROGRAM_INSTALL_DIR): Remove.
11878
11879 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
11880
11881         * rootcontext.cs (LookupType): Make sure to cache lookups that
11882         don't give us a negative result. This saves about 5% of corlib
11883         compilation time.
11884
11885 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
11886
11887         * report.cs (AbstractMessage.Print): messages are sent to stderr
11888
11889         * class.cs (TypeContainer.GetClassBases): It is an error to have a
11890         non-interface in the list of interfaces (at this point, either
11891         parent was properly set, or a base class is being listed in the
11892         interfaces section).
11893
11894         This flags error 1722, and resolves the crash from bug 69259.
11895
11896 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
11897
11898         * statement.cs (Using.EmitExpressionFinally): make this work right
11899         for valuetypes. Fixes 69926.
11900
11901 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
11902
11903         * const.cs (Const.ChangeType): Cope with the "0 literal can be
11904         converted to an enum" here, before we try to change the underlying
11905         type.  This code exists, but it is a different code path than the
11906         one used while encoding constants.
11907
11908         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
11909         old bug: when converting from the null literal to a pointer,
11910         return an EmptyCast, not the NullLiteral.
11911
11912         This fixes #69921, the recent null_type changes probably made this
11913         bug more prominent.
11914
11915         (ImplicitReferenceConversionExists): In addition, resynchronized
11916         the code here, so it matches the same code in
11917         ImplicitReferenceConversionExists for the `from any class-type S
11918         to any interface-type T'.
11919         
11920
11921 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
11922
11923         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
11924
11925 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
11926
11927         * cs-parser.jay: Use verbosity accordingly. 
11928
11929 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
11930
11931         * expression.cs (Unary.ResolveOperator): Do not report warning;
11932         AddressOf reads from variable.
11933         
11934         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
11935
11936 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
11937
11938         Fix bug #69462
11939
11940         * attribute.cs (Attributable): Removed CheckTargets.
11941         (Attributes.Emit): Explicit attribute targets are tested here.
11942
11943         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
11944         not enabled for interfaces.
11945
11946         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
11947         (GetAssemblyName): Ouch next bug there.
11948
11949 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11950
11951         * expression.cs: Error 275 added.
11952         
11953 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
11954
11955         Fix bug #69177 (Implemented decimal constant support)
11956
11957         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
11958         (BinaryFold): Add DecimalConstant.
11959
11960         * const.cs (Define): Decimal constant 
11961         (is not constant.
11962         (ChangeType): Add decimal type handling.
11963         (LookupConstantValue): Don't set value for decimal type but
11964         emit DecimalConstantAttribute. Needed for constant optimization.
11965
11966         * constant.cs (ToDecimal): New method.
11967         (ConvertToDecimal): New method.
11968         (IntConstant): Implemented ConvertToDecimal.
11969         (DecimalConstant.Emit): Emit optimized version for decimals in
11970         int range.
11971
11972         * expression.cs (ResolveOperator): Changed order of constant
11973         reduction to work correctly with native types which have
11974         overloaded operators.
11975         (ResolveMemberAccess): Extract constant value from attribute
11976         for decimal type.
11977
11978         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
11979
11980         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
11981         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
11982         (ChangeType): Decimal is special.
11983         (TypeToCoreType): Add decimal type.
11984
11985 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
11986
11987         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
11988         decimal types.
11989
11990 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
11991
11992         * class.cs (EventField.ApplyAttributeBuilder): Fix error
11993         test cs1667-5.cs.
11994
11995 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
11996
11997         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
11998
11999         * pending.cs (PendingImplementation): Grab only interfaces.
12000
12001 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
12002
12003         * statement.cs (ForeachHelperMethods): Add location member and
12004         error 202 detection.
12005
12006 2004-11-19  Raja R Harinath  <rharinath@novell.com>
12007
12008         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
12009         automatically handled by executable.make.
12010         (PROGRAM): Make profile-specific.
12011
12012 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
12013
12014         * expression.cs (DoResolveBase): Fixed wrong warning for out
12015         variables.
12016
12017 2004-11-18  Martin Baulig  <martin@ximian.com>
12018
12019         Merged latest changes into gmcs.  Please keep this comment in
12020         here, it makes it easier for me to see what changed in MCS since
12021         the last time I merged.
12022
12023 2004-11-17  Raja R Harinath  <rharinath@novell.com>
12024
12025         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12026         (TypeHandle.GetMemberCache): New.
12027         (TypeHandle.TypeHandle): Update.
12028         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12029         (TypeManager.LookupParentInterfacesCache):
12030         Rename from LookupInterfaceCache.  Optimize slightly.
12031         (TypeManager.MemberLookup_FindMembers): Update.
12032         * decl.cs (MemberCache.MemberCache): Set Container to null in the
12033         multi-type variant.
12034         (AddCacheContents): Rename from AddHashtable.
12035         * class.cs (TypeContainer.parent_container): Remove.
12036         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12037         (TypeContainer.DoDefineMembers): Don't initialize it.
12038         Update to name changes.
12039         
12040 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
12041
12042         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12043         that factors the code to check access modifiers on override.  
12044
12045         (PropertyBase): Use the code here.
12046
12047         Patch from Lluis S'anchez, fixes bug #69361.
12048
12049 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
12050
12051         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12052         routine that is used to report the use of a captured variable
12053         whose address has been taken.
12054
12055         There are two checks: one when variables are being captured and
12056         the other check is when the address of a variable is taken. 
12057         
12058         (because an anonymous methods might be resolved before *or* after
12059         the address has been taken) and 
12060
12061         * expression.cs (Conditional.DoResolve): Remove the special
12062         casing that Martin added to trueExpr and falseExpr being both
12063         NullLiteral.  We get the right behavior now just by introducing
12064         the null_type into the compiler. 
12065
12066         * convert.cs (ExplicitConversion): Change the code to use
12067         null_type instead of testing `expr is NullLiteral'.
12068         (ImplicitConversionStandard): use null_type too.
12069         (ImplicitReferenceConversionExists): use null_type too.
12070         (ImplicitReferenceConversion): use null_type too.
12071
12072         * literal.cs: The type of `NullLiteral' is now null_type instead
12073         of object_type. 
12074         (Resolve): Set the type here.
12075
12076         * typemanager.cs: Introduce null_type.
12077
12078 2004-11-17  Martin Baulig  <martin@ximian.com>
12079
12080         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12081         direction, like FindMembers() does.  Fixes #69546, testcase is in
12082         test-315.cs.    
12083
12084 2004-11-16  Martin Baulig  <martin@ximian.com>
12085
12086         This is based on a patch from Marek Safar, see bug #69082.
12087         Fixes bugs #63705 and #67130.
12088
12089         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12090         method; create a MemberCache for an interface type and cache the
12091         result.
12092
12093         * decl.cs (IMemberContainer.ParentContainer): Removed.
12094         (IMemberContainer.ParentCache): New property.
12095         (MemberCache.SetupCacheForInterface): Removed.
12096         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12097         to create a cache for an interface's "parent".
12098
12099         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12100         interfaces too.
12101
12102 2004-11-16  Martin Baulig  <martin@ximian.com>
12103
12104         Merged back from gmcs; these changes already went into gmcs a
12105         couple of weeks ago.
12106
12107         * typemanager.cs
12108         (TypeManager.AddUserType): Removed the `ifaces' argument.
12109         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12110         `TypeExpr []'.
12111         (TypeManager.AddUserInterface): Removed.
12112         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12113         `TypeExpr []'.
12114         (TypeManager.GetInterfaces): Likewise.
12115         (TypeManager.GetExplicitInterfaces): Likewise.
12116
12117         * ecore.cs (TypeExpr.GetInterfaces): Removed.
12118
12119         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12120         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12121
12122 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
12123
12124         * statement.cs: Avoid adding bools to a hashtable.
12125
12126 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
12127
12128         * expression.cs (Invocation.OverloadResolve): Flag error if we are
12129         calling an unsafe method from a safe location.
12130
12131 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
12132
12133         Fix #69167
12134         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12135
12136 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
12137
12138         * namespace.cs (VerifyUsing): use GetPartialName instead of
12139         ToString. 
12140
12141 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
12142
12143         * statement.cs (Return.Resolve): Fix regression in typo: if
12144         `in_exc', we have to request a NeedReturnLabel, this was a typo
12145         introduced in the anonymous method check-in.  Fixes #69131.
12146
12147         * Indexers were using the ShortName when defining themselves,
12148         causing a regression in the compiler bootstrap when applying the
12149         patch from 2004-11-02 (first part), now they use their full name
12150         and the bug is gone.
12151
12152 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
12153
12154         * driver.cs: Strip the path from the names of embedded resources. Fixes
12155         #68519.
12156
12157 2004-11-04  Raja R Harinath  <rharinath@novell.com>
12158
12159         Fix error message regression: cs0104-2.cs.
12160         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12161         (AliasEntry.Resolve): Update.
12162         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
12163         'silent' flag.
12164         (RootContext.LookupType): Update.
12165
12166 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
12167
12168         * cs-parser.jay: Add support for handling accessor modifiers
12169         * class: Add support port accessor modifiers and error checking,
12170         define PropertyMethod.Define as virtual (not abstract anymore)
12171         * ecore.cs: Add checking for proeprties access with access modifiers
12172         * iterators.cs: Modify Accessor constructor call based in the modified
12173         constructor
12174 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
12175
12176         * expression.cs (StringConcat): Handle being called twice,
12177         as when we have a concat in a field init with more than two
12178         ctors in the class
12179
12180 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
12181
12182         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12183         special case explicit implementations, we should always produce
12184         the .property or .event declaration.
12185         
12186         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12187         since it will not return correct data if people use this
12188         unresolved in the presence of using statements (see test-313).
12189
12190         * class.cs (MethodData.Define): If we are an explicit interface
12191         implementation, set the method name to the full name of the
12192         interface plus the name of the method.  
12193
12194         Notice that using the method.MethodName.GetFullName() does not
12195         work, as it will only contain the name as declared on the source
12196         file (it can be a shorthand in the presence of using statements)
12197         and not the fully qualifed type name, for example:
12198
12199         using System;
12200
12201         class D : ICloneable {
12202                 object ICloneable.Clone ()  {
12203                 }
12204         }
12205
12206         Would produce a method called `ICloneable.Clone' instead of
12207         `System.ICloneable.Clone'.
12208
12209         * namespace.cs (Alias.Resolve): Use GetPartialName.
12210         
12211 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12212
12213         * cs-parser.jay: Add error 1055 report.
12214
12215 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
12216
12217         * assign.cs (Assign.DoResolve): Only do the transform of
12218         assignment into a New if the types are compatible, if not, fall
12219         through and let the implicit code deal with the errors and with
12220         the necessary conversions. 
12221
12222 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12223
12224         * cs-parser.jay: Add error 1031 report.
12225
12226         * cs-tokenizer.cs: Add location for error 1038.
12227
12228 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12229
12230         * cs-parser.jay: Add error 1016 report.
12231
12232 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12233
12234         * cs-parser.jay: Add errors 1575,1611 report.
12235
12236 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12237
12238         * cs-parser.jay: Add error 1001 report.
12239
12240 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12241
12242         Fix #68850
12243         * attribute.cs (GetMarshal): Add method argument for
12244         caller identification.
12245
12246         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12247         agument for GetMarshal and RuntimeMissingSupport.
12248
12249 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12250
12251         * attribute.cs (ExtractSecurityPermissionSet): Removed
12252         TypeManager.code_access_permission_type.
12253
12254         * typemanager.cs: Removed TypeManager.code_access_permission_type.
12255
12256 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
12257
12258         * expression.cs (LocalVariableReference.DoResolveLValue): Check
12259         for obsolete use of a variable here.   Fixes regression on errors
12260         cs0619-25 and cs0619-26.
12261
12262 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
12263
12264         Fix #62358, implemented security attribute encoding.
12265
12266         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12267         Tests permitted SecurityAction for assembly or other types.
12268         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12269         data from SecurityPermissionAttribute to PermisionSet class.
12270
12271         * class.cs (ApplyAttributeBuilder): Added special handling
12272         for System.Security.Permissions.SecurityAttribute based types.
12273
12274         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12275         special handling for System.Security.Permissions.SecurityAttribute
12276         based types.
12277
12278         * enum.cs (ApplyAttributeBuilder): Added special handling
12279         for System.Security.Permissions.SecurityAttribute based types.
12280
12281         * parameter.cs (ApplyAttributeBuilder): Added special handling
12282         for System.Security.Permissions.SecurityAttribute based types.
12283
12284         * rootcontext.cs: Next 2 core types.
12285
12286         * typemanager.cs (TypeManager.security_permission_attr_type):
12287         Built in type for the SecurityPermission Attribute.
12288         (code_access_permission_type): Build in type.
12289
12290 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
12291
12292         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12293         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12294         all of this information into
12295         EmitContext.EmitCapturedVariableInstance.
12296         
12297         * codegen.cs (EmitCapturedVariableInstance): move here the
12298         funcionality of emitting an ldarg.0 in the presence of a
12299         remapping.   This centralizes the instance emit code.
12300
12301         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12302         then emit a load of this: it means that we have reached the
12303         topmost ScopeInfo: the one that contains the pointer to the
12304         instance of the class hosting the anonymous method.
12305
12306         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12307         captures to the topmost CaptureContext.
12308
12309 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
12310
12311         * expression.cs (LocalVariableReference): Move the knowledge about
12312         the iterators into codegen's EmitCapturedVariableInstance.
12313
12314 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
12315
12316         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12317         all code paths return a value from an anonymous method (it is the
12318         same as the 161 error, but for anonymous methods).
12319
12320 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
12321
12322         The introduction of anonymous methods in the compiler changed
12323         various ways of doing things in the compiler.  The most
12324         significant one is the hard split between the resolution phase
12325         and the emission phases of the compiler.
12326
12327         For instance, routines that referenced local variables no
12328         longer can safely create temporary variables during the
12329         resolution phase: they must do so from the emission phase,
12330         since the variable might have been "captured", hence access to
12331         it can not be done with the local-variable operations from the runtime.
12332         
12333         * statement.cs 
12334
12335         (Block.Flags): New flag `IsTopLevel' to indicate that this block
12336         is a toplevel block.
12337
12338         (ToplevelBlock): A new kind of Block, these are the blocks that
12339         are created by the parser for all toplevel method bodies.  These
12340         include methods, accessors and anonymous methods.
12341
12342         These contain some extra information not found in regular blocks:
12343         A pointer to an optional CaptureContext (for tracking captured
12344         local variables and parameters).  A pointer to the parent
12345         ToplevelBlock.
12346         
12347         (Return.Resolve): Catch missmatches when returning a value from an
12348         anonymous method (error 1662).
12349         Invoke NeedReturnLabel from the Resolve phase instead of the emit
12350         phase.
12351
12352         (Break.Resolve): ditto.
12353
12354         (SwitchLabel): instead of defining the labels during the
12355         resolution phase, we now turned the public ILLabel and ILLabelCode
12356         labels into methods called GetILLabelCode() and GetILLabel() that
12357         only define the label during the Emit phase.
12358
12359         (GotoCase): Track the SwitchLabel instead of the computed label
12360         (its contained therein).  Emit the code by using
12361         SwitchLabel.GetILLabelCode ().
12362
12363         (LocalInfo.Flags.Captured): A new flag has been introduce to track
12364         whether the Local has been captured or not.
12365
12366         (LocalInfo.IsCaptured): New property, used to tell whether the
12367         local has been captured.
12368         
12369         * anonymous.cs: Vastly updated to contain the anonymous method
12370         support.
12371
12372         The main classes here are: CaptureContext which tracks any
12373         captured information for a toplevel block and ScopeInfo used to
12374         track the activation frames for various local variables.   
12375
12376         Each toplevel block has an optional capture context associated
12377         with it.  When a method contains an anonymous method both the
12378         toplevel method and the anonymous method will create a capture
12379         context.   When variables or parameters are captured, they are
12380         recorded on the CaptureContext that owns them, for example:
12381
12382         void Demo () {
12383              int a;
12384              MyDelegate d = delegate {
12385                  a = 1;
12386              }
12387         }
12388
12389         Here `a' will be recorded as captured on the toplevel
12390         CapturedContext, the inner captured context will not have anything
12391         (it will only have data if local variables or parameters from it
12392         are captured in a nested anonymous method.
12393
12394         The ScopeInfo is used to track the activation frames for local
12395         variables, for example:
12396
12397         for (int i = 0; i < 10; i++)
12398                 for (int j = 0; j < 10; j++){
12399                    MyDelegate d = delegate {
12400                         call (i, j);
12401                    }
12402                 }
12403
12404         At runtime this captures a single captured variable `i', but it
12405         captures 10 different versions of the variable `j'.  The variable
12406         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12407         recorded on a child.  
12408
12409         The toplevel ScopeInfo will also track information like the `this'
12410         pointer if instance variables were referenced (this is necessary
12411         as the anonymous method lives inside a nested class in the host
12412         type of the method). 
12413
12414         (AnonymousMethod): Expanded to track the Toplevel, implement
12415         `AnonymousMethod.Compatible' to tell whether an anonymous method
12416         can be converted to a target delegate type. 
12417
12418         The routine now also produces the anonymous method content
12419
12420         (AnonymousDelegate): A helper class that derives from
12421         DelegateCreation, this is used to generate the code necessary to
12422         produce the delegate for the anonymous method that was created. 
12423
12424         * assign.cs: API adjustments for new changes in
12425         Convert.ImplicitStandardConversionExists.
12426
12427         * class.cs: Adjustments to cope with the fact that now toplevel
12428         blocks are of type `ToplevelBlock'. 
12429
12430         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12431         insteda of standard blocks.
12432
12433         Flag errors if params arguments are passed to anonymous methods.
12434
12435         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12436         `CurrentAnonymousMethod' which points to the current Anonymous
12437         Method.  The variable points to the AnonymousMethod class that
12438         holds the code being compiled.  It is set in the new EmitContext
12439         created for the anonymous method.
12440
12441         (EmitContext.Phase): Introduce a variable and an enumeration to
12442         assist in enforcing some rules about when and where we are allowed
12443         to invoke certain methods (EmitContext.NeedsReturnLabel is the
12444         only one that enfonces this right now).
12445
12446         (EmitContext.HaveCaptureInfo): new helper method that returns
12447         whether we have a CapturedContext initialized.
12448
12449         (EmitContext.CaptureVariable): New method used to register that a
12450         LocalInfo must be flagged for capturing. 
12451
12452         (EmitContext.CapturedParameter): New method used to register that a
12453         parameters must be flagged for capturing. 
12454         
12455         (EmitContext.CapturedField): New method used to register that a
12456         field must be flagged for capturing. 
12457
12458         (EmitContext.HaveCapturedVariables,
12459         EmitContext.HaveCapturedFields): Return whether there are captured
12460         variables or fields. 
12461
12462         (EmitContext.EmitMethodHostInstance): This is used to emit the
12463         instance for the anonymous method.  The instance might be null
12464         (static methods), this (for anonymous methods that capture nothing
12465         and happen to live side-by-side with the current method body) or a
12466         more complicated expression if the method has a CaptureContext.
12467
12468         (EmitContext.EmitTopBlock): Routine that drives the emission of
12469         code: it will first resolve the top block, then emit any metadata
12470         and then emit the code.  The split is done so that we can extract
12471         any anonymous methods and flag any captured variables/parameters.
12472         
12473         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12474         during this phase, the ILGenerator should not be used as labels
12475         and local variables declared here might not be accessible to any
12476         code that is part of an anonymous method.  
12477
12478         Exceptions to this include the temporary variables that are
12479         created by some statements internally for holding temporary
12480         variables. 
12481         
12482         (EmitContext.EmitMeta): New routine, in charge of emitting all the
12483         metadata for a cb
12484
12485         (EmitContext.TemporaryReturn): This method is typically called
12486         from the Emit phase, and its the only place where we allow the
12487         ReturnLabel to be defined other than the EmitMeta.  The reason is
12488         that otherwise we would have to duplicate a lot of logic in the
12489         Resolve phases of various methods that today is on the Emit
12490         phase. 
12491
12492         (EmitContext.NeedReturnLabel): This no longer creates the label,
12493         as the ILGenerator is not valid during the resolve phase.
12494
12495         (EmitContext.EmitThis): Extended the knowledge in this class to
12496         work in anonymous methods in addition to iterators. 
12497
12498         (EmitContext.EmitCapturedVariableInstance): This emits whatever
12499         code is necessary on the stack to access the instance to a local
12500         variable (the variable will be accessed as a field).
12501
12502         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12503         EmitContext.EmitAddressOfParameter): Routines to support
12504         parameters (not completed at this point). 
12505         
12506         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
12507         will also remove the parameters.
12508
12509         * convert.cs (Convert): Define a `ConstantEC' which points to a
12510         null.  This is just to prefity some code that uses
12511         ImplicitStandardConversion code and do not have an EmitContext
12512         handy.
12513
12514         The idea is to flag explicitly that at that point in time, it is
12515         known that the conversion will not trigger the delegate checking
12516         code in implicit conversions (which requires a valid
12517         EmitContext). 
12518
12519         Everywhere: pass new EmitContext parameter since
12520         ImplicitStandardConversionExists now requires it to check for
12521         anonymous method conversions. 
12522
12523         (Convert.ImplicitStandardConversionExists): If the type of an
12524         expression is the anonymous_method_type, and the type is a
12525         delegate, we invoke the AnonymousMethod.Compatible method to check
12526         whether an implicit conversion is possible. 
12527
12528         (Convert.ImplicitConversionStandard): Only do implicit method
12529         group conversions if the language level is not ISO_1.
12530
12531         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12532         MethodInfo for the Invoke method.  used by Delegate and
12533         AnonymousDelegate.
12534
12535         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12536         method conversions if the target type is a delegate.
12537
12538         Removed extra debugging nops.
12539
12540         (LocalVariableReference): Turn the `local_info' into a public
12541         field. 
12542
12543         Add `prepared' field, the same hack used for FieldExprs to cope
12544         with composed assignments, as Local variables do not necessarily
12545         operate purely on the stack as they used to: they can be captured
12546         fields. 
12547
12548         Add `temp' for a temporary result, like fields.
12549
12550         Refactor DoResolve and DoResolveLValue into DoResolveBase.
12551
12552         It now copes with Local variables that are captured and emits the
12553         proper instance variable to load it from a field in the captured
12554         case. 
12555
12556         (ParameterReference.DoResolveBase): During the resolve phase,
12557         capture parameters if we are in an anonymous method.
12558
12559         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12560         anonymous method, use the EmitContext helper routines to emit the
12561         parameter reference.
12562
12563         * iterators.cs: Set RemapToProxy to true/false during the
12564         EmitDispose class.
12565
12566         * parameters.cs (GetParameterByName): New helper method. 
12567
12568         * typemanager.cs (anonymous_method_type) a new type that
12569         represents an anonyous method.  This is always an internal type,
12570         used as a fencepost to test against the anonymous-methodness of an
12571         expression. 
12572         
12573 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
12574
12575         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12576         561 report.
12577         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12578
12579 2004-10-18  Martin Baulig  <martin@ximian.com>
12580
12581         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12582         `Type' directly, but call ResolveType() on it.
12583         (Catch.Resolve): Likewise.
12584         (Foreach.Resolve): Likewise.
12585
12586 2004-10-18  Martin Baulig  <martin@ximian.com>
12587
12588         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12589         `Type' directly, but call ResolveType() on it.
12590         (Probe.DoResolve): Likewise.
12591         (ArrayCreation.LookupType): Likewise.
12592         (TypeOf.DoResolve): Likewise.
12593         (SizeOf.DoResolve): Likewise.
12594
12595 2004-10-18  Martin Baulig  <martin@ximian.com>
12596
12597         * expression.cs (Invocation.BetterFunction): Put back
12598         TypeManager.TypeToCoreType().
12599
12600 2004-10-18  Raja R Harinath  <rharinath@novell.com>
12601
12602         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12603         the ResolveType.
12604
12605 2004-10-18  Martin Baulig  <martin@ximian.com>
12606
12607         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
12608         `Type' directly, but call ResolveType() on it.
12609
12610 2004-10-18  Martin Baulig  <martin@ximian.com>
12611
12612         * class.cs (FieldMember.Define): Don't access the TypeExpr's
12613         `Type' directly, but call ResolveType() on it.
12614         (MemberBase.DoDefine): Likewise.
12615
12616         * expression.cs (New.DoResolve): Don't access the TypeExpr's
12617         `Type' directly, but call ResolveType() on it.
12618         (ComposedCast.DoResolveAsTypeStep): Likewise.
12619
12620         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12621         `Type' directly, but call ResolveType() on it.
12622
12623 2004-10-17  John Luke  <john.luke@gmail.com>
12624
12625         * class.cs (Operator.GetSignatureForError): use CSharpName
12626
12627         * parameter.cs (Parameter.GetSignatureForError): Returns
12628         correct name even if was not defined.
12629
12630 2004-10-13  Raja R Harinath  <rharinath@novell.com>
12631
12632         Fix #65816.
12633         * class.cs (TypeContainer.EmitContext): New property.
12634         (DefineNestedTypes): Create an emitcontext for each part.
12635         (MethodCore.DoDefineParameters): Use container's emitcontext.
12636         Pass type array to InternalParameters.
12637         (MemberBase.DoDefine): Use container's emitcontext.
12638         (FieldMember.Define): Likewise.
12639         (Event.Define): Likewise.
12640         (SetMethod.GetParameterInfo): Change argument to EmitContext.
12641         Pass type array to InternalParameters.
12642         (SetIndexerMethod.GetParameterInfo): Likewise.
12643         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12644         * delegate.cs (Define): Pass emitcontext to
12645         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
12646         array to InternalParameters.
12647         * expression.cs (ParameterReference.DoResolveBase): Pass
12648         emitcontext to GetParameterInfo.
12649         (ComposedCast.DoResolveAsTypeStep): Remove check on
12650         ec.ResolvingTypeTree.
12651         * parameter.cs (Parameter.Resolve): Change argument to
12652         EmitContext.  Use ResolveAsTypeTerminal.
12653         (Parameter.GetSignature): Change argument to EmitContext.
12654         (Parameters.ComputeSignature): Likewise.
12655         (Parameters.ComputeParameterTypes): Likewise.
12656         (Parameters.GetParameterInfo): Likewise.
12657         (Parameters.ComputeAndDefineParameterTypes): Likewise.
12658         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
12659         * support.cs (InternalParameters..ctor): Remove variant that takes
12660         a DeclSpace.
12661         * typemanager.cs (system_intptr_expr): New.
12662         (InitExpressionTypes): Initialize it.
12663
12664 2004-10-12  Chris Toshok  <toshok@ximian.com>
12665
12666         * cs-parser.jay: fix location for try_statement and catch_clause.
12667
12668 2004-10-11  Martin Baulig  <martin@ximian.com>
12669
12670         * report.cs: Don't make --fatal abort on warnings, we have
12671         -warnaserror for that.
12672
12673 2004-10-07  Raja R Harinath  <rharinath@novell.com>
12674
12675         More DeclSpace.ResolveType avoidance.
12676         * decl.cs (MemberCore.InUnsafe): New property.
12677         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
12678         with newly created EmitContext.
12679         (FieldMember.Define): Likewise.
12680         * delegate.cs (Delegate.Define): Likewise.
12681         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
12682         only if normal name-lookup fails.
12683         (TypeExpr.DoResolve): Enable error-checking.
12684         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
12685         (SizeOf.DoResolve): Likewise.
12686         (ComposedCast.DoResolveAsTypeStep): Likewise.
12687         (StackAlloc.DoResolve): Likewise.
12688         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
12689         (Block.Unsafe): New property.
12690         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
12691         (Unsafe): Set 'unsafe' flag of contained block.
12692         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
12693         (Fixed.Resolve): Likewise.
12694         (Catch.Resolve): Likewise.
12695         (Using.ResolveLocalVariableDecls): Likewise.
12696         (Foreach.Resolve): Likewise.
12697
12698 2004-10-05  John Luke <john.luke@gmail.com>
12699
12700         * cs-parser.jay: add location to error CS0175
12701
12702 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
12703
12704         * ecore.cs (Expression.Constantity): Add support for turning null
12705         into a constant.
12706
12707         * const.cs (Const.Define): Allow constants to be reference types
12708         as long as the value is Null.
12709
12710 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
12711
12712         * namespace.cs (NamespaceEntry.Using): No matter which warning
12713         level is set, check if this namespace name has already been added.
12714
12715 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
12716
12717         * expression.cs: reftype [!=]= null should always use br[true,false].
12718         # 67410
12719
12720 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
12721
12722         Fix #67108
12723         * attribute.cs: Enum conversion moved to 
12724         GetAttributeArgumentExpression to be applied to the all
12725         expressions.
12726
12727 2004-10-01  Raja R Harinath  <rharinath@novell.com>
12728
12729         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
12730         * class.c (TypeContainer.DefineType): Flag error if
12731         base types aren't accessible due to access permissions.
12732         * decl.cs (DeclSpace.ResolveType): Move logic to
12733         Expression.ResolveAsTypeTerminal.
12734         (DeclSpace.ResolveTypeExpr): Thin layer over
12735         Expression.ResolveAsTypeTerminal.
12736         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
12737         Refactor code into NestedAccess.  Use it.
12738         (DeclSpace.NestedAccess): New.
12739         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
12740         argument to silence errors.  Check access permissions.
12741         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
12742         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
12743         (Cast.DoResolve): Likewise.
12744         (New.DoResolve): Likewise.
12745         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
12746         (TypeOf.DoResolve): Likewise.
12747
12748         * expression.cs (Invocation.BetterConversion): Return the Type of
12749         the better conversion.  Implement section 14.4.2.3 more faithfully.
12750         (Invocation.BetterFunction): Make boolean.  Make correspondence to
12751         section 14.4.2.2 explicit.
12752         (Invocation.OverloadResolve): Update.
12753         (Invocation): Remove is_base field.
12754         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
12755         (Invocation.Emit): Likewise.
12756
12757 2004-09-27  Raja R Harinath  <rharinath@novell.com>
12758
12759         * README: Update to changes.
12760
12761 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
12762
12763         * cs-parser.jay: Reverted 642 warning fix.
12764
12765 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
12766
12767         Fix bug #66615
12768         * decl.cs (FindMemberWithSameName): Indexer can have more than
12769         1 argument.
12770
12771 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
12772
12773         * expression.cs (LocalVariableReference.DoResolveLValue):
12774         Do not report warning 219 for out values.
12775         (EmptyExpression.Null): New member to avoid extra allocations.
12776
12777 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
12778
12779         * cs-parser.jay: Fix wrong warning 642 report.
12780
12781         * cs-tokenizer.cs (CheckNextToken): New helper;
12782         Inspect next character if is same as expected.
12783
12784 2004-09-23  Martin Baulig  <martin@ximian.com>
12785
12786         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
12787         (Convert.ImplicitReferenceConversionExists): Likewise.
12788
12789 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
12790
12791         * class.cs (Operator.Define): Add error 448 and 559 report.
12792
12793 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
12794
12795         * class.cs (MemberBase.IsTypePermitted): New protected
12796         method for checking error CS0610.
12797
12798 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
12799
12800         * class.cs (TypeContainer.HasExplicitLayout): New property
12801         Returns whether container has StructLayout attribute set Explicit.
12802         (FieldMember): New abstract class for consts and fields.
12803         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
12804         (Field): Reuse FieldMember.
12805
12806         * const.cs (Const): Reuse FieldMember.
12807
12808         * rootcontext.cs: EmitConstants call moved to class.
12809
12810 2004-09-22  Martin Baulig  <martin@ximian.com>
12811
12812         Thanks to Peter Sestoft for this bug report.
12813
12814         * expression.cs (Conditional): If both the `trueExpr' and the
12815         `falseExpr' is a NullLiteral, return a NullLiteral.
12816
12817 2004-09-22  Martin Baulig  <martin@ximian.com>
12818
12819         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
12820         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
12821         for the "get_Current" call.
12822
12823 2004-09-22  Martin Baulig  <martin@ximian.com>
12824
12825         Marek and me just fixed one of our oldest bugs: #28562 :-)
12826
12827         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
12828
12829         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
12830         we're an EnumConstant, just return that.
12831         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
12832         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
12833         to get the value which'll actually be written into the attribute.
12834         However, we have to use GetValue() to access the attribute's value
12835         in the compiler.        
12836
12837 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
12838
12839         * constant.cs (Constant.IsNegative): New abstract property
12840         IsNegative.
12841
12842         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
12843         (StackAlloc.DoResolve): Reused IsNegative.
12844
12845 2004-09-21  Martin Baulig  <martin@ximian.com>
12846
12847         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
12848         if we're used in an iterator, we may be called from different
12849         methods.
12850
12851         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
12852         we actually have an exception block.
12853
12854 2004-09-20  John Luke <jluke@cfl.rr.com>
12855
12856         * class.cs, cs-parser.jay: Improve the error report for 1520:
12857         report the actual line where the error happens, not where the
12858         class was declared.
12859
12860         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
12861         Pass location information that was available elsewhere.
12862
12863 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
12864
12865         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
12866         runtime to delay sign assemblies.
12867
12868 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
12869
12870         * cs-parser.jay: Do not report the stack trace, this is barely
12871         used nowadays.
12872
12873 2004-08-22  John Luke  <john.luke@gmail.com>
12874  
12875         * driver.cs : check that a resource id is not already used
12876         before adding it, report CS1508 if it is, bug #63637
12877
12878 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
12879
12880         * ecore.cs: Removed dead code.
12881
12882 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
12883
12884         * class.cs: Do not report warning CS0067 on the interfaces.
12885
12886 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
12887
12888         * cs-parser.jay: Add error 504 report.
12889
12890 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
12891
12892         * rootcontext.cs: WarningLevel is 4 by default now.
12893
12894         * statement.cs (Fixed.Resolve): Do not null
12895         VariableInfo.
12896
12897 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
12898
12899         Fixed bug #55780
12900         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
12901         deep search when property is not virtual.
12902         (PropertyExpr.ResolveAccessors): Make one call for both
12903         accessors.
12904
12905 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
12906
12907         Fixed bug #65766
12908         * statement.cs: Error 152 report constains also location.
12909
12910 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
12911
12912         Fixed bug #65766
12913         * const.cs: Explicitly set constant as static.
12914
12915 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
12916
12917         Fixed bug #64226
12918         * cs-parser.jay: Add error 1017 report.
12919
12920 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
12921
12922         Fixed bug #59980, #64224
12923         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
12924
12925         * typemanager.cs (IsSpecialMethod): Simplified
12926
12927 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
12928
12929         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
12930         condition with better params.
12931
12932 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
12933
12934         Fixed bug #65238
12935         * attribute.cs (Resolve): Property has to have both
12936         accessors.
12937
12938 2004-09-14  Martin Baulig  <martin@ximian.com>
12939
12940         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
12941
12942 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
12943
12944         Fixed bug #61902
12945         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
12946         called and is obsolete then this member suppress message
12947         when call is inside next [Obsolete] method or type.
12948
12949         * expression.cs: Use TestObsoleteMethodUsage member.
12950
12951 2004-09-14  Martin Baulig  <martin@ximian.com>
12952
12953         * cs-parser.jay: Sync a bit with the GMCS version.
12954
12955 2004-09-14  Martin Baulig  <martin@ximian.com>
12956
12957         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
12958         (CSharpParser.yacc_verbose_flag): New public field.
12959
12960         * genericparser.cs: Removed.
12961
12962 2004-09-14  Raja R Harinath  <rharinath@novell.com>
12963
12964         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
12965
12966 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
12967
12968         * class.cs (MethodCore.CheckBase): Fix bug #65757.
12969
12970 2004-09-10  Martin Baulig  <martin@ximian.com>
12971
12972         Backported my MemberName changes from GMCS into MCS.
12973
12974         - we are now using a special `MemberName' class instead of using
12975         strings; in GMCS, the `MemberName' also contains the type
12976         arguments.
12977
12978         - changed the grammar rules a bit:
12979           * the old `member_name' is now a `namespace_or_type_name':
12980             The rule is that we use `namespace_or_type_name' everywhere
12981             where we expect either a "member name" (GetEnumerator) or a
12982             "member name" with an explicit interface name
12983             (IEnumerable.GetEnumerator).
12984             In GMCS, the explicit interface name may include type arguments
12985             (IEnumerable<T>.GetEnumerator).
12986           * we use `member_name' instead of just `IDENTIFIER' for
12987             "member names":
12988             The rule is that we use `member_name' wherever a member may
12989             have type parameters in GMCS.       
12990
12991         * decl.cs (MemberName): New public class.
12992         (MemberCore.MemberName): New public readonly field.
12993         (MemberCore.ctor): Take a `MemberName' argument, not a string.
12994         (DeclSpace): Likewise.
12995
12996         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
12997         * enum.cs (Enum.ctor): Likewise.
12998
12999         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13000         MemberName.     
13001         (AliasEntry.ctor): Take a MemberName, not an Expression.
13002         (AliasEntry.UsingAlias): Likewise.
13003
13004         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13005         (IMethodData.MemberName): Changed type from string to MemberName.
13006         (MemberBase.ExplicitInterfaceName): Likewise.
13007         (AbstractPropertyEventMethod.SetupName): Make this private.
13008         (AbstractPropertyEventMethod.ctor): Added `string prefix'
13009         argument; compute the member name here.
13010         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13011         on the `member.MemberName' and the `prefix'.
13012
13013         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13014         not `type_name'.
13015         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13016         thus, we get a `MemberName' instead of a `string'.  These
13017         declarations may have type parameters in GMCS.
13018         (interface_method_declaration, delegate_declaration): Likewise.
13019         (class_declaration, interface_declaration): Likewise.
13020         (method_header): Use `namespace_or_type_name' instead of
13021         `member_name'.  We may be an explicit interface implementation.
13022         (property_declaration, event_declaration): Likewise.
13023         (member_name): This is now just an `IDENTIFIER', not a
13024         `namespace_or_type_name'.
13025         (type_name, interface_type): Removed.
13026         (namespace_or_type_name): Return a MemberName, not an Expression.
13027         (primary_expression): Use `member_name' instead of `IDENTIFIER';
13028         call GetTypeExpression() on the MemberName to get an expression.
13029         (IndexerDeclaration.interface_type): Changed type from string to
13030         MemberName.
13031         (MakeName): Operate on MemberName's instead of string's.
13032
13033 2004-09-13  Raja R Harinath  <rharinath@novell.com>
13034
13035         Fix bug #55770.
13036         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13037         (NamespaceEntry.Lookup): Add new argument to flag if we want the
13038         lookup to avoid symbols introduced by 'using'.
13039         * rootcontext.cs (NamespaceLookup): Update.
13040
13041 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13042
13043         * class.cs (TypeContainer.DoDefineMembers): Do not call
13044         DefineDefaultConstructor for static classes.
13045
13046 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13047
13048         * attribute.cs (Attribute.Resolve): Add error 653 report.
13049
13050         * class.cs (Class.ApplyAttributeBuilder): Add error 641
13051         report.
13052         (Method.ApplyAttributeBuilder): Add error 685 report.
13053         (Operator.Define): Add error 564 report.
13054
13055         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13056
13057         * expression.cs (Invocation.DoResolve): Add error
13058         245 and 250 report.
13059
13060         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13061         error 674 report.
13062
13063 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13064
13065         * class.cs (ConstructorInitializer.Resolve):
13066         Wrong error number (515->516).
13067
13068 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13069
13070         * class.cs (Indexer.Define): Add error 631 report.
13071
13072 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13073
13074         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13075
13076 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13077
13078         * expression.cs (Probe.DoResolve): Add error CS0241 report.
13079
13080 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
13081
13082         * cs-parser.jay: Added error CS0241 report.
13083
13084 2004-09-10  Raja R Harinath  <rharinath@novell.com>
13085
13086         * cs-parser.jay (fixed_statement): Introduce a scope for the
13087         declaration in the 'fixed' statement.
13088
13089 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13090
13091         * cs-parser.jay: Added CS0230 error report.
13092
13093 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13094
13095         * cs-parser.jay: Added errors CS0231 and CS0257 report.
13096
13097 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13098
13099         * expression.cs (Argument.Resolve): Added error CS0192 and
13100         CS0199 report.
13101
13102 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13103
13104         C# 2.0 #pragma warning feature
13105
13106         * cs-tokenizer.cs (PreProcessPragma): New method; 
13107         Handles #pragma directive.
13108
13109         * report.cs (WarningRegions): New class; Support
13110         class for #pragma warning directive. It tests whether
13111         warning is enabled for a given line.
13112
13113 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
13114
13115         * const.cs: Add more descriptive error report, tahnks to
13116         Sebastien. 
13117
13118 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
13119
13120         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13121
13122 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
13123
13124         * expression.cs: Apply patch from Ben: Remove dead code from
13125         ArrayCreation, and remove the TurnintoConstant call in const.cs,
13126         as that code just threw an exception anwyays.
13127
13128         * const.cs: Remove the call to the turnintoconstant, for details
13129         see bug: #63144
13130         
13131         * literal.cs: The type of the null-literal is the null type;  So
13132         we use a placeholder type (literal.cs:System.Null, defined here)
13133         for it.
13134
13135         * expression.cs (Conditional.DoResolve): Remove some old code that
13136         is no longer needed, conversions have been fixed.
13137
13138         (ArrayCreationExpression.DoResolve): Return false if we fail to
13139         resolve the inner expression.
13140
13141 2004-09-07  Raja R Harinath  <rharinath@novell.com>
13142
13143         Fix test-290.cs.
13144         * cs-parser.jay (delegate_declaration): Record a delegate
13145         declaration as a type declaration.
13146         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13147
13148 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
13149
13150         * parameter.cs: Do not crash if the type can not be resolved. 
13151
13152         * expression.cs: Report errors with unsafe pointers, fixes #64896
13153
13154 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
13155
13156         * expression.cs: Pointer arith always needs to do a conv.i
13157         if the operand is a long. fix 65320
13158
13159 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13160
13161         Fixed cs0619-37.cs, cs0619-38.cs
13162
13163         * enum.cs (GetObsoleteAttribute): Removed.
13164
13165         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13166         on Enum member is double staged. The first is tested member
13167         and then enum.
13168
13169 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13170
13171         Fixed #56986, #63631, #65231
13172
13173         * class.cs: (TypeContainer.AddToMemberContainer): New method,
13174         adds member to name container.
13175         (TypeContainer.AddToTypeContainer): New method, adds type to
13176         name container.
13177         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13178         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13179         AddOperator): Simplified by reusing AddToMemberContainer.
13180         (TypeContainer.UserDefinedStaticConstructor): Changed to property
13181         instead of field.
13182         (Method.CheckForDuplications): Fixed implementation to test all
13183         possibilities.
13184         (MemberBase): Detection whether member is explicit interface
13185         implementation is now in constructor.
13186         (MemberBase.UpdateMemberName): Handles IndexerName.
13187         (Accessor): Changed to keep also location information.
13188         (AbstractPropertyEventMethod): Is derived from MemberCore.
13189         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13190         will be emited or not.
13191         (PropertyBase.AreAccessorsDuplicateImplementation):
13192         Tests whether accessors are not in collision with some method.
13193         (Operator): Is derived from MethodCore to simplify common
13194         operations.
13195
13196         * decl.cs (Flags.TestMethodDuplication): Test for duplication
13197         must be performed.
13198         (DeclSpace.AddToContainer): Adds the member to defined_names
13199         table. It tests for duplications and enclosing name conflicts.
13200
13201         * enum.cs (EnumMember): Clean up to reuse the base structures
13202
13203 2004-09-03  Martin Baulig  <martin@ximian.com>
13204
13205         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13206         into TypeContainer, to make partial classes work again.
13207
13208 2004-09-03  Martin Baulig  <martin@ximian.com>
13209
13210         * rootcontext.cs (RootContext.V2): Removed.
13211
13212 2004-03-23  Martin Baulig  <martin@ximian.com>
13213
13214         * expression.cs (Invocation.OverloadResolve): Added `bool
13215         may_fail' argument and use it instead of the Location.IsNull() hack.
13216
13217 2004-09-03  Martin Baulig  <martin@ximian.com>
13218
13219         Merged latest changes into gmcs.  Please keep this comment in
13220         here, it makes it easier for me to see what changed in MCS since
13221         the last time I merged.
13222
13223 2004-09-03  Raja R Harinath  <rharinath@novell.com>
13224
13225         Fix #61128.
13226         * expression.cs (BetterConversion): Don't allow either conversion 
13227         to be null.  Remove redundant implicit conversion test when 'q ==
13228         null' -- when this function is invoked, we already know that the
13229         implicit conversion exists.
13230         (BetterFunction): Assume that 'best' is non-null.  Remove
13231         redundant reimplementation of IsApplicable when 'best' is null.
13232         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13233         number of arguments.
13234         (IsAncestralType): Extract from OverloadResolve.
13235         (OverloadResolve): Make robust to the MethodGroupExpr being
13236         unsorted.  Implement all the logic of Section 14.5.5.1, and
13237         support overloading of methods from multiple applicable types.
13238         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
13239
13240         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13241         (RealError, Warning): Append type of report to related symbol.
13242
13243 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
13244
13245         * enum.cs: Fixed CLS-Compliance checks for enum members.
13246         Error tests cs3008-8.cs, cs3014-8.cs
13247
13248 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13249
13250         Fixed bug #62342, #63102
13251         * class.cs: ImplementIndexer uses member.IsExplicitImpl
13252         like ImplementMethod.
13253
13254 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13255
13256         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13257         Fixed bug #65170.
13258
13259 2004-09-02  Martin Baulig  <martin@ximian.com>
13260
13261         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13262         TypeManager.GetArgumentTypes() rather than calling GetParameters()
13263         on the MethodBase.
13264
13265 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
13266
13267         C# 2.0 Static classes implemented
13268
13269         * class.cs (TypeContainer): instance_constructors,
13270         initialized_fields, initialized_static_fields,
13271         default_constructor, base_inteface_types are protected to be
13272         accessible from StaticClass.
13273         (TypeContainer.DefineDefaultConstructor): New virtual method
13274         for custom default constructor generating
13275         (StaticClass): New class to handle "Static classes" feature.
13276
13277         * cs-parser.jay: Handle static keyword on class like instance
13278         of StaticClass.
13279
13280         * driver.cs: Added "/langversion" command line switch with two
13281         options (iso-1, default).
13282
13283 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
13284
13285         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13286
13287 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
13288
13289         * delegate.cs: Style.
13290
13291 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13292
13293         * delegate.cs: Add seperate instance expr field for miguel.
13294
13295 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13296
13297         * PointerArithmetic (Resolve): make sure we are not doing
13298         pointer arith on void*. Also, make sure we are resolved
13299         by not setting eclass until resolve.
13300
13301         All callers: Make sure that PointerArithmetic gets resolved.
13302
13303 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13304
13305         * ArrayCreation (LookupType): If the type does not resolve 
13306         to an array, give an error.
13307
13308 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
13309
13310         * statement.cs (Try.Resolve): Fixed bug #64222
13311
13312 2004-08-27  Martin Baulig  <martin@ximian.com>
13313
13314         * class.cs
13315         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13316         crash here.     
13317
13318 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13319
13320         * ecore.cs (Constantify): Get underlying type via
13321         System.Enum.GetUnderlyingType to avoid StackOverflow on the
13322         Windows in special cases.
13323
13324 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13325
13326         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13327         for obtaining also private methods.
13328         (GetRemoveMethod): Used GetRemoveMethod (true)
13329         for obtaining also private methods.
13330
13331 2004-08-24  Martin Baulig  <martin@ximian.com>
13332
13333         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13334         MethodAttributes.HideBySig for operators.
13335
13336 2004-08-23  Martin Baulig  <martin@ximian.com>
13337
13338         Back to the old error reporting system :-)
13339
13340         * report.cs (Message): Removed.
13341         (Report.MessageData, ErrorData, WarningData): Removed.
13342         (Report.Error, Warning): Back to the old system.
13343
13344 2004-08-23  Martin Baulig  <martin@ximian.com>
13345
13346         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13347
13348         * class.cs (TypeContainer.ParentContainer): New public virtual
13349         method; replaces the explicit interface implementation.
13350         (ClassPart.ParentContainer): Override.
13351
13352 2004-08-23  Martin Baulig  <martin@ximian.com>
13353
13354         * statement.cs (Switch): Added support for constant switches; see
13355         #59428 or test-285.cs.
13356
13357 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13358
13359         Fixed bug #62740.
13360         * statement.cs (GetEnumeratorFilter): Removed useless
13361         logic because C# specs is strict. GetEnumerator must be
13362         public.
13363
13364 2004-08-22  Martin Baulig  <martin@ximian.com>
13365
13366         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13367         a switch and may break, reset the barrier.  Fixes #59867.
13368
13369 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13370
13371         CLS-Compliance speed up (~5% for corlib)
13372
13373         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13374         New method. Tests container for CLS-Compliant names
13375
13376         * class.cs (TypeContainer.VerifyClsName): New method.
13377         Checks whether container name is CLS Compliant.
13378         (Constructor): Implements IMethodData.
13379
13380         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13381         low-case table for CLS Compliance test.
13382         (MemberCache.VerifyClsParameterConflict): New method.
13383         Checks method parameters for CS3006 error.
13384
13385         * enum.cs (EnumMember): Is derived from MemberCore.
13386         (Enum.VerifyClsName): Optimized for better performance.
13387
13388 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13389
13390         * report.cs: Renamed Error_T to Error and changed all
13391         references.
13392
13393 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13394
13395         * class.cs (TypeContainer.IndexerArrayList): New inner class
13396         container for indexers.
13397         (TypeContainer.DefaultIndexerName): New constant for default
13398         indexer name. Replaced all "Item" with this constant.
13399         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13400
13401         * typemanager.cs (TypeManager.default_member_ctor): Cache here
13402         DefaultMemberAttribute constructor.
13403
13404 2004-08-05  Martin Baulig  <martin@ximian.com>
13405
13406         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13407         Fix bug #59429.
13408
13409 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
13410
13411         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13412         multi platforms problem.
13413
13414         * compiler.csproj: Included shared files.
13415
13416 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13417
13418         Fix bug 60333, 55971 in the more general way
13419         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13420         Added arg_type argument for constant conversion.
13421         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13422
13423 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13424
13425         Fix bug #59760
13426         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
13427         OperatorArrayList, MethodCoreArrayList for typecontainer
13428         containers. Changed class member types to these new types.
13429         (MethodArrayList.DefineMembers): Added test for CS0659.
13430
13431 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
13432
13433         * cfold.cs: Synchronize the folding with the code in expression.cs
13434         Binary.DoNumericPromotions for uint operands.
13435
13436         * attribute.cs: Revert patch from Raja, it introduced a regression
13437         while building Blam-1.2.1 (hard to isolate a test case).
13438
13439 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13440
13441         Fix for #55382
13442         * class.cs:
13443         (TypeContainer.Define): Renamed to DefineContainerMembers because of
13444         name collision.
13445         (MethodCore.parent_method): New member. The method we're overriding
13446         if this is an override method.
13447         (MethodCore.CheckBase): Moved from Method class and made common.
13448         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13449         private.
13450         (MethodCore.CheckForDuplications): New abstract method. For custom
13451         member duplication search in a container
13452         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13453         method and its return type.
13454         (Event.conflict_symbol): New member. Symbol with same name in the
13455         parent class.
13456
13457         * decl.cs:
13458         (MemberCache.FindMemberWithSameName): New method. The method
13459         is looking for conflict with inherited symbols.
13460
13461 2004-08-04  Martin Baulig  <martin@ximian.com>
13462
13463         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13464
13465         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13466
13467 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13468
13469         * report.cs (Message): New enum for better error, warning reference in
13470         the code.
13471         (MessageData): New inner abstract class. It generally handles printing of
13472         error and warning messages.
13473         Removed unused Error, Warning, Message methods.
13474
13475 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13476
13477         Fix for cs0592-8.cs test
13478         * attribute.cs
13479         (Attributable.ValidAttributeTargets): Made public.
13480         (Attribute.ExplicitTarget): New member for explicit target value.
13481         (Attribute.CheckTargets): Now we translate explicit attribute
13482         target to Target here.
13483
13484 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
13485
13486         * ecore.cs (MethodGroupExpr): new IsBase property.
13487
13488         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13489
13490         * delegate.cs (DelegateCreation): store a MethodGroupExpr
13491         rather than an instance expr.
13492
13493         (DelegateCreation.Emit): Use the method group rather than
13494         the instance expression. Also, if you have base.Foo as the
13495         method for a delegate, make sure to emit ldftn, not ldftnvirt.
13496
13497         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
13498
13499         (NewDelegate.DoResolve): Only check for the existance of Invoke
13500         if the method is going to be needed. Use MethodGroupExpr.
13501
13502         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
13503
13504         * expression.cs: For pointer arith., make sure to use
13505         the size of the type, not the size of the pointer to
13506         the type.
13507
13508 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13509
13510         Fix for #60722
13511         * class.cs (Class): Added error CS0502 test.
13512
13513 2004-08-03  John Luke  <jluke@cfl.rr.com>
13514             Raja R Harinath  <rharinath@novell.com>
13515
13516         Fix for #60997.
13517         * attribute.cs (Attribute.complained_before): New flag.
13518         (Attribute.ResolveType, Attribute.Resolve),
13519         (Attribute.DefinePInvokeMethod): Set it.
13520         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13521         
13522 2004-08-03  Martin Baulig  <martin@ximian.com>
13523
13524         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13525         use a user-defined operator; we still need to do numeric
13526         promotions in case one argument is a builtin type and the other
13527         one has an implicit conversion to that type.  Fixes #62322.
13528
13529 2004-08-02  Martin Baulig  <martin@ximian.com>
13530
13531         * statement.cs (LocalInfo.Flags): Added `IsThis'.
13532         (LocalInfo.IsThis): New public property.
13533         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13534
13535 2004-08-01  Martin Baulig  <martin@ximian.com>
13536
13537         * class.cs (TypeContainer.GetClassBases): Don't set the default
13538         here since we may get called from GetPartialBases().
13539         (TypeContainer.DefineType): If GetClassBases() didn't return a
13540         parent, use the default one.
13541
13542 2004-07-30  Duncan Mak  <duncan@ximian.com>
13543
13544         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13545
13546 2004-07-30  Martin Baulig  <martin@ximian.com>
13547
13548         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13549
13550         * class.cs (SourceMethod): New public class, derive from the
13551         symbol writer's ISourceMethod.
13552         (Method): Use the new symbol writer API.
13553
13554         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13555         as argument and use the new symbol writer.
13556
13557         * location.cs
13558         (SourceFile): Implement the symbol writer's ISourceFile.
13559         (Location.SymbolDocument): Removed.
13560         (Location.SourceFile): New public property.
13561
13562         * symbolwriter.cs: Use the new symbol writer API.
13563
13564 2004-07-30  Raja R Harinath  <rharinath@novell.com>
13565
13566         * Makefile (install-local): Remove.  Functionality moved to
13567         executable.make.
13568
13569 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
13570
13571         * Makefile: Install mcs.exe.config file together with mcs.exe.
13572         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13573         correct runtime version.
13574         
13575 2004-07-25  Martin Baulig  <martin@ximian.com>
13576
13577         * class.cs
13578         (TypeContainer.RegisterOrder): Removed, this was unused.
13579         (TypeContainer, interface_order): Removed.
13580         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13581         TypeContainer as argument since we can also be called with a
13582         `PartialContainer' for a partial class/struct/interface.
13583         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13584         of checking whether we're an `Interface' - we could be a
13585         `PartialContainer'.
13586         (PartialContainer.Register): Override; call
13587         AddClass()/AddStruct()/AddInterface() on our parent.
13588
13589         * cs-parser.jay (interface_member_declaration): Add things to the
13590         `current_container', not the `current_class'.
13591
13592         * rootcontext.cs (RegisterOrder): The overloaded version which
13593         takes an `Interface' was unused, removed.
13594
13595         * typemanager.cs (TypeManager.LookupInterface): Return a
13596         `TypeContainer', not an `Interface'.
13597         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13598         contain a `PartialContainer' for an interface, so check it's
13599         `Kind' to figure out what it is.
13600
13601 2004-07-25  Martin Baulig  <martin@ximian.com>
13602
13603         * class.cs (Class.DefaultTypeAttributes): New public constant.
13604         (Struct.DefaultTypeAttributes): Likewise.
13605         (Interface.DefaultTypeAttributes): Likewise.
13606         (PartialContainer.TypeAttr): Override this and add the
13607         DefaultTypeAttributes.
13608
13609 2004-07-25  Martin Baulig  <martin@ximian.com>
13610
13611         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13612         we can just use the `Parent' field instead.
13613
13614 2004-07-25  Martin Baulig  <martin@ximian.com>
13615
13616         * class.cs (TypeContainer.Emit): Renamed to EmitType().
13617
13618 2004-07-25  Martin Baulig  <martin@ximian.com>
13619
13620         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13621         our parts before defining any methods.
13622         (TypeContainer.VerifyImplements): Make this virtual.
13623         (ClassPart.VerifyImplements): Override and call VerifyImplements()
13624         on our PartialContainer.
13625
13626 2004-07-25  Martin Baulig  <martin@ximian.com>
13627
13628         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13629
13630         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13631         argument, we can just use the `Parent' field instead.
13632
13633         * class.cs
13634         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
13635         (MemberBase.DoDefine): Likewise.
13636
13637 2004-07-24  Martin Baulig  <martin@ximian.com>
13638
13639         * decl.cs (MemberCore.Parent): New public field.
13640         (DeclSpace.Parent): Moved to MemberCore.
13641
13642         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13643         (MemberBase.ctor): Added TypeContainer argument, pass it to our
13644         parent's .ctor.
13645         (FieldBase, Field, Operator): Likewise.
13646         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13647         (EventField, Event): Likewise.
13648
13649 2004-07-23  Martin Baulig  <martin@ximian.com>
13650
13651         * class.cs (PartialContainer): New public class.
13652         (ClassPart): New public class.
13653         (TypeContainer): Added support for partial classes.
13654         (TypeContainer.GetClassBases): Splitted some of the functionality
13655         out into GetNormalBases() and GetPartialBases().
13656
13657         * cs-tokenizer.cs (Token.PARTIAL): New token.
13658         (Tokenizer.consume_identifier): Added some hacks to recognize
13659         `partial', but only if it's immediately followed by `class',
13660         `struct' or `interface'.
13661
13662         * cs-parser.jay: Added support for partial clases.
13663
13664 2004-07-23  Martin Baulig  <martin@ximian.com>
13665
13666         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13667         a `DeclSpace' and also made it readonly.
13668         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13669         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
13670         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
13671
13672         * cs-parser.jay: Pass the `current_class', not the
13673         `current_container' (at the moment, this is still the same thing)
13674         to a new Method, Property, Event, Indexer or Constructor.
13675
13676 2004-07-23  Martin Baulig  <martin@ximian.com>
13677
13678         * cs-parser.jay (CSharpParser): Added a new `current_class' field
13679         and removed the `current_interface' one.
13680         (struct_declaration, class_declaration, interface_declaration):
13681         Set `current_class' to the newly created class/struct/interface;
13682         set their `Bases' and call Register() before parsing their body.
13683
13684 2004-07-23  Martin Baulig  <martin@ximian.com>
13685
13686         * class.cs (Kind): New public enum.
13687         (TypeContainer): Made this class abstract.
13688         (TypeContainer.Kind): New public readonly field.
13689         (TypeContainer.CheckDef): New public method; moved here from
13690         cs-parser.jay.
13691         (TypeContainer.Register): New public abstract method.
13692         (TypeContainer.GetPendingImplementations): New public abstract
13693         method.
13694         (TypeContainer.GetClassBases): Removed the `is_class' and
13695         `is_iface' parameters.
13696         (TypeContainer.DefineNestedTypes): Formerly known as
13697         DoDefineType().
13698         (ClassOrStruct): Made this class abstract.
13699
13700         * tree.cs (RootTypes): New public type. 
13701
13702 2004-07-20  Martin Baulig  <martin@ximian.com>
13703
13704         * tree.cs (Tree.RecordNamespace): Removed.
13705         (Tree.Namespaces): Removed.
13706
13707         * rootcontext.cs (RootContext.IsNamespace): Removed.
13708
13709         * cs-parser.jay (namespace_declaration): Just create a new
13710         NamespaceEntry here.
13711
13712 2004-07-20  Martin Baulig  <martin@ximian.com>
13713
13714         * statement.cs (ExceptionStatement): New abstract class.  This is
13715         now used as a base class for everyone who's using `finally'.
13716         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
13717         our local variables before using them.
13718
13719         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
13720         virtual method.  This is used by Yield.Resolve() to "steal" an
13721         outer block's `finally' clauses.
13722         (FlowBranchingException): The .ctor now takes an ExceptionStatement
13723         argument.
13724
13725         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
13726         version which takes an ExceptionStatement.  This version must be
13727         used to create exception branchings.
13728
13729         * iterator.cs
13730         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
13731         (Iterator.EmitMoveNext): Added exception support; protect the
13732         block with a `fault' clause, properly handle 'finally' clauses.
13733         (Iterator.EmitDispose): Run all the `finally' clauses here.
13734
13735 2004-07-20  Martin Baulig  <martin@ximian.com>
13736
13737         * iterator.cs: This is the first of a set of changes in the
13738         iterator code.  Match the spec more closely: if we're an
13739         IEnumerable, then GetEnumerator() must be called.  The first time
13740         GetEnumerator() is called, it returns the current instance; all
13741         subsequent invocations (if any) must create a copy.
13742
13743 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
13744
13745         * expression.cs: Resolve the constant expression before returning
13746         it. 
13747
13748 2004-07-19  Martin Baulig  <martin@ximian.com>
13749
13750         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
13751         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
13752         the return type of the new EmitContext.
13753
13754 2004-07-18  Martin Baulig  <martin@ximian.com>
13755
13756         * class.cs (Property.Define): Fix iterators.
13757
13758         * iterators.cs (Iterator.Define): Moved the
13759         `container.AddInterator (this)' call here from the .ctor; only do
13760         it if we resolved successfully.
13761
13762 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
13763
13764         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
13765         `true' for preprocessing directives that we parse.  The return
13766         value indicates whether we should return to regular tokenizing or
13767         not, not whether it was parsed successfully.
13768
13769         In the past if we were in: #if false ... #line #endif, we would
13770         resume parsing after `#line'.  See bug 61604.
13771
13772         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
13773         building: IsEnumType should return true only for enums, not for
13774         enums or System.Enum itself.  This fixes #61593.
13775
13776         Likely what happened is that corlib was wrong: mcs depended on
13777         this bug in some places.  The bug got fixed, we had to add the
13778         hack, which caused bug 61593.
13779
13780         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
13781         that was a workaround for the older conditions.
13782
13783 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
13784
13785         * assign.cs: IAssignMethod has a new interface, as documented
13786         inline. All assignment code now uses this new api.
13787
13788         * ecore.cs, expression.cs: All classes which implement
13789         IAssignMethod now use the new interface.
13790
13791         * expression.cs (Invocation): add a hack to EmitCall so that
13792         IndexerAccess can be the target of a compound assignment without
13793         evaluating its arguments twice.
13794
13795         * statement.cs: Handle changes in Invocation api.
13796
13797 2004-07-16  Martin Baulig  <martin@ximian.com>
13798
13799         * iterators.cs: Rewrote this.  We're now using one single Proxy
13800         class for both the IEnumerable and the IEnumerator interface and
13801         `Iterator' derives from Class so we can use the high-level API.
13802
13803         * class.cs (TypeContainer.AddIterator): New method.
13804         (TypeContainer.DoDefineType): New protected virtual method, which
13805         is called from DefineType().
13806         (TypeContainer.DoDefineMembers): Call DefineType() and
13807         DefineMembers() on all our iterators.
13808         (TypeContainer.Emit): Call Emit() on all our iterators.
13809         (TypeContainer.CloseType): Call CloseType() on all our iterators.
13810
13811         * codegen.cs (EmitContext.CurrentIterator): New public field.
13812
13813 2004-07-15  Martin Baulig  <martin@ximian.com>
13814
13815         * typemanager.cs
13816         (TypeManager.not_supported_exception_type): New type.   
13817
13818 2004-07-14  Martin Baulig  <martin@ximian.com>
13819
13820         * iterators.cs: Use real error numbers.
13821
13822 2004-07-14  Martin Baulig  <martin@ximian.com>
13823
13824         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
13825         requires this to be a System.Collection.IEnumerable and not a
13826         class implementing that interface.
13827         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
13828
13829 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
13830
13831         * class.cs: Fixed previous fix, it broke some error tests.
13832
13833 2004-07-12  Martin Baulig  <martin@ximian.com>
13834
13835         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
13836         Fixes #61293.
13837
13838 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
13839
13840         * assign.cs (LocalTemporary): Add new argument: is_address,If
13841         `is_address' is true, then the value that we store is the address
13842         to the real value, and not the value itself.
13843         
13844         * ecore.cs (PropertyExpr): use the new local temporary
13845         stuff to allow us to handle X.Y += z (where X is a struct)
13846
13847 2004-07-08  Martin Baulig  <martin@ximian.com>
13848
13849         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
13850         not always return, just like we're doing in Using.Resolve().
13851
13852 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
13853
13854         * cs-parser.jay (fixed_statement): flag this as Pinned.
13855
13856 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
13857
13858         * typemanager.cs (TypeManager): Removed MakePinned method, this
13859         mechanism is replaced with the .NET 2.x compatible mechanism of
13860         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
13861
13862         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
13863         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
13864         `IsFixed' property which has a different meaning.
13865
13866 2004-07-02  Raja R Harinath  <rharinath@novell.com>
13867
13868         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
13869         visible from inside a nested class, not just the names of the
13870         immediately enclosing class.
13871         Fix for bug #60730.
13872
13873 2004-06-24  Raja R Harinath  <rharinath@novell.com>
13874
13875         * expression.cs (BetterConversion): Remove buggy special-case
13876         handling of "implicit constant expression conversions".  At this
13877         point, we already know that the conversion is possible -- we're
13878         only checking to see which is better.
13879
13880 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
13881
13882         * cs-parser.jay: Added error CS0210 test.
13883
13884 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
13885
13886         * cs-parser.jay: Added error CS0134 test.
13887
13888 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
13889
13890         Fix bug #52507
13891         * cs-parser.jay: Added error CS0145 test.
13892
13893 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
13894
13895         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
13896
13897 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
13898         
13899         * expression.cs (StackAlloc.Resolve): The argument may not
13900         be a constant; deal with this case.
13901         
13902 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
13903
13904         * attribute.cs (IndexerName_GetIndexerName): Renamed to
13905         GetIndexerAttributeValue.
13906         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
13907
13908         * class.cs (Indexer.Define): Added error tests for CS0415,
13909         CS0609.
13910
13911 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
13912
13913         * attribute.cs (Attribute.Resolve): Keep field code in sync with
13914         property code.
13915
13916 2004-06-23  Martin Baulig  <martin@ximian.com>
13917
13918         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
13919         neither return nor throw, reset the barrier as well.  Fixes #60457.
13920
13921 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
13922
13923         * class.cs : EventAttributes is now set to None by default.
13924           This fixes bug #60459.
13925
13926 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
13927
13928         Fix bug #60219
13929         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
13930         Don't throw exception but return null (it's sufficient now).
13931
13932 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
13933
13934         * typemanager.cs (GetArgumentTypes): Faster implementation.
13935
13936 2004-06-18  Martin Baulig  <martin@ximian.com>
13937
13938         * attribute.cs (Attribute.Resolve): Check whether we're an
13939         EmptyCast which a Constant child.  Fixes #60333.
13940
13941 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
13942
13943         * statement.cs (EmitCollectionForeach): Account for the fact that
13944         not all valuetypes are in areas which we can take the address of.
13945         For these variables, we store to a temporary variable. Also, make
13946         sure that we dont emit a `callvirt' on a valuetype method.
13947
13948 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
13949
13950         * expression.cs (StackAlloc.DoReSolve): Added test for
13951         negative parameter (CS0247).
13952
13953 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
13954
13955         Fix bug #59792
13956         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
13957
13958 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
13959
13960         Fix bug #59781
13961         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
13962         ulong.
13963
13964 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
13965
13966         Fix bug #58254 & cs1555.cs, cs1556.cs
13967         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
13968
13969 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
13970
13971         * cs-parser.jay: Added error CS1669 test for indexers.
13972
13973 2004-06-11  Martin Baulig  <martin@ximian.com>
13974
13975         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
13976         call this twice: for params and varargs methods.
13977
13978 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13979
13980         * class.cs:
13981         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
13982
13983 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
13984
13985         * attribute.cs (Attribute.GetValidTargets): Made public.
13986
13987         * class.cs: 
13988         (AbstractPropertyEventMethod): New class for better code sharing.
13989         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
13990         CS1667 report.
13991         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
13992
13993 2004-06-11  Raja R Harinath  <rharinath@novell.com>
13994
13995         Fix bug #59477.
13996         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
13997         that the call to Resolve is part of a MemberAccess.
13998         (Expression.Resolve): Use it for SimpleName resolution.
13999         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14000         Add 'intermediate' boolean argument.
14001         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
14002         error message when the SimpleName can be resolved ambiguously
14003         between an expression and a type.
14004         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14005         public.
14006         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14007         call on the left-side.
14008
14009 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14010
14011         * class.cs:
14012         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14013
14014 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14015
14016         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14017
14018 2004-06-11  Martin Baulig  <martin@ximian.com>
14019
14020         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14021         varargs methods if applicable.
14022
14023 2004-06-11  Martin Baulig  <martin@ximian.com>
14024
14025         * expression.cs (Invocation.EmitCall): Don't use
14026         `method.CallingConvention == CallingConventions.VarArgs' since the
14027         method could also have `CallingConventions.HasThis'.
14028
14029 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14030
14031         * class.cs (Event.GetSignatureForError): Implemented.
14032         Fixed crash in error test cs3010.cs
14033
14034 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
14035
14036         * cs-tokenizer.cs: Change the way we track __arglist to be
14037         consistent with the other keywords.
14038
14039 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
14040
14041         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14042         tomorrow.
14043
14044 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
14045
14046         * codegen.cs: Check that all referenced assemblies have a strongname
14047         before strongnaming the compiled assembly. If not report error CS1577.
14048         Fix bug #56563. Patch by Jackson Harper.
14049         * typemanager.cs: Added a method to return all referenced assemblies.
14050         Fix bug #56563. Patch by Jackson Harper.
14051
14052 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14053
14054         * class.cs:
14055         (Method.ApplyAttributeBuilder): Moved and added conditional
14056         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14057
14058         * delegate.cs:
14059         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14060
14061 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14062
14063         Fixed #59640
14064         * class.cs: (EventField.attribute_targets): Changed default target.
14065
14066 2004-06-08  Martin Baulig  <martin@ximian.com>
14067
14068         * expression.cs (Invocation.EmitCall): Enable varargs methods.
14069
14070 2004-06-08  Martin Baulig  <martin@ximian.com>
14071
14072         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14073
14074 2004-06-07  Martin Baulig  <martin@ximian.com>
14075
14076         Added support for varargs methods.
14077
14078         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14079         keyword.
14080
14081         * cs-parser.jay: Added support for `__arglist'.
14082
14083         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14084
14085         * expression.cs (Argument.AType): Added `ArgList'.
14086         (Invocation): Added support for varargs methods.
14087         (ArglistAccess): New public class.
14088         (Arglist): New public class.
14089
14090         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14091
14092         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
14093         a method's top-level block if the method has varargs.
14094
14095         * support.cs (ReflectionParameters, InternalParameters): Added
14096         support for varargs methods.    
14097
14098 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
14099
14100         * class.cs: Provide location in indexer error report.
14101
14102         * driver.cs: Use standard names.
14103
14104         * namespace.cs: Catch the use of using after a namespace has been
14105         declared also on using aliases.
14106
14107 2004-06-03  Raja R Harinath  <rharinath@novell.com>
14108
14109         Bug #50820.
14110         * typemanager.cs (closure_private_ok, closure_invocation_type)
14111         (closure_qualifier_type, closure_invocation_assembly)
14112         (FilterWithClosure): Move to ...
14113         (Closure): New internal nested class.
14114         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14115         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14116         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14117         (MemberLookup, MemberLookupFailed): Use it.
14118         * expression.cs (New.DoResolve): Treat the lookup for the
14119         constructor as being qualified by the 'new'ed type.
14120         (Indexers.GetIndexersForTypeOrInterface): Update.
14121
14122 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
14123
14124         * attribute.cs
14125         (GetConditionalAttributeValue): New method. Returns
14126         condition of ConditionalAttribute.
14127         (SearchMulti): New method.  Returns all attributes of type 't'.
14128         Use it when attribute is AllowMultiple = true.
14129         (IsConditionalMethodExcluded): New method.
14130
14131         * class.cs
14132         (Method.IsExcluded): Implemented. Returns true if method has conditional
14133         attribute and the conditions is not defined (method is excluded).
14134         (IMethodData): Extended interface for ConditionalAttribute support.
14135         (PropertyMethod.IsExcluded): Implemented.
14136
14137         * decl.cs
14138         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14139
14140         * expression.cs
14141         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14142         on the method.
14143
14144 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
14145
14146         * expression.cs (ArrayCreationExpression): Make this just an
14147         `expression'. It can't be a statement, so the code here was
14148         dead.
14149
14150 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14151
14152         Fixed #59072
14153         * typemanager.cs (GetFullNameSignature): New method for
14154         MethodBase types.
14155
14156 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14157
14158         Fixed #56452
14159         * class.cs (MemberBase.GetSignatureForError): New virtual method.
14160         Use this method when MethodBuilder is null.
14161         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14162         Added test for error CS0626 (MONO reports error for this situation).
14163         (IMethodData.GetSignatureForError): Extended interface.
14164
14165 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14166
14167         * attribute.cs
14168         (AttributeTester.GetObsoleteAttribute): Returns instance of
14169         ObsoleteAttribute when type is obsolete.
14170
14171         * class.cs
14172         (TypeContainer.VerifyObsoleteAttribute): Override.
14173         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14174         (MethodCode.VerifyObsoleteAttribute): Override.
14175         (MemberBase.VerifyObsoleteAttribute): Override.
14176
14177         * decl.cs
14178         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14179         and report proper error.
14180
14181         *delegate.cs
14182         Delegate.VerifyObsoleteAttribute): Override.
14183
14184         * ecore.cs
14185         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14186         and report proper error.
14187         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14188
14189         * enum.cs
14190         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14191         and enum member.
14192
14193         * expression.cs
14194         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14195         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14196         Added test for ObsoleteAttribute.
14197
14198         * statement.cs
14199         (Catch): Derived from Statement.
14200
14201 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14202  
14203         Fixed bug #59071 & cs0160.cs
14204  
14205         * statement.cs (Try.Resolve): Check here whether order of catch
14206         clauses matches their dependencies.
14207
14208 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
14209
14210         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
14211         caused a regression: #59343.  Referencing nested classes from an
14212         assembly stopped working.
14213
14214 2004-05-31  Martin Baulig  <martin@ximian.com>
14215
14216         MCS is now frozen for beta 2.
14217
14218 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14219
14220         * convert.cs: add a trivial cache for overload operator resolution.
14221
14222 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14223
14224         * decl.cs: If possible, use lookuptypedirect here. We can only do
14225         this if there is no `.' after the namespace. Avoids using
14226         LookupType, which does lots of slow processing.
14227         (FindNestedType) New method, does what it says :-).
14228         * namespace.cs: use LookupTypeDirect.
14229         * rootcontext.cs: use membercache, if possible.
14230         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14231
14232 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14233
14234         * expression.cs:
14235         According to the spec, 
14236
14237         In a member access of the form E.I, if E is a single identifier,
14238         and if the meaning of E as a simple-name (§7.5.2) is a constant,
14239         field, property, localvariable, or parameter with the same type as
14240         the meaning of E as a type-name (§3.8), then both possible
14241         meanings of E are permitted.
14242
14243         We did not check that E as a simple-name had the same type as E as
14244         a type name.
14245
14246         This trivial check gives us 5-7% on bootstrap time.
14247
14248 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14249
14250         * expression.cs (Invocation.OverloadResolve): Avoid the
14251         use of hashtables and boxing here by allocating on demand.
14252
14253 2004-05-30  Martin Baulig  <martin@ximian.com>
14254
14255         * rootcontext.cs (RootContext.LookupType): Don't cache things if
14256         we're doing a silent lookup.  Don't try to lookup nested types in
14257         TypeManager.object_type (thanks to Ben Maurer).
14258
14259 2004-05-30  Martin Baulig  <martin@ximian.com>
14260
14261         Committing a patch from Ben Maurer.
14262
14263         * rootcontext.cs (RootContext.LookupType): Cache negative results.
14264
14265 2004-05-29  Martin Baulig  <martin@ximian.com>
14266
14267         * class.cs (IMethodData.ShouldIgnore): New method.
14268
14269         * typemanager.cs (TypeManager.MethodFlags): Don't take a
14270         `Location' argument, we don't need it anywhere.  Use
14271         `IMethodData.ShouldIgnore ()' instead of
14272         `MethodData.GetMethodFlags ()'.
14273         (TypeManager.AddMethod): Removed.
14274         (TypeManager.AddMethod2): Renamed to AddMethod.
14275
14276 2004-05-29  Martin Baulig  <martin@ximian.com>
14277
14278         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14279
14280         * convert.cs (Convert.ImplicitReferenceConversion): If we're
14281         converting from a class type S to an interface type and we already
14282         have an object on the stack, don't box it again.  Fixes #52578.
14283
14284 2004-05-29  Martin Baulig  <martin@ximian.com>
14285
14286         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14287         Added support for `params' parameters.  Fixes #59267.
14288
14289 2004-05-29  Martin Baulig  <martin@ximian.com>
14290
14291         * literal.cs (NullPointer): Provide a private .ctor which sets
14292         `type' to TypeManager.object_type.  Fixes #59048.
14293
14294 2004-05-29  Martin Baulig  <martin@ximian.com>
14295
14296         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14297         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
14298
14299         * ecore.cs (EventExpr.instance_expr): Make the field private.
14300
14301 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
14302
14303         Fixed bug #50080 & cs0214-2.cs
14304         * expression.cs (Cast.DoResolve): Check unsafe context here.
14305         
14306         * statement.cs (Resolve.DoResolve): Likewise.
14307
14308 2004-05-26  Martin Baulig  <martin@ximian.com>
14309
14310         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14311
14312         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14313         (RootContext.LookupType): Pass down the `silent' flag.
14314
14315 2004-05-25  Martin Baulig  <martin@ximian.com>
14316
14317         * expression.cs
14318         (MethodGroupExpr.IdenticalTypeName): New public property.
14319         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14320         expression actually refers to a type.
14321
14322 2004-05-25  Martin Baulig  <martin@ximian.com>
14323
14324         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14325         for #56176 and made it actually work.
14326
14327 2004-05-25  Martin Baulig  <martin@ximian.com>
14328
14329         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14330         (FieldExpr, PropertyExpr): Override and implement
14331         CacheTemporaries.  Fixes #52279.
14332
14333 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
14334
14335         * location.cs: In the new compiler listing a file twice is a
14336         warning, not an error.
14337
14338 2004-05-24  Martin Baulig  <martin@ximian.com>
14339
14340         * enum.cs (Enum.DefineType): For the `BaseType' to be a
14341         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
14342
14343 2004-05-24  Martin Baulig  <martin@ximian.com>
14344
14345         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14346         walking the `using' list.  Fixes #53921.
14347
14348 2004-05-24  Martin Baulig  <martin@ximian.com>
14349
14350         * const.cs (Const.LookupConstantValue): Added support for
14351         EmptyCast's; fixes #55251.
14352
14353 2004-05-24  Martin Baulig  <martin@ximian.com>
14354
14355         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14356         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14357         which does the CS0135 check.  The reason is that we first need to
14358         check whether the variable actually exists.
14359
14360 2004-05-24  Martin Baulig  <martin@ximian.com>
14361
14362         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14363         than RootContext.LookupType() to find the explicit interface
14364         type.  Fixes #58584.
14365
14366 2004-05-24  Raja R Harinath  <rharinath@novell.com>
14367
14368         * Makefile: Simplify.  Use executable.make.
14369         * mcs.exe.sources: New file.  List of sources of mcs.exe.
14370
14371 2004-05-24  Anders Carlsson  <andersca@gnome.org>
14372
14373         * decl.cs:
14374         * enum.cs:
14375         Use the invariant culture when doing String.Compare for CLS case
14376         sensitivity.
14377         
14378 2004-05-23  Martin Baulig  <martin@ximian.com>
14379
14380         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14381         don't have any dots.  Fixes #52622, added cs0246-8.cs.
14382
14383         * namespace.cs (NamespaceEntry.Lookup): Likewise.
14384         
14385 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14386
14387         * class.cs (MemberBase.Define): Reuse MemberType member for 
14388         resolved type. Other methods can use it too.
14389
14390 2004-05-23  Martin Baulig  <martin@ximian.com>
14391
14392         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14393         the variable also exists in the current block (otherwise, we need
14394         to report a CS0103).  Fixes #58670.
14395
14396 2004-05-23  Martin Baulig  <martin@ximian.com>
14397
14398         * flowanalysis.cs (Reachability.Reachable): Compute this
14399         on-the-fly rather than storing it as a field.
14400
14401 2004-05-23  Martin Baulig  <martin@ximian.com>
14402
14403         * flowanalysis.cs (Reachability.And): Manually compute the
14404         resulting `barrier' from the reachability.      
14405        
14406 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14407
14408         Fix bug #57835
14409         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14410         instance of ObsoleteAttribute when symbol is obsolete.
14411
14412         * class.cs
14413         (IMethodData): Extended interface for ObsoleteAttribute support.
14414
14415 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14416
14417         * attribute.cs: Fix bug #55970
14418
14419 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14420
14421         Fix bug #52705
14422         * attribute.cs
14423         (GetObsoleteAttribute): New method. Creates the instance of
14424         ObsoleteAttribute.
14425         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14426         ObsoleteAttribute when member is obsolete.
14427         (AttributeTester.Report_ObsoleteMessage): Common method for
14428         Obsolete error/warning reporting.
14429
14430         * class.cs
14431         (TypeContainer.base_classs_type): New member for storing parent type.
14432
14433         * decl.cs
14434         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14435         for this MemberCore.
14436
14437 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14438
14439         * attribute.cs, const.cs: Fix bug #58590
14440
14441 2004-05-21  Martin Baulig  <martin@ximian.com>
14442
14443         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14444         out parameters if the end of the method is unreachable.  Fixes
14445         #58098. 
14446
14447 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14448
14449         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14450         Hari was right, why extra method.
14451
14452 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14453
14454         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14455
14456 2004-05-20  Martin Baulig  <martin@ximian.com>
14457
14458         Merged this back from gmcs to keep the differences to a minumum.
14459
14460         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14461         instead of a Declspace.
14462         (Attribute.ResolveType): Likewise.
14463         (Attributes.Search): Likewise.
14464         (Attributes.Contains): Likewise.
14465         (Attributes.GetClsCompliantAttribute): Likewise.
14466
14467         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14468         argument.
14469         (MethodData.ApplyAttributes): Take an EmitContext instead of a
14470         DeclSpace.
14471
14472 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
14473
14474         Fix bug #58688 (MCS does not report error when the same attribute
14475         is assigned twice)
14476
14477         * attribute.cs (Attribute.Emit): Distinction between null and default.
14478
14479 2004-05-19  Raja R Harinath  <rharinath@novell.com>
14480
14481         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14482         of a top-level attribute without an attribute target.
14483         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
14484         Make non-static.
14485         (Attribute.Conditional_GetConditionName), 
14486         (Attribute.Obsolete_GetObsoleteMessage): Update.
14487         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
14488         part of ScanForIndexerName.
14489         (Attribute.CanIgnoreInvalidAttribute): New function.
14490         (Attribute.ScanForIndexerName): Move to ...
14491         (Attributes.ScanForIndexerName): ... here.
14492         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14493         (Attributes.Search): New internal variant that can choose not to
14494         complain if types aren't resolved.  The original signature now
14495         complains.
14496         (Attributes.GetClsCompliantAttribute): Use internal variant, with
14497         complaints suppressed.
14498         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14499         only if it not useful.
14500         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14501         top-level for attributes that are shared between the assembly
14502         and a top-level class.
14503         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14504         * class.cs: Update to reflect changes.
14505         (DefineIndexers): Fuse loops.
14506         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
14507         a couple more variants of attribute names.
14508
14509 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
14510
14511         Fix bug #52585 (Implemented explicit attribute declaration)
14512
14513         * attribute.cs:
14514         (Attributable.ValidAttributeTargets): New abstract method. It gets
14515         list of valid attribute targets for explicit target declaration.
14516         (Attribute.Target): It holds target itself.
14517         (AttributeSection): Removed.
14518         (Attribute.CheckTargets): New method. It checks whether attribute
14519         target is valid for the current element.
14520
14521         * class.cs:
14522         (EventProperty): New class. For events that are declared like
14523         property (with add and remove accessors).
14524         (EventField): New class. For events that are declared like field.
14525         class.cs
14526
14527         * cs-parser.jay: Implemented explicit attribute target declaration.
14528
14529         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
14530         Override ValidAttributeTargets.
14531
14532         * parameter.cs:
14533         (ReturnParameter): Class for applying custom attributes on 
14534         the return type.
14535         (ParameterAtribute): New class. Class for applying custom
14536         attributes on the parameter type.
14537
14538 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
14539
14540         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14541         definitions. 
14542
14543         (Method): Allow UNSAFE here.
14544
14545         * modifiers.cs: Support unsafe reporting.
14546
14547 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
14548
14549         * decl.cs: Fix bug #58478.
14550
14551 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14552
14553         * statement.cs: When checking for unreachable code on an EmptyStatement,
14554         set the location. Fixes bug #58488.
14555
14556 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
14557
14558         * driver.cs: Add -pkg handling.
14559
14560         From Gonzalo: UseShelLExecute=false
14561
14562 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
14563
14564         * attribute.cs:
14565         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14566         for attribute.
14567         (Attribute.IsClsCompliaceRequired): Moved to base for better
14568         accesibility.
14569         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14570         when attribute is AttributeUsageAttribute.
14571         (Attribute.GetValidTargets): Simplified.
14572         (Attribute.GetAttributeUsage): New method returns AttributeUsage
14573         attribute for this type.
14574         (Attribute.ApplyAttributes): Method renamed to Emit and make
14575         non-static.
14576         (GlobalAttributeSection): New class for special handling of global
14577         attributes (assembly, module).
14578         (AttributeSection.Emit): New method.
14579
14580         * class.cs: Implemented Attributable abstract methods.
14581         (MethodCore.LabelParameters): Moved to Parameter class.
14582         (Accessor): Is back simple class.
14583         (PropertyMethod): Implemented Attributable abstract class.
14584         (DelegateMethod): Implemented Attributable abstract class.
14585         (Event): New constructor for disctintion between normal Event
14586         and Event with accessors.
14587
14588         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14589
14590         * codegen.cs, const.cs, decl.cs, delegate.cs:
14591         (CommonAssemblyModulClass): Implemented Attributable abstract class
14592         and simplified.
14593
14594         * enum.cs: Implement IAttributeSupport interface.
14595         (EnumMember): New class for emum members. Implemented Attributable
14596         abstract class
14597
14598         * parameter.cs:
14599         (ParameterBase): Is abstract.
14600         (ReturnParameter): New class for easier [return:] attribute handling.
14601
14602         * typemanager.cs: Removed builder_to_attr.
14603
14604 2004-05-11  Raja R Harinath  <rharinath@novell.com>
14605
14606         Fix bug #57151.
14607         * attribute.cs (Attribute.GetPositionalValue): New function.
14608         * class.cs (TypeContainer.VerifyMembers): New function.
14609         (TypeContainer.Emit): Use it.
14610         (ClassOrStruct): New base class for Class and Struct.
14611         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
14612         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14613         class.
14614         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14615         then each non-static field should have a FieldOffset attribute.
14616         Otherwise, none of the fields should have a FieldOffset attribute.
14617         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
14618         and FieldOffset attributes.
14619         * typemanager.cs (TypeManager.struct_layout_attribute_type)
14620         (TypeManager.field_offset_attribute_type): New core types.
14621         (TypeManager.InitCoreTypes): Initialize them.
14622
14623 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
14624
14625         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14626         Return correct type.
14627         From bug #58270.
14628
14629 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
14630
14631         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14632         be implicitly converted to ulong.
14633         
14634         * expression.cs: The logic for allowing operator &, | and ^ worked
14635         was wrong, it worked before because we did not report an error in
14636         an else branch.  Fixes 57895.
14637
14638         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14639         allow volatile fields to be reference types.
14640
14641 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
14642
14643         * driver.cs: Add support for /debug-
14644
14645 2004-05-07  Raja R Harinath  <rharinath@novell.com>
14646
14647         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
14648         Add a 'complain' parameter to silence errors.
14649         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
14650         silently overlooked type-resolutions.
14651         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14652         to reflect changes.
14653         (Attributes.Search): New function.
14654         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14655         (Attributes.GetAttributeFullName): Remove hack.
14656         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
14657         Update to reflect changes.
14658         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14659         Use Attributes.Search instead of nested loops.
14660
14661 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
14662
14663         * decl.cs:
14664         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14665         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14666         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14667
14668         * report.cs: (Report.Warning): Renamed to Warning_T because of
14669         parameter collision.
14670
14671 2004-05-05  Raja R Harinath  <rharinath@novell.com>
14672
14673         * expression.cs (MemberAccess.ResolveMemberAccess):
14674         Exit with non-zero status after Report.Error.
14675         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
14676         Likewise.
14677         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
14678
14679 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
14680
14681         * support.cs: Don't hang when the file is empty.
14682
14683 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
14684
14685         * support.cs: In SeekableStreamReader, compute the preamble size of the
14686           underlying stream. Position changes should take into account that initial
14687           count of bytes.
14688
14689 2004-05-03  Todd Berman  <tberman@sevenl.net>
14690
14691         * driver.cs: remove unused GetSysVersion function.
14692
14693 2004-05-03  Todd Berman  <tberman@sevenl.net>
14694
14695         * driver.cs: Remove the hack from saturday, as well as the hack
14696         from jackson (LoadAssemblyFromGac), also adds the CWD to the
14697         link_paths to get that bit proper.
14698
14699 2004-05-01  Todd Berman  <tberman@sevenl.net>
14700
14701         * driver.cs: Try a LoadFrom before a Load, this checks the current
14702         path. This is currently a bug in mono that is be fixed, however, this
14703         provides a workaround for now. This will be removed when the bug
14704         is fixed.
14705
14706 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
14707
14708         * CryptoConvert.cs: Updated to latest version. Fix issue with 
14709         incomplete key pairs (#57941).
14710
14711 2004-05-01  Todd Berman  <tberman@sevenl.net>
14712
14713         * driver.cs: Remove '.' from path_chars, now System.* loads properly
14714         from the GAC
14715
14716 2004-04-30  Jackson Harper  <jackson@ximian.com>
14717
14718         * codegen.cs: Open keys readonly.
14719         
14720 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14721
14722         * typemanager.cs: don't report cyclic struct layout when a struct
14723         contains 2 or more fields of the same type. Failed for Pango.AttrShape
14724         which has 2 Pango.Rectangle fields.
14725
14726 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14727
14728         * expression.cs: Handle IntPtr comparisons with IL code
14729         rather than a method call.
14730
14731 2004-04-29  Martin Baulig  <martin@ximian.com>
14732
14733         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
14734         the list of PropertyInfo's in class hierarchy and find the
14735         accessor.  Fixes #56013.
14736
14737 2004-04-29  Martin Baulig  <martin@ximian.com>
14738
14739         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
14740
14741 2004-04-29  Martin Baulig  <martin@ximian.com>
14742
14743         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
14744
14745         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
14746
14747 2004-04-29  Martin Baulig  <martin@ximian.com>
14748
14749         * class.cs (ConstructorInitializer.Resolve): Check whether the
14750         parent .ctor is accessible.  Fixes #52146.
14751
14752 2004-04-29  Martin Baulig  <martin@ximian.com>
14753
14754         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
14755
14756         * statement.cs (Using.EmitLocalVariableDecls): Use
14757         TypeManager.idisposable_type, not typeof (IDisposable).
14758         (Foreach.EmitCollectionForeach): Added support for valuetypes.
14759
14760 2004-04-29  Martin Baulig  <martin@ximian.com>
14761
14762         * class.cs (Event.Define): Don't emit the field and don't set
14763         RTSpecialName and SpecialName for events on interfaces.  Fixes
14764         #57703. 
14765
14766 2004-04-29  Raja R Harinath  <rharinath@novell.com>
14767
14768         Refactor Attribute.ApplyAttributes.
14769         * attribute.cs (Attributable): New base class for objects that can
14770         have Attributes applied on them.
14771         (Attribute): Make AttributeUsage fields public.
14772         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
14773         (Attribute.IsInternalCall): New property.
14774         (Attribute.UsageAttr): Convert to a public read-only property.
14775         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
14776         (Attribute.ResolveType, Attribute.Resolve)
14777         (Attribute.ScanForIndexerName): Update to reflect changes.
14778         (Attribute.CheckAttributeTarget): Re-format.
14779         (Attribute.ApplyAttributes): Refactor, to various
14780         Attributable.ApplyAttributeBuilder methods.
14781         * decl.cs (MemberCore): Make Attributable.
14782         * class.cs (Accessor): Make Attributable.
14783         (MethodData.ApplyAttributes): Use proper attribute types, not
14784         attribute names.
14785         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
14786         (TypeContainer.ApplyAttributeBuilder)
14787         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
14788         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
14789         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
14790         (Operator.ApplyAttributeBuilder): New factored-out methods.
14791         * const.cs (Const.ApplyAttributeBuilder): Likewise.
14792         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
14793         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
14794         * parameter.cs (ParameterBase): New Attributable base class
14795         that can also represent Return types.
14796         (Parameter): Update to the changes.
14797
14798 2004-04-29  Jackson Harper  <jackson@ximian.com>
14799
14800         * driver.cs: Prefer the corlib system version when looking for
14801         assemblies in the GAC. This is still a hack, but its a better hack
14802         now.
14803         
14804 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
14805
14806         * decl.cs, enum.cs: Improved error 3005 reporting.
14807   
14808         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
14809         (related_symbols): New private member for list of symbols
14810         related to reported error/warning.
14811         
14812         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
14813
14814 2004-04-29  Martin Baulig  <martin@ximian.com>
14815
14816         * ecore.cs (Expression.Constantify): If we're an enum and
14817         TypeManager.TypeToCoreType() doesn't give us another type, use
14818         t.UnderlyingSystemType.  Fixes #56178.  
14819
14820 2004-04-29  Martin Baulig  <martin@ximian.com>
14821
14822         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
14823         interfaces and for each interface, only add members directly
14824         declared in that interface.  Fixes #53255.
14825
14826 2004-04-28  Martin Baulig  <martin@ximian.com>
14827
14828         * expression.cs (ConditionalLogicalOperator): Use a temporary
14829         variable for `left' to avoid that we evaluate it more than once;
14830         bug #52588.
14831
14832 2004-04-28  Martin Baulig  <martin@ximian.com>
14833
14834         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
14835         `void[]' (CS1547).
14836
14837 2004-04-28  Martin Baulig  <martin@ximian.com>
14838
14839         * statement.cs (LocalInfo.Resolve): Check whether the type is not
14840         void (CS1547).
14841
14842         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
14843         whether the type is not void (CS1547).
14844
14845 2004-04-28  Martin Baulig  <martin@ximian.com>
14846
14847         * expression.cs (Unary.DoResolveLValue): Override this and report
14848         CS0131 for anything but Operator.Indirection.
14849
14850 2004-04-28  Martin Baulig  <martin@ximian.com>
14851
14852         Committing a patch from Ben Maurer; see bug #50820.
14853
14854         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
14855         check for classes.
14856
14857         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
14858         classes.        
14859
14860 2004-04-28  Martin Baulig  <martin@ximian.com>
14861
14862         Committing a patch from Ben Maurer; see bug #50820.
14863
14864         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
14865         check for classes.
14866
14867         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
14868         classes.        
14869
14870 2004-04-28  Martin Baulig  <martin@ximian.com>
14871
14872         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
14873         (Block.AddLabel): Call DoLookupLabel() to only search in the
14874         current block.
14875
14876 2004-04-28  Martin Baulig  <martin@ximian.com>
14877
14878         * cfold.cs (ConstantFold.BinaryFold): Added special support for
14879         comparing StringConstants and NullLiterals in Equality and Inequality.
14880
14881 2004-04-28  Jackson Harper  <jackson@ximian.com>
14882
14883         * driver.cs: Attempt to load referenced assemblies from the
14884         GAC. This is the quick and dirty version of this method that
14885         doesnt take into account versions and just takes the first
14886         canidate found. Will be good enough for now as we will not have more
14887         then one version installed into the GAC until I update this method.
14888
14889 2004-04-28  Martin Baulig  <martin@ximian.com>
14890
14891         * typemanager.cs (TypeManager.CheckStructCycles): New public
14892         static method to check for cycles in the struct layout.
14893
14894         * rootcontext.cs (RootContext.PopulateTypes): Call
14895         TypeManager.CheckStructCycles() for each TypeContainer.
14896         [Note: We only need to visit each type once.]
14897
14898 2004-04-28  Martin Baulig  <martin@ximian.com>
14899
14900         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
14901
14902         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
14903         success and added `out object value'.  Use a `bool resolved' field
14904         to check whether we've already been called rather than
14905         `ConstantValue != null' since this breaks for NullLiterals.
14906
14907 2004-04-28  Raja R Harinath  <rharinath@novell.com>
14908
14909         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
14910         setting of this flag, since the 'set' method may be non-public.
14911
14912 2004-04-28  Raja R Harinath  <rharinath@novell.com>
14913
14914         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
14915         check on current_vector.Block.
14916
14917 2004-04-27  Martin Baulig  <martin@ximian.com>
14918
14919         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
14920         a field initializer.  Fixes #56459.
14921
14922 2004-04-27  Martin Baulig  <martin@ximian.com>
14923
14924         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
14925         we're not attempting to use an indexer.  Fixes #52154.
14926
14927 2004-04-27  Martin Baulig  <martin@ximian.com>
14928
14929         * statement.cs (Return): Don't create a return label if we don't
14930         need it; reverts my change from January 20th.  Thanks to Ben
14931         Maurer for this.
14932
14933 2004-04-27  Martin Baulig  <martin@ximian.com>
14934
14935         According to the spec, `goto' can only leave a nested scope, but
14936         never enter it.
14937
14938         * statement.cs (Block.LookupLabel): Only lookup in the current
14939         block, don't recurse into parent or child blocks.
14940         (Block.AddLabel): Check in parent and child blocks, report
14941         CS0140/CS0158 if we find a duplicate.
14942         (Block): Removed this indexer for label lookups.
14943         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
14944         this already does the error reporting for us.
14945
14946         * flowanalysis.cs
14947         (FlowBranching.UsageVector.Block): New public variable; may be null.
14948         (FlowBranching.CreateSibling): Added `Block' argument.
14949         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
14950         label for the target of a `goto' and check whether we're not
14951         leaving a `finally'.
14952
14953 2004-04-27  Martin Baulig  <martin@ximian.com>
14954
14955         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
14956         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
14957         just for returns).
14958
14959 2004-04-27  Martin Baulig  <martin@ximian.com>
14960
14961         * statement.cs (Block.AddLabel): Also check for implicit blocks
14962         and added a CS0158 check.
14963
14964 2004-04-27  Martin Baulig  <martin@ximian.com>
14965
14966         * flowanalysis.cs (FlowBranchingLoop): New class.
14967         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
14968         UsageVector's instead of an ArrayList.
14969         (FlowBranching.Label): Likewise.
14970         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
14971         (FlowBranching.AddBreakVector): New method.
14972
14973 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
14974
14975         * attribute.cs: Small regression fix: only convert the type if we
14976         the type is different, fixes System.Drawing build.
14977
14978 2004-04-27  Martin Baulig  <martin@ximian.com>
14979
14980         * attribute.cs (Attribute.Resolve): If we have a constant value
14981         for a named field or property, implicity convert it to the correct
14982         type.
14983
14984 2004-04-27  Raja R Harinath  <rharinath@novell.com>
14985
14986         * statement.cs (Block.Block): Implicit blocks share
14987         'child_variable_names' fields with parent blocks.
14988         (Block.AddChildVariableNames): Remove.
14989         (Block.AddVariable): Mark variable as "used by a child block" in
14990         every surrounding block.
14991         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
14992         been used in a child block, complain about violation of "Invariant
14993         meaning in blocks" rule.
14994         * cs-parser.jay (declare_local_variables): Don't use
14995         AddChildVariableNames.
14996         (foreach_statement): Don't create an implicit block: 'foreach'
14997         introduces a scope.
14998
14999 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
15000
15001         * convert.cs (ImplicitNumericConversion): 0 is also positive when
15002         converting from 0L to ulong.  Fixes 57522.
15003
15004 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15005
15006         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15007         derived class hides via 'new' keyword field from base class (test-242.cs).
15008         TODO: Handle this in the more general way.
15009         
15010         * class.cs (CheckBase): Ditto.
15011
15012 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15013
15014         * decl.cs (caching_flags): New member for storing cached values
15015         as bit flags.
15016         (MemberCore.Flags): New enum where bit flags for caching_flags
15017         are defined.
15018         (MemberCore.cls_compliance): Moved to caching_flags.
15019         (DeclSpace.Created): Moved to caching_flags.
15020
15021         * class.cs: Use caching_flags instead of DeclSpace.Created
15022         
15023 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
15024
15025         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15026         if we are only a derived class, not a nested class.
15027
15028         * typemanager.cs: Same as above, but do this at the MemberLookup
15029         level (used by field and methods, properties are handled in
15030         PropertyExpr).   Allow for the qualified access if we are a nested
15031         method. 
15032
15033 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
15034
15035         * class.cs: Refactoring.
15036         (IMethodData): New inteface; Holds links to parent members
15037         to avoid member duplication (reduced memory allocation).
15038         (Method): Implemented IMethodData interface.
15039         (PropertyBase): New inner classes for get/set methods.
15040         (PropertyBase.PropertyMethod): Implemented IMethodData interface
15041         (Event): New inner classes for add/remove methods.
15042         (Event.DelegateMethod): Implemented IMethodData interface.
15043
15044         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15045         EmitContext (related to class.cs refactoring).
15046
15047 2004-04-21  Raja R Harinath  <rharinath@novell.com>
15048
15049         * delegate.cs (Delegate.VerifyApplicability): If the number of
15050         arguments are the same as the number of parameters, first try to
15051         verify applicability ignoring  any 'params' modifier on the last
15052         parameter.
15053         Fixes #56442.
15054
15055 2004-04-16  Raja R Harinath  <rharinath@novell.com>
15056
15057         * class.cs (TypeContainer.AddIndexer): Use
15058         'ExplicitInterfaceName' to determine if interface name was
15059         explicitly specified.  'InterfaceType' is not initialized at this time.
15060         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
15061         Indexers array is already in the required order.  Initialize
15062         'IndexerName' only if there are normal indexers.
15063         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15064         (TypeContainer.Emit): Emit DefaultMember attribute only if
15065         IndexerName is initialized.
15066         Fixes #56300.
15067
15068 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
15069
15070         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15071         Fixes #57007
15072
15073 2004-04-15  Raja R Harinath  <rharinath@novell.com>
15074
15075         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15076         attributes.
15077         Fix for #56456.
15078
15079         * attribute.cs (Attribute.Resolve): Check for duplicate named
15080         attributes.
15081         Fix for #56463.
15082
15083 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
15084
15085         * iterators.cs (MarkYield): track whether we are in an exception,
15086         and generate code accordingly.  Use a temporary value to store the
15087         result for our state.
15088
15089         I had ignored a bit the interaction of try/catch with iterators
15090         since their behavior was not entirely obvious, but now it is
15091         possible to verify that our behavior is the same as MS .NET 2.0
15092
15093         Fixes 54814
15094
15095 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
15096
15097         * iterators.cs: Avoid creating temporaries if there is no work to
15098         do. 
15099
15100         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15101         Enumerations, use TypeManager.EnumToUnderlying and call
15102         recursively. 
15103
15104         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15105         bug #57013
15106
15107         (This.Emit): Use EmitContext.EmitThis to emit our
15108         instance variable.
15109
15110         (This.EmitAssign): Ditto.
15111
15112         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15113         codepaths, we will move all the functionality into
15114         Mono.CSharp.This 
15115
15116         (FieldExpr.EmitAssign): Ditto.
15117
15118         This fixes several hidden bugs that I uncovered while doing a code
15119         review of this today.
15120
15121         * codegen.cs (EmitThis): reworked so the semantics are more clear
15122         and also support value types "this" instances.
15123
15124         * iterators.cs: Changed so that for iterators in value types, we
15125         do not pass the value type as a parameter.  
15126
15127         Initialization of the enumerator helpers is now done in the caller
15128         instead of passing the parameters to the constructors and having
15129         the constructor set the fields.
15130
15131         The fields have now `assembly' visibility instead of private.
15132
15133 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
15134
15135         * expression.cs (Argument.Resolve): Check if fields passed as ref
15136         or out are contained in a MarshalByRefObject.
15137
15138         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15139         another compiler type.
15140
15141 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15142
15143         * class.cs (Indexer.Define): use the new name checking method.
15144         Also, return false on an error.
15145         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15146         (is_identifier_[start/part]_character): make static.
15147
15148 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
15149
15150         * expression.cs (Binary.ResolveOperator): Do no append strings
15151         twice: since we can be invoked more than once (array evaluation)
15152         on the same concatenation, take care of this here.  Based on a fix
15153         from Ben (bug #56454)
15154
15155 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
15156
15157         * codegen.cs: Fix another case where CS1548 must be reported (when 
15158         delay-sign isn't specified and no private is available #56564). Fix
15159         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
15160         error when MCS is used on the MS runtime and we need to delay-sign 
15161         (which seems unsupported by AssemblyBuilder - see #56621).
15162
15163 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
15164
15165         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15166         (TypeManager.ComputeNamespaces): Faster implementation for
15167         Microsoft runtime.
15168
15169         * compiler.csproj: Updated AssemblyName to mcs.
15170
15171 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
15172
15173         * rootcontext.cs: Add new types to the boot resolution.
15174
15175         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15176         MulticastDelegate is not allowed.
15177
15178         * typemanager.cs: Add new types to lookup: System.TypedReference
15179         and ArgIterator.
15180
15181         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15182         check for TypedReference or ArgIterator, they are not allowed. 
15183
15184         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15185         makes us properly catch 1510 in some conditions (see bug 56016 for
15186         details). 
15187
15188 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
15189
15190         * CryptoConvert.cs: update from corlib version
15191         with endian fixes.
15192
15193 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
15194
15195         * class.cs (Indexer.Define): Check indexername declaration
15196
15197 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
15198
15199         * attribute.cs (IsClsCompliant): Fixed problem with handling
15200         all three states (compliant, not-compliant, undetected).
15201
15202 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
15203
15204         * attribute.cs (Attribute): Location is now public.
15205         (Resolve): Store resolved arguments (pos_values) in attribute class.
15206         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15207         (GetClsCompliantAttributeValue): New method that gets
15208         CLSCompliantAttribute value.
15209         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15210         if exists else null.
15211         (AttributeTester): New class for CLS-Compliant verification routines.
15212
15213         * class.cs (Emit): Add CLS-Compliant verification.
15214         (Method.GetSignatureForError): Implemented.
15215         (Constructor.GetSignatureForError): Implemented
15216         (Constructor.HasCompliantArgs): Returns if constructor has
15217         CLS-Compliant arguments.
15218         (Constructor.Emit): Override.
15219         (Construcor.IsIdentifierClsCompliant): New method; For constructors
15220         is needed to test only parameters.
15221         (FieldBase.GetSignatureForError): Implemented.
15222         (TypeContainer): New member for storing base interfaces.
15223         (TypeContainer.FindMembers): Search in base interfaces too.
15224
15225         * codegen.cs (GetClsComplianceAttribute): New method that gets
15226         assembly or module CLSCompliantAttribute value.
15227         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15228         for assembly.
15229         (ModuleClass.Emit): Add error 3012 test.
15230
15231         * const.cs (Emit): Override and call base for CLS-Compliant tests.
15232
15233         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15234         state for all decl types.
15235         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15236         if CLS-Compliant tests are required.
15237         (IsClsCompliaceRequired): New method. Analyze whether code
15238         must be CLS-Compliant.
15239         (IsExposedFromAssembly): New method. Returns true when MemberCore
15240         is exposed from assembly.
15241         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15242         value or gets cached value.
15243         (HasClsCompliantAttribute): New method. Returns true if MemberCore
15244         is explicitly marked with CLSCompliantAttribute.
15245         (IsIdentifierClsCompliant): New abstract method. This method is
15246         used to testing error 3005.
15247         (IsIdentifierAndParamClsCompliant): New method. Common helper method
15248         for identifier and parameters CLS-Compliant testing.
15249         (VerifyClsCompliance): New method. The main virtual method for
15250         CLS-Compliant verifications.
15251         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15252         null. I don't know why is null (too many public members !).
15253         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15254         and get value of first CLSCompliantAttribute that found.
15255
15256         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15257         (VerifyClsCompliance): Override and add extra tests.
15258
15259         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15260         clscheck- disable CLS-Compliant verification event if assembly is has
15261         CLSCompliantAttribute(true).
15262
15263         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15264         ApllyAttribute is now called in emit section as in the other cases.
15265         Possible future Emit integration.
15266         (IsIdentifierClsCompliant): New override.
15267         (VerifyClsCompliance): New override.
15268         (GetEnumeratorName): Returns full enum name.
15269
15270         * parameter.cs (GetSignatureForError): Implemented.
15271
15272         * report.cs (WarningData): New struct for Warning message information.
15273         (LocationOfPreviousError): New method.
15274         (Warning): New method. Reports warning based on the warning table.
15275         (Error_T): New method. Reports error based on the error table.
15276
15277         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15278         verifications are done here.
15279
15280         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15281
15282         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15283         CLSCompliantAttribute.
15284         (all_imported_types): New member holds all imported types from other
15285         assemblies.
15286         (LoadAllImportedTypes): New method fills static table with exported types
15287         from all referenced assemblies.
15288         (Modules): New property returns all assembly modules.
15289
15290 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
15291
15292         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15293         throwing a parser error.
15294
15295         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15296         which removes the hardcoded get_/set_ prefixes for properties, as
15297         IL allows for the properties to be named something else.  
15298
15299         Bug #56013
15300
15301         * expression.cs: Do not override operand before we know if it is
15302         non-null.  Fix 56207
15303
15304 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15305
15306         * typemanager.cs: support for pinned variables.
15307
15308 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15309
15310         * decl.cs, typemanager.cs: Avoid using an arraylist
15311         as a buffer if there is only one result set.
15312
15313 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15314
15315         * expression.cs: Make sure you cant call a static method
15316         with an instance expression, bug #56174.
15317
15318 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
15319
15320         * class.cs (IsDuplicateImplementation): Improve error reporting to
15321         flag 663 (method only differs in parameter modifier).
15322
15323         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15324         in preprocessor directives.
15325
15326         * location.cs (LookupFile): Allow for the empty path.
15327
15328         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
15329         better approach for some of that patch, but its failing with the
15330         CharSet enumeration.  For now try/catch will do.
15331
15332         * typemanager.cs: Do not crash if a struct does not have fields.
15333         Fixes 56150.
15334
15335 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15336
15337         * expression.cs: cs0213, cant fix a fixed expression.
15338         fixes 50231.
15339
15340 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15341
15342         * cs-parser.jay: detect invalid embeded statements gracefully.
15343         bug #51113.
15344
15345 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15346
15347         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15348         As a regex:
15349         s/
15350         the invocation type may not be a subclass of the tye of the item/
15351         The type of the item must be a subclass of the invocation item.
15352         /g
15353
15354         Fixes bug #50820.
15355
15356 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
15357
15358         * attribute.cs: Added methods to get a string and a bool from an
15359         attribute. Required to information from AssemblyKeyFileAttribute,
15360         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15361         * codegen.cs: Modified AssemblyName creation to include support for
15362         strongnames. Catch additional exceptions to report them as CS1548.
15363         * compiler.csproj: Updated include CryptoConvert.cs.
15364         * compiler.csproj.user: Removed file - user specific configuration.
15365         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
15366         Mono.Security assembly. The original class is maintained and tested in
15367         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15368         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15369         like CSC 8.0 (C# v2) supports.
15370         * Makefile: Added CryptoConvert.cs to mcs sources.
15371         * rootcontext.cs: Added new options for strongnames.
15372
15373 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
15374
15375         * driver.cs: For --expect-error, report error code `2'
15376         if the program compiled with no errors, error code `1' if
15377         it compiled with an error other than the one expected.
15378
15379 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
15380
15381         * compiler.csproj: Updated for Visual Studio .NET 2003.
15382         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15383         * compiler.sln: Updated for Visual Studio .NET 2003.
15384
15385 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
15386
15387         * expression.cs: Fix bug #47234. We basically need to apply the
15388         rule that we prefer the conversion of null to a reference type
15389         when faced with a conversion to 'object' (csc behaviour).
15390
15391 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15392
15393         * statement.cs: Shorter form for foreach, eliminates
15394         a local variable. r=Martin.
15395
15396 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15397
15398         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15399         checks if we can use brtrue/brfalse to test for 0.
15400         * expression.cs: use the above in the test for using brtrue/brfalse.
15401         cleanup code a bit.
15402
15403 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15404
15405         * expression.cs: Rewrite string concat stuff. Benefits:
15406
15407         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15408         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15409         rather than a concat chain.
15410
15411         * typemanager.cs: Add lookups for more concat overloads.
15412
15413 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15414
15415         * expression.cs: Emit shorter il code for array init.
15416
15417         newarr
15418         dup
15419         // set 1
15420
15421         // set 2
15422
15423         newarr
15424         stloc.x
15425
15426         ldloc.x
15427         // set 1
15428
15429         ldloc.x
15430         // set 2
15431
15432 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
15433
15434         * statement.cs: Before, two switch blocks would be merged if the
15435         total size of the blocks (end_item - begin_item + 1) was less than
15436         two times the combined sizes of the blocks.
15437
15438         Now, it will only merge if after the merge at least half of the
15439         slots are filled.
15440
15441         fixes 55885.
15442
15443 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
15444
15445         * class.cs : csc build fix for GetMethods(). See bug #52503.
15446
15447 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
15448
15449         * expression.cs: Make sure fp comparisons work with NaN.
15450         This fixes bug #54303. Mig approved this patch a long
15451         time ago, but we were not able to test b/c the runtime
15452         had a related bug.
15453
15454 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
15455
15456         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
15457
15458 2004-03-19  Martin Baulig  <martin@ximian.com>
15459
15460         * class.cs (MemberCore.IsDuplicateImplementation): Report the
15461         error here and not in our caller.
15462
15463 2004-03-19  Martin Baulig  <martin@ximian.com>
15464
15465         * interface.cs: Completely killed this file.
15466         (Interface): We're now a TypeContainer and live in class.cs.
15467
15468         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15469         argument; we're now also called for interfaces.
15470         (TypeContainer.DefineMembers): Allow this method being called
15471         multiple times.
15472         (TypeContainer.GetMethods): New public method; formerly known as
15473         Interface.GetMethod().  This is used by PendingImplementation.
15474         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15475         it's now private and non-static.
15476         (Interface): Moved this here; it's now implemented similar to
15477         Class and Struct.
15478         (Method, Property, Event, Indexer): Added `bool is_interface'
15479         argument to their .ctor's.
15480         (MemberBase.IsInterface): New public field.
15481
15482         * cs-parser.jay: Create normal Method, Property, Event, Indexer
15483         instances instead of InterfaceMethod, InterfaceProperty, etc.
15484         (opt_interface_base): Removed; we now use `opt_class_base' instead.
15485         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15486
15487 2004-03-19  Martin Baulig  <martin@ximian.com>
15488
15489         * class.cs (MethodCore.IsDuplicateImplementation): New private
15490         method which does the CS0111 checking.
15491         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15492         Use IsDuplicateImplementation().
15493
15494 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
15495
15496         * decl.cs (FindMemberToOverride): New method to find the correct
15497         method or property to override in the base class.
15498         * class.cs
15499             - Make Method/Property use the above method to find the
15500               version in the base class.
15501             - Remove the InheritableMemberSignatureCompare as it is now
15502               dead code.
15503
15504         This patch makes large code bases much faster to compile, as it is
15505         O(n) rather than O(n^2) to do this validation.
15506
15507         Also, it fixes bug 52458 which is that nested classes are not
15508         taken into account when finding the base class member.
15509
15510         Reviewed/Approved by Martin.
15511
15512 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
15513
15514         * interface.cs: In all interface classes removed redundant
15515         member initialization.
15516
15517 2004-03-16  Martin Baulig  <martin@ximian.com>
15518
15519         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15520
15521 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
15522
15523         * decl.cs (DefineTypeAndParents): New helper method to define a
15524         type's containers before the type itself is defined;  This is a
15525         bug exposed by the recent changes to Windows.Forms when an
15526         implemented interface was defined inside a class that had not been
15527         built yet.   
15528
15529         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15530
15531         (Check): Loop correctly to report errors modifiers
15532         (UNSAFE was not in the loop, since it was the same as TOP).
15533
15534         * interface.cs: Every interface member now takes a ModFlags,
15535         instead of a "is_new" bool, which we set on the base MemberCore. 
15536
15537         Every place where we called "UnsafeOk" in the interface, now we
15538         call the proper member (InterfaceMethod.UnsafeOK) instead to get
15539         the unsafe settings from the member declaration instead of the
15540         container interface. 
15541
15542         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
15543
15544         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15545         `set_indexer_name' to the pending bits (one per type).
15546
15547         We fixed a bug today that was picking the wrong method to
15548         override, since for properties the existing InterfaceMethod code
15549         basically ignored the method name.  Now we make sure that the
15550         method name is one of the valid indexer names.
15551
15552 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
15553  
15554         * support.cs (SeekableStreamReader): Keep track of stream byte
15555         positions and don't mix them with character offsets to the buffer.
15556
15557         Patch from Gustavo Giráldez
15558
15559 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
15560
15561         * interface.cs (InterfaceSetGetBase): Removed double member
15562         initialization, base class does it as well.
15563
15564 2004-03-13  Martin Baulig  <martin@ximian.com>
15565
15566         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15567         when compiling corlib.
15568
15569 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
15570
15571         * convert.cs (ExplicitConversion): We were reporting an error on
15572         certain conversions (object_type source to a value type, when the
15573         expression was `null') before we had a chance to pass it through
15574         the user defined conversions.
15575
15576         * driver.cs: Replace / and \ in resource specifications to dots.
15577         Fixes 50752
15578
15579         * class.cs: Add check for duplicate operators.  Fixes 52477
15580
15581 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
15582
15583         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15584         that are in the middle of the statements, not only at the end.
15585         Fixes #54987
15586
15587         * class.cs (TypeContainer.AddField): No longer set the
15588         `HaveStaticConstructor' flag, now we call it
15589         `UserDefineStaticConstructor' to diferentiate the slightly
15590         semantic difference.
15591
15592         The situation is that we were not adding BeforeFieldInit (from
15593         Modifiers.TypeAttr) to classes that could have it.
15594         BeforeFieldInit should be set to classes that have no static
15595         constructor. 
15596
15597         See:
15598
15599         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15600
15601         And most importantly Zoltan's comment:
15602
15603         http://bugzilla.ximian.com/show_bug.cgi?id=44229
15604
15605         "I think beforefieldinit means 'it's ok to initialize the type sometime 
15606          before its static fields are used', i.e. initialization does not need
15607          to be triggered by the first access to the type. Setting this flag
15608          helps the JIT to compile better code, since it can run the static
15609          constructor at JIT time, and does not need to generate code to call it
15610          (possibly lots of times) at runtime. Unfortunately, mcs does not set
15611          this flag for lots of classes like String. 
15612          
15613          csc sets this flag if the type does not have an explicit static 
15614          constructor. The reasoning seems to be that if there are only static
15615          initalizers for a type, and no static constructor, then the programmer
15616          does not care when this initialization happens, so beforefieldinit
15617          can be used.
15618          
15619          This bug prevents the AOT compiler from being usable, since it 
15620          generates so many calls to mono_runtime_class_init that the AOT code
15621          is much slower than the JITted code. The JITted code is faster, 
15622          because it does not generate these calls if the vtable is type is
15623          already initialized, which is true in the majority of cases. But the
15624          AOT compiler can't do this."
15625
15626 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
15627
15628         * class.cs (MethodData.Emit): Refactor the code so symbolic
15629         information is generated for destructors;  For some reasons we
15630         were taking a code path that did not generate symbolic information
15631         before. 
15632
15633 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15634
15635         * class.cs: Create a Constructor.CheckBase method that
15636         takes care of all validation type code. The method
15637         contains some code that was moved from Define.
15638
15639         It also includes new code that checks for duplicate ctors.
15640         This fixes bug #55148.
15641
15642 2004-03-09  Joshua Tauberer <tauberer@for.net>
15643
15644         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15645         a { ... }-style array creation invokes EmitStaticInitializers
15646         which is not good for reference-type arrays.  String, decimal
15647         and now null constants (NullCast) are not counted toward
15648         static initializers.
15649
15650 2004-03-05  Martin Baulig  <martin@ximian.com>
15651
15652         * location.cs (SourceFile.HasLineDirective): New public field;
15653         specifies whether the file contains or is referenced by a "#line"
15654         directive.
15655         (Location.DefineSymbolDocuments): Ignore source files which
15656         either contain or are referenced by a "#line" directive.        
15657
15658 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
15659
15660         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15661         direct access to our parent, so check the method inline there.
15662
15663 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15664
15665         * expression.cs (Invocation.EmitCall): Miguel's last commit
15666         caused a regression. If you had:
15667
15668             T t = null;
15669             t.Foo ();
15670
15671         In Foo the implict this would be null.
15672
15673 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
15674
15675         * expression.cs (Invocation.EmitCall): If the method is not
15676         virtual, do not emit a CallVirt to it, use Call.
15677
15678         * typemanager.cs (GetFullNameSignature): Improve the method to
15679         cope with ".ctor" and replace it with the type name.
15680
15681         * class.cs (ConstructorInitializer.Resolve): Now the method takes
15682         as an argument the ConstructorBuilder where it is being defined,
15683         to catch the recursive constructor invocations.
15684
15685 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
15686
15687         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
15688         routines to check if a type is an enumerable/enumerator allow
15689         classes that implement the IEnumerable or IEnumerator interfaces.
15690
15691         * class.cs (Property, Operator): Implement IIteratorContainer, and
15692         implement SetYields.
15693
15694         (Property.Define): Do the block swapping for get_methods in the
15695         context of iterators.   We need to check if Properties also
15696         include indexers or not.
15697
15698         (Operator): Assign the Block before invoking the
15699         OperatorMethod.Define, so we can trigger the Iterator code
15700         replacement. 
15701
15702         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
15703         Property and Operator classes are not created when we parse the
15704         declarator but until we have the block completed, so we use a
15705         singleton SimpleIteratorContainer.Simple to flag whether the
15706         SetYields has been invoked.
15707
15708         We propagate this setting then to the Property or the Operator to
15709         allow the `yield' to function.
15710
15711 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
15712
15713         * codegen.cs: Implemented attribute support for modules.
15714         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
15715         Assembly/Module functionality.
15716
15717         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
15718         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
15719         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
15720
15721 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
15722
15723         * interface.cs (FindMembers): The operation is performed on all base
15724         interfaces and not only on the first. It is required for future CLS Compliance patch.
15725
15726 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
15727
15728         * statement.cs, codegen.cs:
15729         This patch deals with patterns such as:
15730
15731         public class List : IEnumerable {
15732
15733                 public MyEnumerator GetEnumerator () {
15734                         return new MyEnumerator(this);
15735                 }
15736
15737                 IEnumerator IEnumerable.GetEnumerator () {
15738                         ...
15739                 }
15740                 
15741                 public struct MyEnumerator : IEnumerator {
15742                         ...
15743                 }
15744         }
15745
15746         Before, there were a few things we did wrong:
15747         1) we would emit callvirt on a struct, which is illegal
15748         2) we emited ldarg when we needed to emit ldarga
15749         3) we would mistakenly call the interface methods on an enumerator
15750         type that derived from IEnumerator and was in another assembly. For example:
15751
15752         public class MyEnumerator : IEnumerator
15753
15754         Would have the interface methods called, even if there were public impls of the
15755         method. In a struct, this lead to invalid IL code.
15756
15757 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
15758
15759         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
15760           renamed to Emit.
15761
15762         * delegate.cs (Define): Fixed crash when delegate type is undefined.
15763
15764 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
15765
15766         * cs-parser.jay: Fix small regression: we were not testing V2
15767         compiler features correctly.
15768
15769         * interface.cs: If the emit context is null, then create one
15770
15771 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
15772
15773         * decl.cs (GetSignatureForError): New virtual method to get full name
15774           for error messages.
15775
15776         * attribute.cs (IAttributeSupport): New interface for attribute setting.
15777           Now it is possible to rewrite ApplyAttributes method to be less if/else.
15778
15779         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
15780           Duplicated members and code in these classes has been removed.
15781           Better encapsulation in these classes.
15782
15783 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
15784
15785         * assign.cs (Assign.DoResolve): When dealing with compound
15786         assignments, there is a new rule in ECMA C# 2.4 (might have been
15787         there before, but it is documented here) that states that in:
15788
15789         a op= b;
15790
15791         If b is of type int, and the `op' is a shift-operator, then the
15792         above is evaluated as:
15793
15794         a = (int) a op b 
15795
15796         * expression.cs (Binary.ResolveOperator): Instead of testing for
15797         int/uint/long/ulong, try to implicitly convert to any of those
15798         types and use that in pointer arithmetic.
15799
15800         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
15801         method to print information for from the type, not from the
15802         null-method we were given.
15803
15804 2004-02-01  Duncan Mak  <duncan@ximian.com>
15805
15806         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
15807         parsing for cmd, fixes bug #53694.
15808
15809 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
15810
15811         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
15812         in the member name duplication tests. Property and operator name duplication
15813         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
15814
15815 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
15816
15817         * interface.cs (PopulateMethod): Fixed crash when interface method
15818         returns not existing type (error test cs0246-3.cs).
15819
15820 2004-02-02  Ravi Pratap M <ravi@ximian.com>
15821
15822         * cs-parser.jay (interface_accessors): Re-write actions to also
15823         store attributes attached to get and set methods. Fix spelling
15824         while at it.
15825
15826         (inteface_property_declaration): Modify accordingly.
15827
15828         (InterfaceAccessorInfo): New helper class to store information to pass
15829         around between rules that use interface_accessors.
15830
15831         * interface.cs (Emit): Apply attributes on the get and set
15832         accessors of properties and indexers too.
15833
15834         * attribute.cs (ApplyAttributes): Modify accordingly to use the
15835         right MethodBuilder when applying attributes to the get and set accessors.
15836
15837 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
15838
15839         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
15840
15841 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
15842
15843         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
15844
15845 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
15846
15847         * cs-parser.jay: Remove YIELD token, instead use the new grammar
15848         changes that treat `yield' specially when present before `break'
15849         or `return' tokens.
15850
15851         * cs-tokenizer.cs: yield is no longer a keyword.
15852
15853 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
15854
15855         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
15856         setting for default constructors.
15857         For default constructors are almost every time set wrong Modifier. The
15858         generated IL code has been alright. But inside mcs this values was
15859         wrong and this was reason why several of my CLS Compliance tests
15860         failed.
15861
15862 2004-01-22  Martin Baulig  <martin@ximian.com>
15863
15864         * cs-parser.jay (namespace_or_type_name): Return an Expression,
15865         not a QualifiedIdentifier.  This is what `type_name_expression'
15866         was previously doing.
15867         (type_name_expression): Removed; the code is now in
15868         `namespace_or_type_name'.
15869         (qualified_identifier): Removed, use `namespace_or_type_name'
15870         instead.
15871         (QualifiedIdentifier): Removed this class.      
15872
15873 2004-01-22  Martin Baulig  <martin@ximian.com>
15874
15875         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
15876         not a string as alias name.
15877
15878 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
15879
15880         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
15881         #52730 bug, and instead compute correctly the need to use a
15882         temporary variable when requesting an address based on the
15883         static/instace modified of the field and the constructor.
15884  
15885 2004-01-21  Martin Baulig  <martin@ximian.com>
15886
15887         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
15888         class and namespace before looking up aliases.  Fixes #52517.
15889
15890 2004-01-21  Martin Baulig  <martin@ximian.com>
15891
15892         * flowanalysis.cs (UsageVector.Merge): Allow variables being
15893         assinged in a 'try'; fixes exception4.cs.
15894
15895 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15896         * class.cs : Implemented parameter-less constructor for TypeContainer
15897
15898         * decl.cs: Attributes are now stored here. New property OptAttributes
15899
15900         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
15901
15902         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
15903
15904 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15905
15906         * typemanager.cs (CSharpSignature): Now reports also inner class name.
15907           (CSharpSignature): New method for indexer and property signature.
15908
15909 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15910
15911         * pending.cs (IsVirtualFilter): Faster implementation.
15912
15913 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15914
15915         * typemanager.cs: Avoid inclusion of same assembly more than once.
15916
15917 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15918
15919         * cs-parser.jay: Fixed problem where the last assembly attribute
15920           has been applied also to following declaration (class, struct, etc.)
15921           
15922 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15923
15924         * class.cs: Added error CS0538, CS0539 reporting.
15925         Fixed crash on Microsoft runtime when field type is void.
15926
15927         * cs-parser.jay: Added error CS0537 reporting.
15928
15929         * pending.cs: Added error CS0535 reporting.
15930         Improved error report for errors CS0536, CS0534.
15931
15932 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
15933
15934         Merge a few bits from the Anonymous Method MCS tree.
15935
15936         * statement.cs (ToplevelBlock): New class for toplevel methods,
15937         will hold anonymous methods, lifted variables.
15938
15939         * cs-parser.jay: Create toplevel blocks for delegates and for
15940         regular blocks of code. 
15941
15942 2004-01-20  Martin Baulig  <martin@ximian.com>
15943
15944         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
15945         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
15946         and `NeedExplicitReturn'; added `IsLastStatement'.
15947         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
15948         have a `ReturnLabel' or we're not unreachable.
15949
15950         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
15951         child's reachability; don't just override ours with it.  Fixes
15952         #58058 (lluis's example).
15953         (FlowBranching): Added public InTryOrCatch(), InCatch(),
15954         InFinally(), InLoop(), InSwitch() and
15955         BreakCrossesTryCatchBoundary() methods.
15956
15957         * statement.cs (Return): Do all error checking in Resolve().
15958         Unless we are the last statement in a top-level block, always
15959         create a return label and jump to it.
15960         (Break, Continue): Do all error checking in Resolve(); also make
15961         sure we aren't leaving a `finally'.
15962         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
15963         statement in a top-level block.
15964         (Block.Flags): Added `IsDestructor'.
15965         (Block.IsDestructor): New public property.
15966
15967 2004-01-20  Martin Baulig  <martin@ximian.com>
15968
15969         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
15970
15971 2004-01-20  Martin Baulig  <martin@ximian.com>
15972
15973         * statement.cs (Statement.ResolveUnreachable): New public method.
15974         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
15975         (Block.Resolve): Resolve unreachable statements.
15976
15977 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
15978
15979         * expression.cs: We need to fix the case where we do
15980         not have a temp variable here.
15981
15982         * assign.cs: Only expression compound assignments need
15983         temporary variables.
15984
15985 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
15986
15987         * flowanalysis.cs: Reduce memory allocation in a few ways:
15988           - A block with no variables should not allocate a bit
15989             vector for itself.
15990           - A method with no out parameters does not need any tracking
15991             for assignment of the parameters, so we need not allocate
15992             any data for it.
15993           - The arrays:
15994                 public readonly Type[] VariableTypes;
15995                 public readonly string[] VariableNames;
15996             Are redundant. The data is already stored in the variable
15997             map, so we need not allocate another array for it.
15998           - We need to add alot of checks for if (params | locals) == null
15999             due to the first two changes.
16000
16001 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
16002
16003         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16004         implement IMemoryLocation, we store a copy on a local variable and
16005         take the address of it.  Patch from Benjamin Jemlich
16006
16007         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16008         to use a special "type_name_expression" rule which reduces the
16009         number of "QualifiedIdentifier" classes created, and instead
16010         directly creates MemberAccess expressions.
16011
16012 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
16013
16014         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16015         that fixes #52853.  Null literal assignment to ValueType
16016
16017         * class.cs (MethodData.Emit): Instead of checking the name of the
16018         method to determine if its a destructor, create a new derived
16019         class from Method called Destructor, and test for that.  
16020
16021         * cs-parser.jay: Create a Destructor object instead of a Method.  
16022
16023         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16024
16025         Fixes: 52933
16026
16027 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
16028
16029         * expression.cs (Binary.ResolveOperator): Perform an implicit
16030         conversion from MethodGroups to their delegate types on the
16031         Addition operation.
16032
16033         * delegate.cs: Introduce a new class DelegateCreation that is the
16034         base class for `NewDelegate' and `ImplicitDelegateCreation',
16035         factor some code in here.
16036
16037         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16038         conversion from MethodGroups to compatible delegate types. 
16039
16040         * ecore.cs (Expression.Resolve): Do not flag error 654
16041         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16042         we allow conversions from MethodGroups to delegate types now.
16043
16044         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16045         assignments in v2 either.
16046
16047 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
16048
16049         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16050         static read-only fields in ctors.
16051
16052         Applied patch from Benjamin Jemlich 
16053
16054         * expression.cs (UnaryMutator): Avoid leaking local variables. 
16055
16056 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
16057
16058         * cs-tokenizer.cs (IsCastToken): Allow the various native types
16059         here to return true, as they can be used like this:
16060
16061                 (XXX) int.MEMBER ()
16062
16063         Fixed 49836 and all the other dups
16064
16065 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
16066
16067         * driver.cs: Implement /win32res and /win32icon.
16068
16069 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
16070
16071         * cs-parser.jay: Add a rule to improve error handling for the
16072         common mistake of placing modifiers after the type.
16073
16074 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * cs-parser.jay (interface_event_declaration): Catch
16077         initialization of events on interfaces, and report cs0068
16078
16079         * cs-parser.jay (interface_event_declaration): Catch
16080         initialization of events. 
16081
16082         * ecore.cs: Better report missing constructors.
16083
16084         * expression.cs (Binary.ResolveOperator): My previous bug fix had
16085         the error reporting done in the wrong place.  Fix.
16086
16087         * expression.cs (Binary.ResolveOperator): Catch the 
16088         operator + (E x, E y) error earlier, and later allow for implicit
16089         conversions in operator +/- (E e, U x) from U to the underlying
16090         type of E.
16091
16092         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16093         52596, if the container class is abstract, the default constructor
16094         is protected otherwise its public (before, we were always public).
16095
16096         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16097         fixed statement.
16098
16099         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16100         Jemlich that fixes bug #52597, MCS was generating invalid code for
16101         idisposable structs.   Thanks to Ben for following up with this
16102         bug as well.
16103
16104 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
16105
16106         * driver.cs: Allow assemblies without code to be generated, fixes
16107         52230.
16108
16109 2004-01-07  Nick Drochak <ndrochak@gol.com>
16110
16111         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16112
16113 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
16114
16115         * cs-parser.jay: Add rules to improve error reporting if fields or
16116         methods are declared at the namespace level (error 116)
16117
16118         * Add rules to catch event add/remove
16119
16120 2004-01-04  David Sheldon <dave-mono@earth.li>
16121
16122   * expression.cs: Added matching ")" to error message for 
16123   CS0077
16124
16125 2004-01-03 Todd Berman <tberman@gentoo.org>
16126
16127         * ecore.cs, attribute.cs:
16128         Applying fix from #52429.
16129
16130 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16131
16132         * ecore.cs, expression.cs, statement.cs:
16133         Total rewrite of how we handle branching. We
16134         now handle complex boolean expressions with fewer
16135         jumps. As well if (x == 0) no longer emits a ceq.
16136
16137         if (x is Foo) is much faster now, because we generate
16138         better code.
16139
16140         Overall, we get a pretty big improvement on our benchmark
16141         tests. The code we generate is smaller and more readable.
16142
16143         I did a full two-stage bootstrap. The patch was reviewed
16144         by Martin and Miguel.
16145
16146 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16147
16148         * cs-parser.jay: Make primary_expression not take a QI.
16149         we dont need this because the member_access rule covers
16150         us here. So we replace the rule with just IDENTIFIER.
16151
16152         This has two good effects. First, we remove a s/r conflict.
16153         Second, we allocate many fewer QualifiedIdentifier objects.
16154
16155 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16156
16157         * attribute.cs: Handle MarshalAs attributes as pseudo, and
16158         set the correct information via SRE. This prevents
16159         hanging on the MS runtime. Fixes #29374.
16160
16161 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16162
16163         * convert.cs: correctly handle conversions to value types
16164         from Enum and ValueType as unboxing conversions.
16165
16166         Fixes bug #52569. Patch by Benjamin Jemlich.
16167
16168 2004-01-02  Ravi Pratap  <ravi@ximian.com>
16169
16170         * expression.cs (BetterConversion): Prefer int -> uint
16171         over int -> ulong (csc's behaviour). This fixed bug #52046.
16172
16173 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16174
16175         * decl.cs (MemberCache.FindMembers): now returns a
16176         MemberInfo [].
16177
16178         * typemanager.cs: In general, go with with ^^.
16179         (CopyNewMethods): take an IList.
16180         (RealMemberLookup): Only allocate an arraylist
16181         if we copy from two sets of methods.
16182
16183         This change basically does two things:
16184         1) Fewer array lists allocated due to CopyNewMethods.
16185         2) the explicit cast in MemberList costed ALOT.
16186
16187 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
16188
16189         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16190         a hashtable to avoid needless string allocations when an identifier is
16191         used more than once (the common case).
16192
16193 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16194
16195         * pending.cs: MS's TypeBuilder.GetInterfaces ()
16196         is broken, it will not return anything. So, we
16197         have to use the information we have in mcs to
16198         do the task.
16199
16200         * typemanager.cs: Add a cache for GetInterfaces,
16201         since this will now be used more often (due to ^^)
16202
16203         (GetExplicitInterfaces) New method that gets the
16204         declared, not effective, interfaces on a type
16205         builder (eg, if you have interface IFoo, interface
16206         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16207         { IBar }.
16208
16209         This patch makes MCS able to bootstrap itself on
16210         Windows again.
16211
16212 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16213
16214         * expression.cs: Remove the Nop's that Miguel put
16215         in by mistake.
16216
16217 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16218
16219         * report.cs, codegen.cs: Give the real stack trace to
16220         the error when an exception is thrown.
16221
16222 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16223
16224         * decl.cs: only allocate hashtables for ifaces if 
16225         it is an iface!
16226
16227 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16228
16229         * expression.cs: fix the error from cs0121-2.cs
16230         (a parent interface has two child interfaces that
16231         have a function with the same name and 0 params
16232         and the function is called through the parent).
16233
16234 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16235
16236         * class.cs, rootcontext.cs, typmanager.cs: do not
16237         leak pointers.
16238
16239 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16240
16241         * codegen.cs: remove stack for the ec flow branching.
16242         It is already a linked list, so no need.
16243
16244 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
16245
16246         * Makefile: Allow custom profiler here.
16247
16248 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16249
16250         * typemanager.cs (LookupType):
16251           - Use a static char [], because split takes
16252             a param array for args, so it was allocating
16253             every time.
16254           - Do not store true in a hashtable, it boxes.
16255
16256 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16257
16258         * flowanalysis.cs: bytify common enums.
16259
16260 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16261
16262         * modifiers.cs: Add a new set of flags for the
16263         flags allowed on explicit interface impls.
16264         * cs-parser.jay: catch the use of modifiers in
16265         interfaces correctly.
16266         * class.cs: catch private void IFoo.Blah ().
16267
16268         All related to bug #50572.
16269
16270 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16271
16272         * decl.cs: Rewrite the consistant accessability checking.
16273         Accessability is not linear, it must be implemented in
16274         a tableish way. Fixes #49704.
16275
16276 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16277
16278         * expression.cs: Handle negation in a checked context.
16279         We must use subtraction from zero. Fixes #38674.
16280
16281 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16282
16283         * class.cs: Ignore static void main in DLLs.
16284         * rootcontext.cs: Handle the target type here,
16285         since we are have to access it from class.cs
16286         * driver.cs: account for the above.
16287
16288 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16289
16290         * report.cs: Give line numbers and files if available.
16291
16292 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
16293
16294         * driver.cs: Implement /addmodule.
16295
16296         * typemanager.cs:  Change 'modules' field so it now contains Modules not
16297         ModuleBuilders.
16298
16299 2003-12-20  Martin Baulig  <martin@ximian.com>
16300
16301         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16302         (FieldBase.IsAssigned): Removed this field.
16303         (FieldBase.SetAssigned): New public method.
16304         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16305
16306 2003-12-20  Martin Baulig  <martin@ximian.com>
16307
16308         * expression.cs (LocalVariableReference.DoResolve): Don't set
16309         `vi.Used' if we're called from DoResolveLValue().
16310
16311         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16312         returns the usage vector it just merged into the current one -
16313         pass this one to UsageWarning().
16314         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16315         of the `EmitContext', don't call this recursively on our children.
16316
16317 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
16318
16319         * driver.cs: Implement /target:module.
16320
16321 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
16322
16323         * support.cs (CharArrayHashtable): New helper class.
16324
16325         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
16326         char arrays, not strings, so we can avoid creating a string in
16327         consume_identifier if the identifier is a keyword.
16328
16329 2003-12-16  Martin Baulig  <martin@ximian.com>
16330
16331         * statement.cs (LocalInfo.Assigned): Removed this property.
16332         (LocalInfo.Flags): Removed `Assigned'.
16333         (LocalInfo.IsAssigned): New public method; takes the EmitContext
16334         and uses flow analysis.
16335         (Block.UsageWarning): Made this method private.
16336         (Block.Resolve): Call UsageWarning() if appropriate.
16337
16338         * expression.cs (LocalVariableReference.DoResolve): Always set
16339         LocalInfo.Used here.
16340
16341 2003-12-13  Martin Baulig  <martin@ximian.com>
16342
16343         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16344         any value here; we're now using flow analysis to figure out
16345         whether a statement/block returns a value.
16346
16347 2003-12-13  Martin Baulig  <martin@ximian.com>
16348
16349         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16350         working again.
16351         (FlowBranching.MergeFinally): Don't call
16352         `branching.CheckOutParameters()' here, this is called in
16353         MergeTopBlock().
16354         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16355         when adding the `finally' vector.       
16356
16357 2003-12-13  Martin Baulig  <martin@ximian.com>
16358
16359         * flowanalysis.cs
16360         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16361         actually work and also fix #48962.
16362
16363 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
16364
16365         * decl.cs: Do not check System.Object for nested types,
16366         since we know it does not have any. Big bang for buck:
16367
16368         BEFORE:
16369            Run 1:   8.35 seconds
16370            Run 2:   8.32 seconds
16371            corlib:  17.99 seconds
16372         AFTER:
16373            Run 1:   8.17 seconds
16374            Run 2:   8.17 seconds
16375            corlib:  17.39 seconds
16376
16377 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
16378
16379         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16380         time we are returning 0 members, so we save alot here.
16381
16382 2003-12-11  Martin Baulig  <martin@ximian.com>
16383
16384         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16385         `MergeChild()', also just take the `FlowBranching' as argument;
16386         call Merge() on it and return the result.
16387         (FlowBranching.Merge): We don't need to do anything if we just
16388         have one sibling.
16389
16390 2003-12-11  Martin Baulig  <martin@ximian.com>
16391
16392         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16393         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
16394         Maurer for this idea.
16395
16396 2003-12-11  Martin Baulig  <martin@ximian.com>
16397
16398         * flowanalysis.cs (MergeResult): This class is now gone; we now
16399         use the `UsageVector' for this.  The reason for this is that if a
16400         branching just has one sibling, we don't need to "merge" them at
16401         all - that's the next step to do.
16402         (FlowBranching.Merge): We now return a `UsageVector' instead of a
16403         `MergeResult'.
16404
16405 2003-12-11  Martin Baulig  <martin@ximian.com>
16406
16407         Reworked flow analyis and made it more precise and bug-free.  The
16408         most important change is that we're now using a special `Reachability'
16409         class instead of having "magic" meanings of `FlowReturns'.  I'll
16410         do some more cleanups and optimizations and also add some more
16411         documentation this week.
16412
16413         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16414         largely reworked this class.
16415         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16416         the new `Reachability' class instead of having "magic" values here.
16417         (FlowBranching): We're now using an instance of `Reachability'
16418         instead of having separate `Returns', `Breaks' etc. fields.
16419
16420         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16421         based on flow analysis; ignore the return value of block.Emit ().
16422
16423 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
16424
16425         * driver.cs typemanager.cs: Find the mono extensions to corlib even
16426         if they are private.
16427
16428 2003-12-09  Martin Baulig  <martin@ximian.com>
16429
16430         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16431         call them directly on the UsageVector.
16432
16433 2003-12-09  Martin Baulig  <martin@ximian.com>
16434
16435         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16436         Changed return type from `FlowReturns' to `Reachability'.
16437
16438 2003-12-09  Martin Baulig  <martin@ximian.com>
16439
16440         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16441         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16442         `Reachable' fields with a single `Reachability' one.
16443
16444 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16445
16446         * class.cs (FindMembers): Remove foreach's.
16447
16448         Bootstrap times:
16449
16450         BEFORE
16451                 Run 1:   8.74 seconds
16452                 Run 2:   8.71 seconds
16453
16454         AFTER
16455                 Run 1:   8.64 seconds
16456                 Run 2:   8.58 seconds
16457
16458
16459 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16460
16461         * cs-parser.jay:
16462         * gen-treedump.cs:
16463         * statement.cs:
16464         This patch does a few things:
16465                 1. EmptyStatement is now a singleton, so it is never reallocated.
16466                 2. All blah is EmptyStatement constructs have been changed to
16467                    blah == EmptyStatement.Value, which is much faster and valid
16468                    now that EmptyStatement is a singleton.
16469                 3. When resolving a block, rather than allocating a new array for
16470                    the non-empty statements, empty statements are replaced with
16471                    EmptyStatement.Value
16472                 4. Some recursive functions have been made non-recursive.
16473         Mainly the performance impact is from (3), however (1) and (2) are needed for
16474         this to work. (4) does not make a big difference in normal situations, however
16475         it makes the profile look saner.
16476
16477         Bootstrap times:
16478
16479         BEFORE
16480         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16481         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16482         Total memory allocated: 56397 KB
16483
16484         AFTER
16485         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16486         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16487         Total memory allocated: 55666 KB
16488
16489 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16490
16491         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16492         than the hashtable in a hashtable version
16493
16494         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16495         we always end up concating a string. This results in a huge perf
16496         loss, because many strings have to be tracked by the GC. In this
16497         patch, we first use a hashtable that works with two keys, so that
16498         the strings do not need to be concat'ed.
16499
16500         Bootstrap times:
16501         BEFORE
16502                 Run 1:   8.74 seconds
16503                 Run 2:   8.71 seconds
16504
16505         AFTER
16506                 Run 1:   8.65 seconds
16507                 Run 2:   8.56 seconds
16508
16509 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16510
16511         * Makefile: Add a new target `do-time' that does a quick and simple
16512         profile, leaving easy to parse output.
16513
16514 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
16515
16516         * codegen.cs (Init): Create the dynamic assembly with 
16517         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16518
16519 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16520
16521         * support.cs: Make the PtrHashtable use only one
16522         instance of its comparer.
16523
16524 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
16525
16526         * typemanager.cs: Fix lookup of GetNamespaces.
16527
16528 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
16529
16530         * expression.cs: Removed redundant line.
16531
16532         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16533         ArrayLists, use for loops with bounds.  
16534
16535         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16536         arraylist.
16537
16538         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16539         arraylists, use for loop with bounds.
16540
16541         The above three changes give us a 0.071 second performance
16542         improvement out of 3.294 seconds down to 3.223.  On my machine
16543         the above changes reduced the memory usage by 1,387 KB during
16544         compiler bootstrap.
16545
16546         * cs-parser.jay (QualifiedIdentifier): New class used to represent
16547         QualifiedIdentifiers.  Before we created a new string through
16548         concatenation, and mostly later on, the result would be
16549         manipulated by DecomposeQI through string manipulation.
16550
16551         This reduced the compiler memory usage for bootstrapping from
16552         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16553         compile times in 0.05 seconds.
16554
16555 2003-11-28  Dick Porter  <dick@ximian.com>
16556
16557         * support.cs: Do string compares with the Invariant culture.
16558
16559         * rootcontext.cs: 
16560         * gen-treedump.cs: 
16561         * expression.cs: 
16562         * driver.cs: 
16563         * decl.cs: 
16564         * codegen.cs: 
16565         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16566         the comparison is done with the Invariant culture.
16567
16568 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
16569
16570         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16571         GetEnumerator method.
16572
16573         (ProbeCollectionType): Iterate starting at the most specific type
16574         upwards looking for a GetEnumerator
16575
16576         * expression.cs: Shift count can be up to 31 for int/uint and 63
16577         for long/ulong.
16578
16579 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
16580
16581         * statement.cs (Block.LookupLabel): Also look for the label on the
16582         children blocks.  Use a hash table to keep track of visited
16583         nodes. 
16584
16585         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16586         we actually did transform the other operand, otherwise fall back
16587         to the common codepath that casts to long.
16588
16589         * cs-tokenizer.cs: Use the same code pattern as the int case.
16590         Maybe I should do the parsing myself, and avoid depending on the
16591         Parse routines to get this done.
16592
16593 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
16594
16595         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16596         which fixes bug 51347.  This time test it.
16597
16598         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16599         attributes for example can not tell the difference between these.
16600         The difference was only a syntax feature of the language. 
16601
16602         * attribute.cs: Apply attributes to delegates.
16603
16604         * delegate.cs: Call the apply attributes method.
16605
16606 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16609         comparing 0 vs Byte.MinValue, not the value
16610
16611         (ImplicitConversionRequired): When reporting a conversion error,
16612         use error 31 to print out the constant error instead of the
16613         simpler 29.
16614
16615         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16616         which fixes bug 51347.
16617
16618 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
16619
16620         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
16621         which fixes the -warnaserror command line option.
16622
16623 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
16624
16625         * cfold.cs (DoNumericPromotions): During constant folding of
16626         additions on UIntConstant, special case intconstants with
16627         IntConstants like we do on the expression binary operator. 
16628
16629 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
16630
16631         * convert.cs (ImplicitReferenceConversion): We were missing a case
16632         (System.Enum are not value types or class types, so we need to
16633         classify them separatedly).
16634
16635         * driver.cs: We do not support error 2007.
16636
16637 2003-11-12 Jackson Harper <jackson@ximian.com>
16638
16639         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16640         system directory. Also use the full file name so users can
16641         libraries names mscorlib-o-tron.dll in a non system dir.
16642
16643 2003-11-10  Martin Baulig  <martin@ximian.com>
16644
16645         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16646         (TypeManager.InitCoreTypes): Initialize them here, but instead of
16647         calling `ResolveType()' on them, directly assign their `Type'.
16648
16649 2003-11-08  Martin Baulig  <martin@ximian.com>
16650
16651         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16652         return value and the `out parent' parameter.
16653         (TypeContainer.DefineType): Moved the CS0644 check into
16654         GetClassBases().  Don't pass the interface types to the
16655         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16656         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16657
16658         * ecore.cs (TypeExpr.IsAttribute): New property.
16659         (TypeExpr.GetInterfaces): New method.
16660
16661         * interface.cs (Interface.GetInterfaceTypeByName): Return a
16662         TypeExpr instead of a Type.
16663         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16664         (Interface.DefineType): Don't pass the interface types to the
16665         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16666         them later and then call `TypeBulider.AddInterfaceImplementation()'.
16667
16668         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16669         instead of a `Type[]'.
16670         (TypeManager.RegisterBuilder): Likewise.
16671         (TypeManager.AddUserInterface): Likewise.
16672         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
16673         `Type[]' and also return a `TypeExpr[]'.
16674         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
16675
16676 2003-11-08  Martin Baulig  <martin@ximian.com>
16677
16678         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
16679         Expression.     
16680
16681 2003-11-08  Martin Baulig  <martin@ximian.com>
16682
16683         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
16684         TypeManager.ResolveExpressionTypes().
16685
16686         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
16687         instead of an Expression.
16688         (TypeExpr): This is now an abstract base class for `TypeExpression'.
16689         (TypeExpression): New public class; formerly known as `TypeExpr'.
16690
16691         * expression.cs (ComposedCast): Derive from TypeExpr.
16692
16693         * typemanager.cs (TypeManager.system_*_expr): These are now
16694         TypExpr's instead of Expression's.
16695         (TypeManager.ResolveExpressionTypes): New public static function;
16696         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
16697         of them.        
16698
16699 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
16700
16701         * expression.cs (New.DoResolve): Do not dereference value that
16702         might be a null return.
16703
16704         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
16705         sure that the constant value has the right type.  Fixes an
16706         unreported bug, similar to 50425.
16707
16708         * const.cs (Const.LookupConstantValue): Call
16709         ImplicitStandardConversionExists before doing a conversion to
16710         avoid havng the TypeManager.ChangeType do conversions.
16711
16712         Reduced the number of casts used
16713
16714         (Const.ChangeType): New routine to enable reuse of the constant
16715         type changing code from statement.
16716
16717         * typemanager.cs (ChangeType): Move common initialization to
16718         static global variables.
16719
16720         Fixes #50425.
16721
16722         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
16723         every value type to go through, even if it was void.  Fix that. 
16724
16725         * cs-tokenizer.cs: Use is_identifier_start_character on the start
16726         character of the define, and the is_identifier_part_character for
16727         the rest of the string.
16728
16729 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
16730
16731         * expression.cs (UnaryMutator.EmitCode): When I updated
16732         LocalVariableReference.DoResolve, I overdid it, and dropped an
16733         optimization done on local variable references.
16734
16735 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
16736
16737         * ecore.cs: Convert the return from Ldlen into an int.
16738
16739 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
16740
16741         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
16742         the accessibility, this is a special case for toplevel non-public
16743         classes (internal for instance).
16744
16745 2003-10-20  Nick Drochak <ndrochak@gol.com>
16746
16747         * ecore.cs: Fix typo and build.  Needed another right paren.
16748
16749 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
16750
16751         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
16752         `internal' case regular and protected, but not allowing protected
16753         to be evaluated later.  Bug 49840
16754
16755 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
16756
16757         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
16758         to kb.Nlast, and not the kb.nFirst to isolate the switch
16759         statement.
16760
16761         Extract the underlying type, so enumerations of long/ulong are
16762         treated like long/ulong.
16763
16764 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
16765
16766         * expression.cs (New): Overload the meaning of RequestedType to
16767         track the possible creation of the NewDelegate type, since
16768         DoResolve is invoked more than once for new constructors on field
16769         initialization.
16770
16771         See bugs: #48800 and #37014
16772
16773         * cs-parser.jay (declare_local_constants): Take an arraylist
16774         instead of a single constant.
16775
16776         (local_constant_declaration): It should take a
16777         constant_declarators, not a constant_declarator.  Fixes 49487
16778
16779         * convert.cs: Fix error report.
16780
16781 2003-10-13 Jackson Harper <jackson@ximian.com>
16782
16783         * typemanager.cs (TypeToCoreType): Add float and double this fixes
16784         bug #49611
16785
16786 2003-10-09  Martin Baulig  <martin@ximian.com>
16787
16788         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
16789         to the .ctor.
16790         (MethodCore.DoDefineParameters): Removed the TypeContainer
16791         argument; use the DeclSpace which was passed to the .ctor instead.
16792         (MethodCore.CheckParameter): Take a DeclSpace instead of a
16793         TypeContainer; we only need a DeclSpace here.
16794
16795 2003-10-09  Martin Baulig  <martin@ximian.com>
16796
16797         * class.cs (MethodData): Added additional `DeclSpace ds' argument
16798         to the .ctor.
16799         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
16800         EmitContext's .ctor.    
16801
16802 2003-10-09  Martin Baulig  <martin@ximian.com>
16803
16804         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
16805         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
16806         AsAccessible(), moved them as well.
16807
16808         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
16809
16810 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
16811
16812         * cs-parser.jay : Renamed yyName to yyNames related to jay.
16813
16814 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
16815
16816         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
16817         generation for >=, as spotted by Paolo, bug 48679.  
16818         Patch from David Waite.
16819
16820         * cs-tokenizer.cs: Add handling for #pragma.
16821
16822         * cs-parser.jay: Allow for both yield and yield return in the
16823         syntax.  The anti-cobolization of C# fight will go on!
16824
16825         * class.cs (TypeBuilder.DefineType): Catch error condition here
16826         (Parent.DefineType erroring out and returning null).
16827
16828         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16829         coping with enumerations variables, we were mistakenly processing
16830         them as a regular value type instead of built-in types.  Fixes the
16831         bug #48063
16832
16833         * typemanager.cs (IsBuiltinOrEnum): New method.
16834
16835 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
16836
16837         * cs-parser.jay: Upgrade: yield now needs the return clause.
16838
16839 2003-09-19  Martin Baulig  <martin@ximian.com>
16840
16841         * decl.cs (MemberCache.SetupCacheForInterface): Take a
16842         `MemberCache parent' argument.  Normally, an interface doesn't
16843         have a parent type except System.Object, but we use this in gmcs
16844         for generic type parameters.
16845
16846 2003-09-18  Martin Baulig  <martin@ximian.com>
16847
16848         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
16849         on `type.IsInterface'; don't check whether the type has a parent
16850         to determine whether it's an interface.
16851
16852 2003-09-15  Martin Baulig  <martin@ximian.com>
16853
16854         * class.cs (TypeContainer.DefineType): Added an error flag to
16855         avoid reporting duplicate CS0146's ("class definition is
16856         circular.").
16857
16858         * driver.cs (Driver.MainDriver): Abort if
16859         RootContext.ResolveTree() reported any errors.
16860
16861 2003-09-07  Martin Baulig  <martin@ximian.com>
16862
16863         * report.cs (Error, Warning): Added overloaded versions which take
16864         a `params object[] args' and call String.Format().
16865
16866 2003-09-07  Martin Baulig  <martin@ximian.com>
16867
16868         * decl.cs (DeclSpace..ctor): Don't call
16869         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
16870         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
16871         (DeclSpace.RecordDecl): New method.
16872
16873         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
16874
16875 2003-09-02  Ravi Pratap  <ravi@ximian.com>
16876
16877         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
16878         value attributes to be applied to ParameterBuilders.
16879
16880         * class.cs (MethodCore.LabelParameters): Make static and more
16881         generic so that it can be used from other places - like interface
16882         methods, for instance.
16883
16884         * interface.cs (Interface.Emit): Call LabelParameters before
16885         emitting attributes on the InterfaceMethod.
16886
16887 2003-08-26  Martin Baulig  <martin@ximian.com>
16888
16889         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
16890         resolving aliases; fixes #47927.
16891
16892 2003-08-26  Martin Baulig  <martin@ximian.com>
16893
16894         * statement.cs (Using.DoResolve): This is internally emitting a
16895         try/finally clause, so we need to set ec.NeedExplicitReturn if we
16896         do not always return.  Fixes #47681.
16897
16898 2003-08-26  Martin Baulig  <martin@ximian.com>
16899
16900         * decl.cs (MemberCore): Moved WarningNotHiding(),
16901         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
16902         into MemberBase.
16903         (AdditionResult): Make this nested in DeclSpace.
16904         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
16905         argument; call NamespaceEntry.Define() unless we're nested in a
16906         class or struct.
16907
16908         * namespace.cs (Namespace.DefineName): New public function.  This
16909         is called from DeclSpace's .ctor to add 
16910         (Namespace.Lookup): Include DeclSpaces in the lookup.
16911
16912         * class.cs (Operator): Derive from MemberBase, not MemberCore.
16913
16914         * const.cs (Const): Derive from MemberBase, not MemberCore.     
16915
16916 2003-08-25  Martin Baulig  <martin@ximian.com>
16917
16918         * convert.cs (Convert.ExplicitReferenceConversion): When
16919         converting from an interface type to a class, unbox if the target
16920         type is a struct type.  Fixes #47822.
16921
16922 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16923
16924         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
16925         #47854.
16926
16927 2003-08-22  Martin Baulig  <martin@ximian.com>
16928
16929         * class.cs (TypeManager.DefineType): When defining a nested type,
16930         call DefineType() on our parent; fixes #47801.
16931
16932 2003-08-22  Martin Baulig  <martin@ximian.com>
16933
16934         * class.cs (MethodData.Define): While checking if a method is an
16935         interface implementation, improve the test a bit more to fix #47654.
16936
16937 2003-08-22  Martin Baulig  <martin@ximian.com>
16938
16939         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
16940         correctly; fixes #47722.
16941
16942 2003-08-22  Martin Baulig  <martin@ximian.com>
16943
16944         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
16945         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
16946
16947         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
16948
16949 2003-08-22  Martin Baulig  <martin@ximian.com>
16950
16951         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
16952         can only be assigned in static constructors.  Fixes #47161.
16953
16954 2003-08-22  Martin Baulig  <martin@ximian.com>
16955
16956         Rewrote and improved the flow analysis code.
16957
16958         * flowbranching.cs (FlowBranching): Make this class abstract.
16959         (FlowBranching.CreateBranching): New static function to create a
16960         new flow branching.
16961         (FlowBranchingBlock, FlowBranchingException): New classes.
16962         (FlowBranching.UsageVector.Type): New public readonly field.
16963         (FlowBranching.UsageVector.Breaks): Removed the setter.
16964         (FlowBranching.UsageVector.Returns): Removed the setter.
16965         (FlowBranching.UsageVector): Added Break(), Return(),
16966         NeverReachable() and Throw() methods to modify the reachability.
16967         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
16968         done by FlowBranching.Merge().
16969         (FlowBranching.UsageVector.MergeChild): New method; merges the
16970         merge result into the current vector.
16971         (FlowBranching.Merge): New abstract method to merge a branching.
16972
16973 2003-08-12  Martin Baulig  <martin@ximian.com>
16974
16975         * expression.cs (Indirection.CacheTemporaries): Create the
16976         LocalTemporary with the pointer type, not its element type.
16977
16978 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
16979
16980         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
16981         token was a keyword or not.
16982
16983         Add `error' options where an IDENTIFIER was expected;  Provide
16984         CheckToken and CheckIdentifierToken convenience error reporting
16985         functions. 
16986
16987         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
16988
16989         * decl.cs: Rename `NamespaceEntry Namespace' public field into
16990         NameSpaceEntry NameSpaceEntry.
16991
16992         (LookupInterfaceOrClass): Avoid creating a full qualified name
16993         from namespace and name: avoid doing lookups when we know the
16994         namespace is non-existant.   Use new Tree.LookupByNamespace which
16995         looks up DeclSpaces based on their namespace, name pair.
16996
16997         * driver.cs: Provide a new `parser verbose' to display the
16998         exception thrown during parsing.  This is turned off by default
16999         now, so the output of a failure from mcs is more graceful.
17000
17001         * namespace.cs: Track all the namespaces defined in a hashtable
17002         for quick lookup.
17003
17004         (IsNamespace): New method
17005
17006 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
17007
17008         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
17009         we know that we need to concatenate (full typename can never be
17010         null). 
17011
17012         * class.cs: ditto.
17013
17014         * statement.cs: Use a bitfield;  Do not initialize to null things
17015         which are done by the constructor by default.
17016
17017         * cs-parser.jay: bug fix, parameter was 4, not 3.
17018
17019         * expression.cs: Just use the property;
17020
17021         * statement.cs: No need for GetVariableInfo method.
17022
17023 2003-08-08  Martin Baulig  <martin@ximian.com>
17024
17025         * flowanalysis.cs (FlowReturns): This is now nested in the
17026         `FlowBranching' class.
17027         (MyBitVector): Moved this here from statement.cs.
17028         (FlowBranching.SiblingType): New enum type.
17029         (FlowBranching.CreateSibling): Added `SiblingType' argument.
17030
17031 2003-08-07  Martin Baulig  <martin@ximian.com>
17032
17033         * flowanalysis.cs (FlowBranchingType): This is now nested in the
17034         `FlowBranching' class and called `BranchingType'.
17035
17036 2003-08-07  Martin Baulig  <martin@ximian.com>
17037
17038         * flowanalysis.cs: Moved all the control flow analysis code into
17039         its own file.
17040
17041 2003-08-07  Martin Baulig  <martin@ximian.com>
17042
17043         * assign.cs (Assign.DoResolve): `target' must either be an
17044         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
17045         #37319.
17046
17047 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
17048
17049         * expression.cs (BinaryMethod): This kind of expression is created by the
17050         Binary class if it determines that the operator has to be handled
17051         by a method.
17052
17053         (BinaryDelegate): This kind of expression is created if we are
17054         dealing with a + or - operator on delegates.
17055
17056         (Binary): remove method, argumetns, and DelegateOperator: when
17057         dealing with methods, 
17058
17059         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17060
17061         * statement.cs (Block): use bitfields for the three extra booleans
17062         we had in use.   Remove unused topblock parameter.
17063
17064         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17065
17066         * assign.cs: Drop extra unneeded tests.
17067
17068 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
17069
17070         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17071
17072         * statement.cs (Foreach): Use VariableStorage instead of
17073         LocalBuilders.   
17074
17075         * codegen.cs (VariableStorage): New class used by clients that
17076         require a variable stored: locals or fields for variables that
17077         need to live across yield.
17078
17079         Maybe provide a convenience api for EmitThis+EmitLoad?
17080
17081         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17082         these bad boys.
17083
17084 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
17085
17086         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17087         RemapParameterLValue): New methods that are used to turn a
17088         precomputed FieldInfo into an expression like this:
17089
17090                 instance.FieldInfo
17091
17092         The idea is to use this instead of making LocalVariableReference
17093         have more than one meaning.
17094
17095         * cs-parser.jay: Add error production to BASE.
17096
17097         * ecore.cs: Deal with TypeManager.GetField returning null, which
17098         is now a valid return value.
17099
17100         (FieldExprNoAddress): New expression for Fields whose address can
17101         not be taken.
17102
17103         * expression.cs (LocalVariableReference): During the resolve
17104         phases, create new expressions if we are in a remapping context.
17105         Remove code that dealt with remapping here.
17106
17107         (ParameterReference): same.
17108
17109         (ProxyInstance): New expression, like the `This' expression, but
17110         it is born fully resolved.  We know what we are doing, so remove
17111         the errors that are targeted to user-provided uses of `this'.
17112
17113         * statement.cs (Foreach): our variable is now stored as an
17114         Expression;  During resolution, follow the protocol, dont just
17115         assume it will return this.
17116
17117 2003-08-06  Martin Baulig  <martin@ximian.com>
17118
17119         * support.cs (SeekableStreamReader.cs): New public class.
17120
17121         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17122         SeekableStreamReader instead of the normal StreamReader.
17123
17124 2003-08-04  Martin Baulig  <martin@ximian.com>
17125
17126         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17127         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17128         deambiguate casts and delegate invocations.
17129         (parenthesized_expression): Use the new tokens to ensure this is
17130         not a cast of method invocation.
17131
17132         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17133         when reading a `)' and Deambiguate_CloseParens () was previously
17134         called.
17135
17136         * expression.cs (ParenthesizedExpression): New class.  This is
17137         just used for the CS0075 test.
17138         (Binary.DoResolve): Check for CS0075.   
17139
17140 2003-07-29  Ravi Pratap  <ravi@ximian.com>
17141
17142         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17143         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17144         reference comparison.
17145
17146         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17147         examine the ReturnType for equality - this is necessary in the
17148         cases of implicit and explicit operators whose signature also
17149         includes the return type.
17150
17151 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
17152
17153         * namespace.cs: Cache the result of the namespace computation,
17154         instead of computing it every time.
17155
17156 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
17157
17158         * decl.cs: Use a global arraylist that we reuse over invocations
17159         to avoid excesive memory consumption.  Reduces memory usage on an
17160         mcs compile by one meg (45 average).
17161
17162         * typemanager.cs (LookupTypeReflection): In .NET pointers are
17163         private, work around that.
17164
17165 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
17166
17167         * literal.cs (IntLiteral): Define Zero and One static literals. 
17168
17169         * cs-parser.jay (integer_literal): use static literals to reduce
17170         memory usage for the most used literals (0, 1 and -1).  211kb
17171         reduced in memory usage.
17172
17173         Replace all calls to `new ArrayList' with `new
17174         ArrayList(4)' which is a good average number for most allocations,
17175         and also requires only 16 bytes of memory for its buffer by
17176         default. 
17177
17178         This reduced MCS memory usage in seven megabytes for the RSS after
17179         bootstrapping.
17180
17181 2003-07-28  Ravi Pratap  <ravi@ximian.com>
17182
17183         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17184         handle params methods the correct way by forming only one
17185         applicable set with params and normal methods in them. Earlier we
17186         were looking at params methods only if we found no normal methods
17187         which was not the correct thing to do.
17188
17189         (Invocation.BetterFunction): Take separate arguments indicating
17190         when candidate and the best method are params methods in their
17191         expanded form.
17192
17193         This fixes bugs #43367 and #46199.
17194
17195         * attribute.cs: Documentation updates.
17196
17197         (CheckAttribute): Rename to CheckAttributeTarget.
17198         (GetValidPlaces): Rename to GetValidTargets.
17199
17200         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17201         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17202
17203         Fixes bug #44468.
17204
17205 2003-07-28  Martin Baulig  <martin@ximian.com>
17206
17207         * class.cs (TypeContainer.DefineMembers): Use the base type's full
17208         name when looking up the base class of a nested class.  Fixes #46977.
17209
17210 2003-07-26  Martin Baulig  <martin@ximian.com>
17211
17212         * expression.cs (Indexers.Indexer): New nested struct; contains
17213         getter, setter and the indexer's type.
17214         (Indexers.Properties): This is now an ArrayList of
17215         Indexers.Indexer's.
17216         (IndexerAccess.DoResolveLValue): Correctly set the type if the
17217         indexer doesn't have any getters.
17218
17219         * assign.cs (Assign.DoResolve): Also do the implicit conversions
17220         for embedded property and indexer assignments.
17221
17222 2003-07-26  Martin Baulig  <martin@ximian.com>
17223
17224         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17225         preprocessor directive is not the first non-whitespace character
17226         on a line.
17227
17228 2003-07-26  Martin Baulig  <martin@ximian.com>
17229
17230         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17231         namespace parsing, follow the spec more closely.
17232
17233         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17234         NamespaceEntry.Lookup().
17235
17236 2003-07-25  Martin Baulig  <martin@ximian.com>
17237
17238         * MethodCore.cs (OverridesSomething): New public field; it's set
17239         from TypeContainer.DefineMembers if this method overrides
17240         something (which doesn't need to be a method).  Fix #39462.
17241
17242 2003-07-25  Ravi Pratap  <ravi@ximian.com>
17243
17244         * typemanager.cs (GetMembers): Ensure that the list of members is
17245         reversed. This keeps things in sync.
17246
17247         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17248         find an AttributeUsage attribute.
17249
17250         * expression.cs (Invocation.OverloadResolve): Perform the check
17251         which disallows Invoke to be directly called on a Delegate.
17252
17253         (Error_InvokeOnDelegate): Report error cs1533.
17254
17255 2003-07-25  Martin Baulig  <martin@ximian.com>
17256
17257         * expression.cs (Indexers.GetIndexersForType): Only look in the
17258         interface hierarchy if the requested type is already an
17259         interface.  Fixes #46788 while keeping #46502 fixed.
17260
17261 2003-07-25  Martin Baulig  <martin@ximian.com>
17262
17263         * class.cs (TypeContainer.DefineMembers): Check whether all
17264         readonly fields have been assigned and report warning CS0649 if
17265         not.
17266
17267         * statement.cs (LocalInfo.IsFixed): Always return true if this is
17268         a valuetype.
17269
17270 2003-07-24  Ravi Pratap  <ravi@ximian.com>
17271
17272         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17273         returned from GetMethods to make things consistent with the
17274         assumptions MCS makes about ordering of methods.
17275
17276         This should comprehensively fix bug #45127 and it does :-)
17277
17278         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17279         ordering is actually reverse.
17280
17281         * Clean up some debug messages I left lying around.
17282
17283         * interface.cs (Populate*): Get rid of code which emits attributes
17284         since the stage in which we emit attributes is the 'Emit' stage,
17285         not the define stage.
17286
17287         (Emit): Move attribute emission for interface members here.
17288
17289 2003-07-22  Ravi Pratap  <ravi@ximian.com>
17290
17291         * expression.cs (Invocation.OverloadResolve): Follow the spec more
17292         closely: we eliminate methods in base types when we have an
17293         applicable method in a top-level type.
17294
17295         Please see section 14.5.5.1 for an exact description of what goes
17296         on. 
17297
17298         This fixes bug #45127 and a host of other related to corlib compilation.
17299
17300         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17301         array is the method corresponding to the top-level type (this is
17302         because of the changes made to icall.c) so we change this
17303         accordingly.
17304
17305         (MethodGroupExpr.Name): This too.
17306
17307         * typemanager.cs (GetElementType): New method which does the right
17308         thing when compiling corlib. 
17309
17310         * everywhere: Make use of the above in the relevant places.
17311
17312 2003-07-22  Martin Baulig  <martin@ximian.com>
17313
17314         * cs-parser.jay (invocation_expression): Moved
17315         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17316         `cast_expression', but create a InvocationOrCast which later
17317         resolves to either an Invocation or a Cast.
17318
17319         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17320         method; call this before EmitStatement() to make sure that this
17321         expression can be used as a statement.
17322
17323         * expression.cs (InvocationOrCast): New class; resolves to either
17324         an Invocation or a Cast.
17325
17326         * statement.cs (StatementExpression): Call ResolveStatement() on
17327         the ExpressionStatement before emitting it.
17328
17329 2003-07-21  Martin Baulig  <martin@ximian.com>
17330
17331         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17332         `ref' and `out' attributes match; fixes #46220.
17333         (MemberAccess.ResolveMemberAccess): You can't reference a type
17334         through an expression; fixes #33180.
17335         (Indexers.GetIndexersForType): Don't return the indexers from
17336         interfaces the class implements; fixes #46502.
17337
17338 2003-07-21  Martin Baulig  <martin@ximian.com>
17339
17340         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17341         CS0661 checks; fixes bug #30442.
17342
17343 2003-07-21  Martin Baulig  <martin@ximian.com>
17344
17345         * decl.cs (AdditionResult): Added `Error'.
17346
17347         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17348
17349         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17350         makes cs0031.cs actually work.
17351
17352 2003-07-20  Martin Baulig  <martin@ximian.com>
17353
17354         * namespace.cs: Fixed that bug which caused a crash when compiling
17355         the debugger's GUI.
17356
17357 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
17358
17359         * typemanager.cs (LookupTypeReflection): Never expose types which
17360         are NotPublic, NestedPrivate, NestedAssembly, or
17361         NestedFamANDAssem.  We used to return these, and later do a check
17362         that would report a meaningful error, but the problem is that we
17363         would not get the real match, if there was a name override.
17364
17365 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
17366
17367         * namespace.cs (Namespace, Name): Do not compute the namespace
17368         name dynamically, compute it in the constructor.  This reduced
17369         memory usage by 1697 KB.
17370
17371         * driver.cs: Use --pause to pause at the end.
17372
17373 2003-07-17  Peter Williams  <peter@newton.cx>
17374
17375         * Makefile: Change the name of the test target so that it doesn't
17376         conflict with the recursive test target.
17377
17378 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
17379
17380         * expression.cs (LocalVariableReference.Emit, EmitAssign,
17381         AddressOf): Do not use EmitThis, that was wrong, use the actual
17382         this pointer.
17383
17384 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
17385
17386         * class.cs (MethodData.Define): While checking if a method is an
17387         interface implementation, improve the test: If we are not public
17388         (use new test here: use the computed MethodAttributes directly,
17389         instead of the parsed modifier flags) check if the `implementing'
17390         method comes from an interface or not.
17391
17392         * pending.cs (VerifyPendingMethods): Slightly better error
17393         message.
17394
17395         * makefile: add test target that does the mcs bootstrap.
17396
17397 2003-07-16  Ravi Pratap  <ravi@ximian.com>
17398
17399         * interface.cs (Define): Do nothing here since there are no
17400         members to populate etc. Move the attribute emission out of here
17401         since this was just totally the wrong place to put it. Attribute
17402         application happens during the 'Emit' phase, not in the 'Define'
17403         phase.
17404
17405         (Emit): Add this method and move the attribute emission here
17406
17407         * rootcontext.cs (EmitCode): Call the Emit method on interface
17408         types too.
17409
17410 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17411
17412         * expression.cs (OverloadResolve): Report error only if Location
17413         is not 'Null' which means that there was a probe going on.
17414
17415 2003-07-14  Martin Baulig  <martin@ximian.com>
17416
17417         * expression.cs (ConditionalLogicalOperator): New public class to
17418         implement user defined conditional logical operators.
17419         This is section 14.11.2 in the spec and bug #40505.
17420
17421 2003-07-14  Martin Baulig  <martin@ximian.com>
17422
17423         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17424
17425 2003-07-14  Martin Baulig  <martin@ximian.com>
17426
17427         * codegen.cs (EmitContext.InFixedInitializer): New public field.
17428
17429         * ecore.cs (IVariable.VerifyFixed): New interface method.
17430
17431         * expression.cs (Unary.ResolveOperator): When resolving the `&'
17432         operator, check whether the variable is actually fixed.  Fixes bug
17433         #36055.  Set a variable definitely assigned when taking its
17434         address as required by the spec.
17435
17436         * statement.cs (LocalInfo.IsFixed): New field.
17437         (LocalInfo.MakePinned): Set `IsFixed' to true.
17438
17439 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17440
17441         * attribute.cs (Attribute.Resolve): While doing a Member lookup
17442         for .ctors, ensure that we only ask for members declared in the
17443         attribute type (BindingFlags.DeclaredOnly).
17444
17445         Fixes bug #43632.
17446
17447         * expression.cs (Error_WrongNumArguments): Report error 1501
17448         correctly the way CSC does.
17449
17450 2003-07-13  Martin Baulig  <martin@ximian.com>
17451
17452         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17453         lookup on the fully qualified name, to make things like "X.X" work
17454         where "X.X" is a fully qualified type name, but we also have a
17455         namespace "X" in the using list.  Fixes #41975.
17456
17457 2003-07-13  Martin Baulig  <martin@ximian.com>
17458
17459         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17460         function. If we're a CompoundAssign, we need to create an embedded
17461         CompoundAssign, not an embedded Assign.
17462         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17463         Fixes #45854.
17464
17465 2003-07-13  Martin Baulig  <martin@ximian.com>
17466
17467         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17468         work to fix bug #46088.
17469
17470 2003-07-13  Ravi Pratap <ravi@ximian.com>
17471
17472         * class.cs (Operator.Emit): Do not emit attributes here - it is
17473         taken care of by the Method class that we delegate too. This takes
17474         care of bug #45876.
17475
17476 2003-07-10  Martin Baulig  <martin@ximian.com>
17477
17478         * expression.cs (TypeOfVoid): New class.
17479         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
17480
17481 2003-07-10  Martin Baulig  <martin@ximian.com>
17482
17483         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17484         bug #35957.
17485
17486 2003-07-10  Martin Baulig  <martin@ximian.com>
17487
17488         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17489         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17490
17491         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17492
17493         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17494
17495 2003-07-10  Martin Baulig  <martin@ximian.com>
17496
17497         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17498         of decimal.  Fixes #42850.
17499
17500         NOTE: I also fixed the created byte blob, but this doesn't work on
17501         the MS runtime and csc never produces any byte blobs for decimal
17502         arrays.
17503
17504 2003-07-10  Martin Baulig  <martin@ximian.com>
17505
17506         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17507         structs; fixes #32068.
17508         (Block.AddChildVariableNames): Fixed #44302.
17509
17510 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17511
17512         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17513
17514 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17515
17516         * attribute.cs: And this test is onger needed.
17517
17518 2003-07-08  Martin Baulig  <martin@ximian.com>
17519
17520         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17521         inaccessible types.  Fixes #36313.
17522
17523         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17524
17525         * namespace.cs (NamespaceEntry): Create implicit entries for all
17526         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17527         implicit entries for N1.N2 and N1.
17528
17529 2003-07-08  Martin Baulig  <martin@ximian.com>
17530
17531         Rewrote the handling of namespaces to fix a lot of the issues
17532         wrt. `using' aliases etc.
17533
17534         * namespace.cs (Namespace): Splitted this class into a
17535         per-assembly `Namespace' and a per-file `NamespaceEntry'.
17536
17537         * typemanager.cs (TypeManager.IsNamespace): Removed.
17538         (TypeManager.ComputeNamespaces): Only compute namespaces from
17539         loaded assemblies here, not the namespaces from the assembly we're
17540         currently compiling.
17541
17542 2003-07-08  Martin Baulig  <martin@ximian.com>
17543
17544         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17545
17546 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17547
17548         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17549         already fixed it.  
17550
17551         I thought about the memory savings here, but LookupTypeReflection
17552         is used under already very constrained scenarios.  Compiling
17553         corlib or mcs only exposes one hit, so it would not really reduce
17554         any memory consumption.
17555
17556 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17557
17558         * typemanager.cs: fixes bug #45889 by only adding public types from
17559         other assemblies to the list of known types.
17560
17561 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17562
17563         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17564         on the type we resolved.
17565
17566 2003-07-05  Martin Baulig  <martin@ximian.com>
17567
17568         * pending.cs (PendingImplementation.ParentImplements): Don't
17569         create the proxy if the parent is abstract.
17570
17571         * class.cs (TypeContainer.DefineIndexers): Process explicit
17572         interface implementations first.  Fixes #37714.
17573
17574 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
17575
17576         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17577         defined recursively;  but since we modify the input parameters
17578         (left is set to `this' temporarily), we reset this value if the
17579         left_is_explicit is false, which gives the original semantics to
17580         the code.  
17581
17582         * literal.cs (NullPointer): new class used to represent a null
17583         literal in a pointer context.
17584
17585         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17586         type is a pointer, use a NullPointer object instead of a
17587         NullLiteral.   Closes 43687
17588
17589         (ExplicitConversion): Convert pointer values using
17590         the conv opcode to the proper type.
17591
17592         * ecore.cs (New): change ValueTypeVariable property into a method,
17593         that returns whether the valuetype is suitable for being used.
17594
17595         * expression.cs (Binary.DoNumericPromotions): Only return if we
17596         the int constant was a valid uint, and we can return both left and
17597         right as uints.  If not, we continue processing, to trigger the
17598         type conversion.  This fixes 39018.
17599
17600         * statement.cs (Block.EmitMeta): During constant resolution, set
17601         the CurrentBlock property on the emitcontext, so that we resolve
17602         constants propertly.
17603
17604 2003-07-02  Martin Baulig  <martin@ximian.com>
17605
17606         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17607         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17608
17609         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17610         than emitting it here.
17611
17612         * statement.cs: Fixed some more flow analysis bugs.
17613
17614 2003-07-02  Martin Baulig  <martin@ximian.com>
17615
17616         * class.cs (MethodData.Define): When implementing interface
17617         methods, set Final unless we're Virtual.
17618
17619         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17620         check work for interface methods.
17621
17622 2003-07-01  Martin Baulig  <martin@ximian.com>
17623
17624         * ecore.cs (EmitContext.This): Replaced this property with a
17625         GetThis() method which takes a Location argument.  This ensures
17626         that we get the correct error location for a CS0188.
17627
17628 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
17629
17630         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17631         ImplicitStandardConversion.
17632
17633         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17634
17635 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
17636
17637         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17638         optimization.
17639
17640 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
17641
17642         * class.cs (Constructor.Define): Turn off initlocals for unsafe
17643         constructors.
17644
17645         (MethodData.Define): Turn off initlocals for unsafe methods.
17646
17647 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
17648
17649         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17650         complete;  Fixes #37521.
17651
17652         * delegate.cs: Use Modifiers.TypeAttr to compute the
17653         TypeAttributes, instead of rolling our own.  This makes the flags
17654         correct for the delegates.
17655
17656 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
17657
17658         * class.cs (Constructor.Define): Set the private flag for static
17659         constructors as well.
17660
17661         * cs-parser.jay (statement_expression): Set the return value to
17662         null, to avoid a crash when we catch an error.
17663
17664 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
17665
17666         * cs-parser.jay: Applied patch from Jackson that adds support for
17667         extern and unsafe modifiers to destructor declarations.
17668
17669         * expression.cs: Report error 21 if the user is trying to index a
17670         System.Array.
17671
17672         * driver.cs: Add an error message, suggested by the bug report.
17673
17674         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
17675         if we do not have a ": this ()" constructor initializer.  Fixes 45149
17676
17677 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
17678
17679         * namespace.cs: Add some information to reduce FAQs.
17680
17681 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
17682
17683         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
17684         underlying enumeration types.  Fixes #43915.
17685
17686         * expression.cs: Treat ushort/short as legal values to be used in
17687         bitwise operations.
17688
17689 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
17690
17691         * delegate.cs: transfer custom attributes for paramenters from
17692         the delegate declaration to Invoke and BeginInvoke.
17693
17694 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
17695
17696         * attribute.cs: handle custom marshalers and emit marshal info
17697         for fields, too.
17698
17699 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
17700
17701         * makefile.gnu: Added anonymous.cs to the compiler sources.
17702
17703 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
17704
17705         * iterators.cs: Change the name of the proxy class to include two
17706         underscores.
17707
17708         * cs-parser.jay: Update grammar to include anonymous methods.
17709
17710         * anonymous.cs: new file.
17711
17712 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
17713
17714         * class.cs (Field.Define): Add missing test for pointers and
17715         safety. 
17716
17717 2003-05-27  Ravi Pratap  <ravi@ximian.com>
17718
17719         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
17720         we use the stobj opcode.
17721
17722         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
17723         since it wasn't the correct fix. 
17724
17725         It still is puzzling that we are required to use stobj for IntPtr
17726         which seems to be a ValueType.
17727
17728 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
17729
17730         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
17731         during regular simple name resolution.   Now, the trick is that
17732         instead of returning for processing the simplename, we do a
17733         TypeManager.LookupType (ie, a rooted lookup as opposed to a
17734         contextual lookup type).   If a match is found, return that, if
17735         not, return for further composition.
17736
17737         This fixes long-standing 30485.
17738
17739         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17740         using the address to initialize an object, do an Stobj instead of
17741         using the regular Stelem.
17742
17743         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
17744         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
17745         Because if we are a BaseIndexerAccess that value will be true.
17746         Fixes 43643.
17747
17748         * statement.cs (GotoCase.Resolve): Return after reporting an
17749         error, do not attempt to continue. 
17750
17751         * expression.cs (PointerArithmetic.Emit): If our operand is a
17752         long, convert our constants to match the operand before
17753         multiplying.  Convert to I type before adding.   Fixes 43670.
17754
17755 2003-05-14  Ravi Pratap  <ravi@ximian.com>
17756
17757         * enum.cs (ImplicitConversionExists) : Rename to
17758         ImplicitEnumConversionExists to remove ambiguity. 
17759
17760         * ecore.cs (NullCast): New type of cast expression class which
17761         basically is very similar to EmptyCast with the difference being
17762         it still is a constant since it is used only to cast a null to
17763         something else
17764         (eg. (string) null)
17765
17766         * convert.cs (ImplicitReferenceConversion): When casting a null
17767         literal, we return a NullCast.
17768
17769         * literal.cs (NullLiteralTyped): Remove - I don't see why this
17770         should be around anymore.
17771
17772         The renaming (reported was slightly wrong). Corrections:
17773
17774         ConvertImplicitStandard -> ImplicitConversionStandard
17775         ConvertExplicitStandard -> ExplicitConversionStandard
17776
17777         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
17778         before passing them in !
17779
17780         * convert.cs (ImplicitConversionStandard): When comparing for
17781         equal expr and target types, ensure that expr is not a
17782         NullLiteral.
17783
17784         In general, we must not be checking (expr_type ==
17785         target_type) in the top level conversion methods
17786         (ImplicitConversion, ExplicitConversion etc). This checking is
17787         done in the methods that they delegate to.
17788
17789 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
17790
17791         * convert.cs: Move Error_CannotConvertType,
17792         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
17793         ImplicitNumericConversion, ImplicitConversionExists,
17794         ImplicitUserConversionExists, StandardConversionExists,
17795         FindMostEncompassedType, FindMostSpecificSource,
17796         FindMostSpecificTarget, ImplicitUserConversion,
17797         ExplicitUserConversion, GetConversionOperators,
17798         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
17799         TryImplicitIntConversion, Error_CannotConvertImplicit,
17800         ConvertImplicitRequired, ConvertNumericExplicit,
17801         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
17802         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
17803         its own file.
17804
17805         Perform the following renames:
17806
17807         StandardConversionExists -> ImplicitStandardConversionExists
17808         ConvertImplicit -> ImplicitConversion
17809         ConvertImplicitStandard -> ImplicitStandardConversion
17810         TryImplicitIntConversion -> ImplicitIntConversion
17811         ConvertImplicitRequired -> ImplicitConversionRequired
17812         ConvertNumericExplicit -> ExplicitNumericConversion
17813         ConvertReferenceExplicit -> ExplicitReferenceConversion
17814         ConvertExplicit -> ExplicitConversion
17815         ConvertExplicitStandard -> ExplicitStandardConversion
17816
17817 2003-05-19  Martin Baulig  <martin@ximian.com>
17818
17819         * statement.cs (TypeInfo.StructInfo): Made this type protected.
17820         (TypeInfo): Added support for structs having structs as fields.
17821
17822         * ecore.cs (FieldExpr): Implement IVariable.
17823         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
17824         VariableInfo for the field.
17825
17826 2003-05-18  Martin Baulig  <martin@ximian.com>
17827
17828         * expression.cs (This.DoResolve): Report a CS0027 if we're
17829         emitting a field initializer.
17830
17831 2003-05-18  Martin Baulig  <martin@ximian.com>
17832
17833         * expression.cs (This.ResolveBase): New public function.
17834         (This.DoResolve): Check for CS0188.
17835
17836         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
17837         This.Resolve().
17838
17839         * ecore.cs (MethodGroupExpr.DoResolve): Set the
17840         `instance_expression' to null if we don't have any non-static
17841         methods.
17842
17843 2003-05-18  Martin Baulig  <martin@ximian.com>
17844
17845         Reworked the way how local variables and parameters are handled by
17846         the flow analysis code.
17847
17848         * statement.cs (TypeInfo, VariableMap): New public classes.
17849         (VariableInfo): New public class.  This is now responsible for
17850         checking whether a variable has been assigned.  It is used for
17851         parameters and local variables.
17852         (Block.EmitMeta): Take the InternalParameters as argument; compute
17853         the layout of the flow vectors here.
17854         (Block.LocalMap, Block.ParameterMap): New public properties.
17855         (FlowBranching): The .ctor doesn't get the InternalParameters
17856         anymore since Block.EmitMeta() now computes the layout of the flow
17857         vector.
17858         (MyStructInfo): This class is now known as `StructInfo' and nested
17859         in `TypeInfo'; we don't access this directly anymore.
17860
17861         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
17862         property and removed IsAssigned(), IsFieldAssigned(),
17863         SetAssigned() and SetFieldAssigned(); we now call them on the
17864         VariableInfo so we don't need to duplicate this code everywhere.
17865
17866         * expression.cs (ParameterReference): Added `Block block' argument
17867         to the .ctor.
17868         (LocalVariableReference, ParameterReference, This): The new
17869         VariableInfo class is now responsible for all the definite
17870         assignment stuff.
17871
17872         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
17873         IsParameterAssigned, SetParameterAssigned): Removed.
17874
17875 2003-05-18  Martin Baulig  <martin@ximian.com>
17876
17877         * typemanager.cs (InitCoreTypes): Try calling
17878         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
17879         the 3-args-version.  Corlib now also needs our `void_type'.
17880         (GetMethod): Added overloaded version which takes an optional
17881         `bool report_errors' to allow lookups of optional methods.
17882
17883 2003-05-12  Martin Baulig  <martin@ximian.com>
17884
17885         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
17886         only used for locals and not for parameters.
17887
17888 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
17889
17890         * support.cs (InternalParameters.ParameterType): Return the
17891         ExternalType of the parameter.
17892
17893         * parameter.cs (Parameter.ExternalType): drop the two arguments,
17894         they were unused.
17895
17896 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
17897
17898         * class.cs (MethodData.Define): Do not set the `newslot' on
17899         interface members, if they are also flagged as "override".
17900
17901         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
17902         better code for ++i and i++.  This only works for static fields
17903         and local variables.
17904
17905         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
17906         want to pull the DeclSpace out of the builder_to_declspace instead
17907         of the TypeBuilder (like in TypeContainer.FindMembers).
17908
17909         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
17910         instead of LookupTypeContainer.  Fixes the crash on .NET for
17911         looking up interface members.
17912
17913         * const.cs: Create our own emit context during the Definition
17914         stage, so that constants are evaluated in the proper context, when
17915         a recursive definition happens.
17916
17917 2003-05-11  Martin Baulig  <martin@ximian.com>
17918
17919         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
17920         new block for a switch section.
17921         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
17922         the adding/lookup in the switch block.  Fixes #39828.
17923
17924 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
17925
17926         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
17927         functionality: I needed to convert the data after I had performed
17928         the add/sub operation into the operands type size.
17929
17930         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
17931         pass the type for the box operation, otherwise the resulting
17932         object would have been of type object.
17933
17934         (BoxedCast): Add constructor to specify the type to box as.
17935
17936 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
17937
17938         * iterators.cs: I was reusing the `count' variable inadvertently,
17939         take steps to not allow this to happen.
17940
17941 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
17942
17943         * attribute.cs (Attribute.Resolve): Params attributes are encoded
17944         by creating an array at the point where the params starts and
17945         putting all those arguments there, then adjusting the size of the
17946         array.
17947
17948 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
17949
17950         * expression.cs (New.AddressOf): Implement interface
17951         IMemoryLocation.  This is used when the `new' operator is used in
17952         the context of an invocation to a method on a value type.
17953
17954         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
17955         example. 
17956
17957         * namespace.cs: Also check the using aliases here.
17958
17959         * driver.cs: Move the test for using validity after the types have
17960         been entered, so we do a single pass that also includes the using
17961         aliases. 
17962
17963         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
17964         in the regular case.   CreateSiblingForFinally is doing extra
17965         error checking.
17966
17967         * attribute.cs (GetAttributeArgumentExpression): Store the result
17968         on an out value, and use the return value to indicate failure
17969         instead of using null (which is a valid return for Constant.GetValue).
17970
17971         * statement.cs: Perform the analysis flow for the increment
17972         portion after the statement, because this will be the real flow of
17973         execution.  Fixes #42385
17974
17975         * codegen.cs (EmitContext.EmitArgument,
17976         EmitContext.EmitStoreArgument): New helper functions when the
17977         RemapToProxy flag is set.
17978
17979         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
17980         function.
17981
17982         Add support for remapping parameters. 
17983
17984         * iterators.cs: Propagate parameter values;  Store parameter
17985         values in the proxy classes.
17986
17987 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
17988
17989         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
17990         need a proxy reference;  I do not know what I was thinking
17991
17992         * cs-parser.jay (constructor_initializer): catch another error,
17993         and display nice message.
17994
17995         (field_declaration): catch void field declaration
17996         to flag a better error. 
17997
17998         * class.cs (MemberBase.CheckBase): Report an error instead of a
17999         warning if a new protected member is declared in a struct. 
18000         (Field.Define): catch the error of readonly/volatile.
18001
18002         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18003
18004         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
18005         volatile variable is taken
18006
18007 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
18008
18009         * statement.cs (Fixed.Resolve): Report an error if we are not in
18010         an unsafe context.
18011
18012 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
18013
18014         * typemanager.cs: reuse the code that handles type clashes for
18015         delegates and enumerations.
18016
18017         * class.cs (Report28): Always report.
18018
18019         * expression.cs (EncodeAsAttribute): Allow nulls here.
18020
18021 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
18022
18023         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18024         the functionality for testing whether an expression is valid for
18025         an attribute here.  Also handle the case of arrays of elements
18026         being stored. 
18027
18028         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18029         encoding a linear array into an array of objects that are suitable
18030         to be passed to an CustomAttributeBuilder.
18031
18032         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18033
18034         * ecore.cs: (FieldExpr): Handle field remapping here.
18035
18036         * iteratators.cs: Pass the instance variable (if the method is an
18037         instance method) to the constructors, so we can access the field
18038         variables on the class.
18039
18040         TODO: Test this with structs.  I think the THIS variable on
18041         structs might have to be a pointer, and not a refenrece
18042
18043 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
18044
18045         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18046         local variables to fields in a proxy class.
18047
18048         * iterators.cs (PopulateProxy): Rename our internal fields to
18049         <XXX>.  
18050         Create a <THIS> field if we are an instance method, so we can
18051         reference our parent container variables.
18052         (MapVariable): Called back from the EmitContext code to enter a
18053         new variable to field mapping into the proxy class (we just create
18054         a FieldBuilder).
18055
18056         * expression.cs
18057         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18058         for using the remapped locals to fields.
18059
18060         I placed the code here, because that gives the same semantics to
18061         local variables, and only changes the Emit code.
18062
18063         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18064         statements inside iterators.
18065         (VariableInfo): Add a FieldBuilder for the cases when we are
18066         remapping local variables to fields in a proxy class
18067
18068         * ecore.cs (SimpleNameResolve): Avoid testing two times for
18069         current_block != null.
18070
18071         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18072         not cope with strings, as it has been moved to the
18073         TableSwitchEmit.  Fixed bug in switch generation.
18074
18075         * expression.cs (New.DoResolve): Provide more context for the user
18076         when reporting an error.
18077
18078         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18079         pointers. 
18080
18081         * expression.cs (MemberAccess.DoResolve): When we get a type back,
18082         check the permissions for it.  Note than in a type-resolution
18083         context the check was already present in DeclSpace.ResolveType,
18084         but was missing from the MemberAccess.
18085
18086         (ArrayCreation.CheckIndices): warn if the user has
18087         more nested levels of expressions, but there are no more
18088         dimensions specified.  Avoids crash on bug 41906.
18089
18090 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
18091
18092         * statement.cs (Block): replace Implicit bool, for a generic
18093         flags.   
18094         New flag: `Unchecked'.  This is used during the EmitMeta phase
18095         (which is out-of-line with the regular Resolve/Emit process for a
18096         statement, as this is done ahead of time, but still gets a chance
18097         to call constant resolve).
18098
18099         (Block.Flags): new enum for adding a new flag.
18100
18101         (Block.EmitMeta): track the state of unchecked.
18102
18103         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18104         to enable constant resolution to work there as well.
18105
18106 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
18107
18108         * typemanager.cs (ienumerable_type): Also look up
18109         System.Collections.IEnumerable. 
18110
18111 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
18112
18113         TODO: Test more than one conditional per method.
18114
18115         * class.cs (Indexer.Define): Report the location where the user is
18116         referencing the unsupported feature.
18117
18118         (MethodData): Overload the use of `conditionals' to
18119         minimize the creation of needless ArrayLists.   This saves roughly
18120         212kb on my machine.
18121
18122         (Method): Implement the new IIteratorContainer interface.
18123         (Method.SetYields): Implement the method by setting the ModFlags
18124         to contain METHOD_YIELDS.
18125
18126         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18127         which just got set to null.
18128
18129         * iterators.cs: New file.
18130
18131         (Yield, YieldBreak): New statements.
18132
18133         * statement.cs (Return.Resolve): Flag an error if we are used in
18134         an iterator method.
18135
18136         * codegen.cs (InIterator): New flag set if the code is being
18137         compiled in an iterator method.
18138
18139         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
18140         internal modifier, and we just use it to avoid adding extra
18141         fields, as this is seldom used.  
18142
18143         * cs-parser.jay: Add yield_statement (yield and yield break).
18144
18145         * driver.cs: New flag -v2 to turn on version 2 features. 
18146
18147         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18148         hashtable when v2 is enabled.
18149
18150 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
18151
18152         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18153         there is already a namespace defined with this name.
18154
18155         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18156         people upgraded their corlibs.
18157
18158         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18159         always use fully qualified types, no need to use the compiler
18160         front end.
18161
18162         (TypeManager.IsNamespace): Use binarysearch.
18163
18164         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18165         AddDelegate): I did not quite use the new IsValid API properly: I
18166         have to pass the short-name and the fullname.  I was passing only
18167         the basename instead of the fullname sometimes. 
18168
18169         (TypeContainer.DefineType): call NamespaceClash.
18170
18171         * interface.cs (Interface.DefineType): use NamespaceClash before
18172         defining the type.
18173
18174         * delegate.cs (Delegate.DefineType): use NamespaceClash before
18175         defining the type.
18176
18177         * enum.cs: (Enum.DefineType): use NamespaceClash before
18178         defining the type.
18179
18180         * typemanager.cs (: 3-line patch that gives us some tasty 11%
18181         speed increase.  First, use the negative_hits cache when we get a
18182         negative.  Second, add the type with its full original name
18183         instead of the new . and + encoded name (reflection uses + to
18184         separate type from a nested type).  Use LookupTypeReflection
18185         directly which bypasses the type->name hashtable (that we already
18186         know does not contain the type.
18187
18188         * decl.cs (DeclSpace.ResolveTypeExpr): track the
18189         location/container type. 
18190
18191         * driver.cs: When passing utf8, use directly the UTF8Encoding.
18192
18193 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
18194
18195         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18196
18197         * delegate.cs (NewDelegate.Resolve): Test whether an instance
18198         method is being referenced in the method group from a static
18199         context, and report error 120 if so.
18200
18201         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18202         Error118. 
18203
18204         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18205         is created, we create the A namespace).
18206
18207         * cs-parser.jay: A namespace also introduces a DeclarationFound.
18208         Fixes #41591
18209
18210 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
18211
18212         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18213         invocation to ModuleBuilder.GetType with the same values will
18214         return a new type instance, so we need to cache its return
18215         values. 
18216
18217         * expression.cs (Binary.ResolveOperator): Only allow the compare
18218         operators on enums if they are of the same type.
18219
18220         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18221         types of ValueType on their own case.  Before we were giving them
18222         the same treatment as objects.
18223
18224         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18225         fullname.  Short name is used to compare against container name.
18226         Fullname is used to check against defined namespace names.
18227
18228         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18229         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18230
18231         (Method.CheckBase): Call parent.
18232         (MemberBase.CheckBase): Check for protected members on sealed
18233         classes.
18234         (PropertyBase.CheckBase): Call parent.
18235         (Field.Define): Call parent.
18236
18237         * report.cs: Negative error codes are now mapped to 8000 - code,
18238         so that the display is render more nicely.
18239
18240         * typemanager.cs: Do not use try/catch, instead report a regular
18241         error. 
18242
18243         (GetPointerType, GetReferenceType): These methods provide
18244         mechanisms to obtain the T* and T& from a T.  We had the code
18245         previously scattered around the code base, and it also used
18246         TypeManager.LookupType that would go through plenty of caches.
18247         This one goes directly to the type source.
18248
18249         In some places we did the Type.GetType followed by
18250         ModuleBuilder.GetType, but not in others, so this unifies the
18251         processing as well.
18252
18253         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18254         statements now that we have namespace information.
18255
18256         * typemanager.cs (IsNamespace): New method, returns whether the
18257         string presented is a namespace or not.
18258
18259         (ComputeNamespaces): New public entry point, computes the list of
18260         available namespaces, using the GetNamespaces API call in Mono, or
18261         the slower version in MS.NET.   
18262
18263         Now before we start the semantic analysis phase, we have a
18264         complete list of namespaces including everything that the user has
18265         provided.
18266
18267         Deleted old code to cache namespaces in .nsc files.
18268
18269 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
18270
18271         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18272         class/struct location definition Location for the implicit
18273         constructor location.
18274
18275         (Operator.Define): Use the location of the operator for the
18276         implicit Method definition.
18277
18278         (Constructor.Emit): use the constructor location for the implicit
18279         base initializer constructor.
18280
18281         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
18282         and the Expression class now contains two new methods:
18283
18284         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
18285         isolate type lookup from the rest of the resolution process.
18286
18287         Since we use Expressions to hold type definitions due to the way
18288         we parse the input we have historically overloaded Resolve to
18289         perform the Type lookups if a special flag is passed.  Now this is
18290         eliminated and two methods take their place. 
18291
18292         The differences in the two methods between xStep and xTerminal is
18293         that xStep is involved in our current lookup system that uses
18294         SimpleNames to compose a name, while xTerminal is used just to
18295         catch the case where the simplename lookup failed.
18296
18297 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
18298
18299         * expression.cs (ResolveMemberAccess): Remove redundant code.
18300         TypeExpr expressions are always born fully resolved.
18301
18302         * interface.cs (PopulateMethod): Do not lookup the types twice.
18303         We were doing it once during SemanticAnalysis and once during
18304         PopulateMethod.
18305
18306         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18307         in local variable type definitions, were being returned as a
18308         SimpleName (we decomposed everything into a string), that is
18309         because primary_expression was being used instead of a type in the
18310         grammar (reduce/reduce conflicts).
18311
18312         The part that was wrong is that we converted the expression into a
18313         string (an oversimplification in one hand, compounded with primary
18314         expressions doing string concatenation).
18315
18316         So things like:
18317
18318         A.B.C [] x;
18319
18320         Would return "A.B.C[]" as a SimpleName.  This stopped things like
18321         using clauses from working on this particular context.  And a type
18322         was being matched directly against "A.B.C[]".
18323
18324         We now use the correct approach, and allow for ComposedCast to be
18325         part of the unary expression.  So the "A.B.C []" become a composed
18326         cast of "A.B.C" (as a nested group of MemberAccess with a
18327         SimpleName at the end) plus the rank composition "[]". 
18328
18329         Also fixes 35567
18330
18331 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
18332
18333         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18334         for the access level checking.
18335
18336         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
18337         `TypeContainer container', because I kept getting confused when I
18338         was debugging this code.
18339
18340         * expression.cs (Indexers): Instead of tracking getters/setters,
18341         we now track them in parallel.  We create one arraylist less, but
18342         most importantly it is possible now for the LValue code to find a
18343         matching get for a set.
18344
18345         (IndexerAccess.DoResolveLValue): Update the code.
18346         GetIndexersForType has been modified already to extract all the
18347         indexers from a type.  The code assumed it did not.
18348
18349         Also make the code set the correct return type for the indexer.
18350         This was fixed a long time ago for properties, but was missing for
18351         indexers.  It used to be void_type.
18352
18353         (Binary.Emit): Test first for doubles instead of
18354         floats, as they are more common.
18355
18356         (Binary.EmitBranchable): Use the .un version of the branch opcodes
18357         when dealing with floats and the <=, >= operators.  This fixes bug
18358         #39314 
18359
18360         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18361         to load the array value by emitting a load on the foreach variable
18362         type.  This was incorrect.  
18363
18364         We now emit the code to load an element using the the array
18365         variable type, and then we emit the conversion operator.
18366
18367         Fixed #40176
18368
18369 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
18370
18371         * attribute.cs: Avoid allocation of ArrayLists in the common case.
18372
18373 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18376         test for protection before we test for signatures. 
18377
18378         (MethodSignature.ToString): implement.
18379
18380         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18381         to the case where we reduced into a LongConstant.
18382
18383         * decl.cs (CheckAccessLevel): If the type is an array, we can not
18384         depend on whether the information is acurrate, because the
18385         Microsoft runtime will always claim that the array type is public,
18386         regardless of the real state.
18387
18388         If the type is a pointer, another problem happens: the type is
18389         reported as non-public in Microsoft.  
18390
18391         In both cases we have to call CheckAccessLevel recursively with
18392         the underlying type as the argument to be tested.
18393
18394 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
18395
18396         * assign.cs (Assign.Emit): If we are dealing with a compound
18397         assignment expression, we should use the code path that stores the
18398         intermediate result in a temporary value.  This fixes #40903.
18399
18400         *expression.cs (Indirection.ToString): Provide ToString method for
18401         debugging. 
18402
18403 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
18404
18405         * class.cs: Null out fields holding references to Block objects so
18406         they can be garbage collected.
18407
18408         * expression.cs (OverloadResolve): Remove unused local.
18409
18410 2003-04-07  Martin Baulig  <martin@ximian.com>
18411
18412         * codegen.cs (EmitContext.CurrentFile): New public field.
18413         (EmitContext.Mark): Use the CurrentFile to check whether the
18414         location is in the correct file.
18415         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18416
18417 2003-04-07  Martin Baulig  <martin@ximian.com>
18418
18419         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18420
18421         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18422         location.  [FIXME: The location argument which gets passed to this
18423         method is sometimes wrong!]
18424
18425 2003-04-07  Nick Drochak <ndrochak@gol.com>
18426
18427         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18428
18429 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
18430
18431         * expression.cs (Indirection.EmitAssign): We were using the
18432         temporary, but returning immediately instead of continuing the
18433         EmitAssing flow.
18434
18435 2003-04-06  Martin Baulig  <martin@ximian.com>
18436
18437         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18438         if it's a nested child, but also deriving from the outer class.
18439         See test 190.cs.
18440
18441         * typemanager.cs (IsNestedChildOf): Make this work if it's a
18442         nested child, but also deriving from the outer class.  See
18443         test-190.cs.
18444         (FilterWithClosure): We may access private members of the outer
18445         class if we're a nested child and deriving from the outer class.
18446         (RealMemberLookup): Only set `closure_private_ok' if the
18447         `original_bf' contained BindingFlags.NonPublic.
18448
18449 2003-04-05  Martin Baulig  <martin@ximian.com>
18450
18451         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18452
18453 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
18454
18455         * class.cs (Event.Define): Do not allow abstract events to have
18456         initializers. 
18457
18458 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
18459
18460         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18461         block in event declarations.
18462
18463         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18464         value type, get its address.
18465
18466         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18467         leaving a class on the stack instead of a boolean value (int
18468         0/1).  Change the code so we compare against null, and then the
18469         result against zero.
18470
18471         * class.cs (TypeContainer.GetClassBases): We were checking for the
18472         parent class being sealed too late.
18473
18474         * expression.cs (Binary.Emit): For <= and >= when dealing with
18475         floating point values, use cgt.un and clt.un instead of cgt and
18476         clt alone.
18477
18478 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
18479
18480         * statement.cs: Apply the same optimization as MS: skip the 
18481         GetEnumerator returning an IEnumerator, and use the one returning a 
18482         CharEnumerator instead. This allows us to avoid the try-finally block 
18483         and the boxing.
18484
18485 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
18486
18487         * cs-parser.jay: Attributes cannot be applied to
18488                          namespaces. Fixes #40473
18489
18490 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18491
18492         * class.cs:
18493         (Add*): check if the name is valid using the full name for constants,
18494         fields, properties and events.
18495
18496 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
18497
18498         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18499         char constants to be part of the enumeration.
18500
18501         * expression.cs (Conditional.DoResolve): Add support for operator
18502         true. Implements the missing functionality from 14.12
18503
18504         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18505         operator true/false as required by the spec.
18506
18507         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18508         implicit conversion to boolean.
18509
18510         * statement.cs (Statement.ResolveBoolean): A boolean expression is
18511         also one where the type implements `operator true'. 
18512
18513         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18514         get an expression that will invoke operator true based on an
18515         expression.  
18516
18517         (GetConversionOperators): Removed the hack that called op_True
18518         here.  
18519
18520         (Expression.ResolveBoolean): Move this from Statement.
18521
18522 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
18523
18524         * ecore.cs (FieldExpr): do not allow initialization of initonly
18525         fields on derived classes
18526
18527 2003-03-13  Martin Baulig  <martin@ximian.com>
18528
18529         * statement.cs (Block.Emit): Call ig.BeginScope() and
18530         ig.EndScope() when compiling with debugging info; call
18531         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18532
18533 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
18534
18535         * expression.cs (Indexers): Do not construct immediately, allow
18536         for new members to be appended as we go.  Fixes 38143
18537
18538 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18539
18540         * expression.cs: save/restore context when resolving an unchecked
18541         expression.
18542
18543 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
18544
18545         * cfold.cs: Catch division by zero in modulus operator during
18546         constant folding.
18547
18548 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
18549
18550         * interface.cs (Interface.DefineMembers): Avoid defining members
18551         twice. 
18552
18553 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
18554
18555         * driver.cs: handle the +/- options for -noconfig
18556
18557         * statement.cs (Unckeched.Resolve): Also track the state of
18558         unchecked in the Resolve phase.
18559
18560 2003-02-27  Martin Baulig  <martin@ximian.com>
18561
18562         * ecore.cs (Expression.MemberLookup): Don't create a
18563         MethodGroupExpr for something which is not a method.  Fixes #38291.
18564
18565 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
18566
18567         * class.cs (MemberBase.CheckParameters): Also check that the type
18568         is unmanaged if it is a pointer.
18569
18570         * expression.cs (SizeOf.Resolve): Add location information.
18571
18572         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18573         a managed type is declared.
18574
18575         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18576         parameter modifiers as well.  Fixes bug 38606
18577
18578         * class.cs: Very sad.  Am backing out the speed up changes
18579         introduced by the ArrayList -> Array in the TypeContainer, as they
18580         were not actually that much faster, and introduced a bug (no error
18581         reports on duplicated methods).
18582
18583         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18584         source first, this will guarantee that we have a valid expression
18585         before calling in lower levels functions that will require a
18586         resolved object.  Then use this original_source in the
18587         target.ResolveLValue instead of the original source that was
18588         passed to us.
18589
18590         Another change.  Use target.Resolve instead of LValueResolve.
18591         Although we are resolving for LValues, we will let the Assign code
18592         take care of that (it will be called again from Resolve).  This
18593         basically allows code like this:
18594
18595         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18596         class Y { void A (X x) { x [0] += o; }
18597
18598         The problem was that the indexer was trying to resolve for
18599         set_Item (idx, object o) and never finding one.  The real set_Item
18600         was set_Item (idx, X).  By delaying the process we get the right
18601         semantics. 
18602
18603         Fixes bug 36505
18604
18605 2003-02-23  Martin Baulig  <martin@ximian.com>
18606
18607         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18608         while calling DoEmit ().
18609
18610         * codegen.cs (EmitContext.Mark): Don't mark locations in other
18611         source files; if you use the #line directive inside a method, the
18612         compiler stops emitting line numbers for the debugger until it
18613         reaches the end of the method or another #line directive which
18614         restores the original file.
18615
18616 2003-02-23  Martin Baulig  <martin@ximian.com>
18617
18618         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18619
18620 2003-02-23  Martin Baulig  <martin@ximian.com>
18621
18622         * statement.cs (Block.AddChildVariableNames): We need to call this
18623         recursively, not just for our immediate children.
18624
18625 2003-02-23  Martin Baulig  <martin@ximian.com>
18626
18627         * class.cs (Event.Define): Always make the field private, like csc does.
18628
18629         * typemanager.cs (TypeManager.RealMemberLookup): Make events
18630         actually work, fixes bug #37521.
18631
18632 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
18633
18634         * delegate.cs: When creating the various temporary "Parameters"
18635         classes, make sure that we call the ComputeAndDefineParameterTypes
18636         on those new parameters (just like we do with the formal ones), to
18637         allow them to be resolved in the context of the DeclSpace.
18638
18639         This fixes the bug that Dick observed in Bugzilla #38530.
18640
18641 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
18642
18643         * expression.cs (ResolveMemberAccess): When resolving a constant,
18644         do not attempt to pull a constant if the value was not able to
18645         generate a valid constant.
18646
18647         * const.cs (LookupConstantValue): Do not report more errors than required.
18648
18649 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18650
18651         * expression.cs: fixes bug #38328.
18652
18653 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
18654
18655         * class.cs: Changed all the various members that can be part of a
18656         class from being an ArrayList to be an Array of the right type.
18657         During the DefineType type_list, interface_list, delegate_list and
18658         enum_list are turned into types, interfaces, delegates and enums
18659         arrays.  
18660
18661         And during the member population, indexer_list, event_list,
18662         constant_list, field_list, instance_constructor_list, method_list,
18663         operator_list and property_list are turned into their real arrays.
18664
18665         Although we could probably perform this operation earlier, for
18666         good error reporting we need to keep the lists and remove the
18667         lists for longer than required.
18668
18669         This optimization was triggered by Paolo profiling the compiler
18670         speed on the output of `gen-sample-program.pl' perl script. 
18671
18672         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
18673         not crash in methods like MemberLookupFailed that use this field.  
18674
18675         This problem arises when the compiler fails to resolve a type
18676         during interface type definition for example.
18677
18678 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
18679
18680         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
18681         inherit from System.Object, so we have to stop at null, not only
18682         when reaching System.Object.
18683
18684 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
18685
18686         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
18687         DeclaredOnly because the parent indexer might have had a different
18688         name, but did not loop until the top of the hierarchy was reached.
18689
18690         The problem this one fixes is 35492: when a class implemented an
18691         indexer from an interface, we were getting the interface method
18692         (which was abstract) and we were flagging an error (can not invoke
18693         abstract method).
18694
18695         This also keeps bug 33089 functioning, and test-148 functioning.
18696
18697         * typemanager.cs (IsSpecialMethod): The correct way of figuring
18698         out if a method is special is to see if it is declared in a
18699         property or event, or whether it is one of the predefined operator
18700         names.   This should fix correctly #36804.
18701
18702 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
18703
18704         The goal here is to remove the dependency on EmptyCast.Peel ().
18705         Killing it completely.
18706
18707         The problem is that currently in a number of places where
18708         constants are expected, we have to "probe" for an EmptyCast, and
18709         Peel, which is not the correct thing to do, as this will be
18710         repetitive and will likely lead to errors. 
18711
18712         The idea is to remove any EmptyCasts that are used in casts that
18713         can be reduced to constants, so we only have to cope with
18714         constants. 
18715
18716         This bug hunt was triggered by Bug 37363 and the desire to remove
18717         the duplicate pattern where we were "peeling" emptycasts to check
18718         whether they were constants.  Now constants will always be
18719         constants.
18720
18721         * ecore.cs: Use an enumconstant here instead of wrapping with
18722         EmptyCast.  
18723
18724         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
18725         throwing me off.  By handling this we can get rid of a few hacks.
18726
18727         * statement.cs (Switch): Removed Peel() code.
18728
18729 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
18730
18731         * class.cs: Location information for error 508
18732
18733         * expression.cs (New.DoResolve): Add a guard against double
18734         resolution of an expression.  
18735
18736         The New DoResolve might be called twice when initializing field
18737         expressions (see EmitFieldInitializers, the call to
18738         GetInitializerExpression will perform a resolve on the expression,
18739         and later the assign will trigger another resolution
18740
18741         This leads to bugs (#37014)
18742
18743         * delegate.cs: The signature for EndInvoke should contain any ref
18744         or out parameters as well.  We were not doing this in the past. 
18745
18746         * class.cs (Field.Define): Do not overwrite the type definition
18747         inside the `volatile' group.  Turns out that volatile enumerations
18748         were changing the type here to perform a validity test, which
18749         broke conversions. 
18750
18751 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
18752
18753         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
18754         and structs, we do not want to load the instance variable
18755
18756         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
18757         enum_type has to be handled like an object reference (implicit
18758         conversions exists from this to object), but the regular IsClass
18759         and IsValueType tests will never return true for this one.
18760
18761         Also we use TypeManager.IsValueType instead of type.IsValueType,
18762         just for consistency with the rest of the code (this is only
18763         needed if we ever use the construct exposed by test-180.cs inside
18764         corlib, which we dont today).
18765
18766 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
18767
18768         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
18769         just InternalCall.
18770
18771 2003-02-09  Martin Baulig  <martin@ximian.com>
18772
18773         * namespace.cs (Namespace..ctor): Added SourceFile argument.
18774         (Namespace.DefineNamespaces): New static public method; this is
18775         called when we're compiling with debugging to add all namespaces
18776         to the symbol file.
18777
18778         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
18779         pass it to the Namespace's .ctor.
18780
18781         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
18782         and MethodBase arguments; pass the namespace ID to the symwriter;
18783         pass the MethodBase instead of the token to the symwriter.
18784         (SymbolWriter.DefineNamespace): New method to add a namespace to
18785         the symbol file.
18786
18787 2003-02-09  Martin Baulig  <martin@ximian.com>
18788
18789         * symbolwriter.cs: New file.  This is a wrapper around
18790         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
18791         methods here in near future.
18792
18793 2003-02-09  Martin Baulig  <martin@ximian.com>
18794
18795         * codegen.cs (EmitContext.Mark): Just pass the arguments to
18796         ILGenerator.MarkSequencePoint() which are actually used by the
18797         symbol writer.
18798
18799 2003-02-09  Martin Baulig  <martin@ximian.com>
18800
18801         * location.cs (SourceFile): New public sealed class.  This
18802         contains the name and an index which is used in the location's token.
18803         (Location): Reserve an appropriate number of bits in the token for
18804         the source file instead of walking over that list, this gives us a
18805         really huge performance improvement when compiling with debugging.
18806
18807         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
18808         `SourceFile' argument instead of a string.
18809         (Driver.ProcessFile): Add all the files via Location.AddFile(),
18810         but don't parse/tokenize here, we need to generate the list of all
18811         source files before we do that.
18812         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
18813         the files.
18814
18815         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
18816         instead of a string.
18817
18818         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
18819         of a string.
18820
18821 2003-02-09  Martin Baulig  <martin@ximian.com>
18822
18823         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
18824         filename on `#line default'.
18825
18826 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
18827
18828         * statement.cs: don't clear the pinned var when the fixed statement
18829         returns from the method (fixes bug#37752).
18830
18831 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
18832
18833         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
18834         to IsValueType.
18835
18836 2003-02-07  Martin Baulig  <martin@ximian.com>
18837
18838         * driver.cs: Removed the `--debug-args' command line argument.
18839
18840         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
18841         automatically by the AsssemblyBuilder.
18842         (CodeGen.InitializeSymbolWriter): We don't need to call any
18843         initialization function on the symbol writer anymore.  This method
18844         doesn't take any arguments.
18845
18846 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
18847
18848         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
18849         from referenced assemblies as well.
18850
18851 2003-02-02  Martin Baulig  <martin@ximian.com>
18852
18853         * class.cs (MethodData.Emit): Generate debugging info for external methods.
18854
18855 2003-02-02  Martin Baulig  <martin@ximian.com>
18856
18857         * class.cs (Constructor.Emit): Open the symbol writer before
18858         emitting the constructor initializer.
18859         (ConstructorInitializer.Emit): Call ec.Mark() to allow
18860         single-stepping through constructor initializers.
18861
18862 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
18863
18864         * class.cs: Handle error 549: do not allow virtual methods in
18865         sealed classes. 
18866
18867 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
18868
18869         * decl.cs: Check access levels when resolving types
18870
18871 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
18872
18873         * statement.cs: Add parameters and locals set in catch blocks that might 
18874         return to set vector
18875
18876 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
18877
18878         * class.cs (Operator): Set the SpecialName flags for operators.
18879
18880         * expression.cs (Invocation.DoResolve): Only block calls to
18881         accessors and operators on SpecialName methods.
18882
18883         (Cast.TryReduce): Handle conversions from char constants.
18884
18885
18886 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
18887
18888         * statement.cs: small memory and time optimization in FlowBranching.
18889
18890 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
18891
18892         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
18893         problem that the last fix but in the other sid (Set).
18894
18895         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
18896         access when there is no indexer in the hierarchy.
18897
18898 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
18899
18900         * class.cs: Combine some if statements.
18901
18902 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18903
18904         * driver.cs: fixed bug #37187.
18905
18906 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
18907
18908         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
18909         any indexer, it's needed to build a list with all the indexers in the
18910         hierarchy (AllGetters), else we have problems. Fixes #35653.
18911
18912 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
18913
18914         * class.cs (MethodData.Define): It is wrong for an interface
18915         implementation to be static in both cases: explicit and implicit.
18916         We were only handling this in one case.
18917
18918         Improve the if situation there to not have negations.
18919
18920         * class.cs (Field.Define): Turns out that we do not need to check
18921         the unsafe bit on field definition, only on usage.  Remove the test.
18922
18923 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18924
18925         * driver.cs: use assembly.Location instead of Codebase (the latest
18926         patch made mcs fail when using MS assemblies).
18927
18928 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
18929
18930         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
18931         get the path to *corlib.dll.
18932
18933 2003-01-21  Nick Drochak <ndrochak@gol.com>
18934
18935         * cs-tokenizer.cs:
18936         * pending.cs:
18937         * typemanager.cs: Remove compiler warnings
18938
18939 2003-01-20  Duncan Mak  <duncan@ximian.com>
18940
18941         * AssemblyInfo.cs: Bump the version number to 0.19.
18942
18943 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18944
18945         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
18946
18947 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
18948
18949         * class.cs (Constructor::Emit): Emit debugging info for constructors.
18950
18951 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
18952
18953         * cs-parser.jay: Small fix: we were not comparing the constructor
18954         name correctly.   Thanks to Zoltan for the initial pointer.
18955
18956 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
18957
18958         * cs-tokenizer.cs: Set file name when specified with #line
18959
18960 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
18961
18962         * cs-parser.jay: Only perform the constructor checks here if we
18963         are named like the class;  This will help provider a better
18964         error.  The constructor path is taken when a type definition is
18965         not found, but most likely the user forgot to add the type, so
18966         report that rather than the constructor error.
18967
18968 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
18969
18970         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
18971         allocations.
18972
18973 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
18974
18975         * cs-parser.jay: Add cleanup call.
18976
18977 2003-01-13  Duncan Mak  <duncan@ximian.com>
18978
18979         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
18980         consistent with other methods.
18981
18982 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
18983
18984         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
18985
18986 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
18987
18988         * attribute.cs: only set GuidAttr to true when we have a
18989         GuidAttribute.
18990
18991 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18992
18993         * ecore.cs:
18994         * expression.cs:
18995         * typemanager.cs: fixes to allow mcs compile corlib with the new
18996         Type.IsSubclassOf fix.
18997
18998 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
18999
19000         * expression.cs (LocalVariableReference.DoResolve): Classify a
19001         constant as a value, not as a variable.   Also, set the type for
19002         the variable.
19003
19004         * cs-parser.jay (fixed_statement): take a type instead of a
19005         pointer_type, so we can produce a better error message later.
19006
19007         * statement.cs (Fixed.Resolve): Flag types that are not pointers
19008         as an error.  
19009
19010         (For.DoEmit): Make inifinite loops have a
19011         non-conditional branch back.
19012
19013         (Fixed.DoEmit): First populate the pinned variables, then emit the
19014         statement, then clear the variables.  Before I was emitting the
19015         code once for each fixed piece.
19016
19017
19018 2003-01-08  Martin Baulig  <martin@ximian.com>
19019
19020         * statement.cs (FlowBranching.MergeChild): A break in a
19021         SWITCH_SECTION does not leave a loop.  Fixes #36155.
19022
19023 2003-01-08  Martin Baulig  <martin@ximian.com>
19024
19025         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19026         lives in the same number space than `param_map'.  Fixes #36154.
19027
19028 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
19029
19030         * cs-parser.jay (constructor_declaration): Set the
19031         Constructor.ModFlags before probing for it.  This makes the
19032         compiler report 514, 515 and 132 (the code was there, but got
19033         broken). 
19034
19035         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19036         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19037         (GotoCase.Resolve): Set `Returns' to ALWAYS.
19038
19039 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19040
19041         * enum.cs: create the enum static fields using the enum type.
19042
19043 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19044
19045         * class.cs: don't try to create the ParamBuilder for the return
19046         type if it's not needed (and handle it breaking for the ms runtime
19047         anyway).
19048
19049 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19050
19051         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19052
19053 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
19054
19055         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19056         the command.   This showed up while compiling the JANET source
19057         code, which used \r as its only newline separator.
19058
19059 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
19060
19061         * class.cs (Method.Define): If we are an operator (because it
19062         reuses our code), then set the SpecialName and HideBySig.  #36128
19063
19064 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
19065
19066         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19067         exception, report error 120 `object reference required'.
19068
19069         * driver.cs: Add --pause option, used during to measure the size
19070         of the process as it goes with --timestamp.
19071
19072         * expression.cs (Invocation.DoResolve): Do not allow methods with
19073         SpecialName to be invoked.
19074
19075 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
19076
19077         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19078         number before adding it.
19079
19080 2002-12-21  Ravi Pratap  <ravi@ximian.com>
19081
19082         * ecore.cs (StandardImplicitConversion): When in an unsafe
19083         context, we allow conversion between void * to any other pointer
19084         type. This fixes bug #35973.
19085
19086 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19087
19088         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19089         is not thrown when extensionless outputs are used 
19090
19091 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19092
19093         * rootcontext.cs: fixed compilation of corlib.
19094
19095 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
19096
19097         * attribute.cs (Attributes.Contains): Add new method.
19098
19099         * class.cs (MethodCore.LabelParameters): if the parameter is an
19100         `out' parameter, check that no attribute `[In]' has been passed.
19101
19102         * enum.cs: Handle the `value__' name in an enumeration.
19103
19104 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
19105
19106         * decl.cs: Added special case to allow overrides on "protected
19107         internal" methods
19108
19109 2002-12-18  Ravi Pratap  <ravi@ximian.com>
19110
19111         * attribute.cs (Attributes.AddAttributeSection): Rename to this
19112         since it makes much more sense.
19113
19114         (Attributes.ctor): Don't require a Location parameter.
19115
19116         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19117
19118         * attribute.cs (ApplyAttributes): Remove extra Location parameters
19119         since we already have that information per attribute.
19120
19121         * everywhere : make appropriate changes.
19122
19123         * class.cs (LabelParameters): Write the code which actually
19124         applies attributes to the return type. We can't do this on the MS
19125         .NET runtime so we flag a warning in the case an exception is
19126         thrown.
19127
19128 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
19129
19130         * const.cs: Handle implicit null conversions here too.
19131
19132 2002-12-17  Ravi Pratap  <ravi@ximian.com>
19133
19134         * class.cs (MethodCore.LabelParameters): Remove the extra
19135         Type [] parameter since it is completely unnecessary. Instead
19136         pass in the method's attributes so that we can extract
19137         the "return" attribute.
19138
19139 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
19140
19141         * cs-parser.jay (parse): Use Report.Error to flag errors instead
19142         of ignoring it and letting the compile continue.
19143
19144         * typemanager.cs (ChangeType): use an extra argument to return an
19145         error condition instead of throwing an exception.
19146
19147 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
19148
19149         * expression.cs (Unary.TryReduce): mimic the code for the regular
19150         code path.  Perform an implicit cast in the cases where we can
19151         implicitly convert to one of the integral types, and then reduce
19152         based on that constant.   This fixes bug #35483.
19153
19154 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19155
19156         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19157
19158 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19159
19160         * namespace.cs: fixed bug #35489.
19161
19162 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
19163
19164         * class.cs: Remove some dead code.
19165
19166         * cs-parser.jay: Estimate the number of methods needed
19167         (RootContext.MethodCount);
19168
19169         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19170         numbers instead of StringBuilders.
19171
19172         * support.cs (PtrHashtable): Add constructor with initial size;
19173         We can now reduce reallocations of the method table.
19174
19175 2002-12-10  Ravi Pratap  <ravi@ximian.com>
19176
19177         * attribute.cs (ApplyAttributes): Keep track of the emitted
19178         attributes on a per-target basis. This fixes bug #35413.
19179
19180 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
19181
19182         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19183         default to the Windows 1252 encoding.
19184
19185         (UnixParseOption): Support version, thanks to Alp for the missing
19186         pointer. 
19187
19188         * AssemblyInfo.cs: Add nice assembly information.
19189
19190         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19191         (bug 35169).
19192
19193         * cs-parser.jay: Allow a trailing comma before the close bracked
19194         in the attribute_section production.
19195
19196         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19197         address of the instance was being taken, I will take this out,
19198         because we take the address of the object immediately here.
19199
19200 2002-12-09  Ravi Pratap  <ravi@ximian.com>
19201
19202         * typemanager.cs (AreMultipleAllowed): Take care of the most
19203         obvious case where attribute type is not in the current assembly -
19204         stupid me ;-)
19205
19206 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
19207
19208         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19209         definitions, instead of doing that afterwards.  
19210
19211         Also we use a nice little hack, depending on the constructor, we
19212         know if we are a "composed" name or a simple name.  Hence, we
19213         avoid the IndexOf test, and we avoid 
19214
19215         * codegen.cs: Add code to assist in a bug reporter to track down
19216         the source of a compiler crash. 
19217
19218 2002-12-07  Ravi Pratap  <ravi@ximian.com>
19219
19220         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19221         types have been emitted for a given element and flag an error
19222         if something which does not have AllowMultiple set is used more
19223         than once.
19224
19225         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19226         attribute types and their corresponding AllowMultiple properties
19227
19228         (AreMultipleAllowed): Check the property for a given type.
19229
19230         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19231         property in the case we have a TypeContainer.
19232
19233         (Attributes.AddAttribute): Detect duplicates and just skip on
19234         adding them. This trivial fix catches a pretty gross error in our
19235         attribute emission - global attributes were being emitted twice!
19236
19237         Bugzilla bug #33187 is now fixed.
19238
19239 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
19240
19241         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19242         instead of pp_and).
19243
19244         * expression.cs (Binary.ResolveOperator): I can only use the
19245         Concat (string, string, string) and Concat (string, string,
19246         string, string) if the child is actually a concatenation of
19247         strings. 
19248
19249 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
19250
19251         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19252         context where we need a 2-character lookahead.
19253
19254         * pending.cs (PendingImplementation): Rework so we can keep track
19255         of interface types all the time, and flag those which were
19256         implemented by parents as optional.
19257
19258 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
19259
19260         * expression.cs (Binary.ResolveOperator): Use
19261         String.Concat(string,string,string) or
19262         String.Concat(string,string,string,string) when possible. 
19263
19264         * typemanager: More helper methods.
19265
19266
19267 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19268
19269         * pending.cs: remove the bogus return from GetMissingInterfaces()
19270         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19271
19272 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19273
19274         * namespace.cs: avoid duplicated 'using xxx' being added to
19275         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19276         when we get more than one 'using' statement for the same namespace.
19277         Report a CS0105 warning for it.
19278
19279 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
19280
19281         * cs-tokenizer.cs (consume_identifier): use read directly, instead
19282         of calling getChar/putback, uses internal knowledge of it.    
19283
19284         (xtoken): Reorder tokenizer so most common patterns are checked
19285         first.  This reduces the compilation time in another 5% (from 8.11s
19286         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19287
19288         The parsing time is 22% of the compilation in mcs, and from that
19289         64% is spent on the tokenization process.  
19290
19291         I tried using a binary search for keywords, but this is slower
19292         than the hashtable.  Another option would be to do a couple of
19293         things:
19294
19295                 * Not use a StringBuilder, instead use an array of chars,
19296                   with a set value.  Notice that this way we could catch
19297                   the 645 error without having to do it *afterwards*.
19298
19299                 * We could write a hand-parser to avoid the hashtable
19300                   compares altogether.
19301
19302         The identifier consumption process takes 37% of the tokenization
19303         time.  Another 15% is spent on is_number.  56% of the time spent
19304         on is_number is spent on Int64.Parse:
19305
19306                 * We could probably choose based on the string length to
19307                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
19308                   computations. 
19309
19310         Another 3% is spend on wrapping `xtoken' in the `token' function.
19311
19312         Handle 0xa0 as whitespace (#34752)
19313
19314 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
19315
19316         * typemanager.cs (IsCLRType): New routine to tell whether a type
19317         is one of the builtin types.  
19318
19319         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
19320         typecode in more places instead of doing pointer comparissions.
19321         We could leverage some knowledge about the way the typecodes are
19322         laid out.
19323
19324         New code to cache namespaces in assemblies, it is currently not
19325         invoked, to be used soon.
19326
19327         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19328
19329         * expression.cs (Binary.ResolveOperator): specially handle
19330         strings, and do not perform user-defined operator overloading for
19331         built-in types.
19332
19333 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
19334
19335         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19336         internalcall as it is a pretty simple operation;  Avoid whenever
19337         possible to call Char.IsLetter.
19338
19339         (consume_identifier): Cut by half the number of
19340         hashtable calls by merging the is_keyword and GetKeyword behavior.
19341
19342         Do not short-circuit, because if we do, we
19343         report errors (ie, #if false && true would produce an invalid
19344         directive error);
19345
19346
19347 2002-11-24  Martin Baulig  <martin@ximian.com>
19348
19349         * expression.cs (Cast.TryReduce): If we're in checked syntax,
19350         check constant ranges and report a CS0221.  Fixes #33186.
19351
19352 2002-11-24  Martin Baulig  <martin@ximian.com>
19353
19354         * cs-parser.jay: Make this work for uninitialized variable
19355         declarations in the `for' initializer.  Fixes #32416.
19356
19357 2002-11-24  Martin Baulig  <martin@ximian.com>
19358
19359         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19360         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
19361
19362 2002-11-24  Martin Baulig  <martin@ximian.com>
19363
19364         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19365         argument; if true, we also check for user-defined conversions.
19366         This is only needed if both arguments are of a user-defined type.
19367         Fixes #30443, added test-175.cs.
19368         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19369
19370         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19371
19372 2002-11-24  Martin Baulig  <martin@ximian.com>
19373
19374         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19375         function to get the store opcode.
19376         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19377         only emit the Ldelema if the store opcode is Stobj.  You must run
19378         both test-34 and test-167 to test this.  Fixes #34529.
19379
19380 2002-11-23  Martin Baulig  <martin@ximian.com>
19381
19382         * ecore.cs (Expression.MemberLookup): Added additional
19383         `qualifier_type' argument which is used when we're being called
19384         from MemberAccess.DoResolve() and null if we're called from a
19385         SimpleName lookup.
19386         (Expression.MemberLookupFailed): New method to report errors; this
19387         does the CS1540 check and reports the correct error message.
19388
19389         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19390         argument for the CS1540 check and redone the way how we're dealing
19391         with private members.  See the comment in the source code for details.
19392         (FilterWithClosure): Reverted this back to revision 1.197; renamed
19393         `closure_start_type' to `closure_qualifier_type' and check whether
19394         it's not null.  It was not this filter being broken, it was just
19395         being called with the wrong arguments.
19396
19397         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19398         and pass it the correct `qualifier_type'; this also does the error
19399         handling for us.
19400
19401 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
19402
19403         * expression.cs (Invocation.EmitParams): If the we are dealing
19404         with a non-built-in value type, load its address as well.
19405
19406         (ArrayCreation): Use a a pretty constant instead
19407         of the hardcoded value 2.   Use 6 instead of 2 for the number of
19408         static initializers.  
19409
19410         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19411         because they are not really value types, just glorified integers. 
19412
19413         * driver.cs: Do not append .exe, the CSC compiler does not do it.
19414
19415         * ecore.cs: Remove redundant code for enumerations, make them use
19416         the same code path as everything else, fixes the casting issue
19417         with enumerations in Windows.Forms.
19418
19419         * attribute.cs: Do only cast to string if it is a string, the
19420         validation happens later.
19421
19422         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19423         people upgrade their corlibs.
19424
19425         * ecore.cs: Oops, enumerations were not following the entire code path
19426
19427 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
19428
19429         * typemanager.cs (FilterWithClosure): Commented out the test for
19430         1540 in typemanager.cs, as it has problems when accessing
19431         protected methods from a parent class (see test-174.cs). 
19432
19433         * attribute.cs (Attribute.ValidateGuid): new method.
19434         (Attribute.Resolve): Use above.
19435
19436 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
19437
19438         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19439
19440         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19441         handling for enumerations, as we only needed the TypeContainer
19442         functionality to begin with (this is required for the fix below to
19443         work for enums that reference constants in a container class for
19444         example). 
19445
19446         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19447
19448         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19449         a valid TypeBuilder to perform lookups on.o
19450
19451         * class.cs (InheritableMemberSignatureCompare): Use true in the
19452         call to GetGetMethod and GetSetMethod, because we are comparing
19453         the signature, and we need to get the methods *even* if they are
19454         private. 
19455
19456         (PropertyBase.CheckBase): ditto.
19457
19458         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19459         GotoCase.Resolve): Use Peel on EmpytCasts.
19460
19461         * ecore.cs (EmptyCast): drop child, add Peel method.
19462
19463 2002-11-17  Martin Baulig  <martin@ximian.com>
19464
19465         * ecore.cs (EmptyCast.Child): New public property.
19466
19467         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19468         label resolved to an EmptyCast.  Fixes #34162.
19469         (GotoCase.Resolve): Likewise.
19470         (Block.EmitMeta): Likewise.
19471
19472 2002-11-17  Martin Baulig  <martin@ximian.com>
19473
19474         * expression.cs (Invocation.BetterConversion): Prefer int over
19475         uint; short over ushort; long over ulong for integer literals.
19476         Use ImplicitConversionExists instead of StandardConversionExists
19477         since we also need to check for user-defined implicit conversions.
19478         Fixes #34165.  Added test-173.cs.
19479
19480 2002-11-16  Martin Baulig  <martin@ximian.com>
19481
19482         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19483         with the `true' and `false' literals.  Fixes #33151.
19484
19485 2002-11-16  Martin Baulig  <martin@ximian.com>
19486
19487         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19488         October 22nd; don't do the cs1540 check for static members.
19489
19490         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19491         now using our own filter here and doing the cs1540 check again.
19492
19493 2002-11-16  Martin Baulig  <martin@ximian.com>
19494
19495         * support.cs (InternalParameters): Don't crash if we don't have
19496         any fixed parameters.  Fixes #33532.
19497
19498 2002-11-16  Martin Baulig  <martin@ximian.com>
19499
19500         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19501         when looking up static methods to make this work on Windows.
19502         Fixes #33773.
19503
19504 2002-11-16  Martin Baulig  <martin@ximian.com>
19505
19506         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19507         a setter rather than using PropertyInfo.CanWrite.
19508
19509 2002-11-15  Nick Drochak  <ndrochak@gol.com>
19510
19511         * class.cs: Allow acces to block member by subclasses. Fixes build
19512         breaker.
19513
19514 2002-11-14  Martin Baulig  <martin@ximian.com>
19515
19516         * class.cs (Constructor.Emit): Added the extern/block check.
19517         Fixes bug #33678.
19518
19519 2002-11-14  Martin Baulig  <martin@ximian.com>
19520
19521         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19522         iteration while looking for indexers, this is needed because the
19523         indexer may have a different name in our base classes.  Fixed the
19524         error reporting (no indexers at all, not get accessor, no
19525         overloaded match).  Fixes bug #33089.
19526         (IndexerAccess.DoResolveLValue): Likewise.
19527
19528 2002-11-14  Martin Baulig  <martin@ximian.com>
19529
19530         * class.cs (PropertyBase.CheckBase): Make this work for multiple
19531         indexers.  Fixes the first part of bug #33089.
19532         (MethodSignature.InheritableMemberSignatureCompare): Added support
19533         for properties.
19534
19535 2002-11-13  Ravi Pratap  <ravi@ximian.com>
19536
19537         * attribute.cs (Attribute.Resolve): Catch the
19538         NullReferenceException and report it since it isn't supposed to
19539         happen. 
19540
19541 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
19542
19543         * expression.cs (Binary.EmitBranchable): Also handle the cases for
19544         LogicalOr and LogicalAnd that can benefit from recursively
19545         handling EmitBranchable.  The code now should be nice for Paolo.
19546
19547 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
19548
19549         * typemanager.cs (LookupType): Added a negative-hit hashtable for
19550         the Type lookups, as we perform quite a number of lookups on
19551         non-Types.  This can be removed once we can deterministically tell
19552         whether we have a type or a namespace in advance.
19553
19554         But this might require special hacks from our corlib.
19555
19556         * TODO: updated.
19557
19558         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19559         and double which avoids a conversion from an integer to a double.
19560
19561         * expression.cs: tiny optimization, avoid calling IsConstant,
19562         because it effectively performs the lookup twice.
19563
19564 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
19565
19566         But a bogus return here to keep the semantics of the old code
19567         until the Mono runtime is fixed.
19568
19569         * pending.cs (GetMissingInterfaces): New method used to remove all
19570         the interfaces that are already implemented by our parent
19571         classes from the list of pending methods. 
19572
19573         * interface.cs: Add checks for calls after ResolveTypeExpr.
19574
19575 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
19576
19577         * class.cs (Class.Emit): Report warning 67: event not used if the
19578         warning level is beyond 3.
19579
19580         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19581         being a NullLiteral.
19582
19583         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19584         specifiers. 
19585
19586         * class.cs (TypeContainer.GetClassBases): Cover a missing code
19587         path that might fail if a type can not be resolved.
19588
19589         * expression.cs (Binary.Emit): Emit unsigned versions of the
19590         operators. 
19591
19592         * driver.cs: use error 5.
19593
19594 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19595
19596         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19597
19598 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
19599
19600         * cs-parser.jay (switch_section): A beautiful patch from Martin
19601         Baulig that fixed 33094.
19602
19603 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
19604
19605         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19606         Check whether the base is abstract and report an error if so.
19607
19608         * expression.cs (IndexerAccess.DoResolveLValue,
19609         IndexerAccess.DoResolve): ditto. 
19610
19611         (Invocation.DoResolve): ditto.
19612
19613         (Invocation.FullMethodDesc): Improve the report string.
19614
19615         * statement.cs (Block): Eliminate IsVariableDefined as it is
19616         basically just a wrapper for GetVariableInfo.
19617
19618         * ecore.cs (SimpleName): Use new 
19619
19620         * support.cs (ReflectionParamter.ParameterType): We unwrap the
19621         type, as we return the actual parameter ref/unref state on a
19622         different call.
19623
19624 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
19625
19626         * support.cs: Return proper flags REF/OUT fixing the previous
19627         commit.  
19628
19629         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
19630         not used to mean `ref' but `ref or out' in ParameterReference
19631
19632         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19633         full type signature instead of calling TypeManger.CSharpName
19634         ourselves. 
19635
19636         * support.cs (InternalParameters.ParameterDesc): Do not compare
19637         directly to the modflags, because REF/OUT will actually be bitsets
19638         if set. 
19639
19640         * delegate.cs (VerifyMethod): Check also the modifiers.
19641
19642         * cs-tokenizer.cs: Fix bug where floating point values with an
19643         exponent where a sign was missing was ignored.
19644
19645         * driver.cs: Allow multiple assemblies to be specified in a single
19646         /r: argument
19647
19648 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
19649
19650         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
19651         because identifiers after a parenthesis would end up in this kind
19652         of production, and we needed to desamiguate it for having casts
19653         like:
19654
19655                 (UserDefinedType *) xxx
19656
19657 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
19658
19659         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19660         we should set on the Bindingflags.NonPublic, but not turn on
19661         private_ok.  private_ok controls whether a Private member is
19662         returned (this is chekced on the filter routine), while the
19663         BindingFlags.NonPublic just controls whether private/protected
19664         will be allowed.   This fixes the problem part of the problem of
19665         private properties being allowed to be used in derived classes.
19666
19667         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19668         so we can call the children DoResolveLValue method (this will
19669         properly signal errors on lvalue assignments to base properties)
19670
19671         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
19672         getter are null, and we have a property info, we know that this
19673         happened because the lookup failed, so we report an error 122 for
19674         protection level violation.
19675
19676         We also silently return if setter and getter are null in the
19677         resolve functions, this condition only happens if we have flagged
19678         the error before.  This is the other half of the problem. 
19679
19680         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
19681         not have accessibility information, that is why we were returning
19682         true in the filter function in typemanager.cs.
19683
19684         To properly report 122 (property is inaccessible because of its
19685         protection level) correctly, we report this error in ResolveAccess
19686         by failing if both the setter and the getter are lacking (ie, the
19687         lookup failed). 
19688
19689         DoResolve and DoLResolve have been modified to check for both
19690         setter/getter being null and returning silently, the reason being
19691         that I did not want to put the knowledge about this error in upper
19692         layers, like:
19693
19694         int old = Report.Errors;
19695         x = new PropertyExpr (...);
19696         if (old != Report.Errors)
19697                 return null;
19698         else
19699                 return x;
19700
19701         So the property expr is returned, but it is invalid, so the error
19702         will be flagged during the resolve process. 
19703
19704         * class.cs: Remove InheritablePropertySignatureCompare from the
19705         class, as we no longer depend on the property signature to compute
19706         whether it is possible to implement a method or not.
19707
19708         The reason is that calling PropertyInfo.GetGetMethod will return
19709         null (in .NET, in Mono it works, and we should change this), in
19710         cases where the Get Method does not exist in that particular
19711         class.
19712
19713         So this code:
19714
19715         class X { public virtual int A { get { return 1; } } }
19716         class Y : X { }
19717         class Z : Y { public override int A { get { return 2; } } }
19718
19719         Would fail in Z because the parent (Y) would not have the property
19720         defined.  So we avoid this completely now (because the alternative
19721         fix was ugly and slow), and we now depend exclusively on the
19722         method names.
19723
19724         (PropertyBase.CheckBase): Use a method-base mechanism to find our
19725         reference method, instead of using the property.
19726
19727         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
19728         routines are gone now.
19729
19730         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
19731         names, they were incorrectly named.
19732
19733         * cs-tokenizer.cs: Return are more gentle token on failure. 
19734
19735         * pending.cs (PendingImplementation.InterfaceMethod): This routine
19736         had an out-of-sync index variable, which caused it to remove from
19737         the list of pending methods the wrong method sometimes.
19738
19739 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
19740
19741         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
19742         CanWrite, because those refer to this particular instance of the
19743         property, and do not take into account the fact that we can
19744         override single members of a property.
19745
19746         Constructor requires an EmitContext.  The resolution process does
19747         not happen here, but we need to compute the accessors before,
19748         because the resolution does not always happen for properties.
19749
19750         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
19751         subclass, before we did not update this flag, but we did update
19752         bindingflags. 
19753
19754         (GetAccessors): Drop this routine, as it did not work in the
19755         presence of partially overwritten set/get methods. 
19756
19757         Notice that this broke the cs1540 detection, but that will require
19758         more thinking. 
19759
19760 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19761
19762         * class.cs:
19763         * codegen.cs:
19764         * driver.cs: issue a warning instead of an error if we don't support
19765         debugging for the platform. Also ignore a couple of errors that may
19766         arise when trying to write the symbols. Undo my previous patch.
19767
19768 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19769
19770         * driver.cs: ignore /debug switch except for Unix platforms.
19771
19772 2002-10-23  Nick Drochak  <ndrochak@gol.com>
19773
19774         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
19775
19776 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
19777
19778         * driver.cs: Do not make mcs-debug conditional, so we do not break
19779         builds that use it.
19780
19781         * statement.cs (UsageVector.MergeChildren): I would like Martin to
19782         review this patch.  But basically after all the children variables
19783         have been merged, the value of "Breaks" was not being set to
19784         new_breaks for Switch blocks.  I think that it should be set after
19785         it has executed.  Currently I set this to the value of new_breaks,
19786         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
19787         conservative, but I do not understand this code very well.
19788
19789         I did not break anything in the build, so that is good ;-)
19790
19791         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
19792
19793 2002-10-20  Mark Crichton  <crichton@gimp.org>
19794
19795         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
19796
19797 2002-10-20  Nick Drochak  <ndrochak@gol.com>
19798
19799         * cfold.cs: Fixed compile blocker.
19800
19801 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
19802
19803         * driver.cs: I was chekcing the key, not the file.
19804
19805 2002-10-19  Ravi Pratap  <ravi@ximian.com>
19806
19807         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
19808         message that we were generating - we just need to silently return
19809         a null.
19810
19811 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
19812
19813         * class.cs (Event.Define): Change my previous commit, as this
19814         breaks the debugger.  This is a temporary hack, as it seems like
19815         the compiler is generating events incorrectly to begin with.
19816
19817         * expression.cs (Binary.ResolveOperator): Added support for 
19818         "U operator - (E x, E y)"
19819
19820         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
19821         y)".
19822
19823         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
19824         init-only variables, but this path did not take into account that
19825         there might be also instance readonly variables.  Correct this
19826         problem. 
19827
19828         This fixes bug 32253
19829
19830         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
19831         delegates as well.
19832
19833         * driver.cs: Change the extension for modules to `netmodule'
19834
19835         * cs-parser.jay: Improved slightly the location tracking for
19836         the debugger symbols.
19837
19838         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
19839         modifiers that were specified instead of the hardcoded value
19840         (FamAndAssem).  This was basically ignoring the static modifier,
19841         and others.  Fixes 32429.
19842
19843         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
19844         fixed a bug in the process (32476)
19845
19846         * expression.cs (ArrayAccess.EmitAssign): Patch from
19847         hwang_rob@yahoo.ca that fixes bug 31834.3
19848
19849 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
19850
19851         * driver.cs: Make the module extension .netmodule.
19852
19853 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * driver.cs: Report an error if the resource file is not found
19856         instead of crashing.
19857
19858         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
19859         false, like Emit does.
19860
19861 2002-10-16  Nick Drochak  <ndrochak@gol.com>
19862
19863         * typemanager.cs: Remove unused private member.  Also reported mcs
19864         bug to report this as a warning like csc.
19865
19866 2002-10-15  Martin Baulig  <martin@gnome.org>
19867
19868         * statement.cs (Statement.Emit): Made this a virtual method; emits
19869         the line number info and calls DoEmit().
19870         (Statement.DoEmit): New protected abstract method, formerly knows
19871         as Statement.Emit().
19872
19873         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
19874
19875 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
19876
19877         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
19878         have fixed a remaining problem: not every AddXXXX was adding a
19879         fully qualified name.  
19880
19881         Now everyone registers a fully qualified name in the DeclSpace as
19882         being defined instead of the partial name.  
19883
19884         Downsides: we are slower than we need to be due to the excess
19885         copies and the names being registered this way.  
19886
19887         The reason for this is that we currently depend (on the corlib
19888         bootstrap for instance) that types are fully qualified, because
19889         we dump all the types in the namespace, and we should really have
19890         types inserted into the proper namespace, so we can only store the
19891         basenames in the defined_names array.
19892
19893 2002-10-10  Martin Baulig  <martin@gnome.org>
19894
19895         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
19896         from bug #31834, see the bug report for a testcase which is
19897         miscompiled.
19898
19899 2002-10-10  Martin Baulig  <martin@gnome.org>
19900
19901         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
19902         flow analysis code for this.
19903
19904         * statement.cs (Do, While, For): Tell the flow analysis code about
19905         infinite loops.
19906         (FlowBranching.UsageVector): Added support for infinite loops.
19907         (Block.Resolve): Moved the dead code elimination here and use flow
19908         analysis to do it.
19909
19910 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
19911
19912         * class.cs (Field.Define): Catch cycles on struct type
19913         definitions. 
19914
19915         * typemanager.cs (IsUnmanagedtype): Do not recursively check
19916         fields if the fields are static.  We only need to check instance
19917         fields. 
19918
19919         * expression.cs (As.DoResolve): Test for reference type.
19920
19921         * statement.cs (Using.ResolveExpression): Use
19922         ConvertImplicitRequired, not ConvertImplicit which reports an
19923         error on failture
19924         (Using.ResolveLocalVariableDecls): ditto.
19925
19926         * expression.cs (Binary.ResolveOperator): Report errors in a few
19927         places where we had to.
19928
19929         * typemanager.cs (IsUnmanagedtype): Finish implementation.
19930
19931 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
19932
19933         * expression.cs: Use StoreFromPtr instead of extracting the type
19934         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
19935
19936         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
19937         an enumeration value to a System.Enum, but System.Enum is not a
19938         value type, but an class type, so we need to box.
19939
19940         (Expression.ConvertExplicit): One codepath could return
19941         errors but not flag them.  Fix this.  Fixes #31853
19942
19943         * parameter.cs (Resolve): Do not allow void as a parameter type.
19944
19945 2002-10-06  Martin Baulig  <martin@gnome.org>
19946
19947         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
19948         if it's a class type and not a struct.  Fixes #31815.
19949
19950 2002-10-06  Martin Baulig  <martin@gnome.org>
19951
19952         * statement.cs: Reworked the flow analysis code a bit to make it
19953         usable for dead code elimination.
19954
19955 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19956
19957         * cs-parser.jay: allow empty source files. Fixes bug #31781.
19958
19959 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
19960
19961         * expression.cs (ComposedCast.DoResolveType): A quick workaround
19962         to fix the test 165, will investigate deeper.
19963
19964 2002-10-04  Martin Baulig  <martin@gnome.org>
19965
19966         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
19967         finally blocks actually work.
19968         (Try.Resolve): We don't need to create a sibling for `finally' if
19969         there is no finally block.
19970
19971 2002-10-04  Martin Baulig  <martin@gnome.org>
19972
19973         * class.cs (Constructor.Define): The default accessibility for a
19974         non-default constructor is private, not public.
19975
19976 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
19977
19978         * class.cs (Constructor): Make AllowedModifiers public, add
19979         EXTERN.
19980
19981         * cs-parser.jay: Perform the modifiers test here, as the
19982         constructor for the Constructor class usually receives a zero
19983         because of the way we create it (first we create, later we
19984         customize, and we were never checking the modifiers).
19985
19986         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
19987         is a version of LookupTypeReflection that includes the type-name
19988         cache.  This can be used as a fast path for functions that know
19989         the fully qualified name and are only calling into *.GetType() to
19990         obtain a composed type.
19991
19992         This is also used by TypeManager.LookupType during its type
19993         composition.
19994
19995         (LookupType): We now also track the real type name, as sometimes
19996         we can get a quey for the real type name from things like
19997         ComposedCast.  This fixes bug 31422.
19998
19999         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20000         complete type fullname, it does not have to go through the type
20001         resolution system to obtain the composed version of the type (for
20002         obtaining arrays or pointers).
20003
20004         (Conditional.Emit): Use the EmitBoolExpression to
20005         generate nicer code, as requested by Paolo.
20006
20007         (ArrayCreation.CheckIndices): Use the patch from
20008         hwang_rob@yahoo.ca to validate the array initializers. 
20009
20010 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
20011
20012         * class.cs (ConstructorInitializer.Emit): simplify code by using
20013         Invocation.EmitCall, and at the same time, fix the bugs in calling
20014         parent constructors that took variable arguments. 
20015
20016         * ecore.cs (Expression.ConvertNumericExplicit,
20017         Expression.ImplicitNumericConversion): Remove the code that
20018         manually wrapped decimal (InternalTypeConstructor call is now gone
20019         as well).
20020
20021         * expression.cs (Cast.TryReduce): Also handle decimal types when
20022         trying to perform a constant fold on the type.
20023
20024         * typemanager.cs (IsUnmanagedtype): Partially implemented.
20025
20026         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20027         that only turned off an error report, and did nothing else. 
20028
20029 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
20030
20031         * driver.cs: Handle and ignore /fullpaths
20032
20033 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
20034
20035         * expression.cs (Binary.ResolveOperator): Catch the case where
20036         DoNumericPromotions returns true, 
20037
20038         (Binary.DoNumericPromotions): Simplify the code, and the tests.
20039
20040 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
20041
20042         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20043         report error 70.
20044
20045 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
20046
20047         * ecore.cs (ConvertNumericExplicit): It is not enough that the
20048         conversion exists, but it is also required that the conversion be
20049         performed.  This manifested in "(Type64Enum) 2".  
20050
20051         * class.cs (TypeManager.AddMethod): The fix is not to change
20052         AddEnum, because that one was using a fully qualified name (every
20053         DeclSpace derivative does), but to change the AddMethod routine
20054         that was using an un-namespaced name.  This now correctly reports
20055         the duplicated name.
20056
20057         Revert patch until I can properly fix it.  The issue
20058         is that we have a shared Type space across all namespaces
20059         currently, which is wrong.
20060
20061         Options include making the Namespace a DeclSpace, and merge
20062         current_namespace/current_container in the parser.
20063
20064 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
20065
20066         * cs-parser.jay: Improve error reporting when we get a different
20067         kind of expression in local_variable_type and
20068         local_variable_pointer_type. 
20069
20070         Propagate this to avoid missleading errors being reported.
20071
20072         * ecore.cs (ImplicitReferenceConversion): treat
20073         TypeManager.value_type as a target just like object_type.   As
20074         code like this:
20075
20076         ValueType v = 1;
20077
20078         Is valid, and needs to result in the int 1 being boxed before it
20079         is assigned to the value type v.
20080
20081         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20082         to validate the enumeration name.
20083
20084         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20085         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
20086         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20087
20088         * ecore.cs (TryImplicitIntConversion): When doing an
20089         implicit-enumeration-conversion, check if the type is 64-bits and
20090         perform a conversion before passing to EnumConstant.
20091
20092 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
20093
20094         * decl.cs (Error_AmbiguousTypeReference); New routine used to
20095         report ambiguous type references.  Unlike the MS version, we
20096         report what the ambiguity is.   Innovation at work ;-)
20097
20098         (DeclSpace.FindType): Require a location argument to
20099         display when we display an ambiguous error.
20100
20101         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20102
20103         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20104
20105         * expression.cs (EmitDynamicInitializers): Apply patch from
20106         hwang_rob@yahoo.ca that fixes the order in which we emit our
20107         initializers. 
20108
20109 2002-09-21  Martin Baulig  <martin@gnome.org>
20110
20111         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20112         delegate takes no arguments.
20113
20114 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
20115
20116         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20117         from integers.
20118
20119         * expression.cs: Extract the underlying type.
20120
20121         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20122
20123         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20124
20125 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
20126
20127         * class.cs (TypeContainer.DefineType): We can not use the nice
20128         PackingSize with the size set to 1 DefineType method, because it
20129         will not allow us to define the interfaces that the struct
20130         implements.
20131
20132         This completes the fixing of bug 27287
20133
20134         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20135         means also structs.  This fixes part of the problem. 
20136         (Expresion.ImplicitReferenceConversionExists): ditto.
20137
20138         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20139         error if there were no errors reported during the type lookup
20140         process, to avoid duplicates or redundant errors.  Without this
20141         you would get an ambiguous errors plus a type not found.  We have
20142         beaten the user enough with the first error.  
20143
20144         (DeclSparce.FindType): Emit a warning if we have an ambiguous
20145         reference. 
20146
20147         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20148         during the resolution process, stop the lookup, this avoids
20149         repeated error reports (same error twice).
20150
20151         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20152
20153         * typemanager.cs (LookupType): Redo the type lookup code to match
20154         the needs of System.Reflection.  
20155
20156         The issue is that System.Reflection requires references to nested
20157         types to begin with a "+" sign instead of a dot.  So toplevel
20158         types look like: "NameSpace.TopLevelClass", and nested ones look
20159         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20160         levels. 
20161
20162 2002-09-19  Martin Baulig  <martin@gnome.org>
20163
20164         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20165         says that a method always returns or always throws an exception,
20166         don't report the CS0161.
20167
20168         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20169         set `Returns = new_returns'.
20170
20171 2002-09-19  Martin Baulig  <martin@gnome.org>
20172
20173         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20174         to an enum constant, check for a CS0176.
20175
20176 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
20177
20178         * class.cs (TypeContainer.CheckPairedOperators): Now we check
20179         for operators that must be in pairs and report errors.
20180
20181         * ecore.cs (SimpleName.DoResolveType): During the initial type
20182         resolution process, when we define types recursively, we must
20183         check first for types in our current scope before we perform
20184         lookups in the enclosing scopes.
20185
20186         * expression.cs (MakeByteBlob): Handle Decimal blobs.
20187
20188         (Invocation.VerifyArgumentsCompat): Call
20189         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20190         I thought we were supposed to always call this, but there are a
20191         few places in the code where we dont do it.
20192
20193 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
20194
20195         * driver.cs: Add support in -linkres and -resource to specify the
20196         name of the identifier.
20197
20198 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20199
20200         * ecore.cs (StandardConversionExists): Sync with the conversion
20201         code: allow anything-* to void* conversions.
20202
20203         (FindMostSpecificSource): Use an Expression argument
20204         instead of a Type, because we might be handed over a Literal which
20205         gets a few more implicit conversions that plain types do not.  So
20206         this information was being lost.
20207
20208         Also, we drop the temporary type-holder expression when not
20209         required.
20210
20211 2002-09-17  Martin Baulig  <martin@gnome.org>
20212
20213         * class.cs (PropertyBase.CheckBase): Don't check the base class if
20214         this is an explicit interface implementation.
20215
20216 2002-09-17  Martin Baulig  <martin@gnome.org>
20217
20218         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20219         different `IndexerName' attributes.
20220
20221         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20222         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20223         virtual CommonResolve().
20224
20225 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20226
20227         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20228         and convert that to the UnderlyingType.
20229
20230         * statement.cs (Foreach.Resolve): Indexers are just like variables
20231         or PropertyAccesses.
20232
20233         * cs-tokenizer.cs (consume_string): Track line numbers and columns
20234         inside quoted strings, we were not doing this before.
20235
20236 2002-09-16  Martin Baulig  <martin@gnome.org>
20237
20238         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20239         resolve it.  This is needed for the definite assignment check of the
20240         instance expression, fixes bug #29846.
20241         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20242
20243 2002-09-16  Nick Drochak  <ndrochak@gol.com>
20244
20245         * parameter.cs: Fix compile error.  Cannot reference static member
20246         from an instance object.  Is this an mcs bug?
20247
20248 2002-09-14  Martin Baulig  <martin@gnome.org>
20249
20250         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20251         multiple times.  Fixes bug #30295, added test-166.cs.
20252
20253 2002-09-14  Martin Baulig  <martin@gnome.org>
20254
20255         * statement.cs (Block.Emit): Don't emit unreachable code.
20256         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20257         `break' statements.
20258         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20259
20260 2002-09-14  Martin Baulig  <martin@gnome.org>
20261
20262         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20263         is set.
20264
20265 2002-09-14  Martin Baulig  <martin@gnome.org>
20266
20267         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20268         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20269         be false on the ms runtime.
20270
20271 2002-09-13  Martin Baulig  <martin@gnome.org>
20272
20273         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20274         the CS0038 error message.
20275
20276 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
20277
20278         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20279         constant inside, return it.
20280
20281 2002-09-12  Martin Baulig  <martin@gnome.org>
20282
20283         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20284         implicit conversion can be done between enum types.
20285
20286         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20287         check whether an implicit conversion to the current enum's UnderlyingType
20288         exists and report an error if not.
20289
20290         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20291         without debugging support.
20292
20293         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20294         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
20295
20296 2002-09-12  Martin Baulig  <martin@gnome.org>
20297
20298         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20299
20300         * ecore.cs (IMemberExpr.DeclaringType): New property.
20301         (SimpleName.SimpleNameResolve): Check whether we're accessing a
20302         nonstatic member of an outer type (CS0038).
20303
20304 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
20305
20306         * driver.cs: Activate the using-error detector at warning level
20307         4 (at least for MS-compatible APIs).
20308
20309         * namespace.cs (VerifyUsing): Small buglett fix.
20310
20311         * pending.cs (PendingImplementation): pass the container pointer. 
20312
20313         * interface.cs (GetMethods): Allow for recursive definition.  Long
20314         term, I would like to move every type to support recursive
20315         definitions, not the current ordering mechanism that we have right
20316         now.
20317
20318         The situation is this: Attributes are handled before interfaces,
20319         so we can apply attributes to interfaces.  But some attributes
20320         implement interfaces, we will now handle the simple cases
20321         (recursive definitions will just get an error).  
20322
20323         * parameter.cs: Only invalidate types at the end if we fail to
20324         lookup all types.  
20325
20326 2002-09-09  Martin Baulig  <martin@gnome.org>
20327
20328         * ecore.cs (PropertyExpr.Emit): Also check for
20329         TypeManager.system_int_array_get_length so this'll also work when
20330         compiling corlib.  Fixes #30003.
20331
20332 2002-09-09  Martin Baulig  <martin@gnome.org>
20333
20334         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20335         and throw an exception if we can't get the type's size.  Fixed #30040,
20336         added test-165.cs.
20337
20338 2002-09-09  Martin Baulig  <martin@gnome.org>
20339
20340         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20341
20342         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20343         context.  Fixes bug #30027.
20344
20345         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20346         virtual functions.  Fixes bug #30043, added test-164.cs.
20347
20348 2002-09-08  Ravi Pratap  <ravi@ximian.com>
20349
20350         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20351
20352 2002-09-08  Nick Drochak  <ndrochak@gol.com>
20353
20354         * driver.cs: Use an object to get the windows codepage since it's not a
20355         static property.
20356
20357 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
20358
20359         * statement.cs (For.Emit): for infinite loops (test == null)
20360         return whether there is a break inside, not always "true".
20361
20362         * namespace.cs (UsingEntry): New struct to hold the name of the
20363         using definition, the location where it is defined, and whether it
20364         has been used in a successful type lookup.
20365
20366         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20367         strings.
20368
20369         * decl.cs: ditto.
20370
20371 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20372
20373         * attribute.cs : Fix incorrect code which relied on catching
20374         a NullReferenceException to detect a null being passed in
20375         where an object was expected.
20376
20377 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
20378
20379         * statement.cs (Try): flag the catch variable as assigned
20380
20381         * expression.cs (Cast): Simplified by using ResolveType instead of
20382         manually resolving.
20383
20384         * statement.cs (Catch): Fix bug by using ResolveType.
20385
20386 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20387
20388         * expression.cs (BetterConversion): Special case for when we have
20389         a NullLiteral as the argument and we have to choose between string
20390         and object types - we choose string the way csc does.
20391
20392         * attribute.cs (Attribute.Resolve): Catch the
20393         NullReferenceException and report error #182 since the Mono
20394         runtime no more has the bug and having this exception raised means
20395         we tried to select a constructor which takes an object and is
20396         passed a null.
20397
20398 2002-09-05  Ravi Pratap  <ravi@ximian.com>
20399
20400         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20401         message (1502, 1503) when we can't locate a method after overload
20402         resolution. This is much more informative and closes the bug
20403         Miguel reported.
20404
20405         * interface.cs (PopulateMethod): Return if there are no argument
20406         types. Fixes a NullReferenceException bug.
20407
20408         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20409         expressions too. Previously we were checking only in one place for
20410         positional arguments leaving out named arguments.
20411
20412         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20413         type to the enum type is not allowed. Remove code corresponding to
20414         that.
20415
20416         (ConvertNumericExplicit): Allow explicit conversions from
20417         the underlying type to enum type. This precisely follows the spec
20418         and closes a bug filed by Gonzalo.
20419
20420 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20421
20422         * compiler.csproj:
20423         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20424
20425 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
20426
20427         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20428         it was important that we stored the right value after the
20429         reduction in `converted'.
20430
20431 2002-09-04  Martin Baulig  <martin@gnome.org>
20432
20433         * location.cs (Location.SymbolDocument): Use full pathnames for the
20434         source files.
20435
20436 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
20437
20438         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20439         of the expression resolve mechanism, because that will catch the
20440         SimpleName error failures.
20441
20442         (Conditional): If we can not resolve the
20443         expression, return, do not crash.
20444
20445 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20446
20447         * cs-tokenizer.cs:
20448         (location): display token name instead of its number.
20449
20450 2002-08-28  Martin Baulig  <martin@gnome.org>
20451
20452         * expression.cs (Binary.ResolveOperator): Don't silently return
20453         but return an error if an operator cannot be applied between two
20454         enum types.
20455
20456 2002-08-28  Martin Baulig  <martin@gnome.org>
20457
20458         * class.cs (Constructor.Define): Set the permission attributes
20459         correctly instead of making all constructors public.
20460
20461 2002-08-28  Martin Baulig  <martin@gnome.org>
20462
20463         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20464         for private members before reporting a CS0103; if we find anything,
20465         it's a CS0122.
20466
20467 2002-08-28  Martin Baulig  <martin@gnome.org>
20468
20469         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20470         to check whether `closure_start_type == closure_invocation_type',
20471         we also need to check whether `m.DeclaringType == closure_invocation_type'
20472         before bypassing the permission checks.  We might be accessing
20473         protected/private members from the base class.
20474         (TypeManager.RealMemberLookup): Only set private_ok if private
20475         members were requested via BindingFlags.NonPublic.
20476
20477         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20478
20479         * expression.cs (MemberAccess.ResolveMemberAccess): Set
20480         MethodGroupExpr.IsExplicitImpl if appropriate.
20481         (Invocation.DoResolve): Don't report the CS0120 for explicit
20482         interface implementations.
20483
20484 2002-08-27  Martin Baulig  <martin@gnome.org>
20485
20486         * expression.cs (Invocation.DoResolve): If this is a static
20487         method and we don't have an InstanceExpression, we must report
20488         a CS0120.
20489
20490 2002-08-25  Martin Baulig  <martin@gnome.org>
20491
20492         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20493         `==' between a valuetype and an object.
20494
20495 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
20496
20497         * ecore.cs (TypeExpr): Provide a ToString method.
20498
20499 2002-08-24  Martin Baulig  <martin@gnome.org>
20500
20501         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20502         now called proggie.dbg and it's a binary file.
20503
20504 2002-08-23  Martin Baulig  <martin@gnome.org>
20505
20506         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20507
20508 2002-08-23  Martin Baulig  <martin@gnome.org>
20509
20510         * struct.cs (MyStructInfo.ctor): Make this work with empty
20511         structs; it's not allowed to use foreach() on null.
20512
20513 2002-08-23  Martin Baulig  <martin@gnome.org>
20514
20515         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20516         writer the full pathname of the generated assembly.
20517
20518 2002-08-23  Martin Baulig  <martin@gnome.org>
20519
20520         * statements.cs (FlowBranching.UsageVector.MergeChildren):
20521         A `finally' block never returns or breaks; improved handling of
20522         unreachable code.
20523
20524 2002-08-23  Martin Baulig  <martin@gnome.org>
20525
20526         * statement.cs (Throw.Resolve): Allow `throw null'.
20527
20528 2002-08-23  Martin Baulig  <martin@gnome.org>
20529
20530         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20531         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20532         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
20533         MemberLookup would return a wrong event if this is an explicit
20534         interface implementation and the class has an event with the same
20535         name.
20536
20537 2002-08-23  Martin Baulig  <martin@gnome.org>
20538
20539         * statement.cs (Block.AddChildVariableNames): New public method.
20540         (Block.AddChildVariableName): Likewise.
20541         (Block.IsVariableNameUsedInChildBlock): Likewise.
20542         (Block.AddVariable): Check whether a variable name has already
20543         been used in a child block.
20544
20545         * cs-parser.jay (declare_local_variables): Mark all variable names
20546         from the current block as being used in a child block in the
20547         implicit block.
20548
20549 2002-08-23  Martin Baulig  <martin@gnome.org>
20550
20551         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20552         find the symbol writer.
20553
20554         * driver.cs: csc also allows the arguments to /define being
20555         separated by commas, not only by semicolons.
20556
20557 2002-08-23  Martin Baulig  <martin@gnome.org>
20558
20559         * interface.cs (Interface.GetMembers): Added static check for events.
20560
20561 2002-08-15  Martin Baulig  <martin@gnome.org>
20562
20563         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20564         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20565
20566         * ecore.cs (Expression.MemberLookup): Added documentation and explained
20567         why the MethodData.EmitDestructor() change was necessary.
20568
20569 2002-08-20  Martin Baulig  <martin@gnome.org>
20570
20571         * class.cs (TypeContainer.FindMembers): Added static check for events.
20572
20573         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20574
20575         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20576         use Type.GetEvents(), not Type.FindMembers().
20577
20578 2002-08-20  Martin Baulig  <martin@gnome.org>
20579
20580         * decl.cs (MemberCache): Added a special method cache which will
20581         be used for method-only searched.  This ensures that a method
20582         search will return a MethodInfo with the correct ReflectedType for
20583         inherited methods.      
20584
20585 2002-08-20  Martin Baulig  <martin@gnome.org>
20586
20587         * decl.cs (DeclSpace.FindMembers): Made this public.
20588
20589 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20590
20591         * delegate.cs: fixed build on windows.
20592         [FIXME:  Filed as bug #29150: MCS must report these errors.]
20593
20594 2002-08-19  Ravi Pratap  <ravi@ximian.com>
20595
20596         * ecore.cs (StandardConversionExists): Return a false
20597         if we are trying to convert the void type to anything else
20598         since that is not allowed.
20599
20600         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20601         we flag error 70 in the event an event is trying to be accessed
20602         directly from outside the declaring type.
20603
20604 2002-08-20  Martin Baulig  <martin@gnome.org>
20605
20606         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20607         MemberCache from typemanager.cs to decl.cs.
20608
20609 2002-08-19  Martin Baulig  <martin@gnome.org>
20610
20611         * class.cs (TypeContainer): Implement IMemberContainer.
20612         (TypeContainer.DefineMembers): Create the MemberCache.
20613         (TypeContainer.FindMembers): Do better BindingFlags checking; only
20614         return public members if BindingFlags.Public was given, check
20615         whether members are static.
20616
20617 2002-08-16  Martin Baulig  <martin@gnome.org>
20618
20619         * decl.cs (DeclSpace.Define): Splitted this in Define and
20620         DefineMembers.  DefineMembers is called first and initializes the
20621         MemberCache.
20622
20623         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
20624         DefineMembers() on all our DeclSpaces.
20625
20626         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20627         but call DefineMembers() on all nested interfaces.  We call their
20628         Define() in our new Define() function.
20629
20630         * interface.cs (Interface): Implement IMemberContainer.
20631         (Interface.Define): Moved all code except the attribute stuf to
20632         DefineMembers().
20633         (Interface.DefineMembers): Initialize the member cache.
20634
20635         * typemanager.cs (IMemberFinder): Removed this interface, we don't
20636         need this anymore since we can use MemberCache.FindMembers directly.
20637
20638 2002-08-19  Martin Baulig  <martin@gnome.org>
20639
20640         * typemanager.cs (MemberCache): When creating the cache for an
20641         interface type, add all inherited members.
20642         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20643         to `out bool used_cache' and documented it.
20644         (TypeManager.MemberLookup): If we already used the cache in the first
20645         iteration, we don't need to do the interfaces check.
20646
20647 2002-08-19  Martin Baulig  <martin@gnome.org>
20648
20649         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
20650         here from IMemberFinder and don't implement this interface anymore.
20651         (DeclSpace.MemberCache): Moved here from IMemberFinder.
20652
20653         * typemanager.cs (IMemberFinder): This interface is now only used by
20654         classes which actually support the member cache.
20655         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20656         since we only put DeclSpaces into this Hashtable.
20657         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20658         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20659
20660 2002-08-16  Martin Baulig  <martin@gnome.org>
20661
20662         * typemanager.cs (ICachingMemberFinder): Removed.
20663         (IMemberFinder.MemberCache): New property.
20664         (TypeManager.FindMembers): Merged this with RealFindMembers().
20665         This function will never be called from TypeManager.MemberLookup()
20666         so we can't use the cache here, just the IMemberFinder.
20667         (TypeManager.MemberLookup_FindMembers): Check whether the
20668         IMemberFinder has a MemberCache and call the cache's FindMembers
20669         function.
20670         (MemberCache): Rewrote larger parts of this yet another time and
20671         cleaned it up a bit.
20672
20673 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
20674
20675         * driver.cs (LoadArgs): Support quoting.
20676
20677         (Usage): Show the CSC-like command line arguments.
20678
20679         Improved a few error messages.
20680
20681 2002-08-15  Martin Baulig  <martin@gnome.org>
20682
20683         * typemanager.cs (IMemberContainer.Type): New property.
20684         (IMemberContainer.IsInterface): New property.
20685
20686         The following changes are conditional to BROKEN_RUNTIME, which is
20687         defined at the top of the file.
20688
20689         * typemanager.cs (MemberCache.MemberCache): Don't add the base
20690         class'es members, but add all members from TypeHandle.ObjectType
20691         if we're an interface.
20692         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
20693         is the current type.
20694         (MemberCache.CacheEntry.Container): Removed this field.
20695         (TypeHandle.GetMembers): Include inherited members.
20696
20697 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20698
20699         * typemanager.cs: fixed compilation and added a comment on a field that
20700         is never used.
20701
20702 2002-08-15  Martin Baulig  <martin@gnome.org>
20703
20704         * class.cs (ConstructorInitializer.Resolve): In the
20705         Expression.MemberLookup call, use the queried_type as
20706         invocation_type.
20707
20708         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
20709         declared' attribute, it's always true.
20710         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
20711         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
20712         temporary wrapper for FindMembers which tells MemberLookup whether
20713         members from the base classes are included in the return value.
20714         This will go away soon.
20715         (TypeManager.MemberLookup): Use this temporary hack here; once the
20716         new MemberCache is completed, we don't need to do the DeclaredOnly
20717         looping here anymore since the MemberCache will take care of this.
20718         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
20719         (MemberCache): When creating the MemberCache for a class, get
20720         members from the current class and all its base classes.
20721         (MemberCache.CacheEntry.Container): New field.  This is a
20722         temporary hack until the Mono runtime is fixed to distinguish
20723         between ReflectedType and DeclaringType.  It allows us to use MCS
20724         with both the MS runtime and the unfixed Mono runtime without
20725         problems and without accecting performance.
20726         (MemberCache.SearchMembers): The DeclaredOnly looping from
20727         TypeManager.MemberLookup is now done here.      
20728
20729 2002-08-14  Martin Baulig  <martin@gnome.org>
20730
20731         * statement.cs (MyStructInfo.MyStructInfo): Don't call
20732         Type.GetFields on dynamic types but get the fields from the
20733         corresponding TypeContainer.
20734         (MyStructInfo.GetStructInfo): Added check for enum types.
20735
20736         * typemanager.cs (MemberList.IsSynchronized): Implemented.
20737         (MemberList.SyncRoot): Implemented.
20738         (TypeManager.FilterWithClosure): No need to check permissions if
20739         closure_start_type == closure_invocation_type, don't crash if
20740         closure_invocation_type is null.
20741
20742 2002-08-13  Martin Baulig  <martin@gnome.org>
20743
20744         Rewrote TypeContainer.FindMembers to use a member cache.  This
20745         gives us a speed increase of about 35% for the self-hosting MCS
20746         build and of about 15-20% for the class libs (both on GNU/Linux).
20747
20748         * report.cs (Timer): New class to get enhanced profiling.  This
20749         whole class is "TIMER" conditional since it remarkably slows down
20750         compilation speed.
20751
20752         * class.cs (MemberList): New class.  This is an IList wrapper
20753         which we're now using instead of passing MemberInfo[]'s around to
20754         avoid copying this array unnecessarily.
20755         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
20756         (ICachingMemberFinder, IMemberContainer): New interface.
20757         (TypeManager.FilterWithClosure): If `criteria' is null, the name
20758         has already been checked, otherwise use it for the name comparision.
20759         (TypeManager.FindMembers): Renamed to RealMemberFinder and
20760         provided wrapper which tries to use ICachingMemberFinder.FindMembers
20761         if possible.  Returns a MemberList, not a MemberInfo [].
20762         (TypeHandle): New class, implements IMemberContainer.  We create
20763         one instance of this class per type, it contains a MemberCache
20764         which is used to do the member lookups.
20765         (MemberCache): New class.  Each instance of this class contains
20766         all members of a type and a name-based hash table.
20767         (MemberCache.FindMembers): This is our new member lookup
20768         function.  First, it looks up all members of the requested name in
20769         the hash table.  Then, it walks this list and sorts out all
20770         applicable members and returns them.
20771
20772 2002-08-13  Martin Baulig  <martin@gnome.org>
20773
20774         In addition to a nice code cleanup, this gives us a performance
20775         increase of about 1.4% on GNU/Linux - not much, but it's already
20776         half a second for the self-hosting MCS compilation.
20777
20778         * typemanager.cs (IMemberFinder): New interface.  It is used by
20779         TypeManager.FindMembers to call FindMembers on a TypeContainer,
20780         Enum, Delegate or Interface.
20781         (TypeManager.finder_to_member_finder): New PtrHashtable.
20782         (TypeManager.finder_to_container): Removed.
20783         (TypeManager.finder_to_delegate): Removed.
20784         (TypeManager.finder_to_interface): Removed.
20785         (TypeManager.finder_to_enum): Removed.
20786
20787         * interface.cs (Interface): Implement IMemberFinder.
20788
20789         * delegate.cs (Delegate): Implement IMemberFinder.
20790
20791         * enum.cs (Enum): Implement IMemberFinder.
20792
20793         * class.cs (TypeContainer): Implement IMemberFinder.
20794
20795 2002-08-12  Martin Baulig  <martin@gnome.org>
20796
20797         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
20798
20799 2002-08-12  Martin Baulig  <martin@gnome.org>
20800
20801         * ecore.cs (ITypeExpression): New interface for expressions which
20802         resolve to a type.
20803         (TypeExpression): Renamed to TypeLookupExpression.
20804         (Expression.DoResolve): If we're doing a types-only lookup, the
20805         expression must implement the ITypeExpression interface and we
20806         call DoResolveType() on it.
20807         (SimpleName): Implement the new ITypeExpression interface.
20808         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
20809         hack, the situation that we're only looking up types can't happen
20810         anymore when this method is called.  Moved the type lookup code to
20811         DoResolveType() and call it.
20812         (SimpleName.DoResolveType): This ITypeExpression interface method
20813         is now doing the types-only lookup.
20814         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
20815         (ResolveFlags): Added MaskExprClass.
20816
20817         * expression.cs (MemberAccess): Implement the ITypeExpression
20818         interface.
20819         (MemberAccess.DoResolve): Added support for a types-only lookup
20820         when we're called via ITypeExpression.DoResolveType().
20821         (ComposedCast): Implement the ITypeExpression interface.
20822
20823         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
20824         Expression.Resolve() with ResolveFlags.Type instead.
20825
20826 2002-08-12  Martin Baulig  <martin@gnome.org>
20827
20828         * interface.cs (Interface.Define): Apply attributes.
20829
20830         * attribute.cs (Attribute.ApplyAttributes): Added support for
20831         interface attributes.
20832
20833 2002-08-11  Martin Baulig  <martin@gnome.org>
20834
20835         * statement.cs (Block.Emit): Only check the "this" variable if we
20836         do not always throw an exception.
20837
20838         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
20839         whether the property has a set accessor.
20840
20841 2002-08-11  Martin Baulig  <martin@gnome.org>
20842
20843         Added control flow analysis support for structs.
20844
20845         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
20846         with control flow analysis turned off.
20847         (IVariable): New interface.
20848         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
20849         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
20850         (FieldExpr.DoResolve): Resolve the instance expression with flow
20851         analysis turned off and do the definite assignment check after the
20852         resolving when we know what the expression will resolve to.
20853
20854         * expression.cs (LocalVariableReference, ParameterReference):
20855         Implement the new IVariable interface, only call the flow analysis
20856         code if ec.DoFlowAnalysis is true.
20857         (This): Added constructor which takes a Block argument.  Implement
20858         the new IVariable interface.
20859         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
20860         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
20861         This does the definite assignment checks for struct members.
20862
20863         * class.cs (Constructor.Emit): If this is a non-static `struct'
20864         constructor which doesn't have any initializer, call
20865         Block.AddThisVariable() to tell the flow analysis code that all
20866         struct elements must be initialized before control returns from
20867         the constructor.
20868
20869         * statement.cs (MyStructInfo): New public class.
20870         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
20871         argument to this indexer.  If non-zero, check an individual struct
20872         member, not the whole struct.
20873         (FlowBranching.CheckOutParameters): Check struct members.
20874         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
20875         overloaded versions of these methods which take an additional
20876         `int field_idx' argument to check struct members.
20877         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
20878         overloaded versions of these methods which take an additional
20879         `string field_name' argument to check struct member.s
20880         (VariableInfo): Implement the IVariable interface.
20881         (VariableInfo.StructInfo): New public property.  Returns the
20882         MyStructInfo instance of the variable if it's a struct or null.
20883         (Block.AddThisVariable): New public method.  This is called from
20884         Constructor.Emit() for non-static `struct' constructor which do
20885         not have any initializer.  It creates a special variable for the
20886         "this" instance variable which will be checked by the flow
20887         analysis code to ensure that all of the struct's fields are
20888         initialized before control returns from the constructor.
20889         (UsageVector): Added support for struct members.  If a
20890         variable/parameter is a struct with N members, we reserve a slot
20891         in the usage vector for each member.  A struct is considered fully
20892         initialized if either the struct itself (slot 0) or all its
20893         members are initialized.
20894
20895 2002-08-08  Martin Baulig  <martin@gnome.org>
20896
20897         * driver.cs (Driver.MainDriver): Only report an error CS5001
20898         if there were no compilation errors.
20899
20900         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
20901         `UnsafeContext' property to determine whether the parent is in
20902         unsafe context rather than checking the parent's ModFlags:
20903         classes nested in an unsafe class are unsafe as well.
20904
20905 2002-08-08  Martin Baulig  <martin@gnome.org>
20906
20907         * statement.cs (UsageVector.MergeChildren): Distinguish between
20908         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
20909         we return.  Added test17() and test18() to test-154.cs.
20910
20911 2002-08-08  Martin Baulig  <martin@gnome.org>
20912
20913         * typemanager.cs (TypeManager.FilterWithClosure): If we have
20914         Family access, make sure the invoking type isn't a subclass of the
20915         queried type (that'd be a CS1540).
20916
20917         * ecore.cs (Expression.MemberLookup): Added overloaded version of
20918         this method which takes an additional `Type invocation_type'.
20919
20920         * expression.cs (BaseAccess.DoResolve): Use the base type as
20921         invocation and query type.
20922         (MemberAccess.DoResolve): If the lookup failed and we're about to
20923         report a CS0122, try a lookup with the ec.ContainerType - if this
20924         succeeds, we must report a CS1540.
20925
20926 2002-08-08  Martin Baulig  <martin@gnome.org>
20927
20928         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
20929         (MethodGroupExpr): Implement the IMemberExpr interface.
20930
20931         * expression (MemberAccess.ResolveMemberAccess): No need to have
20932         any special code for MethodGroupExprs anymore, they're now
20933         IMemberExprs.   
20934
20935 2002-08-08  Martin Baulig  <martin@gnome.org>
20936
20937         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
20938         Family, FamANDAssem and FamORAssem permissions.
20939         (TypeManager.IsSubclassOrNestedChildOf): New public method.
20940
20941 2002-08-08  Martin Baulig  <martin@gnome.org>
20942
20943         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
20944         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
20945         or loop block.
20946
20947 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
20948
20949         * driver.cs: implemented /resource option to embed managed resources.
20950
20951 2002-08-07  Martin Baulig  <martin@gnome.org>
20952
20953         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
20954         (FieldBase.HasFieldInitializer): New public property.
20955         (FieldBase.GetInitializerExpression): New public method.  Resolves and
20956         returns the field initializer and makes sure it is only resolved once.
20957         (TypeContainer.EmitFieldInitializers): Call
20958         FieldBase.GetInitializerExpression to get the initializer, this ensures
20959         that it isn't resolved multiple times.
20960
20961         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
20962         the resolving process (SimpleName/MemberLookup) that we're currently
20963         emitting a field initializer (which must not access any instance members,
20964         this is an error CS0236).
20965
20966         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
20967         argument, if the `IsFieldInitializer' flag is set, we must report and
20968         error CS0236 and not an error CS0120.   
20969
20970 2002-08-07  Martin Baulig  <martin@gnome.org>
20971
20972         * ecore.cs (IMemberExpr): New public interface.
20973         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
20974         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
20975         if the expression is an IMemberExpr.
20976
20977         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
20978         to be null, implicitly default to `this' if we're non-static in
20979         this case.  Simplified the code a lot by using the new IMemberExpr
20980         interface.  Also fixed bug #28176 here.
20981
20982 2002-08-06  Martin Baulig  <martin@gnome.org>
20983
20984         * cs-parser.jay (SimpleLookup): Removed.  We need to create
20985         ParameterReferences during semantic analysis so that we can do a
20986         type-only search when resolving Cast, TypeOf and SizeOf.
20987         (block): Pass the `current_local_parameters' to the Block's
20988         constructor.
20989
20990         * class.cs (ConstructorInitializer): Added `Parameters parameters'
20991         argument to the constructor.
20992         (ConstructorInitializer.Resolve): Create a temporary implicit
20993         block with the parameters.
20994
20995         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
20996         references here if we aren't doing a type-only search.
20997
20998         * statement.cs (Block): Added constructor which takes a
20999         `Parameters parameters' argument.
21000         (Block.Parameters): New public property.
21001
21002         * support.cs (InternalParameters.Parameters): Renamed `parameters'
21003         to `Parameters' and made it public readonly.
21004
21005 2002-08-06  Martin Baulig  <martin@gnome.org>
21006
21007         * ecore.cs (Expression.Warning): Made this public as well.
21008
21009         * report.cs (Report.Debug): Print the contents of collections.
21010
21011 2002-08-06  Martin Baulig  <martin@gnome.org>
21012
21013         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
21014         used to tell Resolve() which kinds of expressions it may return.
21015         (Expression.Resolve): Added overloaded version of this method which
21016         takes a `ResolveFlags flags' argument.  This can be used to tell
21017         Resolve() which kinds of expressions it may return.  Reports a
21018         CS0118 on error.
21019         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21020         ResolveFlags.SimpleName.
21021         (Expression.Error118): Added overloaded version of this method which
21022         takes a `ResolveFlags flags' argument.  It uses the flags to determine
21023         which kinds of expressions are allowed.
21024
21025         * expression.cs (Argument.ResolveMethodGroup): New public method.
21026         Resolves an argument, but allows a MethodGroup to be returned.
21027         This is used when invoking a delegate.
21028
21029         * TODO: Updated a bit.
21030
21031 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21032
21033         Fixed compilation with csc.
21034
21035         * ecore.cs: Expression.Error made public. Is this correct? Should
21036         Warning be made public too?
21037
21038         * expression.cs: use ea.Location instead of ea.loc.
21039         [FIXME:  Filed as bug #28607: MCS must report these errors.]
21040
21041 2002-08-06  Martin Baulig  <martin@gnome.org>
21042
21043         * ecore.cs (Expression.loc): Moved the location here instead of
21044         duplicating it in all derived classes.
21045         (Expression.Location): New public property.
21046         (Expression.Error, Expression.Warning): Made them non-static and
21047         removed the location argument.
21048         (Expression.Warning): Added overloaded version which takes an
21049         `int level' argument.
21050         (Expression.Error118): Make this non-static and removed the
21051         expression and location arguments.
21052         (TypeExpr): Added location argument to the constructor.
21053
21054         * expression.cs (StaticCallExpr): Added location argument to
21055         the constructor.
21056         (Indirection, PointerArithmetic): Likewise.
21057         (CheckedExpr, UnCheckedExpr): Likewise.
21058         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21059         (StringPtr): Likewise.
21060
21061
21062 2002-08-05  Martin Baulig  <martin@gnome.org>
21063
21064         * expression.cs (BaseAccess.DoResolve): Actually report errors.
21065
21066         * assign.cs (Assign.DoResolve): Check whether the source
21067         expression is a value or variable.
21068
21069         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21070         while resolving the corresponding blocks.
21071
21072         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21073         an error, don't silently return null.
21074
21075         * statement.cs (Block.AddVariable): Do the error reporting here
21076         and distinguish between CS0128 and CS0136.
21077         (Block.DoResolve): Report all unused labels (warning CS0164).
21078         (LabeledStatement): Pass the location to the constructor.
21079         (LabeledStatement.HasBeenReferenced): New property.
21080         (LabeledStatement.Resolve): Set it to true here.
21081
21082         * statement.cs (Return.Emit): Return success even after reporting
21083         a type mismatch error (CS0126 or CS0127), this is what csc does and
21084         it avoids confusing the users with any consecutive errors.
21085
21086 2002-08-05  Martin Baulig  <martin@gnome.org>
21087
21088         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21089
21090         * const.cs (Const.LookupConstantValue): Catch circular definitions.
21091
21092         * expression.cs (MemberAccess.DoResolve): Silently return if an
21093         error has already been reported.
21094
21095         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21096         error has already been reported.
21097
21098 2002-08-05  Martin Baulig  <martin@gnome.org>
21099
21100         * statement.cs (UsageVector): Only initialize the `parameters'
21101         vector if we actually have any "out" parameters.
21102
21103 2002-08-05  Martin Baulig  <martin@gnome.org>
21104
21105         * expression.cs (Binary.ResolveOperator): When combining delegates,
21106         they must have the same type.
21107
21108 2002-08-05  Martin Baulig  <martin@gnome.org>
21109
21110         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21111         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21112         work with the ms runtime and we also don't need it: if we're a
21113         PropertyBuilder and not in the `indexer_arguments' hash, then we
21114         are a property and not an indexer.
21115
21116         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21117         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21118         since the latter one doesn't work with the ms runtime.
21119
21120 2002-08-03  Martin Baulig  <martin@gnome.org>
21121
21122         Fixed bugs #27998 and #22735.
21123
21124         * class.cs (Method.IsOperator): New public field.
21125         (Method.CheckBase): Report CS0111 if there's already a method
21126         with the same parameters in the current class.  Report CS0508 when
21127         attempting to change the return type of an inherited method.
21128         (MethodData.Emit): Report CS0179 if a method doesn't have a body
21129         and it's not marked abstract or extern.
21130         (PropertyBase): New abstract base class for Property and Indexer.
21131         (PropertyBase.CheckBase): Moved here from Property and made it work
21132         for indexers.
21133         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21134         the same so we can reuse it there.
21135         (Property, Indexer): Derive from PropertyBase.
21136         (MethodSignature.inheritable_property_signature_filter): New delegate
21137         to find properties and indexers.
21138
21139         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21140         argument and improved error reporting.
21141
21142         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21143         EmptyReadOnlyParameters and made it a property.
21144
21145         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21146         version of this method which takes a `PropertyInfo indexer'.
21147         (TypeManager.RegisterIndexer): New method.
21148
21149         * class.cs: Added myself as author of this file :-)
21150
21151 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21152
21153         * class.cs: fixed compilation on windoze.
21154
21155 2002-08-03  Martin Baulig  <martin@gnome.org>
21156
21157         * interface.cs (Interface.GetInterfaceBases): Check whether all
21158         base interfaces are at least as accessible than the current one.
21159
21160         * class.cs (TypeContainer.GetClassBases): Check whether base types
21161         are at least as accessible than the current type.
21162         (TypeContainer.AsAccessible): Implemented and made non-static.
21163         (MemberBase.CheckParameters): Report errors if the accessibility
21164         checks fail.
21165
21166         * delegate.cs (Delegate.Delegate): The default visibility is
21167         internal for top-level types and private for nested types.
21168         (Delegate.Define): Report errors if the accessibility checks fail.
21169
21170         * enum.cs (Enum.Enum): The default visibility is internal for
21171         top-level types and private for nested types.
21172         (Enum.DefineType): Compute the correct visibility.
21173
21174         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21175         function which takes a `bool is_toplevel' instead of a TypeContainer.
21176
21177         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21178         builtin type.
21179
21180 2002-08-02  Martin Baulig  <martin@gnome.org>
21181
21182         * expression.cs (LocalVariableReferenc): Added constructor which
21183         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21184         (LocalVariableReference.IsReadOnly): New property.
21185         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21186         variable is readonly, use our own readonly flag to do this; you can
21187         use the new constructor to get a writable reference to a read-only
21188         variable.
21189
21190         * cs-parser.jay (foreach_statement, using_statement): Get a writable
21191         reference to the local variable.
21192
21193 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
21194
21195         * rootcontext.cs (ResolveCore): Also include System.Exception
21196
21197         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21198         we reach an EmptyStatement.
21199
21200         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21201         is also fine.
21202
21203         * expression.cs (Binary.ResolveOperator): Check error result in
21204         two places.
21205
21206         use brtrue/brfalse directly and avoid compares to null.
21207
21208 2002-08-02  Martin Baulig  <martin@gnome.org>
21209
21210         * class.cs (TypeContainer.Define): Define all nested interfaces here.
21211         Fixes bug #28407, added test-155.cs.
21212
21213 2002-08-01  Martin Baulig  <martin@gnome.org>
21214
21215         * class.cs (Event.EmitDefaultMethod): Make this work with static
21216         events.  Fixes #28311, added verify-3.cs.
21217
21218 2002-08-01  Martin Baulig  <martin@gnome.org>
21219
21220         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21221         `is_disposable' fields.
21222         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21223         `hm.is_disposable' if we're using the collection pattern.
21224         (Foreach.EmitCollectionForeach): Use the correct type for the
21225         enumerator's local variable, only emit the try/finally block if
21226         necessary (fixes #27713).
21227
21228 2002-08-01  Martin Baulig  <martin@gnome.org>
21229
21230         * ecore.cs (Expression.report118): Renamed to Error118 and made
21231         it public static.
21232
21233         * statement.cs (Throw.Resolve): Check whether the expression is of
21234         the correct type (CS0118) and whether the type derives from
21235         System.Exception (CS0155).
21236         (Catch.Resolve): New method.  Do the type lookup here and check
21237         whether it derives from System.Exception (CS0155).
21238         (Catch.CatchType, Catch.IsGeneral): New public properties.
21239
21240         * typemanager.cs (TypeManager.exception_type): Added.
21241
21242 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
21243
21244         * driver.cs: Updated About function.
21245
21246 2002-07-31  Martin Baulig  <martin@gnome.org>
21247
21248         Implemented Control Flow Analysis.
21249
21250         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21251         (EmitContext.CurrentBranching): Added.
21252         (EmitContext.StartFlowBranching): Added.
21253         (EmitContext.EndFlowBranching): Added.
21254         (EmitContext.KillFlowBranching): Added.
21255         (EmitContext.IsVariableAssigned): Added.
21256         (EmitContext.SetVariableAssigned): Added.
21257         (EmitContext.IsParameterAssigned): Added.
21258         (EmitContext.SetParameterAssigned): Added.
21259         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21260         Added control flow analysis stuff here.
21261
21262         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21263         resolve the expression as lvalue.
21264         (LocalVariableReference.DoResolve): Check whether the variable has
21265         already been assigned.
21266         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21267         the parameter as assigned here.
21268         (ParameterReference.DoResolve): Check whether the parameter has already
21269         been assigned.
21270         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21271         expression as lvalue.
21272
21273         * statement.cs (FlowBranching): New class for the flow analysis code.
21274         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21275         (LabeledStatement.IsDefined): New public property.
21276         (LabeledStatement.AddUsageVector): New public method to tell flow
21277         analyis that the label may be reached via a forward jump.
21278         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21279         flow analysis.
21280         (VariableInfo.Number): New public field.  This is used by flow analysis
21281         to number all locals of a block.
21282         (Block.CountVariables): New public property.  This is the number of
21283         local variables in this block (including the locals from all parent
21284         blocks).
21285         (Block.EmitMeta): Number all the variables.
21286
21287         * statement.cs: Added flow analysis support to all classes.
21288
21289 2002-07-31  Martin Baulig  <martin@gnome.org>
21290
21291         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21292         To get debugging messages, compile mcs with /define:MCS_DEBUG and
21293         then use this argument.
21294
21295         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21296
21297         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21298         use this to specify /define options.
21299
21300 2002-07-29  Martin Baulig  <martin@gnome.org>
21301
21302         * statement.cs (Fixed): Moved all code that does variable lookups
21303         and resolvings from Emit to Resolve.
21304
21305         * statement.cs (For): Moved all code that does variable lookups
21306         and resolvings from Emit to Resolve.
21307
21308         * statement.cs (Using): Moved all code that does variable lookups
21309         and resolvings from Emit to Resolve.
21310
21311 2002-07-29  Martin Baulig  <martin@gnome.org>
21312
21313         * attribute.cs (Attribute.Resolve): Explicitly catch a
21314         System.NullReferenceException when creating the
21315         CustromAttributeBuilder and report a different warning message.
21316
21317 2002-07-29  Martin Baulig  <martin@gnome.org>
21318
21319         * support.cs (ParameterData.ParameterName): Added method to
21320         get the name of a parameter.
21321
21322         * typemanager.cs (TypeManager.IsValueType): New public method.
21323
21324 2002-07-29  Martin Baulig  <martin@gnome.org>
21325
21326         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
21327         is a flag which specifies that it's either ref or out.
21328         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21329         the out parameter to `out Parameter.Modifier mod', also set the
21330         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21331
21332         * support.cs (InternalParameters.ParameterModifier): Distinguish
21333         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21334         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21335
21336         * expression.cs (Argument.GetParameterModifier): Distinguish
21337         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21338         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21339
21340 2002-07-29  Martin Baulig  <martin@gnome.org>
21341
21342         * expression.cs (ParameterReference.ParameterReference): Added
21343         `Location loc' argument to the constructor.
21344
21345         * cs-parser.jay: Pass location to ParameterReference.
21346
21347 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
21348
21349         * statement.cs (Try): Initialize the location.
21350
21351         * cs-parser.jay: pass location to Try.
21352
21353         * expression.cs (Unary.Reduce): Change the prototype to return
21354         whether a constant fold could be performed or not.  The result is
21355         returned in an out parameters.  In the case of Indirection and
21356         AddressOf, we want to perform the full tests.
21357
21358 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
21359
21360         * statement.cs (Statement.Emit): Flag dead code.
21361
21362 2002-07-27  Andrew Birkett  <andy@nobugs.org>
21363
21364         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21365
21366 2002-07-27  Martin Baulig  <martin@gnome.org>
21367
21368         * class.cs (MethodData.Define): Put back call to
21369         TypeManager.AddMethod(), accidentally commented this out.
21370
21371         * report.cs (Debug): New public method to print debugging information,
21372         this is `[Conditional ("DEBUG")]'.
21373
21374 2002-07-26  Martin Baulig  <martin@gnome.org>
21375
21376         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21377         (switch_statement): Push the current_block to the switch_stack and
21378         pop it again when we're done with the switch.
21379         (switch_section): The new block is a child of the current_block.
21380         Fixes bug #24007, added test-152.cs.
21381
21382 2002-07-27  Martin Baulig  <martin@gnome.org>
21383
21384         * expression.cs (Invocation.EmitArguments): When calling a varargs
21385         function with only its fixed arguments, we need to pass an empty
21386         array.
21387
21388 2002-07-27  Martin Baulig  <martin@gnome.org>
21389
21390         Mono 0.13 has been released.
21391
21392 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
21393
21394         * driver.cs: Rename --resource to --linkres, because that is what
21395         we do currently, we dont support --resource yet.
21396
21397         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21398
21399 2002-07-25  Martin Baulig  <martin@gnome.org>
21400
21401         * class.cs (MethodData): New public class.  This is a `method builder'
21402         class for a method or one accessor of a Property/Indexer/Event.
21403         (MethodData.GetMethodFlags): Moved here from MemberBase.
21404         (MethodData.ApplyAttributes): Likewise.
21405         (MethodData.ApplyObsoleteAttribute): Likewise.
21406         (MethodData.ApplyConditionalAttribute): Likewise.
21407         (MethodData.ApplyDllImportAttribute): Likewise.
21408         (MethodData.CheckAbstractAndExternal): Likewise.
21409         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21410         (MethodData.Emit): Formerly known as Method.Emit().
21411         (MemberBase): Moved everything which was specific to a single
21412         accessor/method to MethodData.
21413         (Method): Create a new MethodData and call Define() and Emit() on it.
21414         (Property, Indexer, Event): Create a new MethodData objects for each
21415         accessor and call Define() and Emit() on them.
21416
21417 2002-07-25  Martin Baulig  <martin@gnome.org>
21418
21419         Made MethodCore derive from MemberBase to reuse the code from there.
21420         MemberBase now also checks for attributes.
21421
21422         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21423         (MemberBase.GetMethodFlags): Moved here from class Method and marked
21424         as virtual.
21425         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21426         `CallingConventions cc' and `Attributes opt_attrs' arguments.
21427         (MemberBase.ApplyAttributes): New virtual method; applies the
21428         attributes to a method or accessor.
21429         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21430         (MemberBase.ApplyConditionalAttribute): Likewise.
21431         (MemberBase.ApplyDllImportAttribute): Likewise.
21432         (MemberBase.CheckAbstractAndExternal): Likewise.
21433         (MethodCore.ParameterTypes): This is now a property instead of a
21434         method, it's initialized from DoDefineParameters().
21435         (MethodCore.ParameterInfo): Removed the set accessor.
21436         (MethodCore.DoDefineParameters): New protected virtual method to
21437         initialize ParameterTypes and ParameterInfo.
21438         (Method.GetReturnType): We can now simply return the MemberType.
21439         (Method.GetMethodFlags): Override the MemberBase version and add
21440         the conditional flags.
21441         (Method.CheckBase): Moved some code from Define() here, call
21442         DoDefineParameters() here.
21443         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21444         here to avoid some larger code duplication.
21445         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21446         ensure that abstract and external accessors don't declare a body.
21447
21448         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21449         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21450         lookup in the attribute's parent classes, so we need to abort as soon
21451         as we found the first match.
21452         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21453         the attribute has no arguments.
21454
21455         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21456         of a Method.
21457
21458 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21459
21460         * cs-parser.jay: reverted previous patch.
21461
21462 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21463
21464         * cs-parser.jay: fixed bug #22119.
21465
21466 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21467
21468         * attribute.cs: fixed compilation. The error was:
21469         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
21470         be assigned to before control leaves the current method."
21471         [FIXME:  Filed as bug #28186: MCS must report this error.]
21472
21473 2002-07-25  Martin Baulig  <martin@gnome.org>
21474
21475         * attribute.cs (Attribute.Conditional_GetConditionName): New static
21476         method to pull the condition name ouf of a Conditional attribute.
21477         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21478         the obsolete message and error flag out of an Obsolete attribute.
21479
21480         * class.cs (Method.GetMethodFlags): New public method to get the
21481         TypeManager.MethodFlags for this method.
21482         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21483         private methods.
21484         (Method.Define): Get and apply the Obsolete and Conditional attributes;
21485         if we're overriding a virtual function, set the new private variable
21486         `parent_method'; call the new TypeManager.AddMethod().
21487
21488         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
21489         the MethodBuilder and the Method in a PtrHashtable.
21490         (TypeManager.builder_to_method): Added for this purpose.
21491         (TypeManager.MethodFlags): Added IsObsoleteError.
21492         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
21493         Obsolete and Conditional arguments in MethodBuilders.  If we discover
21494         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21495         the message from the attribute.
21496
21497 2002-07-24  Martin Baulig  <martin@gnome.org>
21498
21499         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21500         preprocessor directives, ensure that the argument to #define/#undef is
21501         exactly one identifier and that it's actually an identifier.
21502
21503         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21504         did not work ....
21505
21506 2002-07-24  Martin Baulig  <martin@gnome.org>
21507
21508         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21509         initialize it to TypeManager.object_type in the constructor.
21510         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21511         of the `hm.get_current' method if we're using the collection pattern.
21512         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21513         for the explicit conversion to make it work when we're using the collection
21514         pattern and the `Current' property has a different return type than `object'.
21515         Fixes #27713.
21516
21517 2002-07-24  Martin Baulig  <martin@gnome.org>
21518
21519         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21520         does not match, but don't report any errors.  This method is called in
21521         order for all methods in a MethodGroupExpr until a matching method is
21522         found, so we don't want to bail out if the first method doesn't match.
21523         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21524         matches, report the 123.  Fixes #28070.
21525
21526 2002-07-24  Martin Baulig  <martin@gnome.org>
21527
21528         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21529         TypeManager.TypeToCoreType() to the top of the method so the
21530         following equality checks will work.  Fixes #28107.
21531
21532 2002-07-24  Martin Baulig  <martin@gnome.org>
21533
21534         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21535         operand is of type uint, and the other operand is of type sbyte,
21536         short or int, the operands are converted to type long." -
21537         Actually do what this comment already told us.  Fixes bug #28106,
21538         added test-150.cs.
21539
21540 2002-07-24  Martin Baulig  <martin@gnome.org>
21541
21542         * class.cs (MethodBase): New abstract class.  This is now a base
21543         class for Property, Indexer and Event to avoid some code duplication
21544         in their Define() and DefineMethods() methods.
21545         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21546         generic methods for Define() and DefineMethods().
21547         (FieldBase): Derive from MemberBase, not MemberCore.
21548         (Property): Derive from MemberBase, not MemberCore.
21549         (Property.DefineMethod): Moved all the code from this method to the
21550         new MethodBase.DefineAccessor(), just call it with appropriate
21551         argumetnts.
21552         (Property.Define): Call the new Property.DoDefine(), this does some
21553         sanity checks and we don't need to duplicate the code everywhere.
21554         (Event): Derive from MemberBase, not MemberCore.
21555         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21556         accessors, this will also make them work with interface events.
21557         (Indexer): Derive from MemberBase, not MemberCore.
21558         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21559         (Indexer.Define): Use the new MethodBase functions.
21560
21561         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21562         argument to the constructor.
21563         (Interface.FindMembers): Added support for interface events.
21564         (Interface.PopluateEvent): Implemented.
21565
21566         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
21567
21568 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
21569
21570         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21571         but this is required to check for a method name being the same as
21572         the containing class.  
21573
21574         Handle this now.
21575
21576 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21577
21578         * interface.cs: initialize variable.
21579
21580 2002-07-23  Martin Baulig  <martin@gnome.org>
21581
21582         Implemented the IndexerName attribute in interfaces.
21583
21584         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21585         name if this is an explicit interface implementation.
21586         (Indexer.InterfaceIndexerName): New public variable.  If we're
21587         implementing an interface indexer, this is the IndexerName in that
21588         interface.  Otherwise, it's the IndexerName.
21589         (Indexer.DefineMethod): If we're implementing interface indexer,
21590         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
21591         and Pending.ImplementIndexer methods.
21592         (Indexer.Define): Also define the PropertyBuilder if we're
21593         implementing an interface indexer and this is neither an explicit
21594         interface implementation nor do the IndexerName match the one in
21595         the interface.
21596
21597         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21598         If a method is defined here, then we always need to create a proxy
21599         for it.  This is used when implementing interface indexers.
21600         (Pending.IsInterfaceIndexer): New public method.
21601         (Pending.ImplementIndexer): New public method.
21602         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21603         This is used when implementing interface indexers to define a proxy
21604         if necessary.
21605         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21606         define a proxy if necessary.
21607
21608         * interface.cs (Interface.IndexerName): New public variable.
21609         (Interface.PopulateIndexer): Set the IndexerName.
21610         (Interface.DefineIndexers): New private method.  Populate all the
21611         indexers and make sure their IndexerNames match.
21612
21613         * typemanager.cs (IndexerPropertyName): Added support for interface
21614         indexers.
21615
21616 2002-07-22  Martin Baulig  <martin@gnome.org>
21617
21618         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21619         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21620         ret if HasReturnLabel.
21621         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21622         variables.
21623
21624         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21625         and set the ec.LoopBeginTryCatchLevel.
21626         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21627         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21628         the current ec.TryCatchLevel, the branch goes out of an exception
21629         block.  In this case, we need to use Leave and not Br.
21630
21631 2002-07-22  Martin Baulig  <martin@gnome.org>
21632
21633         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21634         block unless the block does not always return or it is contained in
21635         another try { ... } catch { ... } block.  Fixes bug #26506.
21636         Added verify-1.cs to the test suite.
21637
21638 2002-07-22  Martin Baulig  <martin@gnome.org>
21639
21640         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21641         then we do not always return.  Fixes bug #24985.
21642
21643 2002-07-22  Martin Baulig  <martin@gnome.org>
21644
21645         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21646         lookup on a per-class level; ie. walk up the class hierarchy until we
21647         found at least one applicable method, then choose the best among them.
21648         Fixes bug #24463 and test-29.cs.
21649
21650 2002-07-22  Martin Baulig  <martin@gnome.org>
21651
21652         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21653         return types of the methods.  The return type is not part of the
21654         signature and we must not check it to make the `new' modifier work.
21655         Fixes bug #27999, also added test-147.cs.
21656         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21657
21658         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21659         on the method's return type.
21660
21661 2002-07-21  Martin Baulig  <martin@gnome.org>
21662
21663         * assign.cs: Make this work if the rightmost source is a constant and
21664         we need to do an implicit type conversion.  Also adding a few more tests
21665         to test-38.cs which should have caught this.
21666
21667         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21668         target in the makefile for this.  The makefile.gnu is primarily intended
21669         for end-users who don't want to debug the compiler.
21670
21671 2002-07-21  Martin Baulig  <martin@gnome.org>
21672
21673         * assign.cs: Improved the Assign class so it can now handle embedded
21674         assignments (X = Y = Z = something).  As a side-effect this'll now also
21675         consume less local variables.  test-38.cs now passes with MCS, added
21676         a few new test cases to that test.
21677
21678 2002-07-20  Martin Baulig  <martin@gnome.org>
21679
21680         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
21681         instructions.  Fixes bug #27977, also added test-146.cs.
21682
21683 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21684
21685         * cs-tokenizer.cs: fixed getHex ().
21686
21687 2002-07-19  Martin Baulig  <martin@gnome.org>
21688
21689         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
21690         not Type.GetType() to lookup the array type.  This is needed when
21691         we're constructing an array of a user-defined type.
21692         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
21693         single-dimensional arrays, but also for single-dimensial arrays of
21694         type decimal.
21695
21696 2002-07-19  Martin Baulig  <martin@gnome.org>
21697
21698         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
21699         this function is called, it's not allowed to share LocalBuilders
21700         among ILGenerators.
21701
21702 2002-07-19  Martin Baulig  <martin@gnome.org>
21703
21704         * expression.cs (Argument.Resolve): Report an error 118 when trying
21705         to pass a type as argument.
21706
21707 2002-07-18  Martin Baulig  <martin@gnome.org>
21708
21709         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
21710         Conv_R_Un for the signed `long' type.
21711
21712 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
21713
21714         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
21715         `expr' for the temporary result, as that will fail if we do
21716         multiple resolves on the same expression.
21717
21718 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
21719
21720         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
21721         ec.TypeContainer for looking up aliases. 
21722
21723         * class.cs (TypeContainer): Remove LookupAlias from here.
21724
21725         * decl.cs (DeclSpace); Move here.
21726
21727 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
21728
21729         * class.cs (FindMembers): Only call filter if the constructor
21730         bulider is not null.
21731
21732         Also handle delegates in `NestedTypes' now.  Now we will perform
21733         type lookups using the standard resolution process.  This also
21734         fixes a bug.
21735
21736         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
21737         This uses Expressions (the limited kind that can be parsed by the
21738         tree) instead of strings.
21739
21740         * expression.cs (ComposedCast.ToString): Implement, used to flag
21741         errors since now we have to render expressions.
21742
21743         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
21744         FormArrayType. 
21745
21746         * ecore.cs (SimpleName.ToString): ditto.
21747
21748         * cs-parser.jay: Instead of using strings to assemble types, use
21749         Expressions to assemble the type (using SimpleName, ComposedCast,
21750         MemberAccess).  This should fix the type lookups in declarations,
21751         because we were using a different code path for this.
21752
21753         * statement.cs (Block.Resolve): Continue processing statements
21754         even when there is an error.
21755
21756 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
21757
21758         * class.cs (Event.Define): Also remove the `remove' method from
21759         the list of pending items.
21760
21761         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
21762         generate more compact code. 
21763
21764 2002-07-17  Martin Baulig  <martin@gnome.org>
21765
21766         * const.cs (Const.LookupConstantValue): Add support for constant
21767         `unchecked' and `checked' expressions.
21768         Also adding test case test-140.cs for this.
21769
21770 2002-07-17  Martin Baulig  <martin@gnome.org>
21771
21772         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
21773         check whether mi.ReturnType implements the IEnumerator interface; the
21774         `==' and the IsAssignableFrom() will fail in this situation.
21775
21776 2002-07-16  Ravi Pratap  <ravi@ximian.com>
21777
21778         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
21779         here too.
21780
21781 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21782
21783         * expression.cs: fixed bug #27811.
21784
21785 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
21786
21787         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
21788         Molaro: when we are a ref, the value already contains a pointer
21789         value, do not take the address of it.
21790
21791 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21792         * removed mb-parser.jay and mb-tokenizer.cs
21793
21794 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
21795
21796         * expression.cs: check against the building corlib void type.
21797
21798 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
21799
21800         * ecore.cs: fix for valuetype static readonly fields: when 
21801         initializing them, we need their address, not the address of a copy.
21802
21803 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
21804
21805         * typemanager.cs: register also enum_type in corlib.
21806
21807 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
21808
21809         * class.cs: allow calling this (but not base) initializers in structs.
21810
21811 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
21812
21813         * ecore.cs: make sure we compare against the building base types
21814         in GetTypeSize ().
21815
21816 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
21817
21818         * typemanager.cs: fix TypeToCoreType() to handle void and object
21819         (corlib gets no more typerefs after this change).
21820
21821 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
21822
21823         * expression.cs (ArrayCreation.EmitArrayArguments): use
21824         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
21825
21826         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
21827         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
21828         array indexes, the runtime actually forbids them.
21829
21830         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
21831         for array arguments here.
21832
21833         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
21834         instead of the default for ValueTypes.
21835
21836         (New.DoEmit): Use IsValueType instead of
21837         IsSubclassOf (value_type)
21838         (New.DoResolve): ditto.
21839         (Invocation.EmitCall): ditto.
21840
21841         * assign.cs (Assign): ditto.
21842
21843         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
21844         Statements *are* currently doing part of their resolution during
21845         Emit.  
21846
21847         Expressions do always resolve during resolve, but statements are
21848         only required to propagate resolution to their children.
21849
21850 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
21851
21852         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
21853
21854         (LoadAssembly): Do not add the dll if it is already specified
21855
21856         (MainDriver): Add the System directory to the link path at the end,
21857         after all the other -L arguments. 
21858
21859         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
21860         wrong opcode for loading bytes and bools (ldelem.i1 instead of
21861         ldelem.u1) and using the opposite for sbytes.
21862
21863         This fixes Digger, and we can finally run it.
21864
21865         * driver.cs (UnixParseOption): Move the option parsing here.  
21866         (CSCParseOption): Implement CSC-like parsing of options.
21867
21868         We now support both modes of operation, the old Unix way, and the
21869         new CSC-like way.  This should help those who wanted to make cross
21870         platform makefiles.
21871
21872         The only thing broken is that /r:, /reference: and /lib: are not
21873         implemented, because I want to make those have the same semantics
21874         as the CSC compiler has, and kill once and for all the confussion
21875         around this.   Will be doing this tomorrow.
21876
21877         * statement.cs (Unsafe.Resolve): The state is checked during
21878         resolve, not emit, so we have to set the flags for IsUnsfe here.
21879
21880 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
21881
21882         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
21883         not catch the Error_ObjectRefRequired in SimpleName (as it is
21884         possible to have a class/instance variable name that later gets
21885         deambiguated), we have to check this here.      
21886
21887 2002-07-10  Ravi Pratap  <ravi@ximian.com>
21888
21889         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
21890         make static and put into Expression.
21891
21892         (Event.Define): Register the private field of the event with the 
21893         TypeManager so that GetFieldFromEvent can get at it.
21894
21895         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
21896         keep track of the private field associated with an event which
21897         has no accessors.
21898
21899         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
21900         private field.
21901
21902         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
21903
21904 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
21905
21906         * expression.cs (Binary.EmitBranchable): this routine emits the
21907         Binary expression in a branchable context.  This basically means:
21908         we need to branch somewhere, not just get the value on the stack.
21909
21910         This works together with Statement.EmitBoolExpression.
21911
21912         * statement.cs (Statement.EmitBoolExpression): Use
21913         EmitBranchable. 
21914
21915 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
21916
21917         * statement.cs (For): Reduce the number of jumps in loops.
21918
21919         (For): Implement loop inversion for the For statement.
21920
21921         (Break): We can be breaking out of a Try/Catch controlled section
21922         (foreach might have an implicit try/catch clause), so we need to
21923         use Leave instead of Br.
21924
21925         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
21926         now).  If the instace expression supports IMemoryLocation, we use
21927         the AddressOf method from the IMemoryLocation to extract the
21928         address instead of emitting the instance.
21929
21930         This showed up with `This', as we were emitting the instance
21931         always (Emit) instead of the Address of This.  Particularly
21932         interesting when This is a value type, as we dont want the Emit
21933         effect (which was to load the object).
21934
21935 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
21936
21937         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
21938
21939         * statement.cs (Checked): Set the CheckedState during the resolve
21940         process too, as the ConvCast operations track the checked state on
21941         the resolve process, and not emit.
21942
21943         * cs-parser.jay (namespace_member_declaration): Flag that we have
21944         found a declaration when we do.  This is used to flag error 1529
21945
21946         * driver.cs: Report ok when we display the help only.
21947
21948 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
21949
21950         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
21951
21952 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
21953
21954         * cs-tokenizer.cs (define): We also have to track locally the
21955         defines.  AllDefines is just used for the Conditional Attribute,
21956         but we also need the local defines for the current source code. 
21957
21958 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
21959
21960         * statement.cs (While, For, Do): These loops can exit through a
21961         Break statement, use this information to tell whether the
21962         statement is the last piece of code.
21963
21964         (Break): Flag that we break.
21965
21966         * codegen.cs (EmitContexts): New `Breaks' state variable.
21967
21968 2002-07-03  Martin Baulig  <martin@gnome.org>
21969
21970         * class.cs (TypeContainer.MethodModifiersValid): Allow override
21971         modifiers in method declarations in structs.  Otherwise, you won't
21972         be able to override things like Object.Equals().
21973
21974 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
21975
21976         * class.cs (Method, Property, Indexer): Do not allow the public
21977         modifier to be used in explicit interface implementations.
21978
21979         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
21980         override modifiers in method declarations in structs
21981
21982 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
21983
21984         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
21985         integer or real overflow, report an error
21986
21987 2002-07-02  Martin Baulig  <martin@gnome.org>
21988
21989         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
21990         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
21991         to tell the runtime about our newly created System.Object and
21992         System.ValueType types.
21993
21994 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
21995
21996         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
21997         struct instead of Ldarg/Starg.
21998
21999 2002-07-02  Martin Baulig  <martin@gnome.org>
22000
22001         * expression.cs (Indirection.Indirection): Call
22002         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22003
22004 2002-07-02  Martin Baulig  <martin@gnome.org>
22005
22006         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22007         ValueType, call TypeManager.TypeToCoreType() on it.
22008         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22009         the OpCodes.Newarr argument.
22010
22011 2002-07-02  Martin Baulig  <martin@gnome.org>
22012
22013         * expression.cs (Invocation.EmitCall): When compiling corlib,
22014         replace all calls to the system's System.Array type to calls to
22015         the newly created one.
22016
22017         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22018         System.Array methods.
22019         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22020         from the system's System.Array type which must be replaced.
22021
22022 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22023
22024         * typemanager.cs: load unverifiable_code_ctor so we can build
22025         corlib using the correct type. Avoid using GetTypeCode() with
22026         TypeBuilders.
22027         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22028         TypeManager.object_type to allow building corlib.
22029
22030 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22031
22032         * ecore.cs: handle System.Enum separately in LoadFromPtr().
22033
22034 2002-07-01  Martin Baulig  <martin@gnome.org>
22035
22036         * class.cs: Make the last change actually work, we need to check
22037         whether `ifaces != null' to avoid a crash.
22038
22039 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22040
22041         * class.cs: when we build structs without fields that implement
22042         interfaces, we need to add the interfaces separately, since there is
22043         no API to both set the size and add the interfaces at type creation
22044         time.
22045
22046 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22047
22048         * expression.cs: the dimension arguments to the array constructors
22049         need to be converted if they are a long.
22050
22051 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22052
22053         * class.cs: don't emit ldarg.0 if there is no parent constructor
22054         (fixes showstopper for corlib).
22055
22056 2002-06-29  Martin Baulig  <martin@gnome.org>
22057
22058         MCS now compiles corlib on GNU/Linux :-)
22059
22060         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22061         ie. check for MethodImplOptions.InternalCall.
22062
22063         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22064         and TypeManager.attribute_type are null, so we must explicitly check
22065         whether parent is not null to find out whether it's an attribute type.
22066         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22067         and SetBuilder, not only if the property is neither abstract nor external.
22068         This is necessary to set the MethodImplOptions on the accessor methods.
22069         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22070         SetBuilder, see Property.Emit().
22071
22072         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22073         populate "System.Object", "System.ValueType" and "System.Attribute" since
22074         they've already been populated from BootCorlib_PopulateCoreTypes().
22075
22076 2002-06-29  Martin Baulig  <martin@gnome.org>
22077
22078         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22079         is the NullLiteral, we also need to make sure that target_type is not
22080         an enum type.   
22081
22082 2002-06-29  Martin Baulig  <martin@gnome.org>
22083
22084         * rootcontext.cs (RootContext.ResolveCore): We must initialize
22085         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22086         before calling BootstrapCorlib_ResolveDelegate ().
22087
22088 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22089
22090         * statement.cs: fixed build-breaker. All tests passed ok.
22091
22092 2002-06-27  Martin Baulig  <martin@gnome.org>
22093
22094         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22095         for System.Decimal when compiling corlib.
22096
22097 2002-06-27  Martin Baulig  <martin@gnome.org>
22098
22099         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22100         switch blocks which contain nothing but a default clause.
22101
22102 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
22103
22104        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22105
22106 2002-06-27  Martin Baulig  <martin@gnome.org>
22107
22108         * ecore.cs (PropertyExpr.PropertyExpr): Call
22109         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22110
22111         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22112         is already a TypeBuilder.
22113
22114 2002-06-27  Martin Baulig  <martin@gnome.org>
22115
22116         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22117         `target_type == TypeManager.array_type', not IsAssignableFrom() in
22118         the "from an array-type to System.Array" case.  This makes it work
22119         when compiling corlib.
22120
22121 2002-06-27  Martin Baulig  <martin@gnome.org>
22122
22123         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22124         non-static PropertyExpr, set its InstanceExpression.  This makes
22125         the `ICollection.Count' property work in System/Array.cs.
22126
22127 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
22128
22129         * driver.cs: Made error handling more consistent.  Errors now
22130         tracked by Report class, so many methods which used to return int
22131         now return void.  Main() now prints success/failure and 
22132         errors/warnings message.
22133
22134         Renamed '--probe' compiler argument to '--expect-error'.  Removed
22135         the magic number return values (123 and 124).  Now, if the
22136         expected error occurs, the compiler exits with success (exit value
22137         0).  If the compilation completes without seeing that particular
22138         error, the compiler exits with failure (exit value 1).  The
22139         makefile in mcs/errors has been changed to handle the new behaviour.
22140
22141         * report.cs: Made 'expected error' number a property and renamed
22142         it from 'Probe' to 'ExpectedError'.
22143
22144         * genericparser.cs: Removed error handling support, since it is
22145         now all done by Report class.
22146
22147         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22148         class, so parse() no longer returns an int.
22149
22150         * namespace.cs: Use Report.Error instead of GenericParser.error
22151
22152 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
22153
22154         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22155         TypeContainer.AddOperator): At the front of the list put the
22156         explicit implementations, so they get resolved/defined first. 
22157
22158 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
22159
22160         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22161         interface type is implemented by this TypeContainer.  Used during
22162         explicit interface implementation.
22163
22164         (Property.Define, Indexer.Define, Method.Define): Validate that
22165         the given interface in the explicit implementation is one of the
22166         base classes for the containing type.
22167
22168         Also if we are explicitly implementing an interface, but there is
22169         no match in the pending implementation table, report an error.
22170
22171         (Property.Define): Only define the property if we are
22172         not explicitly implementing a property from an interface.  Use the
22173         correct name also for those properties (the same CSC uses,
22174         although that is really not needed).
22175
22176         (Property.Emit): Do not emit attributes for explicitly implemented
22177         properties, as there is no TypeBuilder.
22178
22179         (Indexer.Emit): ditto.
22180
22181         Hiding then means that we do not really *implement* a pending
22182         implementation, which makes code fail.
22183
22184 2002-06-22  Martin Baulig  <martin@gnome.org>
22185
22186         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22187         the return value of Object.GetType().  [FIXME: we need to do this whenever
22188         we get a type back from the reflection library].
22189
22190 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22191
22192         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22193
22194 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
22195
22196         * attribute.cs: Return null if we can not look up the type.
22197
22198         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22199         the interface types found.
22200
22201         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22202         interface types found.
22203
22204         * typemanager.cs (GetInterfaces): Make this routine returns alll
22205         the interfaces and work around the lame differences between
22206         System.Type and System.Reflection.Emit.TypeBuilder in the results
22207         result for GetInterfaces.
22208
22209         (ExpandInterfaces): Given an array of interface types, expand and
22210         eliminate repeated ocurrences of an interface.  This expands in
22211         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22212         be IA, IB, IC.
22213
22214 2002-06-21  Martin Baulig  <martin@gnome.org>
22215
22216         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22217         on System.Enum.
22218
22219 2002-06-21  Martin Baulig  <martin@gnome.org>
22220
22221         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
22222         and called with one of the core types, return the corresponding typebuilder for
22223         that type.
22224
22225         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22226         element type.
22227
22228 2002-06-21  Martin Baulig  <martin@gnome.org>
22229
22230         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22231         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22232         (Expression.ConvertReferenceExplicit): Likewise.
22233
22234         * expression.cs (ElementAccess.DoResolve): Likewise.
22235         (ElementAccess.DoResolveLValue): Likewise.
22236
22237 2002-06-10  Martin Baulig  <martin@gnome.org>
22238
22239         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22240         add the "value" parameter to the parameter list.
22241
22242         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22243         to our caller.
22244
22245 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
22246
22247         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22248         the argument to an int, uint, long or ulong, per the spec.  Also
22249         catch negative constants in array creation.
22250
22251 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22252
22253         * class.cs: do not allow the same interface to appear twice in
22254         the definition list.
22255
22256 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22257
22258         * ecore.cs: don't use ldlen with System.Array.
22259
22260 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22261
22262         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22263
22264 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22265
22266         * modifiers.cs: produce correct field attributes for protected
22267         internal. Easy fix so miguel can work on ther harder stuff:-)
22268
22269 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
22270
22271         * pending.cs: New file.  Move the code from class.cs here.
22272         Support clearning the pending flag for all methods (when not doing
22273         explicit interface implementation).
22274
22275 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22276
22277         * rootcontext.cs: added a couple more types needed to bootstrap.
22278
22279 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
22280
22281         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22282         constructor in the type, instead of any constructor in the type
22283         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
22284         a bug in the Mono runtime when applying the params attribute). 
22285
22286 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
22287         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22288
22289 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
22290
22291         * expression.cs (Unary.ResolveOperator): Use TypeManager
22292         to resolve the type.
22293
22294 2002-06-13  Ravi Pratap  <ravi@ximian.com>
22295
22296         * cs-parser.jay (enum_member_declaration): Pass in the attributes
22297         attached.
22298
22299         * enum.cs (AddEnumMember): Add support to store the attributes associated 
22300         with each member too.
22301
22302         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22303         field builders too - this takes care of the enum member case.
22304
22305 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
22306
22307         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22308         address-of operator on both value types and pointers.
22309
22310 2002-06-10  Martin Baulig  <martin@gnome.org>
22311
22312         * interface.cs (Interface.PopulateIndexer): Add the indexer's
22313         PropertyBuilder to the `property_builders' list.
22314
22315         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22316         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22317         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
22318         find any indexers which are inherited from an interface.
22319
22320 2002-06-09  Martin Baulig  <martin@gnome.org>
22321
22322         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22323         the same type as the constant if necessary.  There's also a test-130.cs
22324         for this.
22325
22326         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22327
22328         * typemanager.cs (TypeManager.ChangeType): Previously known as
22329         Enum.ChangeEnumType().
22330
22331 2002-06-09  Martin Baulig  <martin@gnome.org>
22332
22333         * expression.cs (Cast.TryReduce): Added support for consts.
22334
22335 2002-06-08  Ravi Pratap  <ravi@ximian.com>
22336
22337         * class.cs (Accessor): Hold attributes information so we can pass
22338         it along.
22339
22340         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22341         Modify to pass in attributes attached to the methods.
22342
22343         (add_accessor_declaration, remove_accessor_declaration): Ditto.
22344
22345         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22346         to handle the Accessor kind :-)
22347
22348         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22349
22350 2002-06-08  Martin Baulig  <martin@gnome.org>
22351
22352         * expression.cs (Unary.TryReduceNegative): Added support for
22353         ULongConstants.
22354
22355 2002-06-08  Martin Baulig  <martin@gnome.org>
22356
22357         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22358         name can't be found in the `defined_names' - the caller will do a
22359         MemberLookup in this case and thus find methods in System.Enum
22360         such as Enum.IsDefined().
22361
22362 2002-06-08  Martin Baulig  <martin@gnome.org>
22363
22364         * enum.cs (Enum.ChangeEnumType): This is a custom version of
22365         Convert.ChangeType() which works with TypeBuilder created types.
22366         (Enum.LookupEnumValue, Enum.Define): Use it here.
22367
22368         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22369         `TypeBuilder.BaseType != null' check.
22370         (TypeContainer.FindMembers): Only lookup parent members if we
22371         actually have a parent.
22372         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22373         (ConstructorInitializer.Resolve): Likewise.
22374
22375         * interface.cs (Interface.FindMembers): Added
22376         `TypeBuilder.BaseType != null' check.
22377
22378         * rootcontext.cs (RootContext.ResolveCore): Added
22379         "System.Runtime.CompilerServices.IndexerNameAttribute" to
22380         classes_second_stage.
22381
22382         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22383         debug_type and trace_type when compiling with --nostdlib.       
22384
22385 2002-06-07  Martin Baulig  <martin@gnome.org>
22386
22387         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22388         (AddField): Set it to true when adding a non-static field.
22389         (DefineType): Use `have_nonstatic_fields' to find out whether we
22390         have non-static fields, not `Fields != null'.
22391
22392 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
22393
22394         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22395         dereferencing a null on the static-field code path)
22396
22397 2002-05-30  Martin Baulig  <martin@gnome.org>
22398
22399         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22400         to take command line arguments.  Use reflection to call the new
22401         custom `Initialize' function on the symbol writer and pass it the
22402         command line arguments.
22403
22404         * driver.cs (--debug-args): New command line argument to pass command
22405         line arguments to the symbol writer.
22406
22407 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
22408
22409         * assign.cs (DoResolve): Forgot to do the implicit conversion to
22410         the target type for indexers and properties.  Thanks to Joe for
22411         catching this.
22412
22413 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
22414
22415         * typemanager.cs (MethodFlags): returns the method flags
22416         (Obsolete/ShouldIgnore) that control warning emission and whether
22417         the invocation should be made, or ignored. 
22418
22419         * expression.cs (Invocation.Emit): Remove previous hack, we should
22420         not do this on matching a base type, we should do this based on an attribute
22421
22422         Only emit calls to System.Diagnostics.Debug and
22423         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22424         on the command line.
22425
22426         * rootcontext.cs: Global settings for tracing and debugging.
22427
22428         * cs-tokenizer.cs (define): New utility function to track
22429         defines.   Set the global settings for TRACE and DEBUG if found.
22430
22431 2002-05-25  Ravi Pratap  <ravi@ximian.com>
22432
22433         * interface.cs (Populate*): Pass in the TypeContainer as well as
22434         the DeclSpace as parameters so that we can create EmitContexts and
22435         then use that to apply attributes etc.
22436
22437         (PopulateMethod, PopulateEvent, PopulateProperty)
22438         (PopulateIndexer): Apply attributes everywhere.
22439
22440         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22441         etc.
22442
22443         (ApplyAttributes): Update accordingly.
22444
22445         We now apply interface attributes for all members too.
22446
22447 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
22448
22449         * class.cs (Indexer.Define); Correctly check if we are explicit
22450         implementation (instead of checking the Name for a ".", we
22451         directly look up if the InterfaceType was specified).
22452
22453         Delay the creation of the PropertyBuilder.
22454
22455         Only create the PropertyBuilder if we are not an explicit
22456         interface implementation.   This means that explicit interface
22457         implementation members do not participate in regular function
22458         lookups, and hence fixes another major ambiguity problem in
22459         overload resolution (that was the visible effect).
22460
22461         (DefineMethod): Return whether we are doing an interface
22462         implementation. 
22463
22464         * typemanager.cs: Temporary hack until we get attributes in
22465         interfaces (Ravi is working on that) and we get IndexerName
22466         support in interfaces.
22467
22468         * interface.cs: Register the indexers as properties.
22469
22470         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22471         warning, I have verified that this is a bug in the .NET runtime
22472         (JavaScript suffers of the same problem).
22473
22474         * typemanager.cs (MemberLookup): When looking up members for
22475         interfaces, the parent of an interface is the implicit
22476         System.Object (so we succeed in searches of Object methods in an
22477         interface method invocation.  Example:  IEnumerable x;  x.ToString
22478         ()) 
22479
22480 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
22481
22482         * class.cs (Event): Events should also register if they do
22483         implement the methods that an interface requires.
22484
22485         * typemanager.cs (MemberLookup); use the new GetInterfaces
22486         method. 
22487
22488         (GetInterfaces): The code used to lookup interfaces for a type is
22489         used in more than one place, factor it here. 
22490
22491         * driver.cs: Track the errors at the bottom of the file, we kept
22492         on going.
22493
22494         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22495         instance if the method we are calling is static!
22496
22497 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
22498
22499         * attribute.cs (ApplyAttributes): Make this function filter out
22500         the IndexerName attribute (as that attribute in reality is never
22501         applied) and return the string constant for the IndexerName
22502         attribute. 
22503
22504         * class.cs (TypeContainer.Emit): Validate that all the indexers
22505         have the same IndexerName attribute, and if so, set the
22506         DefaultName attribute on the class. 
22507
22508         * typemanager.cs: The return value might contain other stuff (not
22509         only methods).  For instance, consider a method with an "Item"
22510         property and an Item method.
22511
22512         * class.cs: If there is a problem with the parameter types,
22513         return. 
22514
22515 2002-05-24  Ravi Pratap  <ravi@ximian.com>
22516
22517         * ecore.cs (ImplicitConversionExists): Wrapper function which also
22518         looks at user defined conversion after making a call to 
22519         StandardConversionExists - we need this for overload resolution.
22520
22521         * expression.cs : Update accordingly the various method calls.
22522
22523         This fixes 2 bugs filed against implicit user defined conversions 
22524
22525 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
22526
22527         * statement.cs: Track the result of the assignment.
22528
22529 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
22530
22531         * expression.cs (MemberAccess): Improved error reporting for
22532         inaccessible members.
22533
22534 2002-05-22  Martin Baulig  <martin@gnome.org>
22535
22536         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
22537         itself with debugging support.
22538
22539 2002-05-22  Martin Baulig  <martin@gnome.org>
22540
22541         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22542         Removed, this isn't needed anymore.
22543
22544 2002-05-20  Martin Baulig  <martin@gnome.org>
22545
22546         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22547         be underlying type for an enum.
22548
22549 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
22550
22551         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22552         that splits out the loading of just the core types.
22553
22554         * rootcontext.cs (ResolveCore): Split the struct resolution in
22555         two, so we can load the enumeration underlying types before any
22556         enums are used.
22557
22558         * expression.cs (Is): Bandaid until we fix properly Switch (see
22559         bug #24985 for details).
22560
22561         * typemanager.cs (ImplementsInterface): The hashtable will contain
22562         a null if there are no interfaces implemented.
22563
22564 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
22565
22566         * cs-parser.jay (indexer_declarator): It is fine to have array
22567         parameters
22568
22569 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22570
22571         * typemanager.cs: (RegisterBuilder): New function used to register
22572         TypeBuilders that implement interfaces.  Since
22573         TypeBuilder.GetInterfaces (as usual) does not work with lame
22574         Reflection.Emit. 
22575         (AddUserType): register interfaces.
22576
22577         (ImplementsInterface): Use the builder_to_ifaces hash if we are
22578         dealing with TypeBuilder.  Also, arrays are showing up as
22579         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22580         methods can not be invoked on them!
22581
22582         * ecore.cs (ExplicitReferenceConversionExists): Made public.
22583         (ImplicitReferenceConversionExists): Split out from
22584         StandardConversionExists. 
22585
22586         * expression.cs (As): We were only implementing one of the three
22587         cases for the as operator.  We now implement them all.
22588         (Is): Implement the various other cases for Is as well.
22589
22590         * typemanager.cs (CACHE): New define used to control if we want or
22591         not the FindMembers cache.  Seems to have a negative impact on
22592         performance currently
22593
22594         (MemberLookup): Nested types have full acess to
22595         enclosing type members
22596
22597         Remove code that coped with instance/static returns for events, we
22598         now catch this in RealFindMembers.
22599
22600         (RealFindMembers): only perform static lookup if the instance
22601         lookup did not return a type or an event.  
22602
22603 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22604
22605         * assign.cs (CompoundAssign): We pass more semantic information
22606         now to Compound Assignments than we did before: now we have all
22607         the information at hand, and now we resolve the target *before* we
22608         do the expression expansion, which allows the "CacheValue" method
22609         to have the effect we intended (before, a [x] += 1 would generate
22610         two differen ArrayAccess expressions from the ElementAccess,
22611         during the resolution process).
22612
22613         (CompoundAssign.DoResolve): Resolve target and original_source here.
22614
22615 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
22616
22617         * expression.cs (ArrayAccess): dropped debugging information. 
22618
22619         * typemanager.cs: Small bug fix: I was always returning i_members,
22620         instead of one of i_members or s_members (depending on which had
22621         the content).
22622
22623         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
22624         method is invoked before any code generation takes place, and it
22625         is a mechanism to inform that the expression will be invoked more
22626         than once, and that the method should use temporary values to
22627         avoid having side effects
22628
22629         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22630
22631         * ecore.cs (Expression.CacheTemporaries): Provide empty default
22632         implementation.
22633
22634         * expression.cs (Indirection, ArrayAccess): Add support for
22635         CacheTemporaries in these two bad boys. 
22636
22637         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22638         ldobj or ldind_ref.  
22639         (StoreFromPtr): Handle stobj as well.
22640
22641         * expression.cs (UnaryMutator): Share more code.
22642
22643         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22644         down: I was not tracking the Filter function as well, which
22645         was affecting the results of the cache.
22646
22647 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
22648
22649         * attribute.cs: Remove the hack to handle the CharSet property on
22650         StructLayouts. 
22651
22652 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
22653
22654         * attribute.cs (DoResolve): More uglyness, we now only try to
22655         resolve the attribute partially, to extract the CharSet
22656         information (only if we are a StructLayout attribute).  Otherwise 
22657
22658         (GetExtraTypeInfo): Add some code to conditionally kill in the
22659         future this.   I am more and more convinced that the .NET
22660         framework has special code to handle the attribute setting on
22661         certain elements.
22662
22663         * expression.cs (IsParamsMethodApplicable): Revert my previous
22664         foreach change here, it was wrong.
22665
22666 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
22667
22668         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22669         (pp_expr): do not abort on unknown input, just return.
22670         (eval): abort if there are pending chars.
22671
22672         * attribute.cs (Attribute.Resolve): Positional parameters are
22673         optional.  Deal with that case.
22674
22675         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
22676         the Ansi/Unicode/Auto information for the type.
22677
22678         (TypeContainer.DefineType): instantiate the EmitContext here, as
22679         we will be using it during the type definition (to resolve
22680         attributes) and during the emit phase.
22681
22682         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
22683         to pull type information out of the attributes
22684
22685         (Attribute.Resolve): track the constructor builder, and allow for
22686         multiple invocations (structs and classes will use this).
22687
22688         * ecore.cs (MemberLookupFinal): new version with all the
22689         parameters customizable.
22690
22691         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
22692         constructors.  Return if the result value is null (as the error
22693         would have been flagged already by MemberLookupFinal)
22694
22695         Do not allow instances of abstract classes or interfaces to be
22696         created.
22697
22698         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
22699         We have to compare the assembly property here when dealing with
22700         FamANDAssem and Assembly access modifiers, because we might be
22701         creating an assembly from *modules* (that means that we are not
22702         getting TypeBuilders for types defined in other modules that are
22703         part of this assembly).
22704
22705         (Method.Emit): If the method is marked abstract and has a body,
22706         emit an error. 
22707
22708         (TypeContainer.DefineMembers): If both the defined member and the
22709         parent name match are methods, then do not emit any warnings: let
22710         the Method.Define routine take care of flagging warnings.  But if
22711         there is a mismatch (method overrides something else, or method is
22712         overriwritten by something, then emit warning).
22713
22714         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
22715         set to null, this means `do not check for the return type on the
22716         signature'. 
22717
22718         (Method.Define): set the return type for the method signature to
22719         null, so that we get methods with the same name and parameters and
22720         different return types.  This is used to flag warning 114 (you are
22721         hiding a method, and you probably want to use the new/override
22722         keywords instead).
22723
22724         * typemanager.cs (MemberLookup): Implemented proper access
22725         control, closing a long standing set of bug reports.  The problem
22726         was that the Framework only has two bits: Public and NonPublic,
22727         and NonPublic includes private and protected methods, but we need
22728         to enforce the FamANDAssem, FamOrAssem and Family. 
22729
22730 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
22731
22732         * statement.cs (GotoCase): Return true: Ammounts to giving up
22733         knowledge on whether we return or not, and letting the other case
22734         be responsible for it.
22735
22736 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
22737
22738         * driver.cs: Do not load directories for each file processed, only
22739         do it if there is a pattern.
22740
22741         * ecore.cs: Report readonly assigns here as well, as we might have
22742         been resolved only by MemberAccess.
22743
22744         (SimpleName.SimpleNameResolve): Also be useful for LValue
22745         resolution.   We need this to propagate assign to local readonly variables
22746
22747         * typemanager.cs: Use a ptrhashtable for the criteria, because we
22748         do not want to reuse potential criteria memory.
22749
22750         * class.cs (MyEventBuilder): Set reflected_type;
22751
22752         * ecore.cs (Constantify): Added support for constifying bools.
22753
22754         (RootContext.LookupType): Added a cache for values looked up in
22755         the declaration space.
22756
22757         * typemanager.cs (FindMembers): Now is a front-end to
22758         RealFindMembers, and provides a two-level hashtable-based cache to
22759         the request.  
22760
22761         15% performance improvement: from 22.5 to 19.2 seconds.
22762
22763         * expression.cs (IsParamsMethodApplicable): use foreach.
22764         (Invocation.DoResolve): ditto.
22765         (New.DoResolve): ditto.
22766         (ArrayCreation.DoResolve): ditto.
22767
22768         * ecore.cs (FindMostEncompassingType): use foreach.
22769
22770         * delegate.cs (NewDelegate.DoResolve): Use foreach
22771
22772         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
22773         (RemoveMethods): use foreach.
22774
22775         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
22776         nested foreach statements instead of for, and also break out of
22777         the inner loop once a match is found.
22778
22779         (Invocation.OverloadResolve): Use foreach, simplify the code. 
22780
22781 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
22782
22783         * cfold.cs (BinaryFold): During an enumeration evaluation context,
22784         we actually unwrap the expression to allow for extra information
22785         to be extracted. 
22786
22787         * expression.cs: Use Shr_Un on unsigned operations. 
22788
22789 2002-05-08  Ravi Pratap  <ravi@ximian.com>
22790
22791         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
22792         applicable operators was not being considered correctly. This closes
22793         the bug Miguel reported.
22794
22795 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
22796
22797         * attribute.cs: check that the type derives from System.Attribute
22798         and report the correct error in that case (moved the duplicate code to
22799         its own method, too).
22800
22801 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
22802
22803         * attribute.cs: lookup attribute type name as the spec says: first the
22804         bare attribute name and then name + "Attribute" (nant compiles with
22805         mcs after this fix).
22806
22807 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
22808
22809         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
22810         Because of the way we parse things, we should try to see if a
22811         UIntConstant can fit in an integer.
22812
22813 2002-05-07  Ravi Pratap  <ravi@ximian.com>
22814
22815         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
22816         when we are in an explicit context.
22817
22818         (ConvertReferenceExplicit): When converting from Iface type S to Class
22819         T make sure the rules are implemented as an OR.
22820
22821         * parameter.cs (ParameterType): Make it a property for now although the
22822         purpose really isn't anything immediate.
22823
22824         * expression.cs (Is*Applicable): Do better checking on the parameter type
22825         of a ref/out parameter. The ones from the system assemblies are already 
22826         marked with the correct type so we don't need to do any correction.
22827
22828         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
22829         the object type is standard too so include that.
22830
22831 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
22832
22833         * ecore.cs (StandardConversionExists): Augment with missing code:
22834         deal with IntConstant, LongConstants and Enumerations.
22835
22836         * assign.cs: Report the error, instead of failing silently
22837
22838         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
22839         typecontainer that they are declared, because the
22840         typecontainer/namespace will have the list of using clauses that
22841         need to be applied.
22842
22843         Assembly Attributes were escaping the normal registration
22844         mechanism. 
22845
22846         (EmitCode): Apply attributes within an EmitContext that represents
22847         the container they were declared on.
22848
22849         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
22850
22851 2002-05-06  Ravi Pratap  <ravi@ximian.com>
22852
22853         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
22854         Revamp completely - make much cleaner as we now operate only
22855         on a set of Types.
22856
22857         (FindMostSpecificSource, FindMostSpecificTarget): New methods
22858         to implement the logic detailed in the spec more correctly.
22859
22860         (UserDefinedConversion): Update accordingly.
22861
22862 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
22863
22864         * statement.cs: Return flow analysis information up.
22865
22866         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
22867         and the default.
22868
22869         (token): Do not consume an extra character before calling
22870         decimal_digits.
22871
22872 2002-05-06  Piers Haken <piersh@friskit.com>
22873
22874         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
22875
22876 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
22877
22878         * class.cs (Constructor.Emit): Set the IsStatic flag in the
22879         EmitContext during the instance constructor initializer
22880         resolution, to stop access to instance variables.
22881
22882         This is mandated by the spec, last paragraph of the `constructor
22883         initializers' section. 
22884
22885 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
22886
22887         * cs-parser.jay, class.cs (Accessor): new class used to represent
22888         an accessor (get or set).  In the past we used `null' to represent
22889         a missing accessor.  But this is ambiguous because there was no
22890         way to tell in abstract indexers/properties if one of them was
22891         specified.
22892
22893         Now there is a way of addressing that.
22894
22895         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
22896         instead of FindMembers.
22897
22898         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
22899         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
22900
22901         * attribute.cs: Treat indexers and properties as the same in terms
22902         of applying attributes
22903
22904         * ecore.cs (FindMostEncompassedType): Use statically initialized
22905         EmptyExpressions()s like we do elsewhere to avoid creating useless
22906         objects (and we take this out of the tight loop).
22907
22908         (GetConversionOperators): Move the code to extract the actual
22909         operators to a separate routine to clean things up.
22910
22911 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
22912
22913         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
22914         events are always registered FieldBuilders.
22915
22916         * class.cs (FieldBase): New class shared by Fields 
22917
22918         * delegate.cs: If we are a toplevel delegate, use our full name.
22919         If we are a nested delegate, then only use our tail name.
22920
22921 2002-05-02  Ravi Pratap  <ravi@ximian.com>
22922
22923         * expression.cs (IsApplicable): Ensure that we add the "&" to
22924         ref/out types before comparing it with the type of the argument.
22925
22926         (IsParamsMethodApplicable): Ditto.
22927
22928         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
22929         silly me ;-)
22930
22931         * delegate.cs : Handle the case when we have more than one applicable
22932         method. Flag an error only when we finish checking all.
22933
22934 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
22935
22936         * expression.cs: Add support for boolean static initializers.
22937
22938 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
22939
22940         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
22941
22942         * parameter.cs (ComputeParameterTypes,
22943         ComputeAndDefineParameterTypes): Better error handling: now we
22944         clear the `types' cache if we fail during any of the type lookups.
22945         We also return the status code correctly to our caller
22946
22947         * delegate.cs: If we fail to define a delegate, abort the extra
22948         steps. 
22949
22950         * expression.cs (Binary.ResolveOperator): for
22951         operator==(object,object) and operator !=(object, object) we also
22952         have to verify that there is an implicit conversion from one to
22953         the other.
22954
22955         (ArrayAccess.DoResolve): Array Access can operate on
22956         non-variables. 
22957
22958 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
22959
22960         * assign.cs (CompoundAssign): A new class used as a "flag" that
22961         the assignment actually is happening as part of a compound
22962         assignment operator.
22963
22964         During compound assignment, a few new rules exist to enable things
22965         like:
22966
22967         byte b |= 1 + 2
22968
22969         From the spec:
22970
22971         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
22972         to the type of x) if y is implicitly convertible to the type of x,
22973         and the operator is a builtin operator and the return type of the
22974         operator is explicitly convertible to the type of x. 
22975
22976         * rootcontext.cs: Reset warning level to 2.  4 catches various
22977         "interesting" features in mcs, we must clean this up at some
22978         point, but currently am trying to kill other bugs ;-)
22979
22980         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
22981         in container classes as well.  
22982
22983         * expression.cs (Binary.ResolveOperator): Handle string case
22984         before anything else (as operator overloading does emit an error
22985         before doing anything else).
22986
22987         This code could go away when we move to a table driven model, but
22988         i could not come up with a good plan last night.
22989
22990 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
22991
22992         * typemanager.cs (CSharpName): reimplementation using regex.
22993         * class.cs: added null check for fields in Emit
22994         * rootcontext.cs: set warninglevel to 4
22995
22996 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
22997
22998         * typemanager.cs (CSharpName): reimplemented with Lupus
22999         suggestion.
23000
23001 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
23002
23003         * statement.cs (If): correclty implement Resolve, because we were
23004         not catching sem errors in there.  The same process is needed
23005         everywhere else. 
23006         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23007
23008
23009         (Statement.Warning_DeadCodeFound): Factorize code.
23010         (While): Report dead code here too.
23011
23012         (Statement): Added Resolve virtual method to allow
23013         for resolution split from the emit code.
23014
23015 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23016
23017         * statement.cs (EmitBoolExpression): No longer try to resolve the
23018         expression here.    
23019         (MakeBoolean): New utility function that resolve, implicitly
23020         converts to boolean and tags the expression. 
23021
23022
23023         (If, Do): Implement dead code elimination.
23024         (While): Implement loop inversion
23025
23026         (Do, While, For, If): Resolve the expression prior to calling our
23027         code generation.
23028
23029 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
23030
23031         * class.cs:
23032           - added method Report28 (warning: program has more than one entry point)
23033           - added method IsEntryPoint, implements paragraph 10.1 of the spec
23034           - modified method Method.Define, the part at the end of the method
23035
23036         * rootcontext.cs: added static public Location EntryPointLocation;
23037           
23038         * ../errors/cs0028.cs : Add test case for the above warning.              
23039
23040         * typemanager.cs:
23041           - modified method CSharpName to allow arrays of primitive type to
23042             be printed nicely (e.g. instead of System.Int32[][] it now prints
23043             int[][])
23044           - added method CSharpSignature: returns the signature of a method
23045             in string format to be used in reporting errors, warnings, etc.
23046
23047         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23048         with String.Empty.
23049
23050 2002-04-26  Ravi Pratap  <ravi@ximian.com>
23051
23052         * delegate.cs (Define): Fix extremely silly bug where I was
23053         setting the type of the 'object' parameter of the BeginInvoke
23054         method to System.IAsyncResult instead of System.Object ;-)
23055
23056 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23057
23058         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23059         here. 
23060
23061         (Constructor.Emit): return if we fail to initialize the
23062         constructor.  Another door closed!  
23063
23064         * expression.cs (New.DoResolve): Improve error message (from -6 to
23065         1501).  Use DeclaredOnly lookup to find the exact constructor.
23066
23067         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23068         loop.  This is useful.
23069
23070         * cs-parser.jay: Adjust the default parameters so that destructors
23071         have the proper signature.
23072
23073 2002-04-26  Martin Baulig  <martin@gnome.org>
23074
23075         * driver.cs (LoadAssembly): If `assembly' contains any characters
23076         which are only valid in path names and not in assembly names
23077         (currently slash, backslash and point), use Assembly.LoadFrom ()
23078         instead of Assembly.Load () on the `assembly' (before iteration
23079         over the link_paths).
23080
23081 2002-04-26  Martin Baulig  <martin@gnome.org>
23082
23083         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23084
23085 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
23086
23087         * class.cs (Property): use the new typemanager.MemberLookup
23088
23089         (TypeContainer.MemberLookup): Implement using the
23090         TypeManager.MemberLookup now. 
23091
23092         * typemanager.cs: Make MemberLookup a function of the TypeManager,
23093         and return MemberInfos, so that these can be used without an
23094         EmitContext (what we had before).
23095
23096 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
23097
23098         * expression.cs: Fix the case where the argument to params if the
23099         type of the params.  I omitted handling this before.   Fixed
23100
23101 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23102
23103         * driver.cs: Call BootCorlib_PopulateCoreType
23104
23105         * class.cs (Property.CheckBase): Check for properties only, not
23106         for all members. 
23107
23108         * interface.cs: Temporary hack: try/catch around the
23109         CustomAttributeBuilder, because I am getting an exception that I
23110         do not understand.
23111
23112         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23113         types whose definitions are required to be there (attributes are
23114         defined before standard types).
23115
23116         Compute definitions as we boot the various types, as they are used
23117         immediately (value_type class will need object_type, but if we do
23118         not initialize object_type, we will pass a null, which will let
23119         the runtime pick the System.Object from the existing corlib, which
23120         is not what we want).
23121
23122 2002-04-22  Patrik Torstensson <totte@labs2.com>
23123
23124         * cs-tokenizer.cs: fixed a number of trim() issues.
23125
23126 2002-04-22  Ravi Pratap  <ravi@ximian.com>
23127
23128         * expression.cs (Argument.Type): Ensure that we return the correct
23129         type when we have out or ref parameters [in which case we 
23130         append a "&"].
23131
23132 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23133
23134         * class.cs (Property, Indexer): Allow extern modifier in there. 
23135
23136         * typemanager.cs (InitBaseTypes): Initializes object_type and
23137         value_type, since those will be used early on during the bootstrap
23138         process to compile corlib.
23139
23140         (InitCoreTypes): Move code from here to InitBaseTypes.
23141
23142 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
23143
23144         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23145         single-dimension arrays as using the ldlen opcode.  
23146
23147         Daniel Lewis discovered this optimization.  
23148
23149         * typemanager.cs: Add signature for System.Array::get_Length
23150
23151 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23152
23153         * statement.cs: report the error when the foreach does not apply to an
23154         array nor a collection.
23155
23156 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
23157
23158         * expression.cs: Add implicit conversions to the operator ~.
23159
23160         * constant.cs (DecimalConstant.Emit): Emit decimal value.
23161
23162         * typemanager.cs: Locate the decimal constructor.
23163
23164 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23165
23166         * attribute.cs: use the new property of TypeOf.
23167         * expression.cs: added 'get' property around typearg.
23168
23169         These changes fix a build breaker reported by NickD. Is this the
23170         correct way to fix?  If not, please, revert my changes and make it
23171         work :-).
23172
23173 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
23174
23175         * attribute.cs: Add support for typeof in attribute invocations.
23176         I am not sure that this is right though.
23177
23178 2002-04-14  Duncan Mak  <duncan@ximian.com>
23179
23180         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23181         Binary.Operator.Division case.
23182
23183 2002-04-13  Ravi Pratap  <ravi@ximian.com>
23184
23185         * class.cs (DefineType): Ensure that we do a proper check on
23186         attribute types and also register it with the TypeManager.
23187
23188         (TypeContainer.Targets): The default for attribute types is
23189         AttributeTargets.All.
23190
23191         * attribute.cs (ApplyAttributes): Registering the attribute type
23192         is done elsewhere, not when we discover we have a Usage attribute.
23193
23194 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23195
23196         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23197         and get rid of is_delegate parameter.
23198
23199         * everywhere : update.
23200
23201 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23202
23203         * cs-parser.jay (compilation_unit): Revamp completely to use
23204         some new ideas that I got from Rhys' grammar to solve the problems
23205         with assembly level attributes.
23206
23207         (outer_declaration): New grammar production.
23208
23209         (attribute_sections): Add.
23210
23211         (opt_attributes): Base on attribute_sections
23212
23213         (namespace_declaration): Allow opt_attributes to tackle the case
23214         when we have assembly level attributes - we are clever in this
23215         regard now ;-)
23216
23217         * attribute.cs (ApplyAttributes): Do not worry about assembly 
23218         attributes in the non-global context.
23219
23220         * rootcontext.cs (AddGlobalAttributes): Go back to using this
23221         instead of SetGlobalAttributes.
23222
23223         * class.cs, rootcontext.cs : Ensure we define and generate 
23224         attribute types before anything else.
23225
23226         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23227         and flag the new error -20 for the case when the attribute type
23228         does not have valid targets specified. csc does not catch this.
23229
23230         * ../errors/errors.txt : update for error # -20
23231
23232 2002-04-11  Ravi Pratap  <ravi@ximian.com>
23233
23234         * support.cs (InternalParameters.ParameterModifier): Do some null
23235         checking and return sane values.
23236
23237         * class.cs (Method.Define): If we are a PInvoke method, ensure
23238         that we are static and extern. Report error # 601
23239
23240         * ../errors/cs0601.cs : Add test case for the above error.
23241
23242 2002-04-07  Ravi Pratap  <ravi@ximian.com>
23243
23244         * rootcontext.cs (attribute_types): We need to keep type of
23245         all attribute types separately and emit code for them first.
23246
23247         (RegisterAttribute) : Implement.
23248
23249         * class.cs (DefineType): Check if the current Type is a custom
23250         attribute type and register it accordingly.
23251
23252         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23253         adding the first attribute twice and rename to
23254
23255         (SetGlobalAttributes): this.
23256
23257         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23258         lookups.
23259
23260         * attribute.cs (ApplyAttributes): Take an additional argument telling us
23261         if we are processing global arguments. Hmm, I am unsure of this.
23262
23263 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23264
23265         * expression.cs: added static array of strings to avoid calling
23266         Enum.ToString () for Operator in Binary. Significant recover of
23267         performance.
23268
23269 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
23270
23271         * class.cs (FindMembers): Allow the Builders of the various
23272         members to be null.  If they are skip them.  This only happens
23273         during the PInvoke declaration.
23274
23275 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
23276
23277         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23278         failure, so we do not keep going afterwards.
23279
23280         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23281         wanted to pass `false' as the `is_delegate' argument.  If this is
23282         the case, why not use delegate_type == null to mean `is_delegate =
23283         false' and anything else as is_delegate = true.
23284
23285 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
23286
23287         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23288         code for the section, not the beginning of the tests.
23289
23290 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
23291
23292         * cfold.cs: Handle operator + (Enum x, Underlying x) 
23293
23294         * expression.cs (Binary): same.  Warn about errors where we have
23295         Enum/Enum in operator + as well.
23296
23297 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
23298
23299         * statement.cs:
23300                 - added support for switch(bool)
23301                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23302                 - add TableSwitchEmit() to handle table-based switch statements
23303
23304 2002-04-05  Ravi Pratap  <ravi@ximian.com>
23305
23306         * expression.cs (Invocation.OverloadResolve): Factor out code which
23307         does parameter compatibility checking with arguments so that we can 
23308         re-use the code even from Delegate.VerifyApplicability
23309
23310         (VerifyArgumentsCompat): Move above code here.
23311
23312         * delegate.cs (VerifyApplicability): Get rid of duplicate code
23313         and instead make a call to the above method.
23314
23315 2002-03-31  Ravi Pratap  <ravi@ximian.com>
23316
23317         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23318         We use it to keep track of classes which are attribute types.
23319
23320 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
23321
23322         * delegate.cs (Delegate.Define): Correctly define the types in the
23323         presence of fixed and array parameters.
23324
23325         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23326         doing FindMembers.
23327
23328         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23329         include NonPublic after the first iteration.
23330
23331         * class.cs (Indexer.CheckBase): Only check if both parents are
23332         non-null. 
23333
23334         * cs-parser.jay (accessor_body): If empty, set to null.
23335
23336         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23337         same code path here to resolve constants names that we did have in
23338         MemberAccess.DoResolve.  There is too much code duplicated here.
23339
23340 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
23341
23342         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23343
23344         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23345         to MakeUnionSet.
23346
23347         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23348         tokens, numbers and strings.
23349
23350         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23351         parenthesis.
23352
23353         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23354         asyncronous parameters and the regular parameters.  
23355
23356         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23357         specify the target directory.
23358
23359         * expression.cs: (This.DoResolve): Simplify
23360         (As.Emit): Optimize, do not generate IsInst if the expression is
23361         always of the given type.
23362
23363         (Is.DoResolve): Bug fix, we were reporting both always/never for
23364         the is expression.
23365
23366         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23367         creating too many unnecessary arrays.
23368
23369 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
23370
23371         * class.cs (EmitFieldInitializer): Use Assign expression to assign
23372         fields instead of rolling our own initializer.   Takes care of all
23373         implicit conversions, and drops unnecessary static checks/argument.
23374
23375 2002-03-31  Dick Porter  <dick@ximian.com>
23376
23377         * driver.cs: use the GetDirectories() return values properly, and
23378         use "/" as path separator.
23379
23380 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
23381
23382         * expression.cs (Unary): Optimize - - expr into expr.
23383         (Binary): Optimize a + (-b) into a -b.
23384
23385         * codegen.cs (CodeGen): Made all methods static.
23386
23387 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
23388
23389         * rootcontext.cs: 
23390
23391         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23392         TypeBuilder property.
23393
23394         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23395         instead. 
23396
23397         * tree.cs: Removed the various RecordXXXX, and replaced with a
23398         single RecordDecl.  Removed all the accessor methods, and just
23399         left a single access point Type 
23400
23401         * enum.cs: Rename DefineEnum to DefineType.
23402
23403         * decl.cs: New abstract method `DefineType' used to unify the
23404         Defines for Enumerations, Interfaces, TypeContainers and
23405         Delegates.
23406
23407         (FindType): Moved LookupInterfaceOrClass here.  Moved the
23408         LookupBaseClasses method that used to live in class.cs and
23409         interface.cs here, and renamed to FindType.
23410
23411         * delegate.cs: Implement DefineType.  Take advantage of the
23412         refactored pattern for locating the parent builder without taking
23413         the parent_builder argument (which we know does not work if we are
23414         nested, and triggering a toplevel definition).
23415
23416 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23417
23418         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23419         accessibility of a member has changed during override and report
23420         an error if so.
23421
23422         * class.cs (Method.Define, Property.Define): Only complain on
23423         overrides if the method is private, any other accessibility is
23424         fine (and since we just checked the permission is the same, we are
23425         good to go).
23426
23427         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23428         and elif are processed always.  The other pre-processing
23429         directives are only processed if we are "taking" the path
23430
23431 2002-03-29  Martin Baulig  <martin@gnome.org>
23432
23433         * class.cs (Method.Emit): Only emit symbolic debugging info if the
23434         current location is not Null.
23435
23436         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23437         a separate method so we can profile it.
23438
23439         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23440         `span.Seconds' are just seconds, but no minutes or hours.
23441         (MainDriver): Profile the CodeGen.SaveSymbols calls.
23442
23443 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23444
23445         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23446         Remove the gratuitous set of Final:
23447
23448                                 // If an interface implementation, then we can set Final.
23449                                 if (((flags & MethodAttributes.Abstract) == 0) &&
23450                                     implementing.DeclaringType.IsInterface)
23451                                         flags |= MethodAttributes.Final;
23452
23453         I do not know what I was smoking when I used that.
23454
23455
23456         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23457         step into fixing the name resolution issues for delegates and
23458         unifying the toplevel name resolution.
23459
23460 2002-03-28  Martin Baulig  <martin@gnome.org>
23461
23462         * class.cs (Method.Emit): If we have a symbol writer, call its
23463         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23464         tell it about the current method.
23465
23466         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23467         writer that we're going to emit the first byte of IL code for a new
23468         statement (a new source line).
23469         (EmitContext.EmitTopBlock): If we have a symbol writer, call
23470         EmitContext.Mark() before emitting any code.
23471
23472         * location.cs (SymbolDocument): Return null when we're Null.
23473
23474         * statement.cs (Statement): Moved the `Location loc' variable here.
23475         (Statement.EmitBoolExpression): If we have a symbol writer, call
23476         ec.Mark() before emitting any code to tell it that we're at the
23477         beginning of a new statement.
23478         (StatementExpression): Added `Location' argument to the constructor.
23479         (Block): Added public readonly variable `StartLocation' and public
23480         variable `EndLocation'.  The latter is to be set using SetEndLocation().
23481         (Block): Added constructor which takes a start and end location.
23482         (Block.SetEndLocation): New method. This sets the end location.
23483         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23484         local variables we create.
23485         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23486         each statement and do also mark the begin and end of the block.
23487
23488         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23489         tell it the current lexer.Location, use Location.Null for the end of the
23490         block.
23491         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23492         current block, set its end location using SetEndLocation().
23493         (statement_expression): StatementExpression constructor now takes the
23494         lexer.Location as additional argument.
23495         (for_statement, declare_local_variables): Likewise.
23496         (declare_local_variables): When creating a new implicit block, use the
23497         new Block constructor and pass it the lexer.Location.
23498
23499 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23500
23501         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23502         members also on the parent interfaces recursively.
23503
23504 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
23505
23506         * report.cs: Use new formats, since Gonzalo finished the missing
23507         bits. 
23508
23509         * expression.cs (Binary.ResolveOperator): added missing operator|
23510         operator& and operator^ for bool/bool.
23511
23512         * cs-parser.jay: CheckDef now takes a Location argument that is
23513         used to report errors more precisly (instead of reporting the end
23514         of a definition, we try to track something which is a lot closer
23515         to the source of the problem).
23516
23517         * cs-tokenizer.cs: Track global token use, so we can properly flag
23518         the use of #define/#undef after the first token has been seen.
23519
23520         Also, rename the reportXXXX to Error_DescriptiveName
23521
23522         * decl.cs (DeclSpace.IsTopLevel): Move property here from
23523         TypeContainer, so that Enum and Interface can use this too.
23524
23525         * class.cs (TypeContainer.LookupInterfaceOrClass,
23526         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23527         `builder' argument.  Typically this was used to pass the parent
23528         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23529         the definition).  
23530
23531         The problem is that a nested class could trigger the definition of
23532         a toplevel class, and the builder would be obviously wrong in that
23533         case. 
23534
23535         So we drop this argument, and we compute dynamically the
23536         TypeBuilder/ModuleBuilder (the correct information was available
23537         to us anyways from DeclSpace.Parent)
23538
23539         * interface.cs (Interface.DefineInterface): Drop builder
23540         parameter cleanup like class.cs
23541
23542         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
23543         like class.cs
23544
23545         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23546         values. 
23547
23548         (Try.Emit): Propagate the returns value from the statement.
23549
23550         (Return.Emit): Even if we are leavning 
23551
23552         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23553
23554         * modifiers.cs: Fix the computation of MethodAttributes flags.
23555
23556 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23557
23558         * driver.cs: allow compilation of files that start with '/'.
23559         Add a default case when checking the argument of --target.
23560
23561 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
23562
23563         * interface.cs: Implement the same search algorithm for types in
23564         the interface code.
23565
23566         * delegate.cs: Do not allow multiple definition.
23567
23568         * Recovered ChangeLog that got accidentally amputated
23569
23570         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23571
23572         * rootcontext.cs: Load manually enum to allow core classes to
23573         contain enumerations.
23574
23575         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23576         Update to new static methods in TypeManager.
23577
23578         * typemanager.cs (GetMethod, GetConstructor): Use our
23579         implementation of FindMembers to find the members, since during
23580         corlib compilation, the types are TypeBuilders and GetMethod and
23581         GetConstructor do not work.
23582
23583         Make all methods in TypeManager static.
23584
23585         (InitCodeHelpers): Split the functionality from
23586         the InitCodeTypes function.
23587
23588         * driver.cs: Call InitCodeHelpers after we have populated the
23589         types. 
23590
23591         * cs-parser.jay (delegate_declaration): we did not used to compute
23592         the delegate name correctly for void delegates.
23593
23594 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
23595
23596         * rootcontext.cs (RootContext): Init the interface_resolve_order
23597         and type_container_resolve_order always.
23598
23599         (ResolveCore, BootstrapCorlib_ResolveClass,
23600         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23601         compiler when compiling with --nostdlib
23602
23603         * class.cs (TypeContainer.DefineType): Check that our parent is
23604         not null.  This test is most important when we are bootstraping
23605         the core types.
23606
23607         * codegen.cs: Split out the symbol writing code.
23608
23609 2002-03-25  Martin Baulig  <martin@gnome.org>
23610
23611         * driver.cs (-g): Made -g an alias for --debug.
23612
23613 2002-03-24  Martin Baulig  <martin@gnome.org>
23614
23615         * codegen.cs (SymbolWriter): New public variable. Returns the
23616         current symbol writer.
23617         (CodeGen): Added `bool want_debugging_support' argument to the
23618          constructor. If true, tell the ModuleBuild that we want debugging
23619         support and ask it for the ISymbolWriter.
23620         (Save): If we have a symbol writer, call it's Close() method after
23621         saving the assembly.
23622
23623         * driver.c (--debug): New command line argument to create a
23624         debugger information file.
23625
23626         * location.cs (SymbolDocument): New public property. Returns an
23627         ISymbolDocumentWriter object for the current source file or null
23628         if we don't have a symbol writer.
23629
23630 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
23631
23632         * driver.cs (LoadAssembly): Correctly return when all the paths
23633         have been tried and not before.
23634
23635         * statement.cs (Switch.Emit): return the actual coverage for this
23636         statement (returns/not-returns)
23637
23638         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23639         switch of the statement if we are the last switch section.  That
23640         kills two problems: try/catch problems (we used to emit an empty
23641         nop at the end) and switch statements where all branches would
23642         return. 
23643
23644 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
23645
23646         * driver.cs: Add default assemblies (the equivalent to the
23647         Microsoft CSC.RSP file)
23648
23649         * cs-tokenizer.cs: When updating `cols and setting it to zero,
23650         also update tokens_seen and set it to false.
23651
23652         * driver.cs: Implement --recurse for Mike.
23653
23654         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23655         correctly splitting out the paths.
23656
23657 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
23658
23659         * interface.cs (Interface.PopulateProperty): Instead of using
23660         `parent' as the declaration space for the set parameters, use
23661         `this' 
23662
23663         * support.cs (InternalParameters): InternalParameters constructor
23664         takes a DeclSpace instead of a TypeContainer.
23665
23666         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23667         types are being initialized, load the address of it before calling
23668         the function.  
23669
23670         (New): Provide a mechanism to disable the generation of local
23671         value type temporaries when the caller will be providing us with
23672         an address to store it.
23673
23674         (ArrayCreation.EmitDynamicInitializers): Use it.
23675
23676 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
23677
23678         * expression.cs (Invocation.EmitArguments): Only probe for array
23679         property if there is more than one argument.  Sorry about that.
23680
23681         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
23682         empty param arrays.
23683
23684         * class.cs (Method.LabelParameters): Fix incorrect code path that
23685         prevented the `ParamArrayAttribute' from being applied to the
23686         params attribute.
23687
23688 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
23689
23690         * support.cs (ReflectionParameters): Correctly compute whether the
23691         last argument is a params array.  Fixes the problem with
23692         string.Split ('a')
23693
23694         * typemanager.cs: Make the assemblies array always be non-null
23695         (empty, but non-null)
23696
23697         * tree.cs (RecordDecl): New function that abstracts the recording
23698         of names.  This reports error 101, and provides a pointer to the
23699         previous declaration.  Fixes a crash in the compiler.
23700
23701         * cs-parser.jay (constructor_declaration): Update to new grammar,
23702         and provide a constructor_body that can be empty.
23703
23704 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
23705
23706         * driver.cs: Add support for --resources.
23707
23708         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
23709         Make all types for the various array helper methods be integer.
23710
23711         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
23712         CheckState to ConvCast.
23713
23714         (ConvCast): Now it takes a `checked' state argument, to avoid
23715         depending on the emit context for the conversion, and just using
23716         the resolve time setting.
23717
23718         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
23719         instead of Invocation.EmitArguments.  We do not emit the original
23720         arguments, instead we emit those which have been converted to
23721         unsigned int expressions.
23722
23723         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
23724
23725         * codegen.cs: ditto.
23726
23727         * expression.cs (LocalVariableReference): Drop the use of the
23728         Store function that depended on the variable index.
23729
23730         * statement.cs (VariableInfo): Drop the `Idx' property from this
23731         class, as this is not taking into account the indexes for
23732         temporaries tat we generate during the execution, getting the
23733         indexes wrong.
23734
23735         * class.cs: First emit class initializers, then call the parent
23736         constructor. 
23737
23738         * expression.cs (Binary): Fix opcode emision.
23739         (UnaryMutator.EmitCode): Support checked code generation
23740
23741         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
23742         matches for events for both the Static and Instance scans,
23743         pointing to the same element.   Fix that.
23744
23745 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
23746
23747         * rootcontext.cs (ResolveTree): Always set the
23748         interface_resolve_order, because nested interfaces will be calling
23749         into us.
23750
23751         * class.cs (GetInterfaceOrClass): Track the same resolution
23752         process used by TypeManager.LookupType.  This fixes the nested
23753         type lookups in class declarations (separate path from
23754         LookupType). 
23755
23756         (TypeContainer.DefineType): Also define nested interfaces.
23757         (TypeContainer.RegisterOrder): New public function used to
23758         register the order in which child interfaces need to be closed.
23759
23760         Nested interfaces need to be closed after their parents have been
23761         created. 
23762
23763         * interface.cs (InterfaceAttr): Put all the logic for computing
23764         the interface attribute here. 
23765
23766         (DefineInterface): Register our interface order with the
23767         RootContext or with the TypeContainer depending on the case.
23768
23769 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
23770
23771         * cs-parser.jay: rework foreach statement to work with the new
23772         changes to the policy on SimpleNames.
23773
23774         * report.cs: support Stacktrace on warnings as well.
23775
23776         * makefile: drop --unsafe and /unsafe from the compile.
23777
23778 2002-03-13  Ravi Pratap  <ravi@ximian.com>
23779
23780         * ecore.cs (StandardConversionExists): Modify to take an Expression
23781         as the first parameter. Ensure we do null -> reference type conversion
23782         checking.
23783
23784         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
23785         temporary Expression objects.
23786
23787 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
23788
23789         * interface.cs: workaround bug in method overloading resolution
23790         (there is already a bugzilla bug for it).
23791
23792 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
23793
23794         We could also solve this problem by having a separate path for
23795         performing type lookups, instead of DoResolve, we could have a
23796         ResolveType entry point, and only participating pieces of the
23797         production (simplename, deref, array) would implement this. 
23798
23799         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
23800         signal SimpleName to only resolve type names and not attempt to
23801         resolve anything else.
23802
23803         * expression.cs (Cast): Set the flag.
23804
23805         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
23806
23807         * class.cs: Only report 108 if there is no `new' modifier.
23808
23809         * cs-parser.jay: rework foreach statement to work with the new
23810         changes to the policy on SimpleNames.
23811
23812         * report.cs: support Stacktrace on warnings as well.
23813
23814         * makefile: drop --unsafe and /unsafe from the compile.
23815
23816 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
23817
23818         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
23819         lookups here, instead of doing that at parse time.  This means
23820         that our grammar will not introduce `LocalVariableReferences' as
23821         expressions at this point.  That solves the problem of code like
23822         this:
23823
23824         class X {
23825            static void Main ()
23826            { int X = 1;
23827             { X x = null }}}
23828
23829         This is only half the fix.  The full fix requires parameters to
23830         also be handled in this way.
23831
23832         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
23833         makes the use more obvious of the DeclSpace.  The
23834         ec.TypeContainer.TypeBuilder is now only used to pull the
23835         TypeBuilder for it.
23836
23837         My theory is that I can get rid of the TypeBuilder completely from
23838         the EmitContext, and have typecasts where it is used (from
23839         DeclSpace to where it matters).  
23840
23841         The only pending problem is that the code that implements Aliases
23842         is on TypeContainer, and probably should go in DeclSpace.
23843
23844         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
23845         lookups here, instead of doing that at parse time.  This means
23846         that our grammar will not introduce `LocalVariableReferences' as
23847         expressions at this point.  That solves the problem of code like
23848         this:
23849
23850         class X {
23851            static void Main ()
23852            { int X = 1;
23853             { X x = null }}}
23854
23855         This is only half the fix.  The full fix requires parameters to
23856         also be handled in this way.
23857
23858         * class.cs (Property.DefineMethod): When implementing an interface
23859         method, set newslot, when implementing an abstract method, do not
23860         set the flag (before we tried never setting it, or always setting
23861         it, which is the difference).
23862         (Indexer.DefineMethod): same.
23863         (Method.DefineMethod): same.
23864
23865         * ecore.cs: Only set the status used flag if we get back a Field.
23866
23867         * attribute.cs: Temporary hack, so Paolo can keep working.
23868
23869 2002-03-08  Ravi Pratap  <ravi@ximian.com>
23870
23871         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
23872         the unmanaged type in the case we have a MarshalAs attribute.
23873
23874         (Resolve): Handle the case when we are parsing the special MarshalAs
23875         attribute [we need to store the unmanaged type to use later]
23876
23877         * typemanager.cs (marshal_as_attr_type): Built in type for the 
23878         MarshalAs Attribute.
23879
23880         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
23881         on parameters and accordingly set the marshalling info.
23882
23883 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
23884
23885         * class.cs: Optimizing slightly by removing redundant code after
23886         we switched to the `NoTypes' return value.
23887         (Property.DefineMethod): use NoTypes here too.
23888
23889         This fixes the bug I introduced in my last batch of changes.
23890
23891 2002-03-05  Ravi Pratap  <ravi@ximian.com>
23892
23893         * tree.cs (RecordEnum): Add. We now keep track of enums too.
23894
23895         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
23896         Enums since those are types too. 
23897
23898         * cs-parser.jay (enum_declaration): Record enums as we parse them.
23899
23900         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
23901         thanks to a call during the lookup process.
23902
23903 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
23904
23905         * statement.cs (Foreach): Lots of work to accomodate a particular
23906         kind of foreach statement that I had not kept in mind.  It is
23907         possible to have foreachs on classes that provide a GetEnumerator
23908         method that return objects that implement the "pattern" for using
23909         a foreach, there is no need to support GetEnumerator
23910         specifically. 
23911
23912         This is needed to compile nant.
23913
23914         * decl.cs: Only report 114 if the member is not `Finalize' and if
23915         the warning level is at least 2.
23916
23917         * class.cs: Moved the compare function from Method to
23918         MethodSignature. 
23919
23920         (MethodSignature.InheritableMemberSignatureCompare): Add new
23921         filter function that is used to extract inheritable methods from a
23922         class. 
23923
23924         (Method.Define): Use the new `inheritable_method_signature_filter'
23925         delegate
23926
23927         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
23928         command. 
23929
23930 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
23931
23932         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
23933
23934         * cs-parser.jay: Add opt_semicolon to the interface declaration.
23935
23936         * expression.cs: Pass location information to
23937         ConvertImplicitStandard. 
23938
23939         * class.cs: Added debugging code to track return values from
23940         interfaces. 
23941
23942 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
23943
23944         * expression.cs (Is.DoResolve): If either side of the `is' is an
23945         interface, do not flag the warning.
23946
23947         * ecore.cs (ImplicitReferenceConversion): We need a separate test
23948         for interfaces
23949
23950         * report.cs: Allow for --fatal to be used with --probe.
23951
23952         * typemanager.cs (NoTypes): Move the definition for the empty Type
23953         array here. 
23954
23955         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
23956         properties. 
23957         (TypeContainer.DefineProxy): New function used to proxy to parent
23958         implementations when implementing interfaces.
23959         (TypeContainer.ParentImplements): used to lookup if our parent
23960         implements a public function that is required by an interface.
23961         (TypeContainer.VerifyPendingMethods): Hook this up.
23962
23963         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
23964         `modules' and `assemblies' arraylists into arrays.  We only grow
23965         these are the very early start up of the program, so this improves
23966         the speedof LookupType (nicely measured).
23967
23968         * expression.cs (MakeByteBlob): Replaced unsafe code with
23969         BitConverter, as suggested by Paolo.
23970
23971         * cfold.cs (ConstantFold.Binary): Special case: perform constant
23972         folding of string concatenation, but if either side is a string,
23973         and the other is not, then return null, and let the runtime use
23974         the concatenation on the string plus the object (using
23975         `Object.ToString'). 
23976
23977 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
23978
23979         Constant Folding has been implemented now.
23980
23981         * expression.cs (Unary.Reduce): Do not throw an exception, catch
23982         the error instead on types that are not supported in one's
23983         complement. 
23984
23985         * constant.cs (Constant and all children): New set of functions to
23986         perform implict and explicit conversions.
23987
23988         * ecore.cs (EnumConstant): Implement the new functions to perform
23989         conversion by proxying to the child expression.
23990
23991         * codegen.cs: (ConstantCheckState): Constant evaluation has its
23992         own separate setting that can not be turned off from the command
23993         line using --unchecked or --checked and is only controlled using
23994         the checked/unchecked statements and expressions.  This setting is
23995         used by the constant folder to flag errors.
23996
23997         * expression.cs (CheckedExpr, UncheckedExpr): Set the
23998         ConstantCheckState as well.   
23999
24000         During Resolve, they also have to flag the state, because the
24001         constant folder runs completely in the Resolve phase.
24002
24003         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24004         well.
24005
24006 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24007
24008         * cfold.cs: New file, this file contains the constant folder.
24009
24010         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24011         argument to track whether we are using the resulting address to
24012         load or store a value and provide better error messages. 
24013
24014         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24015         new AddressOf arguments.
24016
24017         * statement.cs (Foreach.EmitCollectionForeach): Update
24018
24019         * expression.cs (Argument.Emit): Call AddressOf with proper
24020         arguments to track usage.
24021
24022         (New.DoEmit): Call AddressOf with new arguments.
24023
24024         (Unary.Emit): Adjust AddressOf call.
24025
24026 2002-03-01  Ravi Pratap  <ravi@ximian.com>
24027
24028         * cs-parser.jay (member_access): Change the case for pre-defined types
24029         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
24030         this suggestion.
24031
24032         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24033         a method body.
24034
24035         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24036         essentially like methods and apply attributes like MethodImplOptions to them too.
24037
24038         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24039         not being null.
24040
24041         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24042         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24043         is the DeclSpace.
24044
24045         * Update code everywhere accordingly.
24046
24047         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24048
24049         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24050
24051 2002-02-28  Ravi Pratap  <ravi@ximian.com>
24052
24053         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24054         try performing lookups against those instead of jumping straight into using
24055         the 'using' clauses.
24056
24057         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24058
24059         (LookupType): Perform lookups in implicit parents too.
24060
24061         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24062         sequence as RootContext.LookupType. 
24063
24064         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
24065         the various cases of namespace lookups into this method.
24066
24067 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24068
24069         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24070         in positional arguments)
24071
24072         * class.cs (Operator): Update the AllowedModifiers to contain
24073         extern. 
24074
24075         * cs-parser.jay: Update operator declaration to allow for the
24076         operator body to be empty.
24077
24078         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24079         values. 
24080
24081 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
24082
24083         * class.cs (Method.Emit): Label parameters.
24084
24085         * driver.cs: Return 1 or 0 as the program exit code.
24086
24087 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
24088
24089         * expression.cs: Special case the `null' object when trying to
24090         auto-compute the type, as anything can be explicitly converted to
24091         that. 
24092
24093         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24094         spotting this Paolo.
24095
24096         (Expression.ImplicitNumericConversion): Perform comparissions of
24097         the type using the underlying type in the case of an enumeration
24098         rather than using the enumeration type for the compare.
24099
24100         Cope with the underlying == type case, which is not possible to
24101         catch before. 
24102
24103         (Expression.ConvertNumericExplicit): Perform comparissions of
24104         the type using the underlying type in the case of an enumeration
24105         rather than using the enumeration type for the compare.
24106
24107         * driver.cs: If the user does not supply an extension, assume .exe
24108
24109         * cs-parser.jay (if_statement): Rewrote so that we can track the
24110         location for the if statement.
24111
24112         * expression.cs (Binary.ConstantFold): Only concat strings when
24113         the operation is "+", not everything ;-)
24114
24115         * statement.cs (Statement.EmitBoolExpression): Take a location
24116         argument. 
24117         (If, While, Do): Track location.
24118
24119         * expression.cs (Binary.ResolveOperator): In the object + string
24120         case, I was missing a call to ConvertImplicit
24121
24122 2002-02-25  Ravi Pratap  <ravi@ximian.com>
24123
24124         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24125         Location arguments. Ensure we use RootContext.LookupType to do our work
24126         and not try to do a direct Type.GetType and ModuleBuilder.GetType
24127
24128         * interface.cs (PopulateMethod): Handle the type of the parameter being
24129         null gracefully.
24130
24131         * expression.cs (Invocation.BetterFunction): Handle the case when we 
24132         have a params method with no fixed arguments and a call is made with no
24133         arguments.
24134
24135 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
24136
24137         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24138         the verbatim-string-literal
24139
24140         * support.cs (InternalParameters.ParameterModifier): handle null
24141         fixed parameters.
24142         (InternalParameters.ParameterType): ditto.
24143
24144         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24145         duplicating the name of the variable parameter.
24146         (GetParameterByName): Fix bug where we were not looking up array
24147         paramters if they were the only present (thanks Paolo!).
24148         (GetParameterInfo): We only have an empty set of types if both
24149         fixed and array are set to null.
24150         (GetParameterInfo-idx): Handle FixedParameter == null
24151
24152         * cs-parser.jay: Handle the case where there is no catch
24153         statements (missing null test).
24154
24155 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
24156
24157         * driver.cs (MainDriver): Be conservative on our command line
24158         handling.
24159
24160         Catch DirectoryNotFoundException when calling GetFiles.
24161
24162         (SplitPathAndPattern): Used to split the input specification into
24163         a path and a pattern that we can feed to Directory.GetFiles.
24164
24165 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
24166
24167         * statement.cs (Fixed): Implement the last case of the Fixed
24168         statement (string handling).
24169
24170         * expression.cs (StringPtr): New class used to return a char * to
24171         a string;  Used by the Fixed statement.
24172
24173         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
24174
24175         * expression.cs (Binary.ResolveOperator): Remove redundant
24176         MemberLookup pn parent type.
24177         Optimize union call, we do not need a union if the types are the same.
24178         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24179         type.
24180
24181         Specialize the use of MemberLookup everywhere, instead of using
24182         the default settings. 
24183
24184         (StackAlloc): Implement stackalloc keyword.
24185
24186         * cs-parser.jay: Add rule to parse stackalloc.
24187
24188         * driver.cs: Handle /h, /help, /?
24189
24190         * expression.cs (MakeByteBlob): Removed the hacks we had in place
24191         before we supported unsafe code.
24192
24193         * makefile: add --unsafe to the self compilation of mcs.
24194
24195 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
24196
24197         * expression.cs (PointerArithmetic): New class that is used to
24198         perform pointer arithmetic.
24199         (Binary.Resolve): Handle pointer arithmetic
24200         Handle pointer comparission.
24201         (ArrayPtr): Utility expression class that is used to take the
24202         address of an array.
24203
24204         (ElementAccess): Implement array access for pointers
24205
24206         * statement.cs (Fixed): Implement fixed statement for arrays, we
24207         are missing one more case before we are done.
24208
24209         * expression.cs (Indirection): Implement EmitAssign and set the
24210         ExprClass to Variable.  This allows pointer dereferences to be
24211         treated as variables, and to have values assigned to them.
24212
24213         * ecore.cs (Expression.StoreFromPtr): New utility function to
24214         store values dereferencing.
24215
24216 2002-02-20  Ravi Pratap  <ravi@ximian.com>
24217
24218         * expression.cs (Binary.ResolveOperator): Ensure that we are
24219         not trying to operate on a void type - this fixes the reported
24220         bug.
24221
24222         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24223         the parent implementation is sealed.
24224
24225         * ../errors/cs0239.cs : Add.
24226
24227         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24228
24229         * typemanager.cs (unverifiable_code_type): Corresponds to 
24230         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24231         which have unsafe code in them.
24232
24233         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
24234         unsafe context.
24235
24236 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
24237
24238         * cs-tokenizer.cs: Add support for @"litreal strings"
24239
24240         Make tokenizer accept pre-processor directives
24241         on any column (remove the old C-like limitation). 
24242
24243         * rootcontext.cs (EmitCode): Emit any global attributes.
24244         (AddGlobalAttributes): Used to keep track of assembly attributes. 
24245
24246         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24247
24248         * cs-parser.jay: Add support for global attributes.  
24249
24250 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
24251
24252         * expression.cs (Indirection): New helper class.  Unary will
24253         create Indirection classes to be able to implement the
24254         IMemoryLocation interface on it.
24255
24256 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
24257
24258         * cs-parser.jay (fixed_statement): reference the right statement.
24259
24260         * statement.cs (Fixed.Emit): Finish implementing the fixed
24261         statement for the &x case.
24262
24263 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
24264
24265         * class.cs (Property.Define, Method.Define): Remove newslot when
24266         `implementing'.  
24267
24268         * modifiers.cs: My use of NewSlot when `Abstract' was set was
24269         wrong.  NewSlot should only be used if the `new' keyword is present.
24270
24271         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24272         locating our system dir.  Sorry about this.
24273
24274 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24275
24276         * driver.cs (GetSystemDir): Compute correctly the location of our
24277         system assemblies.  I was using the compiler directory instead of
24278         the library directory.
24279
24280 2002-02-13  Ravi Pratap  <ravi@ximian.com>
24281
24282         * expression.cs (BetterFunction): Put back in what Miguel commented out
24283         since it is the correct fix. The problem is elsewhere ;-)
24284
24285         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24286         parameters of the parms method are themselves compatible or not !
24287
24288         (StandardConversionExists): Fix very dangerous bug where we were forgetting
24289         to check that a class implements an interface before saying that an implicit
24290         conversion was allowed. Use ImplementsInterface to do the checking.
24291
24292 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24293
24294         * class.cs (Method.Define): Track whether we are an explicit
24295         implementation or not.  And only call DefineMethodOverride if we
24296         are an explicit implementation.
24297
24298         (Property.DefineMethod): Ditto.
24299
24300 2002-02-11  Ravi Pratap  <ravi@ximian.com>
24301
24302         * expression.cs (BetterFunction): Catch hideous bug which was
24303          preventing us from detecting ambiguous calls due to implicit casts i.e
24304         cs0121.
24305
24306 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
24307
24308         * support.cs (Pair): Remove un-needed method.  I figured why I was
24309         getting the error in cs-parser.jay, the variable in a foreach loop
24310         is readonly, and the compiler does not really treat this as a variable.
24311
24312         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
24313         instead of EQUALS in grammar.  
24314
24315         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24316
24317         * expression.cs (Unary.DoResolve): Check whether the argument is
24318         managed or not.
24319
24320 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
24321
24322         * support.cs: Api for Pair to set a value.  Despite the fact that
24323         the variables are public the MS C# compiler refuses to compile
24324         code that accesses the field if the variable is part of a foreach
24325         statement. 
24326
24327         * statement.cs (Fixed): Begin implementation of the fixed
24328         statement.
24329
24330         (Block.AddVariable): Return the VariableInfo on success and null
24331         on failure instead of true/false. 
24332
24333         * cs-parser.jay (foreach): Catch errors on variables already
24334         defined (we were ignoring this value before) and properly unwind
24335         the block hierarchy
24336
24337         (fixed_statement): grammar for the fixed statement.
24338
24339 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
24340
24341         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24342         pointer types to be incretemented.
24343
24344         (SizeOf): Implement.
24345
24346         * cs-parser.jay (pointer_member_access): Implement
24347         expr->IDENTIFIER production.
24348
24349         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24350         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24351         on safe contexts.
24352
24353         (Unary): Implement indirection.
24354
24355         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24356         use in non-unsafe context).
24357
24358         (SimpleName.DoResolve): Check for pointers in field access on safe
24359         contexts. 
24360
24361         (Expression.LoadFromPtr): Factor the load-indirect code in this
24362         function.  This was duplicated in UnboxCast and ParameterReference
24363
24364 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
24365
24366         * expression.cs (ComposedCast): report an error if a pointer cast
24367         is used in a safe region.
24368
24369         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24370         pointer type casts in unsafe context.
24371
24372         * codegen.cs (EmitContext): Set up IsUnsafe.
24373
24374         * cs-parser.jay (non_expression_type): Add productions for pointer
24375         casts. 
24376
24377         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24378         code.  We should not use force into static mode if the method is
24379         not virtual.  Fixes bug in MIS
24380
24381         * statement.cs (Do.Emit, While.Emit, For.Emit,
24382         Statement.EmitBoolExpression): Add support to Do and While to
24383         propagate infinite loop as `I do return' semantics.
24384
24385         Improve the For case to also test for boolean constants.
24386
24387         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24388         to the list of attributes we can add.
24389
24390         Remove `EmitContext' argument.
24391
24392         * class.cs (Method.Define): Apply parameter attributes.
24393         (Constructor.Define): Apply parameter attributes.
24394         (MethodCore.LabelParameters): Move here the core of labeling
24395         parameters. 
24396
24397         * support.cs (ReflectionParameters.ParameterModifier,
24398         InternalParameters.ParameterModifier): Use IsByRef on the type and
24399         only return the OUT bit for these parameters instead of in/out/ref
24400         flags.
24401
24402         This is because I miss-understood things.  The ParameterInfo.IsIn
24403         and IsOut represent whether the parameter has the [In] and [Out]
24404         attributes set.  
24405
24406 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
24407
24408         * ecore.cs (FieldExpr.Emit): Release temporaries.
24409
24410         * assign.cs (LocalTemporary.Release): new function.
24411
24412         * codegen.cs (EmitContext.GetTemporaryStorage,
24413         EmitContext.FreeTemporaryStorage): Rework the way we deal with
24414         temporary storage.  Now we can "put back" localbuilders when we
24415         are done with them
24416
24417 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
24418
24419         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24420         need to make a copy of the variable to generate verifiable code.
24421
24422 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
24423
24424         * driver.cs: Compute dynamically the system directory.
24425
24426         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24427         Slower, but more generally useful.  Used by the abstract
24428         registering implementation. 
24429
24430         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24431         the rules for the special rule on Type/instances.  First check if
24432         we have the same name, and if so, try that special static path
24433         rather than the instance path.
24434
24435 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
24436
24437         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24438         for, while and if.
24439
24440         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24441         Enum, ValueType, Delegate or Array for non-corlib compiles.
24442
24443         * cs-tokenizer.cs: Catch long identifiers (645)
24444
24445         * typemanager.cs (IndexerPropetyName): Ravi never tested this
24446         piece of code.
24447
24448         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24449         fix, we were returning too early, so we were not registering
24450         pending methods from abstract classes.
24451
24452         Do not register pending methods if the class is abstract.
24453
24454         * expression.cs (Conditional.DoResolve): Report circular implicit
24455         conversions when we neecd to compute it for conditional
24456         expressions. 
24457
24458         (Is.DoResolve): If the expression is always of the provided type,
24459         flag warning 183.  If the expression can not ever be of the
24460         provided type flag warning 184.
24461
24462         * class.cs: Catch 169 as well.
24463
24464         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24465         read. 
24466
24467 2002-01-18  Nick Drochak  <ndrochak@gol.com>
24468
24469         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
24470
24471 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
24472
24473         * interface.cs: (PopulateMethod): Check for pointers being defined
24474         only if the unsafe context is active.
24475         (PopulateProperty): ditto.
24476         (PopulateIndexer): ditto.
24477
24478         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24479         specified.  If pointers are present, make sure that they are
24480         present in an unsafe context.
24481         (Constructor, Constructor.Define): ditto.
24482         (Field, Field.Define): ditto.
24483         (Property, Property.Define): ditto.
24484         (Event, Event.Define): ditto.
24485
24486         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24487         hashtable if there are classes or structs defined.
24488
24489         * expression.cs (LocalVariableReference.DoResolve): Simplify this
24490         code, as the constant resolution moved.
24491
24492         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24493         the metadata, so we can flag error 133. 
24494
24495         * decl.cs (MemberCore.UnsafeOK): New function to test that a
24496         pointer is being declared in an unsafe context.
24497
24498 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
24499
24500         * modifiers.cs (Modifiers.Check): Require a Location argument.
24501         Report error 227 for Unsafe use.
24502
24503         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24504
24505         * statement.cs (For.Emit): If the test is null, then report that
24506         we do `return', as we wont reach anything afterwards.
24507
24508         (Switch.SwitchGoverningType): Track the expression that matched
24509         the conversion.
24510
24511         * driver.cs: Allow negative numbers as an error code to flag.
24512
24513         * cs-parser.jay: Handle 1551.
24514
24515         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24516
24517 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24518
24519         * cs-parser.jay: Report 1518 (type declaration can only contain
24520         class, struct, interface, enum or delegate)
24521
24522         (switch_label): Report 1523 (keywords `case' or `default' must
24523         preced code)
24524
24525         (opt_switch_sections): Report 1522 (empty switch)
24526
24527         * driver.cs: Report 1515 (response file specified multiple times)
24528         Report 1516 (Source file specified multiple times).
24529
24530         * expression.cs (Argument.Resolve): Signal 1510
24531
24532         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24533         access not allowed in static code)
24534
24535 2002-01-11  Ravi Pratap  <ravi@ximian.com>
24536
24537         * typemanager.cs (IsPointerType): Utility method which we are going
24538         to need a lot.
24539
24540         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24541         the object type, so we take care of that.
24542
24543         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24544
24545         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24546         added to non-params parameters :-)
24547
24548         * typemanager.cs (CSharpName): Include 'void' type too. 
24549
24550         (void_ptr_type): Include in the set of core types.
24551
24552         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
24553         duplicating code.
24554
24555         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
24556         an unsafe context.
24557
24558         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
24559         completely forgotten about it.
24560
24561 2002-01-10  Ravi Pratap  <ravi@ximian.com>
24562
24563         * cs-parser.jay (pointer_type): Add. This begins our implementation
24564         of parsing rules for unsafe code.
24565
24566         (unsafe_statement): Implement.
24567
24568         (embedded_statement): Modify to include the above.
24569
24570         * statement.cs (Unsafe): Implement new class for unsafe blocks.
24571
24572         * codegen.cs (EmitContext.InUnsafe): Add. This determines
24573         if the current context is an unsafe one.
24574
24575         * cs-parser.jay (local_variable_pointer_type): Since local variable types
24576         are handled differently, we need separate rules for them.
24577
24578         (local_variable_declaration): Update to use local_variable_pointer_type
24579         to allow variable declarations of unmanaged pointer types.
24580
24581         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24582         in unsafe contexts.
24583
24584         * ../errors/cs0214.cs : Add.
24585
24586 2002-01-16  Nick Drochak  <ndrochak@gol.com>
24587
24588         * makefile: remove 'response' file when cleaning.
24589
24590 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24591
24592         * cs-parser.jay: Report 1524.
24593
24594 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
24595
24596         * typemanager.cs (RegisterMethod): drop checking if we have
24597         registered this from here
24598
24599 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
24600
24601         * class.cs (Method.EmitDestructor): Implement calling our base
24602         destructor. 
24603
24604         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24605         value of InFinally.
24606
24607         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24608         this routine and will wrap the call in a try/catch block.  Deal
24609         with the case.
24610
24611 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
24612
24613         * ecore.cs (Expression.MemberLookup): instead of taking a
24614         parameter `same_type' that was used to tell whether we could
24615         access private members we compute our containing type from the
24616         EmitContext.
24617
24618         (FieldExpr): Added partial support for volatile fields.  This does
24619         not work for volatile fields exposed from assemblies, as I can not
24620         figure out how to extract the modreq from it.
24621
24622         Updated all the source files to use this.
24623
24624         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24625         because it is referenced by MemberLookup very often. 
24626
24627 2002-01-09  Ravi Pratap  <ravi@ximian.com>
24628
24629         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24630         TypeBuilder.GetCustomAttributes to retrieve what we need.
24631
24632         Get rid of redundant default_member_attr_type as this is the same as
24633         default_member_type which already exists.
24634
24635         * interface.cs, attribute.cs : Update accordingly.
24636
24637 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
24638
24639         * typemanager.cs: Enable IndexerPropertyName again.  It does not
24640         work for TYpeBuilders though.  Ravi, can you please fix this?
24641
24642         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24643
24644         * expression.cs (Argument.Emit): Handle the case of ref objects
24645         being passed to ref functions;  
24646
24647         (ParameterReference.EmitLoad): Loads the content of the pointer
24648         without dereferencing.
24649
24650 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24651
24652         * cs-tokenizer.cs: Implemented the pre-processing expressions.
24653
24654 2002-01-08  Ravi Pratap  <ravi@ximian.com>
24655
24656         * class.cs (Indexer.DefineMethod): Incorporate the interface
24657         type in the name of the method if we are doing explicit interface
24658         implementation.
24659
24660         * expression.cs (ConversionExists): Remove as it is completely obsolete.
24661
24662         (BetterConversion): Fix extremely trivial bug where we were referring to
24663         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24664         again !
24665
24666         * ../errors/bug16.cs : Add although we have fixed it.
24667
24668 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24669
24670         * expression.cs (BaseIndexer): Begin implementation.
24671
24672         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
24673
24674         * cs-parser.jay (indexer_declarator): Use qualified_identifier
24675         production directly to remove a shift/reduce, and implement
24676         explicit interface implementation.
24677
24678         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
24679         after a floating point suffix.
24680
24681         * expression.cs (DoNumericPromotions): Improved the conversion for
24682         uint/uint.  If we have a constant, we avoid doing a typecast to a
24683         larger type.
24684
24685         * class.cs (Indexer): Implement explicit interface implementation
24686         for indexers.
24687
24688 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
24689
24690         * class.cs: make the default instance constructor public and hidebysig.
24691
24692 2001-01-03  Ravi Pratap  <ravi@ximian.com>
24693
24694         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
24695         so we can call it from elsewhere.
24696
24697         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
24698         we emit it internally if the class has a defined indexer; otherwise the user
24699         emits it by decorating the class definition with the DefaultMemberAttribute.
24700
24701         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
24702         attribute is not used on a type which defines an indexer.
24703
24704         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
24705         character when we skip whitespace.
24706
24707         * ../errors/cs0646.cs : Add.
24708
24709 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
24710
24711         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
24712         again. 
24713
24714         * makefile: Add practical target `mcs3.exe' which builds the third
24715         generation compiler. 
24716
24717         * expression.cs (New): Fix structures constructor calling.
24718
24719         * class.cs (Property, Method, Indexer): Emit Final flag on the
24720         method if we are an interface implementation and we are not
24721         abstract. 
24722
24723         * ecore.cs (PropertyExpr): New public field `IsBase', tells
24724         whether this property is referencing a `base' method.
24725
24726         * expression.cs (Invocation.EmitCall): take an extra argument:
24727         is_base, this is used to determine whether the `call' or
24728         `callvirt' opcode should be used.
24729
24730
24731         * delegate.cs: update EmitCall.
24732
24733         * class.cs (Method.Define): Set NewSlot for the cases where we are
24734         not implementing an interface method.
24735
24736         (Property.Define): ditto.
24737
24738 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
24739
24740         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
24741         'r'.  Allows mcs to parse itself fully.
24742
24743 2002-01-02  Ravi Pratap  <ravi@ximian.com>
24744
24745         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
24746         of the number of initializers that require the InitializeArray method.
24747
24748         (CheckIndices): Store the Expression in all cases - not the plain value. Also
24749         update the above field where necessary.
24750
24751         (MakeByteBlob): Update accordingly.
24752
24753         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
24754         greater than 2.
24755
24756         (EmitDynamicInitializers): Update in accordance with the new optimization.
24757
24758         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
24759         same OpCode applies.
24760
24761         * cs-parser.jay : Fix some glaring errors I introduced.
24762
24763 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
24764
24765         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
24766         so that we can check for name clashes there too.
24767
24768         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
24769         for interface indexers.
24770
24771         * interfaces.cs (Define): Emit the default member attribute.
24772
24773         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
24774         variable was being referred to while setting the value ;-)
24775
24776 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
24777
24778         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
24779         byte-by-byte information when we know the data is zero.
24780
24781         Make the block always a multiple of 4, because
24782         DefineInitializedData has a bug.
24783
24784         * assign.cs: Fix, we should assign from the temporary, not from
24785         the source. 
24786
24787         * expression.cs (MakeByteBlob): Fix my incorrect code.
24788
24789 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
24790
24791         * typemanager.cs (EnumToUnderlying): This function is used to get
24792         the underlying type from an enumeration, because it does not
24793         always work. 
24794
24795         * constant.cs: Use the I4_S form for values between -128 and 127.
24796
24797         * statement.cs (Block.LookupLabel): Looks up a label.
24798         (Block): Drop support for labeled blocks.
24799
24800         (LabeledStatement): New kind of statement that represents a label
24801         only.
24802
24803         (Goto): Finally implement this bad boy.
24804
24805         * cs-parser.jay: Update to reflect new mechanism to implement
24806         labels.
24807
24808 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
24809
24810         * codegen.cs (EmitContext.This): a codegen property that keeps the
24811         a single instance of this instead of creating many different this
24812         instances. 
24813
24814         * delegate.cs (Delegate.DoResolve): Update to use the property;
24815
24816         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
24817
24818         * expression.cs (BaseAccess.DoResolve): Ditto.
24819
24820 2001-12-29  Ravi Pratap  <ravi@ximian.com>
24821
24822         * typemanager.cs (methodimpl_attr_type): Add to hold the type
24823         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
24824
24825         (InitCoreTypes): Update accordingly.
24826
24827         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
24828         so we can quickly store the state.
24829
24830         (ApplyAttributes): Set the correct implementation flags
24831         for InternalCall methods.
24832
24833 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
24834
24835         * expression.cs (EmitCall): if a method is not virtual, then do
24836         not use callvirt on it.
24837
24838         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
24839         user defined stuff) requires the use of stobj, which takes an
24840         address on the stack instead of an array and an index.  So emit
24841         the Ldelema operation for it.
24842
24843         (EmitStoreOpcode): Use stobj for valuetypes.
24844
24845         (UnaryMutator.EmitCode): Use the right 1 value depending on
24846         whether we are dealing with int64/uint64, float or doubles.
24847
24848         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
24849         constructors that I implemented last night.
24850
24851         (Constructor.IsDefault): Fix to work properly for static
24852         constructors.
24853
24854         * cs-parser.jay (CheckDef): report method signature errors.
24855         Update error number 103 to be 132.
24856
24857         * decl.cs: New AdditionResult enumeration value: MethodExists.
24858         Although we do this check for methods later on in the semantic
24859         analysis, catching repeated default constructors is so easy that
24860         we catch these here. 
24861
24862         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
24863         promotions code.
24864
24865         (ParameterReference.EmitAssign, Emit): handle
24866         bools as bytes.
24867
24868         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
24869         (ArrayAccess.EmitStoreOpcode): ditto.
24870
24871         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
24872
24873         * expression.cs (MakeByteBlob): Complete all the missing types
24874         (uint, short, ushort, byte, sbyte)
24875
24876         * class.cs: Only init instance field initializers on instance
24877         constructors. 
24878
24879         Rename `constructors' to instance_constructors. 
24880
24881         (TypeContainer.AddConstructor): Only add constructors to the list
24882         if it is not static.
24883
24884         Make sure that we handle default_static_constructor independently
24885         everywhere where we handle instance_constructors
24886
24887 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
24888
24889         * class.cs: Do not lookup or create a base initializer for a
24890         static constructor.
24891
24892         (ConstructorInitializer.Resolve): use the proper type to lookup
24893         for constructors.
24894
24895         * cs-parser.jay: Report error 1585 (modifiers between type and name).
24896
24897         * enum.cs, interface.cs: Remove CloseType, this is taken care by
24898         in DeclSpace. 
24899
24900         * decl.cs: CloseType is now an virtual method, the default
24901         implementation just closes this type.
24902
24903 2001-12-28  Ravi Pratap  <ravi@ximian.com>
24904
24905         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
24906         to PreserveSig by default. Also emit HideBySig on such methods.
24907
24908         Basically, set the defaults to standard values.
24909
24910         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
24911         argument, if candidate is better, it can't be worse than the best !
24912
24913         (Invocation): Re-write bits to differentiate between methods being
24914         applicable in their expanded form and their normal form - for params
24915         methods of course.
24916
24917         Get rid of use_standard everywhere as only standard conversions are allowed
24918         in overload resolution. 
24919
24920         More spec conformance.
24921
24922 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
24923
24924         * driver.cs: Add --timestamp, to see where the compiler spends
24925         most of its time.
24926
24927         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
24928         `this' in static code.
24929
24930         (SimpleName.DoResolve): Implement in terms of a helper function
24931         that allows static-references to be passed upstream to
24932         MemberAccess.
24933
24934         (Expression.ResolveWithSimpleName): Resolve specially simple
24935         names when called by MemberAccess to implement the special
24936         semantics. 
24937
24938         (Expression.ImplicitReferenceConversion): Handle conversions from
24939         Null to reference types before others, as Null's type is
24940         System.Object. 
24941
24942         * expression.cs (Invocation.EmitCall): Handle the special case of
24943         calling methods declared on a reference type from a ValueType
24944         (Base classes System.Object and System.Enum)
24945
24946         (MemberAccess.Resolve): Only perform lookups on Enumerations if
24947         the left hand side is a TypeExpr, not on every enumeration. 
24948
24949         (Binary.Resolve): If types are reference types, then do a cast to
24950         object on operators != and == of both arguments.
24951
24952         * typemanager.cs (FindMembers): Extract instance and static
24953         members if requested.
24954
24955         * interface.cs (PopulateProperty): Use void_type instead of null
24956         as the return type for the setter method.
24957
24958         (PopulateIndexer): ditto.
24959
24960 2001-12-27  Ravi Pratap  <ravi@ximian.com>
24961
24962         * support.cs (ReflectionParameters): Fix minor bug where we
24963         were examining the wrong parameter for the ParamArray attribute.
24964
24965         Cope with requests for the type of the parameter at position
24966         greater than the params parameter's. We now return the element
24967         type of the params array as that makes more sense.
24968
24969         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
24970         accordingly as we no longer have to extract the element type
24971         ourselves.
24972
24973         (Invocation.OverloadResolve): Update.
24974
24975 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
24976
24977         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
24978         against IEnumerator, test whether the return value is a descendant
24979         of the IEnumerator interface.
24980
24981         * class.cs (Indexer.Define): Use an auxiliary method to implement
24982         the other bits of the method definition.  Begin support for
24983         explicit interface implementation.
24984
24985         (Property.DefineMethod): Use TypeManager.void_type instead of null
24986         for an empty return value.
24987
24988 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
24989
24990         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
24991         dealing with a FieldExpr which is composed of a FieldBuilder, in
24992         the code path we did extract the constant, but we should have
24993         obtained the underlying value to be able to cast it (otherwise we
24994         end up in an infinite loop, this is what Ravi was running into).
24995
24996         (ArrayCreation.UpdateIndices): Arrays might be empty.
24997
24998         (MemberAccess.ResolveMemberAccess): Add support for section
24999         14.5.4.1 that deals with the special case of E.I when E is a type
25000         and something else, that I can be a reference to a static member.
25001
25002         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25003         handle a particular array type to create byte blobs, it is just
25004         something we dont generate byteblobs for.
25005
25006         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25007         arguments. 
25008
25009         * location.cs (Push): remove the key from the hashtable that we
25010         are about to add.   This happens for empty files.
25011
25012         * driver.cs: Dispose files after we have parsed them.
25013
25014         (tokenize): new function that only runs the tokenizer on its
25015         input, for speed testing.
25016
25017 2001-12-26  Ravi Pratap  <ravi@ximian.com>
25018
25019         * class.cs (Event.Define): Define the private field only if there
25020         are no accessors defined.
25021
25022         * expression.cs (ResolveMemberAccess): If there is no associated
25023         field with the event, that means we have an event defined with its
25024         own accessors and we should flag error cs0070 since transforming
25025         ourselves into a field is not valid in that case.
25026
25027         * ecore.cs (SimpleName.DoResolve): Same as above.
25028
25029         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25030         and charset to sane values.
25031
25032 2001-12-25  Ravi Pratap  <ravi@ximian.com>
25033
25034         * assign.cs (DoResolve): Perform check on events only if they 
25035         are being accessed outside the declaring type.
25036
25037         * cs-parser.jay (event_declarations): Update rules to correctly
25038         set the type of the implicit parameter etc.
25039
25040         (add_accessor, remove_accessor): Set current local parameters.
25041
25042         * expression.cs (Binary): For delegate addition and subtraction,
25043         cast the return value from the method into the appropriate delegate
25044         type.
25045
25046 2001-12-24  Ravi Pratap  <ravi@ximian.com>
25047
25048         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25049         of these as the workaround is unnecessary.
25050
25051         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25052         delegate data - none of that is needed at all.
25053
25054         Re-write bits to extract the instance expression and the delegate method
25055         correctly.
25056
25057         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
25058         on delegates too.
25059
25060         * attribute.cs (ApplyAttributes): New method to take care of common tasks
25061         of attaching attributes instead of duplicating code everywhere.
25062
25063         * everywhere : Update code to do attribute emission using the above method.
25064
25065 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25066
25067         * expression.cs (IsParamsMethodApplicable): if there are not
25068         parameters, return immediately.
25069
25070         * ecore.cs: The 0 literal can be implicity converted to an enum
25071         type. 
25072
25073         (SimpleName.DoResolve): First lookup the type, then lookup the
25074         members. 
25075
25076         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25077         want to get its address.  If the InstanceExpression is not
25078         addressable, store the result in a temporary variable, then get
25079         the address of it.
25080
25081         * codegen.cs: Only display 219 errors on warning level or above. 
25082
25083         * expression.cs (ArrayAccess): Make it implement the
25084         IMemoryLocation interface.
25085
25086         (Binary.DoResolve): handle the operator == (object a, object b)
25087         and operator != (object a, object b) without incurring into a
25088         BoxedCast (because 5 != o should never be performed).
25089
25090         Handle binary enumerator operators.
25091
25092         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25093         value type, otherwise use Ldelem_ref.
25094
25095         Use precomputed names;
25096
25097         (AddressOf): Implement address of
25098
25099         * cs-parser.jay (labeled_statement): Fix recursive block
25100         addition by reworking the production.
25101
25102         * expression.cs (New.DoEmit): New has a special case:
25103                 
25104                  If we are dealing with a ValueType, we have a few
25105                  situations to deal with:
25106                 
25107                     * The target of New is a ValueType variable, that is
25108                       easy, we just pass this as the variable reference
25109                 
25110                     * The target of New is being passed as an argument,
25111                       to a boxing operation or a function that takes a
25112                       ValueType.
25113                 
25114                       In this case, we need to create a temporary variable
25115                       that is the argument of New.
25116
25117
25118 2001-12-23  Ravi Pratap  <ravi@ximian.com>
25119
25120         * rootcontext.cs (LookupType): Check that current_type is not null before
25121         going about looking at nested types.
25122
25123         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25124         not implement the IAssignMethod interface any more.
25125
25126         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25127         where we tranform them into FieldExprs if they are being resolved from within
25128         the declaring type.
25129
25130         * ecore.cs (SimpleName.DoResolve): Do the same here.
25131
25132         * assign.cs (DoResolve, Emit): Clean up code considerably. 
25133
25134         * ../errors/bug10.cs : Add.
25135
25136         * ../errors/cs0070.cs : Add.
25137
25138         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25139
25140         * assign.cs : Get rid of EventIsLocal everywhere.
25141
25142 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25143
25144         * ecore.cs (ConvertIntLiteral): finished the implementation.
25145
25146         * statement.cs (SwitchLabel): Convert the value we are using as a
25147         key before looking up the table.
25148
25149 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25150
25151         * codegen.cs (EmitTopBlock): Require a Location argument now.
25152
25153         * cs-parser.jay (constructor_declarator): We need to setup
25154         current_local_parameters before we parse the
25155         opt_constructor_initializer, to allow the variables to be bound
25156         to the constructor arguments.
25157
25158         * rootcontext.cs (LookupType): First lookup nested classes in our
25159         class and our parents before we go looking outside our class.
25160
25161         * expression.cs (ConstantFold): Extract/debox the values at the
25162         beginnning. 
25163
25164         * rootcontext.cs (EmitCode): Resolve the constants first before we
25165         resolve the types.  This is not really needed, but it helps debugging.
25166
25167         * statement.cs: report location.
25168
25169         * cs-parser.jay: pass location to throw statement.
25170
25171         * driver.cs: Small bug fix.
25172
25173         * report.cs: Updated format to be 4-zero filled digits.
25174
25175 2001-12-22  Ravi Pratap  <ravi@ximian.com>
25176
25177         * expression.cs (CheckIndices): Fix minor bug where the wrong
25178         variable was being referred to ;-)
25179
25180         (DoEmit): Do not call EmitStaticInitializers when the 
25181         underlying type is System.Object.
25182
25183 2001-12-21  Ravi Pratap  <ravi@ximian.com>
25184
25185         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25186         and do the usual workaround for SRE.
25187
25188         * class.cs (MyEventBuilder.EventType): New member to get at the type
25189         of the event, quickly.
25190
25191         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25192
25193         * assign.cs (Assign.DoResolve): Handle the case when the target
25194         is an EventExpr and perform the necessary checks.
25195
25196         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25197         interface.
25198
25199         (SimpleName.MemberStaticCheck): Include check for EventExpr.
25200
25201         (EventExpr): Set the type in the constructor itself since we 
25202         are meant to be born fully resolved.
25203
25204         (EventExpr.Define): Revert code I wrote earlier.
25205                 
25206         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25207         instance expression is null. The instance expression is a This in that case
25208         or a null, depending on whether it is a static method or not.
25209
25210         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25211         refers to more than one method.
25212
25213         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25214         and accordingly flag errors.
25215
25216 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25217
25218         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25219
25220 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25221
25222         * location.cs (ToString): Provide useful rutine.
25223
25224 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25225
25226         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25227         objects, return the actual integral boxed.
25228
25229         * statement.cs (SwitchLabel): define an ILLabel for each
25230         SwitchLabel. 
25231
25232         (Switch.CheckSwitch): If the value is a Literal, extract
25233         the underlying literal.
25234
25235         Also in the unused hashtable we had, add the SwitchLabel so we can
25236         quickly look this value up.
25237
25238         * constant.cs: Implement a bunch of new constants.  Rewrite
25239         Literal based on this.  Made changes everywhere to adapt to this.
25240
25241         * expression.cs (Expression.MakeByteBlob): Optimize routine by
25242         dereferencing array only once, and also copes with enumrations.
25243
25244         bytes are two bytes wide, not one.
25245
25246         (Cast): Perform constant conversions.
25247
25248         * ecore.cs (TryImplicitIntConversion): Return literals instead of
25249         wrappers to the literals here.
25250
25251         * expression.cs (DoNumericPromotions): long literals can converted
25252         to ulong implicity (this is taken care of elsewhere, but I was
25253         missing this spot).
25254
25255         * ecore.cs (Expression.Literalize): Make the return type Literal,
25256         to improve type checking.
25257
25258         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25259
25260 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25261
25262         * literal.cs: Revert code from ravi that checked the bounds.  The
25263         bounds are sane by the definition of the type itself. 
25264
25265         * typemanager.cs: Fix implementation of ImplementsInterface.  We
25266         need to actually look up in our parent hierarchy for interfaces
25267         implemented. 
25268
25269         * const.cs: Use the underlying type for enumerations
25270
25271         * delegate.cs: Compute the basename for the delegate creation,
25272         that should fix the delegate test case, and restore the correct
25273         Type Lookup semantics in rootcontext
25274
25275         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
25276         referencing a nested type with the Reflection API is using the "+"
25277         sign. 
25278
25279         * cs-parser.jay: Do not require EOF token at the end.
25280
25281 2001-12-20  Ravi Pratap  <ravi@ximian.com>
25282
25283         * rootcontext.cs (LookupType): Concatenate type names with
25284         a '.' instead of a '+' The test suite passes again.
25285
25286         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25287         field of the enumeration.
25288
25289         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25290         the case when the member is an EventExpr.
25291
25292         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25293         static has an associated instance expression.
25294
25295         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25296
25297         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25298
25299         * class.cs (Event.Define): Register event and perform appropriate checks
25300         for error #111.
25301
25302         We define the Add and Remove methods even if the use provides none because
25303         in that case, we provide default implementations ourselves.
25304
25305         Define a private field of the type of the event. This is done by the CSC compiler
25306         and we should be doing it too ;-)
25307
25308         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25309         More methods we use in code we generate.
25310
25311         (multicast_delegate_type, delegate_type): Two separate types since the distinction
25312         is important.
25313
25314         (InitCoreTypes): Update accordingly for the above.
25315
25316         * class.cs (Event.Emit): Generate code for default accessors that we provide
25317
25318         (EmitDefaultMethod): Do the job in the above.
25319
25320         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
25321         appropriate place.
25322
25323 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25324
25325         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25326         builders even if we were missing one.
25327
25328         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25329         pass the Basename as our class name instead of the Name.  The
25330         basename will be correctly composed for us.
25331
25332         * parameter.cs (Paramters): Now takes a Location argument.
25333
25334         * decl.cs (DeclSpace.LookupType): Removed convenience function and
25335         make all the code call directly LookupType in RootContext and take
25336         this chance to pass the Location information everywhere.
25337
25338         * Everywhere: pass Location information.
25339
25340 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
25341
25342         * class.cs (Constructor.Define): Updated way of detecting the
25343         length of the parameters.
25344
25345         (TypeContainer.DefineType): Use basename as the type name for
25346         nested types.
25347
25348         (TypeContainer.Define): Do not recursively define types here, as
25349         definition is taken care in order by the RootContext.
25350
25351         * tree.cs: Keep track of namespaces in a per-file basis.
25352
25353         * parameter.cs (Parameter.ComputeSignature): Update to use
25354         DeclSpace. 
25355
25356         (Parameters.GetSignature): ditto.
25357
25358         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25359         instead of a TypeContainer.
25360
25361         (Interface.SemanticAnalysis): Use `this' instead of our parent to
25362         resolve names.  Because we need to be resolve in our context, not
25363         our parents.
25364
25365         * driver.cs: Implement response files.
25366
25367         * class.cs (TypeContainer.DefineType): If we are defined, do not
25368         redefine ourselves.
25369
25370         (Event.Emit): Emit the code for add/remove handlers.
25371         (Event.Define): Save the MethodBuilders for add/remove.
25372
25373         * typemanager.cs: Use pair here too.
25374
25375         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25376         DictionaryEntry requires the first argument to be non-null.  
25377
25378         (enum_declaration): Compute full name for registering the
25379         enumeration.
25380
25381         (delegate_declaration): Instead of using
25382         formal_parameter_list, use opt_formal_parameter_list as the list
25383         can be empty.
25384
25385         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25386         (EventParsing): New property that controls whether `add' and
25387         `remove' are returned as tokens or identifiers (for events);
25388
25389 2001-12-19  Ravi Pratap  <ravi@ximian.com>
25390
25391         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25392         use MyEventBuilder only and let it wrap the real builder for us.
25393
25394         (MyEventBuilder): Revamp constructor etc.
25395
25396         Implement all operations that we perform on EventBuilder in precisely the same
25397         way here too.
25398
25399         (FindMembers): Update to use the EventBuilder member.
25400
25401         (Event.Emit): Update accordingly.
25402
25403 2001-12-18  Ravi Pratap  <ravi@ximian.com>
25404
25405         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25406         by calling the appropriate methods.
25407
25408         (GetCustomAttributes): Make stubs as they cannot possibly do anything
25409         useful.
25410
25411         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25412
25413 2001-12-17  Ravi Pratap  <ravi@ximian.com>
25414
25415         * delegate.cs (Delegate.Populate): Check that the return type
25416         and various parameters types are indeed accessible.
25417
25418         * class.cs (Constructor.Define): Same here.
25419
25420         (Field.Define): Ditto.
25421
25422         (Event.Define): Ditto.
25423
25424         (Operator.Define): Check that the underlying Method defined itself
25425         correctly - so it's MethodBuilder should not be null.
25426
25427         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25428         expression happens to be null.
25429
25430         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25431         members but as of now we don't seem to be able to do anything really useful with it.
25432
25433         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25434         not the EventBuilder.
25435
25436 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
25437
25438         * cs-tokenizer.cs: Add support for defines.
25439         Add support for #if, #elif, #else, #endif
25440
25441         (eval_var): evaluates a variable.
25442         (eval): stubbed for evaluating functions.
25443
25444         * cs-parser.jay: Pass the defines information
25445
25446         * driver.cs: Add --define command line option.
25447
25448         * decl.cs: Move MemberCore here.
25449
25450         Make it the base class for DeclSpace.  This allows us to catch and
25451         report 108 and 109 for everything now.
25452
25453         * class.cs (TypeContainer.Define): Extract all the members
25454         before populating and emit the warning 108 (new keyword required
25455         to override) instead of having each member implement this.
25456
25457         (MemberCore.Define): New abstract method, we will be using this in
25458         the warning reporting engine in Populate.
25459
25460         (Operator.Define): Adjust to new MemberCore protocol. 
25461
25462         * const.cs (Const): This does not derive from Expression, it is a
25463         temporary object we use to create fields, it is a MemberCore. 
25464
25465         * class.cs (Method.Define): Allow the entry point to be in a
25466         specific class.
25467
25468         * driver.cs: Rewrite the argument handler to clean it up a bit.
25469
25470         * rootcontext.cs: Made it just an auxiliary namespace feature by
25471         making everything static.
25472
25473         * driver.cs: Adapt code to use RootContext type name instead of
25474         instance variable.
25475
25476         * delegate.cs: Remove RootContext argument.
25477
25478         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25479         argument. 
25480
25481         * class.cs (Event.Define): The lookup can fail.
25482
25483         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
25484
25485         * expression.cs: Resolve the this instance before invoking the code.
25486
25487 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
25488
25489         * cs-parser.jay: Add a production in element_access that allows
25490         the thing to become a "type" reference.  This way we can parse
25491         things like "(string [])" as a type.
25492
25493         Note that this still does not handle the more complex rules of
25494         casts. 
25495
25496
25497         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
25498
25499         * ecore.cs: (CopyNewMethods): new utility function used to
25500         assemble the list of methods from running FindMembers.
25501
25502         (MemberLookup): Rework FindMembers so that 
25503
25504 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
25505
25506         * class.cs (TypeContainer): Remove Delegates who fail to be
25507         defined.
25508
25509         * delegate.cs (Populate): Verify that we dont get null return
25510         values.   TODO: Check for AsAccessible.
25511
25512         * cs-parser.jay: Use basename to emit error 574 (destructor should
25513         have the same name as container class), not the full name.
25514
25515         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25516         possible representation.  
25517
25518         Also implements integer type suffixes U and L.
25519
25520 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
25521
25522         * expression.cs (ArrayCreation.DoResolve): We need to do the
25523         argument resolution *always*.
25524
25525         * decl.cs: Make this hold the namespace.  Hold the root context as
25526         well.
25527         (LookupType): Move here.
25528
25529         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25530
25531         * location.cs (Row, Name): Fixed the code, it was always returning
25532         references to the first file.
25533
25534         * interface.cs: Register properties defined through interfaces.
25535
25536         * driver.cs: Add support for globbing on the command line
25537
25538         * class.cs (Field): Make it derive from MemberCore as well.
25539         (Event): ditto.
25540
25541 2001-12-15  Ravi Pratap  <ravi@ximian.com>
25542
25543         * class.cs (Event::Define): Check that the type of the event is a delegate
25544         type else flag error #66.
25545
25546         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25547         same.
25548
25549         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25550         values of EntryPoint, CharSet etc etc.
25551
25552         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25553
25554         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25555         be null and we should ignore this. I am not sure if this is really clean. Apparently,
25556         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25557         which needs this to do its work.
25558
25559         * ../errors/cs0066.cs : Add.
25560
25561 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
25562
25563         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25564         helper functions.
25565
25566         * class.cs: (MethodSignature.MethodSignature): Removed hack that
25567         clears out the parameters field.
25568         (MemberSignatureCompare): Cleanup
25569
25570         (MemberCore): New base class used to share code between MethodCore
25571         and Property.
25572
25573         (RegisterRequiredImplementations) BindingFlags.Public requires
25574         either BindingFlags.Instace or Static.  Use instance here.
25575
25576         (Property): Refactored code to cope better with the full spec.
25577
25578         * parameter.cs (GetParameterInfo): Return an empty array instead
25579         of null on error.
25580
25581         * class.cs (Property): Abstract or extern properties have no bodies.
25582
25583         * parameter.cs (GetParameterInfo): return a zero-sized array.
25584
25585         * class.cs (TypeContainer.MethodModifiersValid): Move all the
25586         method modifier validation to the typecontainer so we can reuse
25587         this on properties.
25588
25589         (MethodCore.ParameterTypes): return an empty sized array of types.
25590
25591         (Property.Define): Test property modifier validity.
25592
25593         Add tests for sealed/override too.
25594
25595         (Method.Emit): abstract or extern methods have no bodies.
25596
25597 2001-12-14  Ravi Pratap  <ravi@ximian.com>
25598
25599         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25600         thing.
25601
25602         (Method::Define, ::Emit): Modify accordingly.
25603
25604         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25605
25606         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25607
25608         * makefile: Pass in /unsafe.
25609
25610 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
25611
25612         * class.cs (MakeKey): Kill routine.
25613
25614         * class.cs (TypeContainer.Define): Correctly define explicit
25615         method implementations (they require the full interface name plus
25616         the method name).
25617
25618         * typemanager.cs: Deply the PtrHashtable here and stop using the
25619         lame keys.  Things work so much better.
25620
25621         This of course broke everyone who depended on `RegisterMethod' to
25622         do the `test for existance' test.  This has to be done elsewhere.
25623
25624         * support.cs (PtrHashtable): A hashtable that avoid comparing with
25625         the object stupid Equals method (because, that like fails all over
25626         the place).  We still do not use it.
25627
25628         * class.cs (TypeContainer.SetRequiredInterface,
25629         TypeContainer.RequireMethods): Killed these two routines and moved
25630         all the functionality to RegisterRequiredImplementations.
25631
25632         (TypeContainer.RegisterRequiredImplementations): This routine now
25633         registers all the implementations required in an array for the
25634         interfaces and abstract methods.  We use an array of structures
25635         which can be computed ahead of time to reduce memory usage and we
25636         also assume that lookups are cheap as most classes will not
25637         implement too many interfaces.
25638
25639         We also avoid creating too many MethodSignatures.
25640
25641         (TypeContainer.IsInterfaceMethod): Update and optionally does not
25642         clear the "pending" bit if we find that there are problems with
25643         the declaration.
25644
25645         (TypeContainer.VerifyPendingMethods): Update to report errors of
25646         methods that look like implementations but are not.
25647
25648         (TypeContainer.Define): Add support for explicit interface method
25649         implementation. 
25650
25651 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
25652
25653         * typemanager.cs: Keep track of the parameters here instead of
25654         being a feature of the TypeContainer.
25655
25656         * class.cs: Drop the registration of parameters here, as
25657         InterfaceMethods are also interface declarations.
25658
25659         * delegate.cs: Register methods with the TypeManager not only with
25660         the TypeContainer.  This code was buggy.
25661
25662         * interface.cs: Full registation here.
25663
25664 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
25665
25666         * expression.cs: Remove reducer for binary expressions, it can not
25667         be done this way.
25668
25669         * const.cs: Put here the code that used to go into constant.cs
25670
25671         * constant.cs: Put here the code for constants, this is a new base
25672         class for Literals.
25673
25674         * literal.cs: Make Literal derive from Constant.
25675
25676 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
25677
25678         * statement.cs (Return.Emit): Report error 157 if the user
25679         attempts to return from a finally block.
25680
25681         (Return.Emit): Instead of emitting a return, jump to the end of
25682         the function.
25683
25684         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
25685         LocalBuilder to store the result of the function.  ReturnLabel is
25686         the target where we jump.
25687
25688
25689 2001-12-09  Radek Doulik  <rodo@ximian.com>
25690
25691         * cs-parser.jay: remember alias in current namespace
25692
25693         * ecore.cs (SimpleName::DoResolve): use aliases for types or
25694         namespaces
25695
25696         * class.cs (LookupAlias): lookup alias in my_namespace
25697
25698         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
25699         aliases hashtable
25700         (LookupAlias): lookup alias in this and if needed in parent
25701         namespaces
25702
25703 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
25704
25705         * support.cs: 
25706
25707         * rootcontext.cs: (ModuleBuilder) Made static, first step into
25708         making things static.  I need this to avoid passing the
25709         TypeContainer when calling ParameterType.
25710
25711         * support.cs (InternalParameters.ParameterType): Remove ugly hack
25712         that did string manipulation to compute the type and then call
25713         GetType.  Use Parameter.ParameterType instead.
25714
25715         * cs-tokenizer.cs: Consume the suffix for floating values.
25716
25717         * expression.cs (ParameterReference): figure out whether this is a
25718         reference parameter or not.  Kill an extra variable by computing
25719         the arg_idx during emission.
25720
25721         * parameter.cs (Parameters.GetParameterInfo): New overloaded
25722         function that returns whether a parameter is an out/ref value or not.
25723
25724         (Parameter.ParameterType): The type of the parameter (base,
25725         without ref/out applied).
25726
25727         (Parameter.Resolve): Perform resolution here.
25728         (Parameter.ExternalType): The full type (with ref/out applied).
25729
25730         * statement.cs (Using.Emit, Using.EmitExpression): Implement
25731         support for expressions on the using statement.
25732
25733 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
25734
25735         * statement.cs (Using.EmitLocalVariableDecls): Split the
25736         localvariable handling of the using statement.
25737
25738         (Block.EmitMeta): Keep track of variable count across blocks.  We
25739         were reusing slots on separate branches of blocks.
25740
25741         (Try.Emit): Emit the general code block, we were not emitting it. 
25742
25743         Check the type of the declaration to be an IDisposable or
25744         something that can be implicity converted to it. 
25745
25746         Emit conversions if required.
25747
25748         * ecore.cs (EmptyExpression): New utility class.
25749         (Expression.ImplicitConversionExists): New utility function.
25750
25751 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
25752
25753         * statement.cs (Using): Implement.
25754
25755         * expression.cs (LocalVariableReference): Support read only variables.
25756
25757         * statement.cs: Remove the explicit emit for the Leave opcode.
25758         (VariableInfo): Add a readonly field.
25759
25760 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
25761
25762         * ecore.cs (ConvCast): new class used to encapsulate the various
25763         explicit integer conversions that works in both checked and
25764         unchecked contexts.
25765
25766         (Expression.ConvertNumericExplicit): Use new ConvCast class to
25767         properly generate the overflow opcodes.
25768
25769 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
25770
25771         * statement.cs: The correct type for the EmptyExpression is the
25772         element_type, not the variable type.  Ravi pointed this out.
25773
25774 2001-12-04  Ravi Pratap  <ravi@ximian.com>
25775
25776         * class.cs (Method::Define): Handle PInvoke methods specially
25777         by using DefinePInvokeMethod instead of the usual one.
25778
25779         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
25780         above to do the task of extracting information and defining the method.
25781
25782 2001-12-04  Ravi Pratap  <ravi@ximian.com>
25783
25784         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
25785         of the condition for string type.
25786
25787         (Emit): Move that here. 
25788
25789         (ArrayCreation::CheckIndices): Keep string literals in their expression
25790         form.
25791
25792         (EmitDynamicInitializers): Handle strings appropriately.
25793
25794 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
25795
25796         * codegen.cs (EmitContext): Replace multiple variables with a
25797         single pointer to the current Switch statement.
25798
25799         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
25800         EmitContext.
25801
25802 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
25803
25804         * statement.cs 
25805
25806         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
25807         default'.
25808
25809         (Foreach.Emit): Foreach on arrays was not setting
25810         up the loop variables (for break/continue).
25811
25812         (GotoCase): Semi-implented.
25813
25814 2001-12-03  Ravi Pratap  <ravi@ximian.com>
25815
25816         * attribute.cs (CheckAttribute): Handle system attributes by using
25817         Attribute.GetAttributes to examine information we need.
25818
25819         (GetValidPlaces): Same here.
25820
25821         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
25822
25823         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
25824
25825         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
25826
25827         (Method::Define): Set appropriate flags if we have a DllImport attribute.
25828
25829         (Method::Emit): Handle the case when we are a PInvoke method.
25830
25831 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
25832
25833         * expression.cs: Use ResolveWithSimpleName on compound names.
25834
25835 2001-12-02  Ravi Pratap  <ravi@ximian.com>
25836
25837         * constant.cs (EmitConstant): Make sure we resolve the associated expression
25838         before trying to reduce it.
25839
25840         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
25841
25842         * constant.cs (LookupConstantValue): Implement.
25843
25844         (EmitConstant): Use the above in emitting the constant.
25845
25846         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
25847         that are user-defined by doing a LookupConstantValue on them.
25848
25849         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
25850         too, like above.
25851
25852 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
25853
25854         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
25855
25856         (BaseAccess.DoResolve): Implement.
25857
25858         (MemberAccess.DoResolve): Split this routine into a
25859         ResolveMemberAccess routine that can be used independently
25860
25861 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
25862
25863         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
25864         As that share bits of the implementation.  Is returns a boolean,
25865         while As returns the Type that is being probed.
25866
25867 2001-12-01  Ravi Pratap  <ravi@ximian.com>
25868
25869         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
25870         instead of a Literal - much easier.
25871
25872         (EnumInTransit): Remove - utterly useless :-)
25873
25874         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
25875
25876         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
25877
25878         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
25879         chain when we have no associated expression.
25880
25881 2001-11-30  Ravi Pratap  <ravi@ximian.com>
25882
25883         * constant.cs (Define): Use Location while reporting the errror.
25884
25885         Also emit a warning when 'new' is used and there is no inherited
25886         member to hide.
25887
25888         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
25889         populated.
25890
25891         (LookupEnumValue): Implement to lookup an enum member's value and define it
25892         if necessary.
25893
25894         (Populate): Re-write accordingly to use the above routine.
25895
25896 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
25897
25898         * expression.cs (This): Fix prototype for DoResolveLValue to
25899         override the base class DoResolveLValue.
25900
25901         * cs-parser.cs: Report errors cs574 and cs575 (destructor
25902         declarations) 
25903
25904         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
25905         (we need to load the address of the field here).  This fixes
25906         test-22. 
25907
25908         (FieldExpr.DoResolveLValue): Call the DoResolve
25909         function to initialize the Instance expression.
25910
25911         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
25912         correctly the GetEnumerator operation on a value type.
25913
25914         * cs-parser.jay: Add more simple parsing error catches.
25915
25916         * statement.cs (Switch): Add support for string switches.
25917         Handle null specially.
25918
25919         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
25920
25921 2001-11-28  Ravi Pratap  <ravi@ximian.com>
25922
25923         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
25924
25925         (declare_local_constant): New helper function.
25926
25927         * statement.cs (AddConstant): Keep a separate record of constants
25928
25929         (IsConstant): Implement to determine if a variable is a constant.
25930
25931         (GetConstantExpression): Implement.
25932
25933         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
25934
25935         * statement.cs (IsVariableDefined): Re-write.
25936
25937 2001-11-27  Ravi Pratap  <ravi@ximian.com>
25938
25939         * class.cs (TypeContainer::FindMembers): Look for constants
25940         in the case when we are looking for MemberTypes.Field
25941
25942         * expression.cs (MemberAccess::DoResolve): Check that in the
25943         case we are a FieldExpr and a Literal, we are not being accessed
25944         by an instance reference.
25945
25946         * cs-parser.jay (local_constant_declaration): Implement.
25947
25948         (declaration_statement): Implement for constant declarations.
25949
25950 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
25951
25952         * statement.cs (Switch): Catch double defaults.
25953
25954         (Switch): More work on the switch() statement
25955         implementation.  It works for integral values now, need to finish
25956         string support.
25957
25958
25959 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
25960
25961         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
25962         integer literals into other integer literals.  To be used by
25963         switch. 
25964
25965 2001-11-24  Ravi Pratap  <ravi@ximian.com>
25966
25967         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
25968         some memory.
25969
25970         (EmitDynamicInitializers): Cope with the above since we extract data
25971         directly from ArrayData now.
25972
25973         (ExpectInitializers): Keep track of whether initializers are mandatory
25974         or not.
25975
25976         (Bounds): Make it a hashtable to prevent the same dimension being 
25977         recorded for every element in that dimension.
25978
25979         (EmitDynamicInitializers): Fix bug which prevented the Set array method
25980         from being found.
25981
25982         Also fix bug which was causing the indices to be emitted in the reverse
25983         order.
25984
25985 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
25986
25987         * expression.cs (ArrayCreation): Implement the bits that Ravi left
25988         unfinished.  They do not work, because the underlying code is
25989         sloppy.
25990
25991 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
25992
25993         * cs-parser.jay: Remove bogus fixme.
25994
25995         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
25996         on Switch statement.
25997
25998 2001-11-23  Ravi Pratap  <ravi@ximian.com>
25999
26000         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26001         the same. 
26002
26003         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26004         parameter. Apparently, any expression is allowed. 
26005
26006         (ValidateInitializers): Update accordingly.
26007
26008         (CheckIndices): Fix some tricky bugs thanks to recursion.
26009
26010         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
26011         I was being completely brain-dead.
26012
26013         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26014         and re-write acordingly.
26015
26016         (DelegateInvocation): Re-write accordingly.
26017
26018         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26019
26020         (MakeByteBlob): Handle types more correctly.
26021
26022         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26023         initialization from expressions but it is incomplete because I am a complete
26024         Dodo :-|
26025
26026 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26027
26028         * statement.cs (If.Emit): Fix a bug that generated incorrect code
26029         on If.  Basically, we have to return `true' (ie, we do return to
26030         our caller) only if both branches of the if return.
26031
26032         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26033         short-circuit operators, handle them as short circuit operators. 
26034
26035         (Cast.DoResolve): Resolve type.
26036         (Cast.Cast): Take an expression as the target type.
26037
26038         * cs-parser.jay (cast_expression): Remove old hack that only
26039         allowed a limited set of types to be handled.  Now we take a
26040         unary_expression and we resolve to a type during semantic
26041         analysis.
26042
26043         Use the grammar productions from Rhys to handle casts (this is
26044         not complete like Rhys syntax yet, we fail to handle that corner
26045         case that C# has regarding (-x), but we will get there.
26046
26047 2001-11-22  Ravi Pratap  <ravi@ximian.com>
26048
26049         * class.cs (EmitFieldInitializer): Take care of the case when we have a
26050         field which is an array type.
26051
26052         * cs-parser.jay (declare_local_variables): Support array initialization too.
26053
26054         * typemanager.cs (MakeKey): Implement.
26055
26056         (everywhere): Use the above appropriately.
26057
26058         * cs-parser.jay (for_statement): Update for array initialization while
26059         declaring variables.
26060
26061         * ecore.cs : The error message was correct, it's the variable's names that
26062         were misleading ;-) Make the code more readable.
26063
26064         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26065         the correct type etc.
26066
26067         (ConvertExplicit): Handle Enum types by examining the underlying type.
26068
26069 2001-11-21  Ravi Pratap  <ravi@ximian.com>
26070
26071         * parameter.cs (GetCallingConvention): Always return
26072         CallingConventions.Standard for now.
26073
26074 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26075
26076         * expression.cs (Binary.ResolveOperator): Update the values of `l'
26077         and `r' after calling DoNumericPromotions.
26078
26079         * ecore.cs: Fix error message (the types were in the wrong order).
26080
26081         * statement.cs (Foreach.ProbeCollectionType): Need to pass
26082         BindingFlags.Instance as well 
26083
26084         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26085         implicit int literal conversion in an empty cast so that we
26086         propagate the right type upstream.
26087
26088         (UnboxCast): new class used to unbox value types.
26089         (Expression.ConvertExplicit): Add explicit type conversions done
26090         by unboxing.
26091
26092         (Expression.ImplicitNumericConversion): Oops, forgot to test for
26093         the target type before applying the implicit LongLiterals to ULong
26094         literal cast.
26095
26096 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
26097
26098         * cs-parser.jay (for_statement): Reworked the way For works: now
26099         we declare manually any variables that are introduced in
26100         for_initializer to solve the problem of having out-of-band code
26101         emition (that is what got for broken).
26102
26103         (declaration_statement): Perform the actual variable declaration
26104         that used to be done in local_variable_declaration here.
26105
26106         (local_variable_declaration): Do not declare anything, just pass
26107         the information on a DictionaryEntry
26108
26109 2001-11-20  Ravi Pratap  <ravi@ximian.com>
26110
26111         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26112         re-write of the logic to now make it recursive.
26113
26114         (UpdateIndices): Re-write accordingly.
26115
26116         Store element data in a separate ArrayData list in the above methods.
26117
26118         (MakeByteBlob): Implement to dump the array data into a byte array.
26119
26120 2001-11-19  Ravi Pratap  <ravi@ximian.com>
26121
26122         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26123         into CheckIndices.
26124
26125         * constant.cs (Define): Implement.
26126
26127         (EmitConstant): Re-write fully.
26128
26129         Pass in location info.
26130
26131         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26132         respectively.
26133
26134         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26135         DictionaryEntry since we need location info too.
26136
26137         (constant_declaration): Update accordingly.
26138
26139         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26140         code into another method : UpdateIndices.
26141
26142 2001-11-18  Ravi Pratap  <ravi@ximian.com>
26143
26144         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26145         some type checking etc.
26146
26147 2001-11-17  Ravi Pratap  <ravi@ximian.com>
26148
26149         * expression.cs (ArrayCreation::ValidateInitializers): Implement
26150         bits to provide dimension info if the user skips doing that.
26151
26152         Update second constructor to store the rank correctly.
26153
26154 2001-11-16  Ravi Pratap  <ravi@ximian.com>
26155
26156         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26157         and try to implement.
26158
26159         * ../errors/cs0150.cs : Add.
26160
26161         * ../errors/cs0178.cs : Add.
26162
26163 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
26164
26165         * statement.cs: Implement foreach on multi-dimensional arrays. 
26166
26167         * parameter.cs (Parameters.GetParameterByName): Also lookup the
26168         name of the params argument.
26169
26170         * expression.cs: Use EmitStoreOpcode to get the right opcode while
26171         initializing the array.
26172
26173         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26174         we can use this elsewhere.
26175
26176         * statement.cs: Finish implementation of foreach for single
26177         dimension arrays.
26178
26179         * cs-parser.jay: Use an out-of-band stack to pass information
26180         around, I wonder why I need this.
26181
26182         foreach_block: Make the new foreach_block the current_block.
26183
26184         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26185         function used to return a static Parameters structure.  Used for
26186         empty parameters, as those are created very frequently.
26187
26188         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26189
26190 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26191
26192         * interface.cs : Default modifier is private, not public. The
26193         make verify test passes again.
26194
26195 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26196
26197         * support.cs (ReflectionParameters): Fix logic to determine
26198         whether the last parameter is a params one. Test 9 passes again.
26199
26200         * delegate.cs (Populate): Register the builders we define with
26201         RegisterParameterForBuilder. Test 19 passes again.
26202
26203         * cs-parser.jay (property_declaration): Reference $6 instead
26204         of $$ to get at the location.
26205
26206         (indexer_declaration): Similar stuff.
26207
26208         (attribute): Ditto.
26209
26210         * class.cs (Property): Register parameters for the Get and Set methods
26211         if they exist. Test 23 passes again.
26212
26213         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26214         call to EmitArguments as we are sure there aren't any params arguments. 
26215         Test 32 passes again.
26216
26217         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26218         IndexOutOfRangeException. 
26219
26220         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26221         Test 33 now passes again.
26222
26223 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
26224
26225         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26226         broke a bunch of things.  Will have to come up with a better way
26227         of tracking locations.
26228
26229         * statement.cs: Implemented foreach for single dimension arrays.
26230
26231 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26232
26233         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26234         an error.  This removes the lookup from the critical path.
26235
26236         * cs-parser.jay: Removed use of temporary_loc, which is completely
26237         broken. 
26238
26239 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
26240
26241         * support.cs (ReflectionParameters.ParameterModifier): Report
26242         whether the argument is a PARAMS argument or not.
26243
26244         * class.cs: Set the attribute `ParamArrayAttribute' on the
26245         parameter argument.
26246
26247         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26248         and cons_param_array_attribute (ConstructorInfo for
26249         ParamArrayAttribute)., 
26250
26251         * codegen.cs: Emit the return using the `Return' statement, that
26252         way we can report the error correctly for missing return values. 
26253
26254         * class.cs (Method.Emit): Clean up.
26255
26256         * expression.cs (Argument.Resolve): Take another argument: the
26257         location where this argument is used.  Notice that this is not
26258         part of the "Argument" class as to reduce the size of the
26259         structure (we know the approximate location anyways).
26260
26261         Test if the argument is a variable-reference, if not, then
26262         complain with a 206.
26263
26264         (Argument.Emit): Emit addresses of variables.
26265
26266         (Argument.FullDesc): Simplify.
26267
26268         (Invocation.DoResolve): Update for Argument.Resolve.
26269
26270         (ElementAccess.DoResolve): ditto.
26271
26272         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26273         method should be virtual, as this method is always virtual.
26274
26275         (NewDelegate.DoResolve): Update for Argument.Resolve.
26276
26277         * class.cs (ConstructorInitializer.DoResolve): ditto.
26278
26279         * attribute.cs (Attribute.Resolve): ditto.
26280
26281 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
26282
26283         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26284
26285         * expression.cs (ParameterReference): Drop IStackStorage and implement
26286         IAssignMethod instead. 
26287
26288         (LocalVariableReference): ditto.
26289
26290         * ecore.cs (FieldExpr): Drop IStackStorage and implement
26291         IAssignMethod instead. 
26292
26293 2001-11-13  Miguel de Icaza <miguel@ximian.com>
26294
26295         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26296         enumerations that are used in heavily used structures derive from
26297         byte in a laughable and pathetic attempt to reduce memory usage.
26298         This is the kind of pre-optimzations that you should not do at
26299         home without adult supervision.
26300
26301         * expression.cs (UnaryMutator): New class, used to handle ++ and
26302         -- separatedly from the other unary operators.  Cleans up the
26303         code, and kills the ExpressionStatement dependency in Unary.
26304
26305         (Unary): Removed `method' and `Arguments' from this class, making
26306         it smaller, and moving it all to SimpleCall, so I can reuse this
26307         code in other locations and avoid creating a lot of transient data
26308         strucutres when not required.
26309
26310         * cs-parser.jay: Adjust for new changes.
26311
26312 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
26313
26314         * enum.cs (Enum.Populate): If there is a failure during
26315         definition, return
26316
26317         * cs-parser.jay (opt_enum_base): we used to catch type errors
26318         here, but this is really incorrect.  The type error should be
26319         catched during semantic analysis.
26320
26321 2001-12-11  Ravi Pratap  <ravi@ximian.com>
26322
26323         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26324         current_local_parameters as expected since I, in my stupidity, had forgotten
26325         to do this :-)
26326
26327         * attribute.cs (GetValidPlaces): Fix stupid bug.
26328
26329         * class.cs (Method::Emit): Perform check on applicability of attributes.
26330
26331         (Constructor::Emit): Ditto.
26332
26333         (Field::Emit): Ditto.
26334
26335         (Field.Location): Store location information.
26336
26337         (Property, Event, Indexer, Operator): Ditto.
26338
26339         * cs-parser.jay (field_declaration): Pass in location for each field.
26340
26341         * ../errors/cs0592.cs : Add.
26342
26343 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26344
26345         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26346
26347         (InitCoreTypes): Update accordingly.
26348
26349         (RegisterAttrType, LookupAttr): Implement.
26350
26351         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26352         info about the same.
26353
26354         (Resolve): Update to populate the above as necessary.
26355
26356         (Error592): Helper.
26357
26358         (GetValidPlaces): Helper to the above.
26359
26360         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26361
26362         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26363
26364 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26365
26366         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26367
26368         * ../errors/cs0617.cs : Add.
26369
26370 2001-11-11  Ravi Pratap  <ravi@ximian.com>
26371
26372         * enum.cs (Emit): Rename to Populate to be more consistent with what
26373         we expect it to do and when exactly it is called.
26374
26375         * class.cs, rootcontext.cs : Update accordingly.
26376
26377         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26378         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26379
26380         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26381
26382         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26383         of a fieldinfo using the above, when dealing with a FieldBuilder.
26384
26385 2001-11-10  Ravi Pratap  <ravi@ximian.com>
26386
26387         * ../errors/cs0031.cs : Add.
26388
26389         * ../errors/cs1008.cs : Add.
26390
26391         * ../errrors/cs0543.cs : Add.
26392
26393         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26394         enum type.
26395
26396         (FindMembers): Implement.
26397
26398         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26399         enums and delegates too.
26400
26401         (enum_types): Rename to builder_to_enum.
26402
26403         (delegate_types): Rename to builder_to_delegate.
26404
26405         * delegate.cs (FindMembers): Implement.
26406
26407 2001-11-09  Ravi Pratap  <ravi@ximian.com>
26408
26409         * typemanager.cs (IsEnumType): Implement.
26410
26411         * enum.cs (Emit): Re-write parts to account for the underlying type
26412         better and perform checking etc.
26413
26414         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26415         of the underlying type.
26416
26417         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26418         value
26419
26420         * enum.cs (error31): Helper to report error #31.
26421
26422         * cs-parser.jay (enum_declaration): Store location of each member too.
26423
26424         * enum.cs (member_to_location): New hashtable. 
26425
26426         (AddEnumMember): Update location hashtable.
26427
26428         (Emit): Use the location of each member while reporting errors.
26429
26430 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26431
26432         * cs-parser.jay: A for_initializer if is a
26433         local_variable_declaration really ammount to have an implicit
26434         block with the variable declaration and no initializer for for.
26435
26436         * statement.cs (For.Emit): Cope with null initializers.
26437
26438         This fixes the infinite loop on for initializers.
26439
26440 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
26441
26442         * enum.cs: More cleanup.
26443
26444         * ecore.cs: Remove dead code.
26445
26446         * class.cs (Property.Emit): More simplification.
26447         (Event.Emit): ditto.
26448
26449         Reworked to have less levels of indentation.
26450
26451 2001-11-08  Ravi Pratap  <ravi@ximian.com>
26452
26453         * class.cs (Property): Emit attributes.
26454
26455         (Field): Ditto.
26456
26457         (Event): Ditto.
26458
26459         (Indexer): Ditto.
26460
26461         (Operator): Ditto.
26462
26463         * enum.cs (Emit): Ditto.
26464
26465         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26466         Enums too.
26467
26468         * class.cs (Field, Event, etc.): Move attribute generation into the
26469         Emit method everywhere.
26470
26471         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26472         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26473         as we had no way of defining nested enums !
26474
26475         * rootcontext.cs : Adjust code accordingly.
26476
26477         * typemanager.cs (AddEnumType): To keep track of enum types separately.
26478
26479 2001-11-07  Ravi Pratap  <ravi@ximian.com>
26480
26481         * expression.cs (EvalConstantExpression): Move into ecore.cs
26482
26483         * enum.cs (Enum): Rename some members and make them public and readonly
26484         according to our convention.
26485
26486         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26487         nothing else.
26488
26489         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26490
26491         (Enum::Emit): Write a simple version for now which doesn't try to compute
26492         expressions. I shall modify this to be more robust in just a while.
26493
26494         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26495
26496         (TypeContainer::CloseType): Create the Enum types too.
26497
26498         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26499
26500         * expression.cs (EvalConstantExpression): Get rid of completely.
26501
26502         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26503         user-defined values and other cases.
26504
26505         (IsValidEnumLiteral): Helper function.
26506
26507         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
26508         out there in the case we had a literal FieldExpr.
26509
26510         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26511
26512         (Literalize): Revamp a bit to take two arguments.
26513
26514         (EnumLiteral): New class which derives from Literal to wrap enum literals.
26515
26516 2001-11-06  Ravi Pratap  <ravi@ximian.com>
26517
26518         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26519
26520         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26521
26522         (Resolve): Use the above to ensure we have proper initializers.
26523
26524 2001-11-05  Ravi Pratap  <ravi@ximian.com>
26525
26526         * expression.cs (Expression::EvalConstantExpression): New method to 
26527         evaluate constant expressions.
26528
26529         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26530
26531 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
26532
26533         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26534         in an array.
26535
26536         (Binary.ResolveOperator): Handle operator != (object a, object b)
26537         and operator == (object a, object b);
26538
26539         (Binary.DoNumericPromotions): Indicate whether the numeric
26540         promotion was possible.
26541
26542         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26543         Implement.  
26544
26545         Made the ArrayAccess implement interface IAssignMethod instead of
26546         IStackStore as the order in which arguments are passed reflects
26547         this.
26548
26549         * assign.cs: Instead of using expr.ExprClass to select the way of
26550         assinging, probe for the IStackStore/IAssignMethod interfaces.
26551
26552         * typemanager.cs: Load InitializeArray definition.
26553
26554         * rootcontext.cs (RootContext.MakeStaticData): Used to define
26555         static data that can be used to initialize arrays. 
26556
26557 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
26558
26559         * expression.cs: Handle operator== and operator!= for booleans.
26560
26561         (Conditioal.Reduce): Implement reducer for the ?: operator.
26562
26563         (Conditional.Resolve): Implement dead code elimination.
26564
26565         (Binary.Resolve): Catch string literals and return a new
26566         concatenated string.
26567
26568         (Unary.Reduce): Implement reduction of unary expressions.
26569
26570         * ecore.cs: Split out the expression core handling here.
26571
26572         (Expression.Reduce): New method used to perform constant folding
26573         and CSE.  This is needed to support constant-expressions. 
26574
26575         * statement.cs (Statement.EmitBoolExpression): Pass true and false
26576         targets, and optimize for !x.
26577
26578 2001-11-04  Ravi Pratap  <ravi@ximian.com>
26579
26580         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26581         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26582         set custom atttributes.
26583
26584         * literal.cs (Literal::GetValue): New abstract method to return the actual
26585         value of the literal, cast as an object.
26586
26587         (*Literal): Implement GetValue method.
26588
26589         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26590         expressions to the arraylist but objects of type Argument.
26591
26592         * class.cs (TypeContainer::Emit): Emit our attributes too.
26593
26594         (Method::Emit, Constructor::Emit): Ditto.
26595
26596         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26597         to be ignoring earlier.
26598
26599 2001-11-03  Ravi Pratap  <ravi@ximian.com>
26600
26601         * attribute.cs (AttributeSection::Define): Implement to do the business
26602         of constructing a CustomAttributeBuilder.
26603
26604         (Attribute): New trivial class. Increases readability of code.  
26605
26606         * cs-parser.jay : Update accordingly.
26607
26608         (positional_argument_list, named_argument_list, named_argument): New rules
26609
26610         (attribute_arguments): Use the above so that we are more correct.
26611
26612 2001-11-02  Ravi Pratap  <ravi@ximian.com>
26613
26614         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26615         to perform all checks for a method with a params parameter.
26616
26617         (Invocation::OverloadResolve): Update to use the above method and therefore
26618         cope correctly with params method invocations.
26619
26620         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
26621         params too.
26622
26623         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26624         constructors in our parent too because we can't afford to miss out on 
26625         protected ones ;-)
26626
26627         * attribute.cs (AttributeSection): New name for the class Attribute
26628
26629         Other trivial changes to improve readability.
26630
26631         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26632         use the new class names.
26633
26634 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26635
26636         * class.cs (Method::Define): Complete definition for params types too
26637
26638         (Indexer::Define): Ditto.
26639
26640         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26641         Cope everywhere with a request for info about the array parameter.
26642
26643 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26644
26645         * tree.cs (RecordNamespace): Fix up to check for the correct key.
26646
26647         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
26648         local_variable_type to extract the string corresponding to the type.
26649
26650         (local_variable_type): Fixup the action to use the new helper method.
26651
26652         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
26653         go.
26654
26655         * expression.cs : Clean out code which uses the above.
26656
26657 2001-10-31  Ravi Pratap  <ravi@ximian.com>
26658
26659         * typemanager.cs (RegisterMethod): Check if we already have an existing key
26660         and bale out if necessary by returning a false.
26661
26662         (RegisterProperty): Ditto.
26663
26664         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26665         and print out appropriate error messages.
26666
26667         * interface.cs (everywhere): Ditto.
26668
26669         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
26670         location to constructor.
26671
26672         * class.cs (Property, Event, Indexer): Update accordingly.
26673
26674         * ../errors/cs111.cs : Added.
26675
26676         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
26677         of a method, as laid down by the spec.
26678
26679         (Invocation::OverloadResolve): Use the above method.
26680
26681 2001-10-31  Ravi Pratap  <ravi@ximian.com>
26682
26683         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
26684         now take a TypeContainer and a Parameters object.
26685
26686         (ParameterData): Modify return type of ParameterModifier method to be 
26687         Parameter.Modifier and not a string.
26688
26689         (ReflectionParameters, InternalParameters): Update accordingly.
26690
26691         * expression.cs (Argument::GetParameterModifier): Same here.
26692
26693         * support.cs (InternalParameters::ParameterType): Find a better way of determining
26694         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
26695         symbol in it at all so maybe this is only for now.
26696
26697 2001-10-30  Ravi Pratap  <ravi@ximian.com>
26698
26699         * support.cs (InternalParameters): Constructor now takes an extra argument 
26700         which is the actual Parameters class.
26701
26702         (ParameterDesc): Update to provide info on ref/out modifiers.
26703
26704         * class.cs (everywhere): Update call to InternalParameters to pass in
26705         the second argument too.
26706
26707         * support.cs (ParameterData): Add ParameterModifier, which is a method 
26708         to return the modifier info [ref/out etc]
26709
26710         (InternalParameters, ReflectionParameters): Implement the above.
26711
26712         * expression.cs (Argument::ParameterModifier): Similar function to return
26713         info about the argument's modifiers.
26714
26715         (Invocation::OverloadResolve): Update to take into account matching modifiers 
26716         too.
26717
26718         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
26719         a new SetFormalParameters object which we pass to InternalParameters.
26720
26721 2001-10-30  Ravi Pratap  <ravi@ximian.com>
26722
26723         * expression.cs (NewArray): Merge into the ArrayCreation class.
26724
26725 2001-10-29  Ravi Pratap  <ravi@ximian.com>
26726
26727         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
26728         NewUserdefinedArray into one as there wasn't much of a use in having
26729         two separate ones.
26730
26731         * expression.cs (Argument): Change field's name to ArgType from Type.
26732
26733         (Type): New readonly property which returns the proper type, taking into 
26734         account ref/out modifiers.
26735
26736         (everywhere): Adjust code accordingly for the above.
26737
26738         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
26739         whether we are emitting for a ref or out parameter.
26740
26741         * expression.cs (Argument::Emit): Use the above field to set the state.
26742
26743         (LocalVariableReference::Emit): Update to honour the flag and emit the
26744         right stuff.
26745
26746         * parameter.cs (Attributes): Set the correct flags for ref parameters.
26747
26748         * expression.cs (Argument::FullDesc): New function to provide a full desc.
26749
26750         * support.cs (ParameterData): Add method ParameterDesc to the interface.
26751
26752         (ReflectionParameters, InternalParameters): Implement the above method.
26753
26754         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
26755         reporting errors.
26756
26757         (Invocation::FullMethodDesc): Ditto. 
26758
26759 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
26760
26761         * cs-parser.jay: Add extra production for the second form of array
26762         creation. 
26763
26764         * expression.cs (ArrayCreation): Update to reflect the above
26765         change. 
26766
26767         * Small changes to prepare for Array initialization.
26768
26769 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
26770
26771         * typemanager.cs (ImplementsInterface): interface might be null;
26772         Deal with this problem;
26773
26774         Also, we do store negative hits on the cache (null values), so use
26775         this instead of calling t.GetInterfaces on the type everytime.
26776
26777 2001-10-28  Ravi Pratap  <ravi@ximian.com>
26778
26779         * typemanager.cs (IsBuiltinType): New method to help determine the same.
26780
26781         * expression.cs (New::DoResolve): Get rid of array creation code and instead
26782         split functionality out into different classes.
26783
26784         (New::FormArrayType): Move into NewBuiltinArray.
26785
26786         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
26787         quite useless.
26788
26789         (NewBuiltinArray): New class to handle creation of built-in arrays.
26790
26791         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
26792         account creation of one-dimensional arrays.
26793
26794         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
26795
26796         (NewUserdefinedArray::DoResolve): Implement.
26797
26798         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
26799
26800         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
26801         we maintain inside the TypeManager. This is necessary to perform lookups on the
26802         module builder.
26803
26804         (LookupType): Update to perform GetType on the module builders too.     
26805
26806         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
26807
26808         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
26809
26810 2001-10-23  Ravi Pratap  <ravi@ximian.com>
26811
26812         * expression.cs (New::DoResolve): Implement guts of array creation.
26813
26814         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
26815
26816 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
26817
26818         * expression.cs: Fix bug I introduced lsat night that broke
26819         Delegates. 
26820
26821         (Expression.Resolve): Report a 246 error (can not resolve name)
26822         if we find a SimpleName in the stream.
26823
26824         (Expression.ResolveLValue): Ditto.
26825
26826         (Expression.ResolveWithSimpleName): This function is a variant of
26827         ResolveName, this one allows SimpleNames to be returned without a
26828         warning.  The only consumer of SimpleNames is MemberAccess
26829
26830 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
26831
26832         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
26833         might arrive here.  I have my doubts that this is correct.
26834
26835         * statement.cs (Lock): Implement lock statement.
26836
26837         * cs-parser.jay: Small fixes to support `lock' and `using'
26838
26839         * cs-tokenizer.cs: Remove extra space
26840
26841         * driver.cs: New flag --checked, allows to turn on integer math
26842         checking. 
26843
26844         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
26845         Threading.Monitor.Exit 
26846
26847 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
26848
26849         * expression.cs (IndexerAccess::DoResolveLValue): Set the
26850         Expression Class to be IndexerAccess.
26851
26852         Notice that Indexer::DoResolve sets the eclass to Value.
26853
26854 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
26855
26856         * class.cs (TypeContainer::Emit): Emit code for indexers.
26857
26858         * assign.cs (IAssignMethod): New interface implemented by Indexers
26859         and Properties for handling assignment.
26860
26861         (Assign::Emit): Simplify and reuse code. 
26862
26863         * expression.cs (IndexerAccess, PropertyExpr): Implement
26864         IAssignMethod, clean up old code. 
26865
26866 2001-10-22  Ravi Pratap  <ravi@ximian.com>
26867
26868         * typemanager.cs (ImplementsInterface): New method to determine if a type
26869         implements a given interface. Provides a nice cache too.
26870
26871         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
26872         method.
26873
26874         (ConvertReferenceExplicit): Ditto.
26875
26876         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
26877         various methods, with correct names etc.
26878
26879         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
26880         Operator.UnaryNegation.
26881
26882         * cs-parser.jay (operator_declarator): Be a little clever in the case where
26883         we have a unary plus or minus operator.
26884
26885         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
26886         UnaryMinus.
26887
26888         * everywhere : update accordingly.
26889
26890         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
26891         respectively.
26892
26893         * class.cs (Method::Define): For the case where we are implementing a method
26894         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
26895         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
26896
26897 2001-10-21  Ravi Pratap  <ravi@ximian.com>
26898
26899         * interface.cs (FindMembers): Implement to work around S.R.E
26900         lameness.
26901
26902         * typemanager.cs (IsInterfaceType): Implement.
26903
26904         (FindMembers): Update to handle interface types too.
26905
26906         * expression.cs (ImplicitReferenceConversion): Re-write bits which
26907         use IsAssignableFrom as that is not correct - it doesn't work.
26908
26909         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
26910         and accordingly override EmitStatement.
26911
26912         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
26913         using the correct logic :-)
26914
26915 2001-10-19  Ravi Pratap  <ravi@ximian.com>
26916
26917         * ../errors/cs-11.cs : Add to demonstrate error -11 
26918
26919 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
26920
26921         * assign.cs (Assign::Resolve): Resolve right hand side first, and
26922         then pass this as a hint to ResolveLValue.
26923
26924         * expression.cs (FieldExpr): Add Location information
26925
26926         (FieldExpr::LValueResolve): Report assignment to readonly
26927         variable. 
26928
26929         (Expression::ExprClassFromMemberInfo): Pass location information.
26930
26931         (Expression::ResolveLValue): Add new method that resolves an
26932         LValue. 
26933
26934         (Expression::DoResolveLValue): Default invocation calls
26935         DoResolve. 
26936
26937         (Indexers): New class used to keep track of indexers in a given
26938         Type. 
26939
26940         (IStackStore): Renamed from LValue, as it did not really describe
26941         what this did.  Also ResolveLValue is gone from this interface and
26942         now is part of Expression.
26943
26944         (ElementAccess): Depending on the element access type
26945
26946         * typemanager.cs: Add `indexer_name_type' as a Core type
26947         (System.Runtime.CompilerServices.IndexerNameAttribute)
26948
26949         * statement.cs (Goto): Take a location.
26950
26951 2001-10-18  Ravi Pratap  <ravi@ximian.com>
26952
26953         * delegate.cs (Delegate::VerifyDelegate): New method to verify
26954         if two delegates are compatible.
26955
26956         (NewDelegate::DoResolve): Update to take care of the case when
26957         we instantiate a delegate from another delegate.
26958
26959         * typemanager.cs (FindMembers): Don't even try to look up members
26960         of Delegate types for now.
26961
26962 2001-10-18  Ravi Pratap  <ravi@ximian.com>
26963
26964         * delegate.cs (NewDelegate): New class to take care of delegate
26965         instantiation.
26966
26967         * expression.cs (New): Split the delegate related code out into 
26968         the NewDelegate class.
26969
26970         * delegate.cs (DelegateInvocation): New class to handle delegate 
26971         invocation.
26972
26973         * expression.cs (Invocation): Split out delegate related code into
26974         the DelegateInvocation class.
26975
26976 2001-10-17  Ravi Pratap  <ravi@ximian.com>
26977
26978         * expression.cs (New::DoResolve): Implement delegate creation fully
26979         and according to the spec.
26980
26981         (New::DoEmit): Update to handle delegates differently.
26982
26983         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
26984         because of which we were printing out arguments in reverse order !
26985
26986         * delegate.cs (VerifyMethod): Implement to check if the given method
26987         matches the delegate.
26988
26989         (FullDelegateDesc): Implement.
26990
26991         (VerifyApplicability): Implement.
26992
26993         * expression.cs (Invocation::DoResolve): Update to accordingly handle
26994         delegate invocations too.
26995
26996         (Invocation::Emit): Ditto.
26997
26998         * ../errors/cs1593.cs : Added.
26999
27000         * ../errors/cs1594.cs : Added.
27001
27002         * delegate.cs (InstanceExpression, TargetMethod): New properties.
27003
27004 2001-10-16  Ravi Pratap  <ravi@ximian.com>
27005
27006         * typemanager.cs (intptr_type): Core type for System.IntPtr
27007
27008         (InitCoreTypes): Update for the same.
27009
27010         (iasyncresult_type, asynccallback_type): Ditto.
27011
27012         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27013         correct.
27014
27015         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27016         too.
27017
27018         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27019         the builders for the 4 members of a delegate type :-)
27020
27021         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27022         type.
27023
27024         * expression.cs (New::DoResolve): Implement guts for delegate creation.
27025
27026         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27027
27028 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
27029
27030         * statement.cs (Break::Emit): Implement.   
27031         (Continue::Emit): Implement.
27032
27033         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27034         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27035         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27036         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
27037         end loop
27038
27039         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27040         properties that track the label for the current loop (begin of the
27041         loop and end of the loop).
27042
27043 2001-10-15  Ravi Pratap  <ravi@ximian.com>
27044
27045         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27046         use of emitting anything at all.
27047
27048         * class.cs, rootcontext.cs : Get rid of calls to the same.
27049
27050         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27051
27052         (Populate): Define the constructor correctly and set the implementation
27053         attributes.
27054
27055         * typemanager.cs (delegate_types): New hashtable to hold delegates that
27056         have been defined.
27057
27058         (AddDelegateType): Implement.
27059
27060         (IsDelegateType): Implement helper method.
27061
27062         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27063
27064         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27065         and accordingly handle it.
27066
27067         * delegate.cs (Populate): Take TypeContainer argument.
27068         Implement bits to define the Invoke method. However, I still haven't figured out
27069         how to take care of the native int bit :-(
27070
27071         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
27072         Qualify the name of the delegate, not its return type !
27073
27074         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27075         conversion.
27076
27077         (StandardConversionExists): Checking for array types turns out to be recursive.
27078
27079         (ConvertReferenceExplicit): Implement array conversion.
27080
27081         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27082
27083 2001-10-12  Ravi Pratap  <ravi@ximian.com>
27084
27085         * cs-parser.jay (delegate_declaration): Store the fully qualified
27086         name as it is a type declaration.
27087
27088         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
27089         readonly.
27090
27091         (DefineDelegate): Renamed from Define. Does the same thing essentially,
27092         as TypeContainer::DefineType.
27093
27094         (Populate): Method in which all the definition of the various methods (Invoke)
27095         etc is done.
27096
27097         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27098         see.
27099
27100         (CloseDelegate): Finally creates the delegate.
27101
27102         * class.cs (TypeContainer::DefineType): Update to define delegates.
27103         (Populate, Emit and CloseType): Do the same thing here too.
27104
27105         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27106         delegates in all these operations.
27107
27108 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
27109
27110         * expression.cs: LocalTemporary: a new expression used to
27111         reference a temporary that has been created.
27112
27113         * assign.cs: Handle PropertyAccess back here, so that we can
27114         provide the proper semantic access to properties.
27115
27116         * expression.cs (Expression::ConvertReferenceExplicit): Implement
27117         a few more explicit conversions. 
27118
27119         * modifiers.cs: `NEW' modifier maps to HideBySig.
27120
27121         * expression.cs (PropertyExpr): Make this into an
27122         ExpressionStatement, and support the EmitStatement code path. 
27123
27124         Perform get/set error checking, clean up the interface.
27125
27126         * assign.cs: recognize PropertyExprs as targets, and if so, turn
27127         them into toplevel access objects.
27128
27129 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
27130
27131         * expression.cs: PropertyExpr::PropertyExpr: use work around the
27132         SRE.
27133
27134         * typemanager.cs: Keep track here of our PropertyBuilders again to
27135         work around lameness in SRE.
27136
27137 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
27138
27139         * expression.cs (LValue::LValueResolve): New method in the
27140         interface, used to perform a second resolution pass for LValues. 
27141
27142         (This::DoResolve): Catch the use of this in static methods.
27143
27144         (This::LValueResolve): Implement.
27145
27146         (This::Store): Remove warning, assigning to `this' in structures
27147         is 
27148
27149         (Invocation::Emit): Deal with invocation of
27150         methods on value types.  We need to pass the address to structure
27151         methods rather than the object itself.  (The equivalent code to
27152         emit "this" for structures leaves the entire structure on the
27153         stack instead of a pointer to it). 
27154
27155         (ParameterReference::DoResolve): Compute the real index for the
27156         argument based on whether the method takes or not a `this' pointer
27157         (ie, the method is static).
27158
27159         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27160         value types returned from functions when we need to invoke a
27161         method on the sturcture.
27162
27163
27164 2001-10-11  Ravi Pratap  <ravi@ximian.com>
27165
27166         * class.cs (TypeContainer::DefineType): Method to actually do the business of
27167         defining the type in the Modulebuilder or Typebuilder. This is to take
27168         care of nested types which need to be defined on the TypeBuilder using
27169         DefineNestedMethod.
27170
27171         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
27172         methods in RootContext, only ported to be part of TypeContainer.
27173
27174         (TypeContainer::GetInterfaceOrClass): Ditto.
27175
27176         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27177
27178         * interface.cs (Interface::DefineInterface): New method. Does exactly
27179         what RootContext.CreateInterface did earlier, only it takes care of nested types 
27180         too.
27181
27182         (Interface::GetInterfaces): Move from RootContext here and port.
27183
27184         (Interface::GetInterfaceByName): Same here.
27185
27186         * rootcontext.cs (ResolveTree): Re-write.
27187
27188         (PopulateTypes): Re-write.
27189
27190         * class.cs (TypeContainer::Populate): Populate nested types too.
27191         (TypeContainer::Emit): Emit nested members too.
27192
27193         * typemanager.cs (AddUserType): Do not make use of the FullName property,
27194         instead just use the name argument passed in as it is already fully
27195         qualified.
27196
27197         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27198         to TypeContainer mapping to see if a type is user-defined.
27199
27200         * class.cs (TypeContainer::CloseType): Implement. 
27201
27202         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27203         the default constructor.
27204
27205         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27206         twice.
27207
27208         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27209
27210         * interface.cs (CloseType): Create the type here.
27211
27212         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27213         the hierarchy.
27214
27215         Remove all the methods which are now in TypeContainer.
27216
27217 2001-10-10  Ravi Pratap  <ravi@ximian.com>
27218
27219         * delegate.cs (Define): Re-write bits to define the delegate
27220         correctly.
27221
27222 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
27223
27224         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27225
27226         * expression.cs (ImplicitReferenceConversion): handle null as well
27227         as a source to convert to any reference type.
27228
27229         * statement.cs (Return): Perform any implicit conversions to
27230         expected return type.  
27231
27232         Validate use of return statement.  
27233
27234         * codegen.cs (EmitContext): Pass the expected return type here.
27235
27236         * class.cs (Method, Constructor, Property): Pass expected return
27237         type to EmitContext.
27238
27239 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
27240
27241         * expression.cs: Make DoResolve take an EmitContext instead of a
27242         TypeContainer.
27243
27244         Replaced `l' and `location' for `loc', for consistency.
27245
27246         (Error, Warning): Remove unneeded Tc argument.
27247
27248         * assign.cs, literal.cs, constant.cs: Update to new calling
27249         convention. 
27250
27251         * codegen.cs: EmitContext now contains a flag indicating whether
27252         code is being generated in a static method or not.
27253
27254         * cs-parser.jay: DecomposeQI, new function that replaces the old
27255         QualifiedIdentifier.  Now we always decompose the assembled
27256         strings from qualified_identifier productions into a group of
27257         memberaccesses.
27258
27259 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
27260
27261         * rootcontext.cs: Deal with field-less struct types correctly now
27262         by passing the size option to Define Type.
27263
27264         * class.cs: Removed hack that created one static field. 
27265
27266 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27267
27268         * statement.cs: Moved most of the code generation here. 
27269
27270 2001-10-09  Ravi Pratap  <ravi@ximian.com>
27271
27272         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27273         seem very right.
27274
27275         (ElementAccess): Remove useless bits for now - keep checks as the spec
27276         says.
27277
27278 2001-10-08  Ravi Pratap  <ravi@ximian.com>
27279
27280         * expression.cs (ElementAccess::DoResolve): Remove my crap code
27281         and start performing checks according to the spec.
27282
27283 2001-10-07  Ravi Pratap  <ravi@ximian.com>
27284
27285         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27286         rank_specifiers instead.
27287
27288         (rank_specifiers): Change the order in which the rank specifiers are stored
27289
27290         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27291
27292         * expression.cs (ElementAccess): Implement the LValue interface too.
27293
27294 2001-10-06  Ravi Pratap  <ravi@ximian.com>
27295
27296         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27297         except that user defined conversions are not included.
27298
27299         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
27300         perform the conversion of the return type, if necessary.
27301
27302         (New::DoResolve): Check whether we are creating an array or an object
27303         and accordingly do the needful.
27304
27305         (New::Emit): Same here.
27306
27307         (New::DoResolve): Implement guts of array creation.
27308
27309         (New::FormLookupType): Helper function.
27310
27311 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27312
27313         * codegen.cs: Removed most of the code generation here, and move the
27314         corresponding code generation bits to the statement classes. 
27315
27316         Added support for try/catch/finalize and throw.
27317
27318         * cs-parser.jay: Added support for try/catch/finalize.
27319
27320         * class.cs: Catch static methods having the flags override,
27321         virtual or abstract.
27322
27323         * expression.cs (UserCast): This user cast was not really doing
27324         what it was supposed to do.  Which is to be born in fully resolved
27325         state.  Parts of the resolution were being performed at Emit time! 
27326
27327         Fixed this code.
27328
27329 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27330
27331         * expression.cs: Implicity convert the result from UserCast.
27332
27333 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27334
27335         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27336         prevented it from working correctly. 
27337
27338         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27339         merely ConvertImplicit.
27340
27341 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27342
27343         * typemanager.cs: Make the LookupTypeContainer function static,
27344         and not per-instance.  
27345
27346         * class.cs: Make static FindMembers (the one that takes a Type
27347         argument). 
27348
27349         * codegen.cs: Add EmitForeach here.
27350
27351         * cs-parser.jay: Make foreach a toplevel object instead of the
27352         inline expansion, as we need to perform semantic analysis on it. 
27353
27354 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27355
27356         * expression.cs (Expression::ImplicitUserConversion): Rename to
27357         UserDefinedConversion.
27358
27359         (Expression::UserDefinedConversion): Take an extra argument specifying 
27360         whether we look for explicit user conversions too.
27361
27362         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27363
27364         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27365
27366         (ExplicitUserConversion): Make it a call to UserDefinedConversion
27367         with the appropriate arguments.
27368
27369         * cs-parser.jay (cast_expression): Record location too.
27370
27371         * expression.cs (Cast): Record location info.
27372
27373         (Expression::ConvertExplicit): Take location argument.
27374
27375         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27376         to determine if we are doing explicit conversions.
27377
27378         (UserCast::Emit): Update accordingly.
27379
27380         (Expression::ConvertExplicit): Report an error if everything fails.
27381
27382         * ../errors/cs0030.cs : Add.
27383
27384 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
27385
27386         * modifiers.cs: If the ABSTRACT keyword is present, also set the
27387         virtual and newslot bits. 
27388
27389         * class.cs (TypeContainer::RegisterRequiredImplementations):
27390         Record methods we need.
27391
27392         (TypeContainer::MakeKey): Helper function to make keys for
27393         MethodBases, since the Methodbase key is useless.
27394
27395         (TypeContainer::Populate): Call RegisterRequiredImplementations
27396         before defining the methods.   
27397
27398         Create a mapping for method_builders_to_methods ahead of time
27399         instead of inside a tight loop.
27400
27401         (::RequireMethods):  Accept an object as the data to set into the
27402         hashtable so we can report interface vs abstract method mismatch.
27403
27404 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27405
27406         * report.cs: Make all of it static.
27407
27408         * rootcontext.cs: Drop object_type and value_type computations, as
27409         we have those in the TypeManager anyways.
27410
27411         Drop report instance variable too, now it is a global.
27412
27413         * driver.cs: Use try/catch on command line handling.
27414
27415         Add --probe option to debug the error reporting system with a test
27416         suite. 
27417
27418         * report.cs: Add support for exiting program when a probe
27419         condition is reached.
27420
27421 2001-10-03  Ravi Pratap  <ravi@ximian.com>
27422
27423         * expression.cs (Binary::DoNumericPromotions): Fix the case when
27424         we do a forcible conversion regardless of type, to check if 
27425         ForceConversion returns a null.
27426
27427         (Binary::error19): Use location to report error.
27428
27429         (Unary::error23): Use location here too.
27430
27431         * ../errors/cs0019.cs : Check in.
27432
27433         * ../errors/cs0023.cs : Check in.
27434
27435         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27436         case of a non-null MethodInfo object with a length of 0 !
27437
27438         (Binary::ResolveOperator): Flag error if overload resolution fails to find
27439         an applicable member - according to the spec :-)
27440         Also fix logic to find members in base types.
27441
27442         (Unary::ResolveOperator): Same here.
27443
27444         (Unary::report23): Change name to error23 and make first argument a TypeContainer
27445         as I was getting thoroughly confused between this and error19 :-)
27446
27447         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27448         (::FindMostEncompassedType): Implement.
27449         (::FindMostEncompassingType): Implement.
27450         (::StandardConversionExists): Implement.
27451
27452         (UserImplicitCast): Re-vamp. We now need info about most specific
27453         source and target types so that we can do the necessary conversions.
27454
27455         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27456         mathematical union with no duplicates.
27457
27458 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27459
27460         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27461         in order from base classes to child classes, so that we can in
27462         child classes look up in our parent for method names and
27463         attributes (required for handling abstract, virtual, new, override
27464         constructs: we need to instrospect our base class, and if we dont
27465         populate the classes in order, the introspection might be
27466         incorrect.  For example, a method could query its parent before
27467         the parent has any methods and would determine that the parent has
27468         no abstract methods (while it could have had them)).
27469
27470         (RootContext::CreateType): Record the order in which we define the
27471         classes.
27472
27473 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
27474
27475         * class.cs (TypeContainer::Populate): Also method definitions can
27476         fail now, keep track of this.
27477
27478         (TypeContainer::FindMembers): Implement support for
27479         DeclaredOnly/noDeclaredOnly flag.
27480
27481         (Constructor::Emit) Return the ConstructorBuilder.
27482
27483         (Method::Emit) Return the MethodBuilder. 
27484         Check for abstract or virtual methods to be public.
27485
27486         * rootcontext.cs (RootContext::CreateType): Register all the
27487         abstract methods required for the class to be complete and the
27488         interface methods that must be implemented. 
27489
27490         * cs-parser.jay: Report error 501 (method requires body if it is
27491         not marked abstract or extern).
27492
27493         * expression.cs (TypeOf::Emit): Implement.
27494
27495         * typemanager.cs: runtime_handle_type, new global type.
27496
27497         * class.cs (Property::Emit): Generate code for properties.
27498
27499 2001-10-02  Ravi Pratap  <ravi@ximian.com>
27500
27501         * expression.cs (Unary::ResolveOperator): Find operators on base type
27502         too - we now conform exactly to the spec.
27503
27504         (Binary::ResolveOperator): Same here.
27505
27506         * class.cs (Operator::Define): Fix minor quirk in the tests.
27507
27508         * ../errors/cs0215.cs : Added.
27509
27510         * ../errors/cs0556.cs : Added.
27511
27512         * ../errors/cs0555.cs : Added.
27513
27514 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27515
27516         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27517         single integer which is really efficient
27518
27519 2001-10-01  Ravi Pratap  <ravi@ximian.com>
27520
27521         *  expression.cs (Expression::ImplicitUserConversion): Use location
27522         even in the case when we are examining True operators.
27523  
27524         * class.cs (Operator::Define): Perform extensive checks to conform
27525         with the rules for operator overloading in the spec.
27526
27527         * expression.cs (Expression::ImplicitReferenceConversion): Implement
27528         some of the other conversions mentioned in the spec.
27529
27530         * typemanager.cs (array_type): New static member for the System.Array built-in
27531         type.
27532
27533         (cloneable_interface): For System.ICloneable interface.
27534
27535         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27536         we start resolving the tree and populating types.
27537
27538         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27539  
27540 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27541
27542         * expression.cs (Expression::ExprClassFromMemberInfo,
27543         Expression::Literalize): Create literal expressions from
27544         FieldInfos which are literals.
27545
27546         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27547         type casts, because they were wrong.  The test suite in tests
27548         caught these ones.
27549
27550         (ImplicitNumericConversion): ushort to ulong requires a widening
27551         cast. 
27552
27553         Int32 constant to long requires widening cast as well.
27554
27555         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27556         for integers because the type on the stack is not i4.
27557
27558 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
27559
27560         * expression.cs (report118): require location argument. 
27561
27562         * parameter.cs: Do not dereference potential null value.
27563
27564         * class.cs: Catch methods that lack the `new' keyword when
27565         overriding a name.  Report warnings when `new' is used without
27566         anything being there to override.
27567
27568         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27569
27570         * class.cs: Only add constructor to hashtable if it is non-null
27571         (as now constructors can fail on define).
27572
27573         (TypeManager, Class, Struct): Take location arguments.
27574
27575         Catch field instance initialization in structs as errors.
27576
27577         accepting_filter: a new filter for FindMembers that is static so
27578         that we dont create an instance per invocation.
27579
27580         (Constructor::Define): Catch errors where a struct constructor is
27581         parameterless 
27582
27583         * cs-parser.jay: Pass location information for various new
27584         constructs. 
27585
27586         * delegate.cs (Delegate): take a location argument.
27587
27588         * driver.cs: Do not call EmitCode if there were problesm in the
27589         Definition of the types, as many Builders wont be there. 
27590
27591         * decl.cs (Decl::Decl): Require a location argument.
27592
27593         * cs-tokenizer.cs: Handle properly hex constants that can not fit
27594         into integers, and find the most appropiate integer for it.
27595
27596         * literal.cs: Implement ULongLiteral.
27597
27598         * rootcontext.cs: Provide better information about the location of
27599         failure when CreateType fails.
27600
27601 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
27602
27603         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27604         as well.
27605
27606         * expression.cs (Binary::CheckShiftArguments): Add missing type
27607         computation.
27608         (Binary::ResolveOperator): Add type to the logical and and logical
27609         or, Bitwise And/Or and Exclusive Or code paths, it was missing
27610         before.
27611
27612         (Binary::DoNumericPromotions): In the case where either argument
27613         is ulong (and most signed types combined with ulong cause an
27614         error) perform implicit integer constant conversions as well.
27615
27616 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
27617
27618         * expression.cs (UserImplicitCast): Method should always be
27619         non-null. 
27620         (Invocation::BetterConversion): Simplified test for IntLiteral.
27621
27622         (Expression::ImplicitNumericConversion): Split this routine out.
27623         Put the code that performs implicit constant integer conversions
27624         here. 
27625
27626         (Expression::Resolve): Become a wrapper around DoResolve so we can
27627         check eclass and type being set after resolve.
27628
27629         (Invocation::Badness): Remove this dead function
27630
27631         (Binary::ResolveOperator): Do not compute the expensive argumnets
27632         unless we have a union for it.
27633
27634         (Probe::Emit): Is needs to do an isinst and then
27635         compare against null.
27636
27637         (::CanConvert): Added Location argument.  If the Location argument
27638         is null (Location.Null), then we do not report errors.  This is
27639         used by the `probe' mechanism of the Explicit conversion.  We do
27640         not want to generate an error for something that the user
27641         explicitly requested to be casted.  But the pipeline for an
27642         explicit cast first tests for potential implicit casts.
27643
27644         So for now, if the Location is null, it means `Probe only' to
27645         avoid adding another argument.   Might have to revise this
27646         strategy later.
27647
27648         (ClassCast): New class used to type cast objects into arbitrary
27649         classes (used in Explicit Reference Conversions).
27650
27651         Implement `as' as well.
27652
27653         Reverted all the patches from Ravi below: they were broken:
27654
27655                 * The use of `level' as a mechanism to stop recursive
27656                   invocations is wrong.  That was there just to catch the
27657                   bug with a strack trace but not as a way of addressing
27658                   the problem.
27659
27660                   To fix the problem we have to *understand* what is going
27661                   on and the interactions and come up with a plan, not
27662                   just get things going.
27663
27664                 * The use of the type conversion cache that I proposed
27665                   last night had an open topic: How does this work across
27666                   protection domains.  A user defined conversion might not
27667                   be public in the location where we are applying the
27668                   conversion, a different conversion might be selected
27669                   (ie, private A->B (better) but public B->A (worse),
27670                   inside A, A->B applies, but outside it, B->A will
27671                   apply).
27672
27673                 * On top of that (ie, even if the above is solved),
27674                   conversions in a cache need to be abstract.  Ie, `To
27675                   convert from an Int to a Short use an OpcodeCast', not
27676                   `To convert from an Int to a Short use the OpcodeCast on
27677                   the variable 5' (which is what this patch was doing).
27678
27679 2001-09-28  Ravi Pratap  <ravi@ximian.com>
27680
27681         * expression.cs (Invocation::ConversionExists): Re-write to use
27682         the conversion cache
27683
27684         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
27685         cache all conversions done, not just user-defined ones.
27686
27687         (Invocation::BetterConversion): The real culprit. Use ConversionExists
27688         to determine if a conversion exists instead of acutually trying to 
27689         perform the conversion. It's faster too.
27690
27691         (Expression::ConvertExplicit): Modify to use ConversionExists to check
27692         and only then attempt the implicit conversion.
27693
27694 2001-09-28  Ravi Pratap  <ravi@ximian.com>
27695
27696         * expression.cs (ConvertImplicit): Use a cache for conversions
27697         already found. Check level of recursion and bail out if necessary.
27698
27699 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
27700
27701         * typemanager.cs (string_concat_string_string, string_concat_object_object):
27702         Export standard methods that we expect for string operations.
27703
27704         * statement.cs (Block::UsageWarning): Track usage of variables and
27705         report the errors for not used variables.
27706
27707         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
27708         operator. 
27709
27710 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
27711
27712         * codegen.cs: remove unnneded code 
27713
27714         * expression.cs: Removed BuiltinTypeAccess class
27715
27716         Fix the order in which implicit conversions are
27717         done.  
27718
27719         The previous fixed dropped support for boxed conversions (adding a
27720         test to the test suite now)
27721
27722         (UserImplicitCast::CanConvert): Remove test for source being null,
27723         that code is broken.  We should not feed a null to begin with, if
27724         we do, then we should track the bug where the problem originates
27725         and not try to cover it up here.
27726
27727         Return a resolved expression of type UserImplicitCast on success
27728         rather than true/false.  Ravi: this is what I was talking about,
27729         the pattern is to use a static method as a "constructor" for
27730         objects. 
27731
27732         Also, do not create arguments until the very last minute,
27733         otherwise we always create the arguments even for lookups that
27734         will never be performed. 
27735
27736         (UserImplicitCast::Resolve): Eliminate, objects of type
27737         UserImplicitCast are born in a fully resolved state. 
27738
27739         * typemanager.cs (InitCoreTypes): Init also value_type
27740         (System.ValueType). 
27741
27742         * expression.cs (Cast::Resolve): First resolve the child expression.
27743
27744         (LValue): Add new method AddressOf to be used by
27745         the `&' operator.  
27746
27747         Change the argument of Store to take an EmitContext instead of an
27748         ILGenerator, because things like FieldExpr need to be able to call
27749         their children expression to generate the instance code. 
27750
27751         (Expression::Error, Expression::Warning): Sugar functions for
27752         reporting errors.
27753
27754         (Expression::MemberLookup): Accept a TypeContainer instead of a
27755         Report as the first argument.
27756
27757         (Expression::ResolvePrimary): Killed.  I still want to improve
27758         this as currently the code is just not right.
27759
27760         (Expression::ResolveMemberAccess): Simplify, but it is still
27761         wrong. 
27762
27763         (Unary::Resolve): Catch errors in AddressOf operators.
27764
27765         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
27766         index to a byte for the short-version, or the compiler will choose
27767         the wrong Emit call, which generates the wrong data.
27768
27769         (ParameterReference::Emit, ::Store): same.
27770
27771         (FieldExpr::AddressOf): Implement.
27772
27773         * typemanager.cs: TypeManager: made public variable instead of
27774         property.
27775
27776         * driver.cs: document --fatal.
27777
27778         * report.cs (ErrorMessage, WarningMessage): new names for the old
27779         Error and Warning classes.
27780
27781         * cs-parser.jay (member_access): Turn built-in access to types
27782         into a normal simplename
27783
27784 2001-09-27  Ravi Pratap  <ravi@ximian.com>
27785
27786         * expression.cs (Invocation::BetterConversion): Fix to cope
27787         with q being null, since this was introducing a bug.
27788
27789         * expression.cs (ConvertImplicit): Do built-in conversions first.
27790
27791 2001-09-27  Ravi Pratap  <ravi@ximian.com>
27792
27793         * expression.cs (UserImplicitCast::Resolve): Fix bug.
27794
27795 2001-09-27  Ravi Pratap  <ravi@ximian.com>
27796
27797         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
27798         I had introduced long ago (what's new ?).
27799
27800         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
27801         the work of all the checking. 
27802         (ConvertImplicit): Call CanConvert and only then create object if necessary.
27803         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
27804
27805         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
27806         that is the right way. 
27807
27808         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
27809         overloading resolution. Use everywhere instead of cutting and pasting code.
27810
27811         (Binary::ResolveOperator): Use MakeUnionSet.
27812
27813         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
27814         we have to convert to bool types. Not complete yet.
27815
27816 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
27817
27818         * typemanager.cs (TypeManager::CSharpName): support ushort.
27819
27820         * expression.cs (Expression::TryImplicitIntConversion): Attempts
27821         to provide an expression that performsn an implicit constant int
27822         conversion (section 6.1.6).
27823         (Expression::ConvertImplicitRequired): Reworked to include
27824         implicit constant expression conversions.
27825
27826         (Expression::ConvertNumericExplicit): Finished.
27827
27828         (Invocation::Emit): If InstanceExpression is null, then it means
27829         that we perform a call on this.
27830
27831 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
27832
27833         * expression.cs (Unary::Emit): Remove some dead code.
27834         (Probe): Implement Resolve and Emit for `is'.
27835         (Expression::ConvertImplicitRequired): Attempt to do constant
27836         expression conversions here.  Maybe should be moved to
27837         ConvertImplicit, but I am not sure.
27838         (Expression::ImplicitLongConstantConversionPossible,
27839         Expression::ImplicitIntConstantConversionPossible): New functions
27840         that tell whether is it possible to apply an implicit constant
27841         expression conversion.
27842
27843         (ConvertNumericExplicit): Started work on explicit numeric
27844         conversions.
27845
27846         * cs-parser.jay: Update operator constants.
27847
27848         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
27849         (Parameters::GetSignature): Hook up VerifyArgs here.
27850         (Parameters::VerifyArgs): Verifies that no two arguments have the
27851         same name. 
27852
27853         * class.cs (Operator): Update the operator names to reflect the
27854         ones that the spec expects (as we are just stringizing the
27855         operator names).
27856
27857         * expression.cs (Unary::ResolveOperator): Fix bug: Use
27858         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
27859         previous usage did only work for our methods.
27860         (Expression::ConvertImplicit): Handle decimal implicit numeric
27861         conversions as well.
27862         (Expression::InternalTypeConstructor): Used to invoke constructors
27863         on internal types for default promotions.
27864
27865         (Unary::Emit): Implement special handling for the pre/post
27866         increment/decrement for overloaded operators, as they need to have
27867         the same semantics as the other operators.
27868
27869         (Binary::ResolveOperator): ditto.
27870         (Invocation::ConversionExists): ditto.
27871         (UserImplicitCast::Resolve): ditto.
27872
27873 2001-09-26  Ravi Pratap  <ravi@ximian.com>
27874
27875         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
27876         operator, return after emitting body. Regression tests pass again !
27877
27878         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
27879         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
27880         (Invocation::OverloadResolve): Ditto.
27881         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
27882
27883         * everywhere : update calls to the above methods accordingly.
27884
27885 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
27886
27887         * assign.cs (Assign): Make it inherit from ExpressionStatement.
27888
27889         * expression.cs (ExpressionStatement): New base class used for
27890         expressions that can appear in statements, so that we can provide
27891         an alternate path to generate expression that do not leave a value
27892         on the stack.
27893
27894         (Expression::Emit, and all the derivatives): We no longer return
27895         whether a value is left on the stack or not.  Every expression
27896         after being emitted leaves a single value on the stack.
27897
27898         * codegen.cs (EmitContext::EmitStatementExpression): Use the
27899         facilties of ExpressionStatement if possible.
27900
27901         * cs-parser.jay: Update statement_expression.
27902
27903 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
27904
27905         * driver.cs: Change the wording of message
27906
27907 2001-09-25  Ravi Pratap  <ravi@ximian.com>
27908
27909         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
27910         the type of the expression to the return type of the method if
27911         we have an overloaded operator match ! The regression tests pass again !
27912         (Unary::ResolveOperator): Ditto.
27913
27914         * expression.cs (Invocation::ConversionExists): Correct the member lookup
27915         to find "op_Implicit", not "implicit" ;-)
27916         (UserImplicitCast): New class to take care of user-defined implicit conversions.
27917         (ConvertImplicit, ForceConversion): Take TypeContainer argument
27918
27919         * everywhere : Correct calls to the above accordingly.
27920
27921         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
27922         (ConvertImplicit): Do user-defined conversion if it exists.
27923
27924 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
27925
27926         * assign.cs: track location.
27927         (Resolve): Use implicit conversions on assignment.
27928
27929         * literal.cs: Oops.  Not good, Emit of short access values should
27930         pass (Bytes) or the wrong argument will be selected.
27931
27932         * expression.cs (Unary::Emit): Emit code for -expr.
27933
27934         (Unary::ResolveOperator): Handle `Substract' for non-constants
27935         (substract from zero from the non-constants).
27936         Deal with Doubles as well. 
27937
27938         (Expression::ConvertImplicitRequired): New routine that reports an
27939         error if no implicit conversion exists. 
27940
27941         (Invocation::OverloadResolve): Store the converted implicit
27942         expressions if we make them
27943
27944 2001-09-24  Ravi Pratap  <ravi@ximian.com>
27945
27946         * class.cs (ConstructorInitializer): Take a Location argument.
27947         (ConstructorBaseInitializer): Same here.
27948         (ConstructorThisInitializer): Same here.
27949
27950         * cs-parser.jay : Update all calls accordingly.
27951
27952         * expression.cs (Unary, Binary, New): Take location argument.
27953         Update accordingly everywhere.
27954
27955         * cs-parser.jay : Update all calls to the above to take a location
27956         argument.
27957
27958         * class.cs : Ditto.
27959
27960 2001-09-24  Ravi Pratap  <ravi@ximian.com>
27961
27962         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
27963         (Invocation::BetterConversion): Same here
27964         (Invocation::ConversionExists): Ditto.
27965
27966         (Invocation::ConversionExists): Implement.
27967
27968 2001-09-22  Ravi Pratap  <ravi@ximian.com>
27969
27970         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
27971         Also take an additional TypeContainer argument.
27972
27973         * All over : Pass in TypeContainer as argument to OverloadResolve.
27974
27975         * typemanager.cs (CSharpName): Update to check for the string type and return
27976         that too.
27977
27978         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
27979         a given method.
27980
27981 2001-09-21  Ravi Pratap  <ravi@ximian.com>
27982
27983         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
27984         (Invocation::BetterFunction): Implement.
27985         (Invocation::BetterConversion): Implement.
27986         (Invocation::ConversionExists): Skeleton, no implementation yet.
27987
27988         Okay, things work fine !
27989
27990 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
27991
27992         * typemanager.cs: declare and load enum_type, delegate_type and
27993         void_type. 
27994
27995         * expression.cs (Expression::Emit): Now emit returns a value that
27996         tells whether a value is left on the stack or not.  This strategy
27997         might be reveted tomorrow with a mechanism that would address
27998         multiple assignments.
27999         (Expression::report118): Utility routine to report mismatches on
28000         the ExprClass.
28001
28002         (Unary::Report23): Report impossible type/operator combination
28003         utility function.
28004
28005         (Unary::IsIncrementableNumber): Whether the type can be
28006         incremented or decremented with add.
28007         (Unary::ResolveOperator): Also allow enumerations to be bitwise
28008         complemented. 
28009         (Unary::ResolveOperator): Implement ++, !, ~,
28010
28011         (Invocation::Emit): Deal with new Emit convetion.
28012
28013         * All Expression derivatives: Updated their Emit method to return
28014         whether they leave values on the stack or not.
28015
28016         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28017         stack for expressions that are statements. 
28018
28019 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28020
28021         * expression.cs (LValue): New interface.  Must be implemented by
28022         LValue objects.
28023         (LocalVariableReference, ParameterReference, FieldExpr): Implement
28024         LValue interface.
28025
28026         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28027         interface for generating code, simplifies the code.
28028
28029 2001-09-20  Ravi Pratap  <ravi@ximian.com>
28030
28031         * expression.cs (everywhere): Comment out return statements in ::Resolve
28032         methods to avoid the warnings.
28033
28034 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28035
28036         * driver.cs (parse): Report error 2001 if we can not open the
28037         source file.
28038
28039         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28040         not resolve it.
28041
28042         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28043         object. 
28044
28045         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28046         otherwise nested blocks end up with the same index.
28047
28048         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28049
28050         * expression.cs:  Instead of having FIXMEs in the Resolve
28051         functions, throw exceptions so it is obvious that we are facing a
28052         bug. 
28053
28054         * cs-parser.jay (invocation_expression): Pass Location information.
28055
28056         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28057         Use a basename for those routines because .NET does not like paths
28058         on them. 
28059
28060         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28061         already defined.
28062
28063 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
28064
28065         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28066         are loading the correct data types (throws an exception if not).
28067         (TypeManager::InitCoreTypes): Use CoreLookupType
28068
28069         * expression.cs (Unary::ResolveOperator): return the child
28070         expression for expressions which are just +expr.
28071         (Unary::ResolveOperator): Return negative literals for -LITERAL
28072         expressions (otherwise they are Unary {Literal}).
28073         (Invocation::Badness): Take into account `Implicit constant
28074         expression conversions'.
28075
28076         * literal.cs (LongLiteral): Implement long literal class.
28077         (IntLiteral): export the `Value' of the intliteral. 
28078
28079 2001-09-19  Ravi Pratap  <ravi@ximian.com>
28080
28081         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28082
28083         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
28084         instead of 'Operator'
28085
28086         * expression.cs (Binary::ResolveOperator): Update accordingly.
28087         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28088         and 'Minus'
28089
28090         * cs-parser.jay (unary_expression): Update to use the new names.
28091
28092         * gen-treedump.cs (GetUnary): Same here.
28093
28094         * expression.cs (Unary::Resolve): Implement.
28095         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
28096         operators are found instead of making noise ;-)
28097         (Unary::ResolveOperator): New method to do precisely the same thing which
28098         Binary::ResolveOperator does for Binary expressions.
28099         (Unary.method, .Arguments): Add.
28100         (Unary::OperName): Implement.   
28101         (Unary::ForceConversion): Copy and Paste !
28102
28103         * class.cs (Operator::Define): Fix a small bug for the case when we have 
28104         a unary operator.
28105
28106         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28107         for the inbuilt operators. Only overloading works for now ;-)
28108
28109 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
28110
28111         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28112         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28113
28114         * expression.cs (This::Emit): Implement. 
28115         (This::Resolve): Implement.
28116         (TypeOf:Resolve): Implement.
28117         (Expression::ResolveSimpleName): Add an implicit this to instance
28118         field references. 
28119         (MemberAccess::Resolve): Deal with Parameters and Fields. 
28120         Bind instance variable to Field expressions.
28121         (FieldExpr::Instance): New field used to track the expression that
28122         represents the object instance.
28123         (FieldExpr::Resolve): Track potential errors from MemberLookup not
28124         binding 
28125         (FieldExpr::Emit): Implement.
28126
28127         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28128         the last instruction contains a return opcode to avoid generating
28129         the last `ret' instruction (this generates correct code, and it is
28130         nice to pass the peverify output).
28131
28132         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28133         initializer for static and instance variables.
28134         (Constructor::Emit): Allow initializer to be null in the case of
28135         static constructors.  Only emit initializer for instance
28136         constructors. 
28137
28138         (TypeContainer::FindMembers): Return a null array if there are no
28139         matches.
28140
28141         Also fix the code for the MemberTypes.Method branch, as it was not
28142         scanning that for operators (or tried to access null variables before).
28143
28144         * assign.cs (Assign::Emit): Handle instance and static fields. 
28145
28146         * TODO: Updated.
28147
28148         * driver.cs: Stop compilation if there are parse errors.
28149
28150         * cs-parser.jay (constructor_declaration): Provide default base
28151         initializer for non-static constructors.
28152         (constructor_declarator): Do not provide a default base
28153         initializers if none was specified.
28154         Catch the fact that constructors should not have parameters.
28155
28156         * class.cs: Do not emit parent class initializers for static
28157         constructors, that should be flagged as an error.
28158
28159 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28160
28161         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28162         Move back code into TypeContainer::Populate.
28163
28164 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28165
28166         * class.cs (TypeContainer::AddConstructor): Fix the check to
28167         compare against Name, not Basename. 
28168         (Operator::OpType): Change Plus and Minus to Add and Subtract.
28169
28170         * cs-parser.jay : Update accordingly.
28171
28172         * class.cs (TypeContainer::FindMembers): For the case where we are searching
28173         for methods, don't forget to look into the operators too.
28174         (RegisterMethodBuilder): Helper method to take care of this for
28175         methods, constructors and operators.
28176         (Operator::Define): Completely revamp.
28177         (Operator.OperatorMethod, MethodName): New fields.
28178         (TypeContainer::Populate): Move the registering of builders into
28179         RegisterMethodBuilder.
28180         (Operator::Emit): Re-write.
28181
28182         * expression.cs (Binary::Emit): Comment out code path to emit method
28183         invocation stuff for the case when we have a user defined operator. I am
28184         just not able to get it right !
28185
28186 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28187
28188         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28189         argument. 
28190
28191         (Expression::MemberLookup): Provide a version that allows to
28192         specify the MemberTypes and BindingFlags. 
28193
28194         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28195         so it was not fetching variable information from outer blocks.
28196
28197         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28198         Beforefieldinit as it was buggy.
28199
28200         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28201         that Ravi put here.  
28202
28203         * class.cs (Constructor::Emit): Only emit if block is not null.
28204         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28205         deal with this by semantically definining it as if the user had
28206         done it.
28207
28208         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28209         constructors as we now "emit" them at a higher level.
28210
28211         (TypeContainer::DefineDefaultConstructor): Used to define the
28212         default constructors if none was provided.
28213
28214         (ConstructorInitializer): Add methods Resolve and Emit. 
28215
28216         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28217
28218 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28219
28220         * class.cs (TypeContainer::EmitDefaultConstructor): Register
28221         the default constructor builder with our hashtable for methodbuilders
28222         to methodcores.
28223
28224         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28225         and argument_count is 0 in which case we have a match.
28226         (Binary::ResolveOperator): More null checking and miscellaneous coding
28227         style cleanup.
28228
28229 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28230
28231         * rootcontext.cs (IsNameSpace): Compare against null.
28232
28233         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28234
28235         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28236         and Unary::Operator.
28237
28238         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28239         accordingly.
28240
28241         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28242         we have overloaded operators.
28243         (Binary::ResolveOperator): Implement the part which does the operator overload
28244         resolution.
28245
28246         * class.cs (Operator::Emit): Implement.
28247         (TypeContainer::Emit): Emit the operators we have too.
28248
28249         * expression.cs (Binary::Emit): Update to emit the appropriate code for
28250         the case when we have a user-defined operator.
28251
28252 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28253
28254         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28255
28256 2001-09-16  Ravi Pratap  <ravi@ximian.com>
28257
28258         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28259         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28260         (Constructor::Emit): Implement.
28261         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28262         if we have no work to do. 
28263         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
28264         Emit method.
28265
28266         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28267         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28268
28269         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28270         of parent.parent.
28271
28272 2001-09-15  Ravi Pratap  <ravi@ximian.com>
28273
28274         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28275         in the source.
28276         (Tree::RecordNamespace): Method to do what the name says ;-)
28277         (Tree::Namespaces): Property to get at the namespaces hashtable.
28278
28279         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
28280         keep track.
28281
28282         * rootcontext.cs (IsNamespace): Fixed it :-)
28283
28284 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28285
28286         * class.cs (TypeContainer::FindMembers): Add support for
28287         constructors. 
28288         (MethodCore): New class that encapsulates both the shared aspects
28289         of a Constructor and a Method.  
28290         (Method, Constructor): Factored pieces into MethodCore.
28291
28292         * driver.cs: Added --fatal which makes errors throw exceptions.
28293         Load System assembly as well as part of the standard library.
28294
28295         * report.cs: Allow throwing exceptions on errors for debugging.
28296
28297         * modifiers.cs: Do not use `parent', instead use the real type
28298         container to evaluate permission settings.
28299
28300         * class.cs: Put Ravi's patch back in.  He is right, and we will
28301         have to cope with the
28302
28303 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28304
28305         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28306         FamORAssem, not FamANDAssem.
28307
28308 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28309
28310         * driver.cs: Added --parse option that only parses its input files
28311         and terminates.
28312
28313         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
28314         incorrect.  IsTopLevel is not used to tell whether an object is
28315         root_types or not (that can be achieved by testing this ==
28316         root_types).  But to see if this is a top-level *class* (not
28317         necessarly our "toplevel" container). 
28318
28319 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28320
28321         * enum.cs (Enum::Define): Modify to call the Lookup method on the
28322         parent instead of a direct call to GetType.
28323
28324 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28325
28326         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28327         Modifiers.TypeAttr. This should just be a call to that method.
28328
28329         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28330         object so that we can determine if we are top-level or not.
28331
28332         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
28333         TypeContainer too.
28334
28335         * enum.cs (Enum::Define): Ditto.
28336
28337         * modifiers.cs (FieldAttr): Re-write.
28338
28339         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28340         (TypeContainer::HaveStaticConstructor): New property to provide access
28341         to precisely that info.
28342
28343         * modifiers.cs (MethodAttr): Re-write.
28344         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28345
28346         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28347         of top-level types as claimed.
28348
28349 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28350
28351         * expression.cs (MemberLookup): Fruitless attempt to lookup
28352         constructors.  Maybe I need to emit default constructors?  That
28353         might be it (currently .NET emits this for me automatically).
28354         (Invocation::OverloadResolve): Cope with Arguments == null.
28355         (Invocation::EmitArguments): new function, shared by the new
28356         constructor and us.
28357         (Invocation::Emit): Handle static and instance methods.  Emit
28358         proper call instruction for virtual or non-virtual invocations.
28359         (New::Emit): Implement.
28360         (New::Resolve): Implement.
28361         (MemberAccess:Resolve): Implement.
28362         (MethodGroupExpr::InstanceExpression): used conforming to the spec
28363         to track instances.
28364         (FieldExpr::Resolve): Set type.
28365
28366         * support.cs: Handle empty arguments.
28367                 
28368         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28369         SimpleLookup): Auxiliary routines to help parse a qualifier
28370         identifier.  
28371
28372         Update qualifier_identifier rule.
28373
28374         * codegen.cs: Removed debugging messages.
28375
28376         * class.cs: Make this a global thing, this acts just as a "key" to
28377         objects that we might have around.
28378
28379         (Populate): Only initialize method_builders_to_methods once.
28380
28381         * expression.cs (PropertyExpr): Initialize type from the
28382         PropertyType. 
28383
28384         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28385         Resolve pattern.  Attempt to implicitly convert value to boolean.
28386         Emit code.
28387
28388         * expression.cs: Set the type for the int32/int32 argument case.
28389         (Binary::ResolveOperator): Set the return type to boolean for
28390         comparission operators
28391
28392         * typemanager.cs: Remove debugging print code.
28393
28394         (Invocation::Resolve): resolve type.
28395
28396         * class.cs: Allocate a MemberInfo of the correct size, as the code
28397         elsewhere depends on the test to reflect the correct contents.
28398
28399         (Method::) Keep track of parameters, due to System.Reflection holes
28400
28401         (TypeContainer::Populate): Keep track of MethodBuilders to Method
28402         mapping here.
28403
28404         (TypeContainer::FindMembers): Use ArrayList and then copy an array
28405         of the exact size and return that.
28406
28407         (Class::LookupMethodByBuilder): New function that maps
28408         MethodBuilders to its methods.  Required to locate the information
28409         on methods because System.Reflection bit us again.
28410
28411         * support.cs: New file, contains an interface ParameterData and
28412         two implementations: ReflectionParameters and InternalParameters
28413         used to access Parameter information.  We will need to grow this
28414         as required.
28415
28416         * expression.cs (Invocation::GetParameterData): implement a cache
28417         and a wrapper around the ParameterData creation for methods. 
28418         (Invocation::OverloadResolve): Use new code.
28419
28420 2001-09-13  Ravi Pratap  <ravi@ximian.com>
28421
28422         * class.cs (TypeContainer::EmitField): Remove and move into 
28423         (Field::Define): here and modify accordingly.
28424         (Field.FieldBuilder): New member.
28425         (TypeContainer::Populate): Update accordingly.
28426         (TypeContainer::FindMembers): Implement.
28427
28428 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28429
28430         * statement.cs: (VariableInfo::VariableType): New field to be
28431         initialized with the full type once it is resolved. 
28432
28433 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
28434
28435         * parameter.cs (GetParameterInfo): Use a type cache to compute
28436         things only once, and to reuse this information
28437
28438         * expression.cs (LocalVariableReference::Emit): Implement.
28439         (OpcodeCast::Emit): fix.
28440
28441         (ParameterReference::Resolve): Implement.
28442         (ParameterReference::Emit): Implement.
28443
28444         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28445         that are expressions need to stay as Expressions.
28446
28447         * typemanager.cs (CSharpName): Returns the C# name of a type if
28448         possible. 
28449
28450         * expression.cs (Expression::ConvertImplicit): New function that
28451         implements implicit type conversions.
28452
28453         (Expression::ImplicitReferenceConversion): Implements implicit
28454         reference conversions.
28455
28456         (EmptyCast): New type for transparent casts.
28457
28458         (OpcodeCast): New type for casts of types that are performed with
28459         a sequence of bytecodes.
28460
28461         (BoxedCast): New type used for casting value types into reference
28462         types.  Emits a box opcode.
28463
28464         (Binary::DoNumericPromotions): Implements numeric promotions of
28465         and computation of the Binary::Type.
28466
28467         (Binary::EmitBranchable): Optimization.
28468
28469         (Binary::Emit): Implement code emission for expressions.
28470
28471         * typemanager.cs (TypeManager): Added two new core types: sbyte
28472         and byte.
28473
28474 2001-09-12  Ravi Pratap  <ravi@ximian.com>
28475
28476         * class.cs (TypeContainer::FindMembers): Method which does exactly
28477         what Type.FindMembers does, only we don't have to use reflection. No
28478         implementation yet.
28479
28480         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28481         typecontainer objects as we need to get at them.
28482         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28483
28484         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28485         typecontainer object.
28486
28487         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28488         of just a Report object.
28489
28490 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28491
28492         * class.cs (Event::Define): Go back to using the prefixes "add_" and
28493         "remove_"
28494         (TypeContainer::Populate): Now define the delegates of the type too.
28495         (TypeContainer.Delegates): Property to access the list of delegates defined
28496         in the type.
28497
28498         * delegates.cs (Delegate::Define): Implement partially.
28499
28500         * modifiers.cs (TypeAttr): Handle more flags.
28501
28502 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28503
28504         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28505         and not <=
28506         (Operator::Define): Re-write logic to get types by using the LookupType method
28507         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28508         (Indexer::Define): Ditto.
28509         (Event::Define): Ditto.
28510         (Property::Define): Ditto.
28511
28512 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28513
28514         * class.cs (TypeContainer::Populate): Now define operators too. 
28515         (TypeContainer.Operators): New property to access the list of operators
28516         in a type.
28517         (Operator.OperatorMethodBuilder): New member to hold the method builder
28518         for the operator we are defining.
28519         (Operator::Define): Implement.
28520
28521 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28522
28523         * class.cs (Event::Define): Make the prefixes of the accessor methods
28524         addOn_ and removeOn_ 
28525
28526         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28527         of the location being passed in too. Ideally, this should go later since all
28528         error reporting should be done through the Report object.
28529
28530         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28531         (Populate): Iterate thru the indexers we have and define them too.
28532         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28533         for the get and set accessors.
28534         (Indexer::Define): Implement.
28535
28536 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
28537
28538         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
28539         my previous implementation, did not work.
28540
28541         * typemanager.cs: Add a couple of missing types (the longs).
28542
28543         * literal.cs: Use TypeManager.bool_type instead of getting it.
28544
28545         * expression.cs (EventExpr): New kind of expressions.
28546         (Expressio::ExprClassFromMemberInfo): finish
28547
28548 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
28549
28550         * assign.cs: Emit stores to static fields differently.
28551
28552 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28553
28554         * Merge in changes and adjust code to tackle conflicts. Backed out my
28555         code in Assign::Resolve ;-) 
28556
28557 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28558
28559         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28560         instead Report.Error and also pass in the location.
28561         (CSharpParser::Lexer): New readonly property to return the reference
28562         to the Tokenizer object.
28563         (declare_local_variables): Use Report.Error with location instead of plain 
28564         old error.
28565         (CheckDef): Ditto.
28566
28567         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28568         (Operator.CheckBinaryOperator): Ditto.
28569
28570         * cs-parser.jay (operator_declarator): Update accordingly.
28571
28572         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28573         (CheckBinaryOperator): Same here.
28574
28575         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28576         on the name without any prefixes of namespace names etc. This is because we
28577         already might have something already fully qualified like 
28578         'System.Console.WriteLine'
28579
28580         * assign.cs (Resolve): Begin implementation. Stuck ;-)
28581
28582 2001-09-07  Ravi Pratap  <ravi@ximian.com>
28583
28584         * cs-tokenizer.cs (location): Return a string which also contains
28585         the file name.
28586
28587         * expression.cs (ElementAccess): New class for expressions of the
28588         type 'element access.'
28589         (BaseAccess): New class for expressions of the type 'base access.'
28590         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28591         respectively.
28592
28593         * cs-parser.jay (element_access): Implement action.
28594         (base_access): Implement actions.
28595         (checked_expression, unchecked_expression): Implement.
28596
28597         * cs-parser.jay (local_variable_type): Correct and implement.
28598         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28599
28600         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28601
28602         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28603         name and the specifiers.
28604
28605         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28606
28607         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
28608         making them all public ;-)
28609
28610         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28611         class anyways.
28612
28613 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
28614
28615         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28616         PropertyExprs.
28617         (FieldExpr, PropertyExprs): New resolved expressions.
28618         (SimpleName::MemberStaticCheck): Perform static checks for access
28619         to non-static fields on static methods. Maybe this should be
28620         generalized for MemberAccesses. 
28621         (SimpleName::ResolveSimpleName): More work on simple name
28622         resolution. 
28623
28624         * cs-parser.jay (primary_expression/qualified_identifier): track
28625         the parameter index.
28626
28627         * codegen.cs (CodeGen::Save): Catch save exception, report error.
28628         (EmitContext::EmitBoolExpression): Chain to expression generation
28629         instead of temporary hack.
28630         (::EmitStatementExpression): Put generic expression code generation.
28631
28632         * assign.cs (Assign::Emit): Implement variable assignments to
28633         local variables, parameters and fields.
28634
28635 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
28636
28637         * statement.cs (Block::GetVariableInfo): New method, returns the
28638         VariableInfo for a variable name in a block.
28639         (Block::GetVariableType): Implement in terms of GetVariableInfo
28640
28641         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28642         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28643
28644 2001-09-06  Ravi Pratap  <ravi@ximian.com>
28645
28646         * cs-parser.jay (operator_declaration): Continue on my quest : update
28647         to take attributes argument.
28648         (event_declaration): Ditto.
28649         (enum_declaration): Ditto.
28650         (indexer_declaration): Ditto.
28651
28652         * class.cs (Operator::Operator): Update constructor accordingly.
28653         (Event::Event): Ditto.
28654
28655         * delegate.cs (Delegate::Delegate): Same here.
28656
28657         * enum.cs (Enum::Enum): Same here.
28658
28659 2001-09-05  Ravi Pratap  <ravi@ximian.com>
28660
28661         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28662
28663         * ../tests/cs0658.cs : New file to demonstrate error 0658.
28664
28665         * attribute.cs (Attributes): New class to encapsulate all attributes which were
28666         being passed around as an arraylist.
28667         (Attributes::AddAttribute): Method to add attribute sections.
28668
28669         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
28670         (struct_declaration): Update accordingly.
28671         (constant_declaration): Update.
28672         (field_declaration): Update.
28673         (method_header): Update.
28674         (fixed_parameter): Update.
28675         (parameter_array): Ditto.
28676         (property_declaration): Ditto.
28677         (destructor_declaration): Ditto.
28678
28679         * class.cs (Struct::Struct): Update constructors accordingly.
28680         (Class::Class): Ditto.
28681         (Field::Field): Ditto.
28682         (Method::Method): Ditto.
28683         (Property::Property): Ditto.
28684         (TypeContainer::OptAttribute): update property's return type.
28685
28686         * interface.cs (Interface.opt_attributes): New member.
28687         (Interface::Interface): Update to take the extra Attributes argument.
28688
28689         * parameter.cs (Parameter::Parameter): Ditto.
28690
28691         * constant.cs (Constant::Constant): Ditto.
28692
28693         * interface.cs (InterfaceMemberBase): New OptAttributes field.
28694         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
28695         the attributes as a parameter.
28696         (InterfaceProperty): Update constructor call.
28697         (InterfaceEvent): Ditto.
28698         (InterfaceMethod): Ditto.
28699         (InterfaceIndexer): Ditto.
28700
28701         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
28702         pass the attributes too.
28703         (interface_event_declaration): Ditto.
28704         (interface_property_declaration): Ditto.
28705         (interface_method_declaration): Ditto.
28706         (interface_declaration): Ditto.
28707
28708 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
28709
28710         * class.cs (Method::Define): Track the "static Main" definition to
28711         create an entry point. 
28712
28713         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
28714         EntryPoint if we find it. 
28715
28716         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
28717         (EmitContext::ig): Make this variable public.
28718
28719         * driver.cs: Make the default output file be the first file name
28720         with the .exe extension.  
28721
28722         Detect empty compilations
28723
28724         Handle various kinds of output targets.  Handle --target and
28725         rename -t to --dumper.
28726
28727         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
28728         methods inherited from Expression return now an Expression.  This
28729         will is used during the tree rewriting as we resolve them during
28730         semantic analysis.
28731
28732         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
28733         the spec.  Missing entirely is the information about
28734         accessability of elements of it.
28735
28736         (Expression::ExprClassFromMemberInfo): New constructor for
28737         Expressions that creates a fully initialized Expression based on
28738         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
28739         a Type.
28740
28741         (Invocation::Resolve): Begin implementing resolution of invocations.
28742
28743         * literal.cs (StringLiteral):  Implement Emit.
28744
28745 2001-09-05  Ravi Pratap  <ravi@ximian.com>
28746
28747         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
28748         member.
28749
28750 2001-09-04  Ravi Pratap  <ravi@ximian.com>
28751
28752         * cs-parser.jay (attribute_arguments): Implement actions.
28753         (attribute): Fix bug in production. Implement action.
28754         (attribute_list): Implement.
28755         (attribute_target): Implement.
28756         (attribute_target_specifier, opt_target_specifier): Implement
28757         (CheckAttributeTarget): New method to check if the attribute target
28758         is valid.
28759         (attribute_section): Implement.
28760         (opt_attributes): Implement.
28761
28762         * attribute.cs : New file to handle attributes.
28763         (Attribute): Class to hold attribute info.
28764
28765         * cs-parser.jay (opt_attribute_target_specifier): Remove production
28766         (attribute_section): Modify production to use 2 different rules to 
28767         achieve the same thing. 1 s/r conflict down !
28768         Clean out commented, useless, non-reducing dimension_separator rules.
28769
28770         * class.cs (TypeContainer.attributes): New member to hold list
28771         of attributes for a type.
28772         (Struct::Struct): Modify to take one more argument, the attribute list.
28773         (Class::Class): Ditto.
28774         (Field::Field): Ditto.
28775         (Method::Method): Ditto.
28776         (Property::Property): Ditto.
28777
28778         * cs-parser.jay (struct_declaration): Update constructor call to
28779         pass in the attributes too.
28780         (class_declaration): Ditto.
28781         (constant_declaration): Ditto.
28782         (field_declaration): Ditto.
28783         (method_header): Ditto.
28784         (fixed_parameter): Ditto.
28785         (parameter_array): Ditto.
28786         (property_declaration): Ditto.
28787
28788         * constant.cs (Constant::Constant): Update constructor similarly.
28789         Use System.Collections.
28790
28791         * parameter.cs (Parameter::Parameter): Update as above.
28792
28793 2001-09-02  Ravi Pratap  <ravi@ximian.com>
28794
28795         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
28796         (TypeContainer.delegates): New member to hold list of delegates.
28797
28798         * cs-parser.jay (delegate_declaration): Implement the action correctly 
28799         this time as I seem to be on crack ;-)
28800
28801 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
28802
28803         * rootcontext.cs (RootContext::IsNamespace): new function, used to
28804         tell whether an identifier represents a namespace.
28805
28806         * expression.cs (NamespaceExpr): A namespace expression, used only
28807         temporarly during expression resolution.
28808         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
28809         utility functions to resolve names on expressions.
28810
28811 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
28812
28813         * codegen.cs: Add hook for StatementExpressions. 
28814
28815         * class.cs: Fix inverted test for static flag in methods.
28816
28817 2001-09-02  Ravi Pratap  <ravi@ximian.com>
28818
28819         * class.cs (Operator::CheckUnaryOperator): Correct error number used
28820         to make it coincide with MS' number.
28821         (Operator::CheckBinaryOperator): Ditto.
28822
28823         * ../errors/errors.txt : Remove error numbers added earlier.
28824
28825         * ../errors/cs1019.cs : Test case for error # 1019
28826
28827         * ../errros/cs1020.cs : Test case for error # 1020
28828
28829         * cs-parser.jay : Clean out commented cruft.
28830         (dimension_separators, dimension_separator): Comment out. Ostensibly not
28831         used anywhere - non-reducing rule.
28832         (namespace_declarations): Non-reducing rule - comment out.
28833
28834         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
28835         with TypeContainer::AddEnum.
28836
28837         * delegate.cs : New file for delegate handling classes.
28838         (Delegate): Class for declaring delegates.
28839
28840         * makefile : Update.
28841
28842         * cs-parser.jay (delegate_declaration): Implement.
28843
28844 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
28845
28846         * class.cs (Event::Define): Implement.
28847         (Event.EventBuilder): New member.
28848
28849         * class.cs (TypeContainer::Populate): Update to define all enums and events
28850         we have.
28851         (Events): New property for the events arraylist we hold. Shouldn't we move to using
28852         readonly fields for all these cases ?
28853
28854 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
28855
28856         * class.cs (Property): Revamp to use the convention of making fields readonly.
28857         Accordingly modify code elsewhere.
28858
28859         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
28860         the Define method of the Property class.
28861
28862         * class.cs : Clean up applied patch and update references to variables etc. Fix 
28863         trivial bug.
28864         (TypeContainer::Populate): Update to define all the properties we have. Also
28865         define all enumerations.
28866
28867         * enum.cs (Define): Implement.
28868
28869 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
28870
28871         * cs-parser.jay (overloadable_operator): The semantic value is an
28872         enum of the Operator class.
28873         (operator_declarator): Implement actions.
28874         (operator_declaration): Implement.
28875
28876         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
28877         validity of definitions.
28878         (Operator::CheckBinaryOperator): Static method to check for binary operators
28879         (TypeContainer::AddOperator): New method to add an operator to a type.
28880
28881         * cs-parser.jay (indexer_declaration): Added line to actually call the
28882         AddIndexer method so it gets added ;-)
28883
28884         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
28885         already taken care of by the MS compiler ?  
28886
28887 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
28888
28889         * class.cs (Operator): New class for operator declarations.
28890         (Operator::OpType): Enum for the various operators.
28891
28892 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
28893
28894         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
28895         ostensibly handle this in semantic analysis.
28896
28897         * cs-parser.jay (general_catch_clause): Comment out
28898         (specific_catch_clauses, specific_catch_clause): Ditto.
28899         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
28900         (catch_args, opt_catch_args): New productions.
28901         (catch_clause): Rewrite to use the new productions above
28902         (catch_clauses): Modify accordingly.
28903         (opt_catch_clauses): New production to use in try_statement
28904         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
28905         and re-write the code in the actions to extract the specific and
28906         general catch clauses by being a little smart ;-)
28907
28908         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
28909         Hooray, try and catch statements parse fine !
28910
28911 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
28912
28913         * statement.cs (Block::GetVariableType): Fix logic to extract the type
28914         string from the hashtable of variables.
28915
28916         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
28917         I end up making that mistake ;-)
28918         (catch_clauses): Fixed gross error which made Key and Value of the 
28919         DictionaryEntry the same : $1 !!
28920
28921 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
28922
28923         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
28924
28925         * cs-parser.jay (event_declaration): Correct to remove the semicolon
28926         when the add and remove accessors are specified. 
28927
28928 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
28929
28930         * cs-parser.jay (IndexerDeclaration): New helper class to hold
28931         information about indexer_declarator.
28932         (indexer_declarator): Implement actions.
28933         (parsing_indexer): New local boolean used to keep track of whether
28934         we are parsing indexers or properties. This is necessary because 
28935         implicit_parameters come into picture even for the get accessor in the 
28936         case of an indexer.
28937         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
28938
28939         * class.cs (Indexer): New class for indexer declarations.
28940         (TypeContainer::AddIndexer): New method to add an indexer to a type.
28941         (TypeContainer::indexers): New member to hold list of indexers for the
28942         type.
28943
28944 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
28945
28946         * cs-parser.jay (add_accessor_declaration): Implement action.
28947         (remove_accessor_declaration): Implement action.
28948         (event_accessors_declaration): Implement
28949         (variable_declarators): swap statements for first rule - trivial.
28950
28951         * class.cs (Event): New class to hold information about event
28952         declarations.
28953         (TypeContainer::AddEvent): New method to add an event to a type
28954         (TypeContainer::events): New member to hold list of events.
28955
28956         * cs-parser.jay (event_declaration): Implement actions.
28957
28958 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
28959
28960         * cs-parser.jay (dim_separators): Implement. Make it a string
28961         concatenating all the commas together, just as they appear.
28962         (opt_dim_separators): Modify accordingly
28963         (rank_specifiers): Update accordingly. Basically do the same
28964         thing - instead, collect the brackets here.
28965         (opt_rank_sepcifiers): Modify accordingly.
28966         (array_type): Modify to actually return the complete type string
28967         instead of ignoring the rank_specifiers.
28968         (expression_list): Implement to collect the expressions
28969         (variable_initializer): Implement. We make it a list of expressions
28970         essentially so that we can handle the array_initializer case neatly too.
28971         (variable_initializer_list): Implement.
28972         (array_initializer): Make it a list of variable_initializers
28973         (opt_array_initializer): Modify accordingly.
28974
28975         * expression.cs (New::NType): Add enumeration to help us
28976         keep track of whether we have an object/delegate creation
28977         or an array creation.
28978         (New:NewType, New::Rank, New::Indices, New::Initializers): New
28979         members to hold data about array creation.
28980         (New:New): Modify to update NewType
28981         (New:New): New Overloaded contructor for the array creation
28982         case.
28983
28984         * cs-parser.jay (array_creation_expression): Implement to call
28985         the overloaded New constructor.
28986
28987 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
28988
28989         * class.cs (TypeContainer::Constructors): Return member
28990         constructors instead of returning null.
28991
28992 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
28993
28994         * typemanager.cs (InitCoreTypes): Initialize the various core
28995         types after we have populated the type manager with the user
28996         defined types (this distinction will be important later while
28997         compiling corlib.dll)
28998
28999         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29000         on Expression Classification.  Now all expressions have a method
29001         `Resolve' and a method `Emit'.
29002
29003         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29004         generation from working.     Also add some temporary debugging
29005         code. 
29006
29007 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
29008
29009         * codegen.cs: Lots of code generation pieces.  This is only the
29010         beginning, will continue tomorrow with more touches of polish.  We
29011         handle the fundamentals of if, while, do, for, return.  Others are
29012         trickier and I need to start working on invocations soon.
29013
29014         * gen-treedump.cs: Bug fix, use s.Increment here instead of
29015         s.InitStatement. 
29016
29017         * codegen.cs (EmitContext): New struct, used during code
29018         emission to keep a context.   Most of the code generation will be
29019         here. 
29020
29021         * cs-parser.jay: Add embedded blocks to the list of statements of
29022         this block.  So code generation proceeds in a top down fashion.
29023
29024 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
29025
29026         * statement.cs: Add support for multiple child blocks.
29027
29028 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
29029
29030         * codegen.cs (EmitCode): New function, will emit the code for a
29031         Block of code given a TypeContainer and its ILGenerator. 
29032
29033         * statement.cs (Block): Standard public readonly optimization.
29034         (Block::Block constructors): Link children. 
29035         (Block::Child): Child Linker.
29036         (Block::EmitVariables): Emits IL variable declarations.
29037
29038         * class.cs: Drop support for MethodGroups here, delay until
29039         Semantic Analysis.
29040         (Method::): Applied the same simplification that I did before, and
29041         move from Properties to public readonly fields.
29042         (Method::ParameterTypes): Returns the parameter types for the
29043         function, and implements a cache that will be useful later when I
29044         do error checking and the semantic analysis on the methods is
29045         performed.
29046         (Constructor::GetCallingConvention): Renamed from CallingConvetion
29047         and made a method, optional argument tells whether this is a class
29048         or a structure to apply the `has-this' bit.
29049         (Method::GetCallingConvention): Implement, returns the calling
29050         convention. 
29051         (Method::Define): Defines the type, a second pass is performed
29052         later to populate the methods.
29053
29054         (Constructor::ParameterTypes): implement a cache similar to the
29055         one on Method::ParameterTypes, useful later when we do semantic
29056         analysis. 
29057
29058         (TypeContainer::EmitMethod):  New method.  Emits methods.
29059
29060         * expression.cs: Removed MethodGroup class from here.
29061
29062         * parameter.cs (Parameters::GetCallingConvention): new method.
29063
29064 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
29065
29066         * class.cs (TypeContainer::Populate): Drop RootContext from the
29067         argument. 
29068
29069         (Constructor::CallingConvention): Returns the calling convention.
29070         (Constructor::ParameterTypes): Returns the constructor parameter
29071         types. 
29072
29073         (TypeContainer::AddConstructor): Keep track of default constructor
29074         and the default static constructor.
29075
29076         (Constructor::) Another class that starts using `public readonly'
29077         instead of properties. 
29078
29079         (Constructor::IsDefault): Whether this is a default constructor. 
29080
29081         (Field::) use readonly public fields instead of properties also.
29082
29083         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29084         track of static constructors;  If none is used, turn on
29085         BeforeFieldInit in the TypeAttributes. 
29086
29087         * cs-parser.jay (opt_argument_list): now the return can be null
29088         for the cases where there are no arguments. 
29089
29090         (constructor_declarator): If there is no implicit `base' or
29091         `this', then invoke the default parent constructor. 
29092
29093         * modifiers.cs (MethodAttr): New static function maps a set of
29094         modifiers flags into a MethodAttributes enum
29095         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
29096         MethodAttr, TypeAttr to represent the various mappings where the
29097         modifiers are used.
29098         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
29099
29100 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
29101
29102         * parameter.cs (GetParameterInfo): Fix bug where there would be no
29103         method arguments.
29104
29105         * interface.cs (PopulateIndexer): Implemented the code generator
29106         for interface indexers.
29107
29108 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
29109
29110         * interface.cs (InterfaceMemberBase): Now we track the new status
29111         here.  
29112
29113         (PopulateProperty): Implement property population.  Woohoo!  Got
29114         Methods and Properties going today. 
29115
29116         Removed all the properties for interfaces, and replaced them with
29117         `public readonly' fields. 
29118
29119 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
29120
29121         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29122         initialize their hashtables/arraylists only when they are needed
29123         instead of doing this always.
29124
29125         * parameter.cs: Handle refs and out parameters.
29126
29127         * cs-parser.jay: Use an ArrayList to construct the arguments
29128         instead of the ParameterCollection, and then cast that to a
29129         Parameter[] array.
29130
29131         * parameter.cs: Drop the use of ParameterCollection and use
29132         instead arrays of Parameters.
29133
29134         (GetParameterInfo): Use the Type, not the Name when resolving
29135         types. 
29136
29137 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
29138
29139         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29140         and instead use public readonly fields.
29141
29142         * class.cs: Put back walking code for type containers.
29143
29144 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
29145
29146         * class.cs (MakeConstant): Code to define constants.
29147
29148         * rootcontext.cs (LookupType): New function.  Used to locate types 
29149
29150
29151 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
29152
29153         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
29154         this System.Reflection code is.  Kudos to Microsoft
29155
29156         * typemanager.cs: Implement a type cache and avoid loading all
29157         types at boot time.  Wrap in LookupType the internals.  This made
29158         the compiler so much faster.  Wow.  I rule!
29159
29160         * driver.cs: Make sure we always load mscorlib first (for
29161         debugging purposes, nothing really important).
29162
29163         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
29164         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
29165
29166         * rootcontext.cs: Lookup types on their namespace;  Lookup types
29167         on namespaces that have been imported using the `using' keyword.
29168
29169         * class.cs (TypeContainer::TypeAttr): Virtualize.
29170         (Class::TypeAttr): Return attributes suitable for this bad boy.
29171         (Struct::TypeAttr): ditto.
29172         Handle nested classes.
29173         (TypeContainer::) Remove all the type visiting code, it is now
29174         replaced with the rootcontext.cs code
29175
29176         * rootcontext.cs (GetClassBases): Added support for structs. 
29177
29178 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
29179
29180         * interface.cs, statement.cs, class.cs, parameter.cs,
29181         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29182         Drop use of TypeRefs, and use strings instead.
29183
29184 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
29185
29186         * rootcontext.cs: 
29187
29188         * class.cs (Struct::Struct): set the SEALED flags after
29189         checking the modifiers.
29190         (TypeContainer::TypeAttr): new property, returns the
29191         TypeAttributes for a class.  
29192
29193         * cs-parser.jay (type_list): Oops, list production was creating a
29194         new list of base types.
29195
29196         * rootcontext.cs (StdLib): New property.
29197         (GetInterfaceTypeByName): returns an interface by type name, and
29198         encapsulates error handling here.
29199         (GetInterfaces): simplified.
29200         (ResolveTree): Encapsulated all the tree resolution here.
29201         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29202         types. 
29203
29204         * driver.cs: Add support for --nostdlib, to avoid loading the
29205         default assemblies.
29206         (Main): Do not put tree resolution here. 
29207
29208         * rootcontext.cs: Beginning of the class resolution.
29209
29210 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
29211
29212         * rootcontext.cs: Provide better error reporting. 
29213
29214         * cs-parser.jay (interface_base): set our $$ to be interfaces.
29215
29216         * rootcontext.cs (CreateInterface): Handle the case where there
29217         are no parent interfaces.
29218
29219         (CloseTypes): Routine to flush types at the end.
29220         (CreateInterface): Track types.
29221         (GetInterfaces): Returns an array of Types from the list of
29222         defined interfaces.
29223
29224         * typemanager.c (AddUserType): Mechanism to track user types (puts
29225         the type on the global type hash, and allows us to close it at the
29226         end). 
29227
29228 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
29229
29230         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29231         RecordInterface instead.
29232
29233         * cs-parser.jay: Updated to reflect changes above.
29234
29235         * decl.cs (Definition): Keep track of the TypeBuilder type that
29236         represents this type here.  Not sure we will use it in the long
29237         run, but wont hurt for now.
29238
29239         * driver.cs: Smaller changes to accomodate the new code.
29240
29241         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29242         when done. 
29243
29244         * rootcontext.cs (CreateInterface):  New method, used to create
29245         the System.TypeBuilder type for interfaces.
29246         (ResolveInterfaces): new entry point to resolve the interface
29247         hierarchy. 
29248         (CodeGen): Property, used to keep track of the code generator.
29249
29250 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
29251
29252         * cs-parser.jay: Add a second production for delegate_declaration
29253         with `VOID'.
29254
29255         (enum_body): Put an opt_comma here instead of putting it on
29256         enum_body or enum_member_declarations so we can handle trailing
29257         commas on enumeration members.  Gets rid of a shift/reduce.
29258
29259         (type_list): Need a COMMA in the middle.
29260
29261         (indexer_declaration): Tell tokenizer to recognize get/set
29262
29263         * Remove old targets.
29264
29265         * Re-add the parser target.
29266
29267 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29268
29269         * cs-parser.jay: Add precendence rules for a number of operators
29270         ot reduce the number of shift/reduce conflicts in the grammar.
29271
29272 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
29273
29274         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29275         and put it here.
29276
29277         Get rid of old crufty code.
29278
29279         * rootcontext.cs: Use this to keep track of the parsed
29280         representation and the defined types available to the program. 
29281
29282         * gen-treedump.cs: adjust for new convention.
29283
29284         * type.cs: Split out the type manager, and the assembly builder
29285         from here. 
29286
29287         * typemanager.cs: the type manager will live here now.
29288
29289         * cil-codegen.cs: And the code generator here. 
29290
29291 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
29292
29293         * makefile: Fixed up for easy making.
29294
29295 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29296
29297         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29298         the 
29299
29300         (unary_expression): Expand pre_increment_expression and
29301         post_decrement_expression to reduce a shift/reduce.
29302
29303 2001-07-11  Simon Cozens
29304
29305         * cs-tokenizer.cs: Hex numbers should begin with a 0.
29306
29307         Improve allow_keyword_as_indent name.
29308
29309 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
29310
29311         * Adjustments for Beta2. 
29312
29313 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
29314
29315         * decl.cs: Added `Define' abstract method.
29316         (InTransit): new property, used to catch recursive definitions. 
29317
29318         * interface.cs: Implement `Define'. 
29319
29320         * modifiers.cs: Map Modifiers.constants to
29321         System.Reflection.TypeAttribute flags.
29322
29323         * class.cs: Keep track of types and user-defined types.
29324         (BuilderInit): New method for creating an assembly
29325         (ResolveType): New function to launch the resolution process, only
29326         used by interfaces for now.
29327
29328         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29329         that are inserted into the name space. 
29330
29331 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
29332
29333         * ARGH.  I have screwed up my tree so many times due to the use of
29334         rsync rather than using CVS.  Going to fix this at once. 
29335
29336         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
29337         load types.
29338
29339 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
29340
29341         * Experiment successful: Use System.Type rather that our own
29342         version of Type.  
29343
29344 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
29345
29346         * cs-parser.jay: Removed nsAliases from here.
29347
29348         Use new namespaces, handle `using XXX;' 
29349
29350         * namespace.cs: Reimplemented namespace handling, use a recursive
29351         definition of the class.  Now we can keep track of using clauses
29352         and catch invalid using clauses.
29353
29354 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
29355
29356         * gen-treedump.cs: Adapted for all the renaming.
29357
29358         * expression.cs (Expression): this class now has a Type property
29359         which returns an expression Type.
29360
29361         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29362         `Type', as this has a different meaning now in the base
29363
29364 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
29365
29366         * interface.cs, class.cs: Removed from all the sources the
29367         references to signature computation, as we can not do method
29368         signature computation during the parsing time, as we are not
29369         trying to solve at that point distinguishing:
29370
29371         class X {
29372                 void a (Blah x) {}
29373                 void a (NS.Blah x) {}
29374         }
29375
29376         Which depending on the context might be valid or not, as we do not
29377         know if Blah is the same thing as NS.Blah at that point.
29378
29379         * Redid everything so the code uses TypeRefs now instead of
29380         Types.  TypeRefs are just temporary type placeholders, that need
29381         to be resolved.  They initially have a pointer to a string and the
29382         current scope in which they are used.  This is used later by the
29383         compiler to resolve the reference to an actual Type. 
29384
29385         * DeclSpace is no longer a CIR.Type, and neither are
29386         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
29387         are all DeclSpaces, but no Types. 
29388
29389         * type.cs (TypeRefManager): This implements the TypeRef manager,
29390         which keeps track of all the types that need to be resolved after
29391         the parsing has finished. 
29392
29393 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
29394
29395         * ARGH.  We are going to have to store `foreach' as a class rather
29396         than resolving it, as we need to verify error 1579 after name
29397         resolution.   *OR* we could keep a flag that says `This request to
29398         IEnumerator comes from a foreach statement' which we can then use
29399         to generate the error.
29400
29401 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
29402
29403         * class.cs (TypeContainer.AddMethod): we now add methods to the
29404         MethodGroup instead of the method hashtable.  
29405
29406         * expression.cs: Add MethodGroup abstraction, which gets us one
29407         step closer to the specification in the way we handle method
29408         declarations.  
29409
29410         * cs-parser.jay (primary_expression): qualified_identifier now
29411         tried to match up an identifier to a local variable reference or
29412         to a parameter reference.
29413
29414         current_local_parameters is now a parser global variable that
29415         points to the current parameters for the block, used during name
29416         lookup.
29417
29418         (property_declaration): Now creates an implicit `value' argument to
29419         the set accessor.
29420
29421 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
29422
29423         * parameter.cs: Do not use `param' arguments as part of the
29424         signature, per the spec.
29425
29426 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
29427
29428         * decl.cs: Base class for classes, structs and interfaces.  This
29429         is the "Declaration Space" 
29430
29431         * cs-parser.jay: Use CheckDef for checking declaration errors
29432         instead of having one on each function.
29433
29434         * class.cs: Factor out some code for handling error handling in
29435         accordance to the "Declarations" section in the "Basic Concepts"
29436         chapter in the ECMA C# spec.
29437
29438         * interface.cs: Make all interface member classes derive from
29439         InterfaceMemberBase.
29440
29441 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
29442
29443         * Many things: all interfaces are parsed and generated in
29444         gen-treedump.  Support for member variables, constructors,
29445         destructors, properties, constants is there.
29446
29447         Beginning of the IL backend, but very little done, just there for
29448         testing purposes. 
29449
29450 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
29451
29452         * cs-parser.jay: Fix labeled statement.
29453
29454         * cs-tokenizer.cs (escape): Escape " and ' always.
29455         ref_line, ref_name: keep track of the line/filename as instructed
29456         by #line by the compiler.
29457         Parse #line.
29458
29459 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
29460
29461         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29462         to match the values in System.CodeDOM.
29463
29464         Divid renamed to Divide.
29465
29466         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29467         statements. 
29468         (Statements.set): remove.
29469
29470         * System.CodeDOM/CodeCatchClause.cs: always have a valid
29471         statements. 
29472
29473         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29474         falseStatements always have valid values. 
29475
29476         * cs-parser.jay: Use System.CodeDOM now.
29477