2008-07-11 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-07-11  Marek Safar  <marek.safar@gmail.com>
2
3         * linq.cs: Reset tranparent parameter counter in probing mode.
4
5 2008-07-11  Marek Safar  <marek.safar@gmail.com>
6
7         * anonymous.cs: Mutate anonymous method type.
8
9 2008-07-11  Marek Safar  <marek.safar@gmail.com>
10
11         * ecore.cs, anonymous.cs: Mutate field expressions.
12
13 2008-07-10  Marek Safar  <marek.safar@gmail.com>
14
15         A fix for bug #369670
16         * linq.cs, statement.cs: Use explicit block for query expressions variables.
17
18 2008-07-10  Marek Safar  <marek.safar@gmail.com>
19
20         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
21
22 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
23
24         Fix bug #314902
25         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
26         only one '>', and finds a '>>', abort the generic lookahead.
27
28 2008-07-10  Marek Safar  <marek.safar@gmail.com>
29
30         A fix for bug #319902
31         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
32
33 2008-07-10  Marek Safar  <marek.safar@gmail.com>
34
35         A fix for bug #406371
36         * statement.cs: Moved EmitSymbolInfo to Block.
37
38 2008-07-09  Marek Safar  <marek.safar@gmail.com>
39
40         * ecore.cs: Report better error for extension method overload failures.
41
42 2008-07-09  Marek Safar  <marek.safar@gmail.com>
43
44         * expression.cs (Is): No need to box reference values.
45
46 2008-07-09  Marek Safar  <marek.safar@gmail.com>
47
48         * class.cs: Use event resolve context when initializing CreateEmitContext.
49
50 2008-07-09  Marek Safar  <marek.safar@gmail.com>
51
52         A fix for bug #394436
53         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
54         method used inside expression trees. Added more LINQ to expression tree
55         conversions.
56
57 2008-07-08  Marek Safar  <marek.safar@gmail.com>
58
59         A fix for bug #378189, #370577
60         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
61         from expression.
62
63 2008-07-08  Marek Safar  <marek.safar@gmail.com>
64
65         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
66         hierarchically.
67
68 2008-07-08  Marek Safar  <marek.safar@gmail.com>
69
70         A fix for bug #406702
71         * anonymous.cs: Always park anonymous method in the nearest parent storey.
72
73 2008-07-07  Marek Safar  <marek.safar@gmail.com>
74
75         A fix for bug #406648
76         * cs-parser.jay: Report nullable use in mcs for some cases.
77
78 2008-07-07  Marek Safar  <marek.safar@gmail.com>
79
80         * ecore.cs: Improved argument mismatch error messages.
81
82 2008-07-07  Marek Safar  <marek.safar@gmail.com>
83
84         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
85
86 2008-07-07  Marek Safar  <marek.safar@gmail.com>
87
88         * expression.cs (TypeOf): Mutate type argument.
89
90 2008-07-04  Marek Safar  <marek.safar@gmail.com>
91
92         * class.cs: Report missing partial modifier for correct type.
93
94 2008-07-04  Marek Safar  <marek.safar@gmail.com>
95
96         * ecore.cs, expression.cs (VariableReference): Variable property is 
97         protected.
98
99 2008-07-04  Marek Safar  <marek.safar@gmail.com>
100
101         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
102         
103 2008-07-04  Marek Safar  <marek.safar@gmail.com>
104
105         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
106         method delegates.
107
108 2008-07-04  Marek Safar  <marek.safar@gmail.com>
109
110         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
111         anonymous method storey to an instance method when only "this" is hoisted.
112
113 2008-07-03  Marek Safar  <marek.safar@gmail.com>
114
115         A fix for bug #321615
116         * expression.cs: Pointer comparisons use unsigned operator.
117
118 2008-07-03  Marek Safar  <marek.safar@gmail.com>
119
120         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
121
122 2008-07-02  Marek Safar  <marek.safar@gmail.com>
123
124         A fix for bug #404905
125         * class.cs: Always initialize local unsafe variables.
126
127 2008-06-30  Marek Safar  <marek.safar@gmail.com>
128
129         A fix for bug #396987
130         * expression.cs (NewInitialize): Clear local temporary variable for next run
131
132 2008-06-27  Marek Safar  <marek.safar@gmail.com>
133
134         A fix for bug #401020
135         * ecore.cs: Both types and modifiers have to match for ref and out arguments
136
137 2008-06-27  Marek Safar  <marek.safar@gmail.com>
138
139         A fix for bug #398319
140         * cs-parser.jay: Implemented undocumented base access expression inside
141         anonymous types.
142
143 2008-06-26  Marek Safar  <marek.safar@gmail.com>
144
145         A fix for bug #404227
146         * cs-parser.jay: Parse namespace declaration using qualified identifier.
147
148 2008-06-26  Marek Safar  <marek.safar@gmail.com>
149
150         A fix for bug #404227
151         * convert.cs: Fixed explicit array to interface cast.
152
153 2008-06-26  Marek Safar  <marek.safar@gmail.com>
154
155         A fix for bug #403894
156         * delegate.cs: Mutate DelegateInvocation type.
157
158 2008-06-26  Marek Safar  <marek.safar@gmail.com>
159
160         A fix for bug #379348
161         * delegate.cs: Box a load of generic parameters.
162
163 2008-06-26  Marek Safar  <marek.safar@gmail.com>
164
165         * expression.cs: Add an array creation arguments mutate.
166
167 2008-06-26  Marek Safar  <marek.safar@gmail.com>
168
169         A fix for bug #386068
170         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
171         parameter.
172
173 2008-06-25  Marek Safar  <marek.safar@gmail.com>
174
175         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
176         CloneTo.
177
178 2008-06-25  Marek Safar  <marek.safar@gmail.com>
179
180         A fix for bug #403518
181         * delegate.cs: Type correctly anonymous method new invocation.
182
183 2008-06-24  Marek Safar  <marek.safar@gmail.com>
184
185         A fix for bug #394826
186         * anonymous.cs: Fully qualify members when resolving anonymous type internal
187         calls.
188
189 2008-06-24  Marek Safar  <marek.safar@gmail.com>
190
191         A fix for bug #394826
192         * anonymous.cs, iterators.cs: Construct generic storey only when is really
193         needed.
194
195 2008-06-24  Marek Safar  <marek.safar@gmail.com>
196
197         * class.cs: Clone indexer parameters for localized capturing.
198
199 2008-06-24  Marek Safar  <marek.safar@gmail.com>
200
201         A fix for bug #402379
202         * expression.cs: Don't crash when an object initializer resolve fails.
203
204 2008-06-24  Marek Safar  <marek.safar@gmail.com>
205
206         A fix for bug #402888
207         * expression.cs: Mutate conditional expression.
208
209 2008-06-24  Marek Safar  <marek.safar@gmail.com>
210
211         A fix for bug #401012
212         * class.cs: Keep StructLayout in shared container.
213
214 2008-06-24  Marek Safar  <marek.safar@gmail.com>
215
216         A fix for bug #400438
217         * decl.cs, class.cs: Only properties can be automatically implemented.
218
219 2008-06-24  Marek Safar  <marek.safar@gmail.com>
220
221         * statement.cs (ChangeToIterator): Copy also labels.
222
223 2008-06-23  Marek Safar  <marek.safar@gmail.com>
224
225         * ecore.cs: Pass type argument details to parent extension method.
226
227 2008-06-23  Marek Safar  <marek.safar@gmail.com>
228
229         A fix for bug #375966
230         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
231
232 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
233
234         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
235
236 2008-06-22  Marek Safar  <marek.safar@gmail.com>
237
238         A fix for bug #394347
239         * anonymous.cs: Cache compatible delegates as compatibility check produces
240         a new method every time.
241
242 2008-06-20  Marek Safar  <marek.safar@gmail.com>
243
244         * anonymous.cs: Propagate storey reference for single references.
245
246 2008-06-20  Marek Safar  <marek.safar@gmail.com>
247
248         A fix for bug #387615
249         * assign.cs, expression.cs: Correctly clone compound assignment.
250
251 2008-06-19  Marek Safar  <marek.safar@gmail.com>
252
253         A fix for bug #359611, #359604
254         * anonymous.cs: Mutate all types of hoisted parameters.
255
256 2008-06-19  Marek Safar  <marek.safar@gmail.com>
257
258         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
259         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
260         expression.cs, codegen.cs, statement.cs
261         
262         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
263         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
264         
265         ** Anonymous methods, lambda expressions rewrite **
266         
267         Anonymous expressions are now resolved when an explicit block is resolved 
268         and they don't require any registration procedure anymore. Further,
269         anonymous methods are defined when explicit block is emitted which allows
270         better control of whole process and opens possibilities for more
271         optimizations as well as alternative to reverse whole process.
272         
273         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
274         process consistent and to correctly emit hoisted generic methods when they
275         have at least 1 hoisted variable.
276         
277 2008-06-17  Martin Baulig  <martin@ximian.com>
278
279         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
280         iterator method.
281         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
282         virtual property; check it in Emit().
283         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
284         an iterator.
285         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
286         an iterator.
287         (Indexer.Define): Likewise.
288
289 2008-06-17  Marek Safar  <marek.safar@gmail.com>
290
291         * convert.cs: Don't use IsInterface on type arguments.
292         
293         * delegate.cs: DelegateInvocation uses MethodInfo.
294         
295         * parameter.cs: Removed IsTypeParameter.
296         
297         * generic-mcs.cs: More missing stuff.
298
299 2008-06-16  Martin Baulig  <martin@ximian.com>
300
301         * modifiers.cs
302         (Modifiers.DEBUGGER_HIDDEN): New public const.
303
304         * typemanager.cs
305         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
306
307         * class.cs
308         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
309         (AbstractPropertyEventMethod): Likewise.
310         (Constructor.Emit): Likewise.
311         (SourceMethod.SetCompilerGenerated): Removed.
312
313         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
314         on MoveNext().
315
316         * anonymous.cs
317         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
318         if we're an `IteratorHost'.
319         (AnonymousMethodMethod..ctor): Don't set
320         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
321         not on the method.
322
323 2008-06-16  Marek Safar  <marek.safar@gmail.com>
324
325         * statement.cs: Clean-up foreach statements.
326
327 2008-06-12  Marek Safar  <marek.safar@gmail.com>
328
329         * class.cs: Stop using public method which should not exist.
330
331 2008-06-11  Martin Baulig  <martin@ximian.com>
332
333         * location.cs
334         (Location.LookupFile): Add `CompilationUnit' argument; when given
335         a relative file name, make it relative to the directory the .cs
336         file is located in instead of using the current directory.
337
338 2008-06-11  Martin Baulig  <martin@ximian.com>
339
340         * class.cs
341         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
342         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
343         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
344         (SourceMethod.SetCompilerGenerated): Likewise.
345
346 2008-06-11  Marek Safar  <marek.safar@gmail.com>
347
348         * codegen.cs, driver: Only write symbol file when it's asked for.
349
350 2008-06-11  Marek Safar  <marek.safar@gmail.com>
351
352         * codegen.cs: Don't use assembly writer error handling for symbol writer.
353
354 2008-06-10  Martin Baulig  <martin@ximian.com>
355
356         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
357
358 2008-06-09  Marek Safar  <marek.safar@gmail.com>
359
360         A fix for bug #316290
361         * expression.cs: Include decimal operators in predefined table.
362         
363         * parameters.cs: More readonlyness.
364
365 2008-06-09  Marek Safar  <marek.safar@gmail.com>
366
367         A fix for bug #397213
368         * cs-parser.jay: One more missing current_local_parameters reset.
369
370 2008-06-09  Marek Safar  <marek.safar@gmail.com>
371
372         A fix for bug #396633
373         * class.cs: Host backing field in partial container.
374
375 2008-06-09  Marek Safar  <marek.safar@gmail.com>
376
377         A fix for bug #397068
378         * expression.cs: Check both operand types when predefined operator is used.
379
380 2008-06-05  Martin Baulig  <martin@ximian.com>
381
382         Merged the `debugger-kahalo' branch.
383
384         * class.cs
385         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
386         we're an iterator method.
387         (SourceMethod): Reflect latest symbol writer changes;
388         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
389         now `start_row' and `end_row'.
390         (Constructor.Emit): Fix the logic whether to emit symbol information.
391
392         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
393         generated methods.
394
395         * location.cs
396         (CompilationUnit): New public class; derives from `SourceFile'.
397         (SourceFileEntry.DefineSymbolInfo): New public method.
398         (SourceFileEntry.SetChecksum): New public method.
399         (Location): Encode hidden line numbers by using `column == 255';
400         the .ctor now accepts `column == -1' to mark a hidden line number.
401         (Location.Hidden): New public property.
402         (Location.CheckPoint): Add `CompilationUnit'.
403         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
404         (Location.Push): Add `CompilationUnit compile_unit' argument.
405         (Location.CompilationUnit): New public property.
406
407         * statement.cs
408         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
409
410         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
411
412         * driver.cs: `SourceFile' -> `CompilationUnit'.
413
414         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
415
416         * namespace.cs: `SourceFile' -> `CompilationUnit'.
417
418         * cs-tokenizer.cs: Add support for `#pragma checksum' and
419         `#line hidden'.
420
421         * symbolwriter.cs
422         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
423         new symbol writer API to also pass the file.
424
425 2008-06-05  Marek Safar  <marek.safar@gmail.com>
426
427         * statement.cs: Emit catch variable assignment using variable expression.
428         
429 2008-06-05  Marek Safar  <marek.safar@gmail.com>
430
431         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
432         with other variable types.
433
434 2008-06-04  Marek Safar  <marek.safar@gmail.com>
435
436         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
437         GetLength method emit, it breaks resolve rules.
438         
439 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
440             Marek Safar  <marek.safar@gmail.com>
441                         
442         A fix for bug #395542
443         * cs-parser.jay: The trailing comma is allowed in anonymous type member
444         declaration.
445         
446 2008-06-02  Marek Safar  <marek.safar@gmail.com>
447
448         A fix for bug #395287
449         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
450
451 2008-05-31  Marek Safar  <marek.safar@gmail.com>
452
453         A fix for bug #395845
454         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
455         non-nullable parameter type.
456         
457 2008-05-31  Marek Safar  <marek.safar@gmail.com>
458
459         * class.cs: Handle contructor initializer as a statement in top-level block.
460
461 2008-05-30  Marek Safar  <marek.safar@gmail.com>
462
463         * attribute.cs: Don't mix old and new corlib types when emitting corlib
464         security attributes.
465
466 2008-05-24  Marek Safar  <marek.safar@gmail.com>
467
468         * ecore.cs, expression.cs: Small IVariable refactoring.
469
470 2008-05-22  Marek Safar  <marek.safar@gmail.com>
471
472         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
473
474 2008-05-21  Marek Safar  <marek.safar@gmail.com>
475
476         * cs-parser.jay: Removed redundant catch type check.
477
478 2008-05-21  Marek Safar  <marek.safar@gmail.com>
479
480         A fix for bug #390372
481         * nullable.cs: Set correct return type.
482
483 2008-05-21  Marek Safar  <marek.safar@gmail.com>
484
485         A fix for bug #391062
486         * typemanager.cs: Fixed crash when comparing null types.
487
488 2008-05-21  Marek Safar  <marek.safar@gmail.com>
489
490         A fix for bug #391871
491         * cs-parser.jay: Better error handling for invalid catch type.
492
493 2008-05-20  Marek Safar  <marek.safar@gmail.com>
494
495         A fix for bug #392155
496         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
497
498 2008-05-15  Marek Safar  <marek.safar@gmail.com>
499
500         A fix for bug #390666
501         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
502         expressions.
503
504 2008-05-15  Marek Safar  <marek.safar@gmail.com>
505
506         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
507         in getter.
508
509 2008-05-13  Marek Safar  <marek.safar@gmail.com>
510
511         A fix for bug #389625
512         * delegate.cs, generic.cs: Some progress on method group return type
513         inference.
514
515 2008-05-13  Marek Safar  <marek.safar@gmail.com>
516
517         A fix for bug #378419
518         * namespace.cs: Inspect also parent namespaces not only namespace entries.
519
520 2008-05-12  Marek Safar  <marek.safar@gmail.com>
521
522         * class.cs (Constructor): Added IsCompilerGenerated.
523
524 2008-05-12  Marek Safar  <marek.safar@gmail.com>
525
526         * expression.cs: Enum binary operators can accept non-enum operand only when
527         is implicitly convertible to underlying type.
528
529 2008-05-12  Marek Safar  <marek.safar@gmail.com>
530
531         A fix for bug #389272
532         * support.cs: Workaround System.InvalidOperationException for enums.
533
534 2008-05-12  Marek Safar  <marek.safar@gmail.com>
535
536         A fix for bug #389073
537         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
538
539 2008-05-10  Marek Safar  <marek.safar@gmail.com>
540
541         * driver.cs: Split Parse.
542         
543         * location.cs (LookupFile): Uses string.Empty.
544
545 2008-05-07  Marek Safar  <marek.safar@gmail.com>
546
547         * expression.cs, parameter.cs: Small ParameterReference clean up.
548
549 2008-05-07  Marek Safar  <marek.safar@gmail.com>
550
551         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
552         hack. Fixes #387502.
553
554 2008-05-06  Martin Baulig  <martin@ximian.com>
555
556         * class.cs (Constructor.Emit): Fix the logic whether to emit
557         symbol information.
558
559 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
560
561         Fix #385503
562         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
563         InvalidOperationException when the iterator is before the start or
564         after the end.
565
566 2008-05-06  Marek Safar  <marek.safar@gmail.com>
567
568         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
569         when left is nullable type.
570
571 2008-05-06  Marek Safar  <marek.safar@gmail.com>
572
573         A fix for bug #386628
574         * expression.cs (LocalVariableReference): Continue in resolving when
575         variable is not assigned.
576
577 2008-05-05  Marek Safar  <marek.safar@gmail.com>
578
579         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
580         nullable operations.
581
582 2008-05-04  Marek Safar  <marek.safar@gmail.com>
583
584         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
585         it saves many redundant temporary variables for nullable operations.
586
587 2008-05-03  Marek Safar  <marek.safar@gmail.com>
588
589         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
590         
591         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
592         method.
593         
594         * nullable.cs: Constant coalescing operator optimizations.
595
596 2008-05-03  Marek Safar  <marek.safar@gmail.com>
597
598         * constant.cs: Use unsigned conversion for values which are unsigned only.
599
600 2008-05-03  Marek Safar  <marek.safar@gmail.com>
601
602         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
603         coalescing operator as it should be.
604
605 2008-05-02  Marek Safar  <marek.safar@gmail.com>
606
607         A fix for bug #371016
608         * expression.cs: All predefined delegate operators require implicit method
609         group conversion.
610         
611 2008-05-02  Marek Safar  <marek.safar@gmail.com>
612
613         * constant.cs: Emit long constant as uint when fits the range.
614         
615         * convert.cs, expression.cs: Fixed few unsafe conversions.
616
617 2008-05-02  Marek Safar  <marek.safar@gmail.com>
618
619         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
620
621 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
622
623         Fix #385758
624         * convert.cs (ImplicitNumericConversion): Don't modify the type of
625         'expr'.
626         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
627
628 2008-05-01  Marek Safar  <marek.safar@gmail.com>
629
630         * constant.cs, literal.cs: IsLiteral property for error reporting.
631         
632         * ecore.cs, expression.cs: Implemented Property expression.
633
634 2008-05-01  Marek Safar  <marek.safar@gmail.com>
635
636         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
637         
638         * nullable.cs: Implemented nullable coalescing null operator.
639
640         * ecore.cs, expression.cs: Expression trees work.
641
642 2008-05-01  Marek Safar  <marek.safar@gmail.com>
643
644         * ecore.cs: CreateExpressionTree is finally abstract.
645
646         * expression.cs, linq.cs: Updated.
647
648 2008-05-01  Marek Safar  <marek.safar@gmail.com>
649
650         * expression.cs, ecore.cs: Block base access expression inside expression
651         tree.
652
653 2008-05-01  Marek Safar  <marek.safar@gmail.com>
654
655         A fix for bug #385058
656         * expression.cs: User-defined operator implementations always take
657         precedence over predefined operator implementations.
658
659 2008-04-30  Marek Safar  <marek.safar@gmail.com>
660
661         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
662         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
663         expression tree conversions.
664         
665 2008-04-30  Marek Safar  <marek.safar@gmail.com>
666
667         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
668         operators method details to Operator class.
669
670 2008-04-30  Marek Safar  <marek.safar@gmail.com>
671
672         * anonymous.cs: Pass unsafe flags to anonymous container.
673         
674         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
675         inside expression tree.
676
677 2008-04-29  Martin Baulig  <martin@ximian.com>
678
679         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
680         (Tokenizer.PopPosition): Also restore the `line'.
681
682 2008-04-29  Marek Safar  <marek.safar@gmail.com>
683
684         * delegate.cs: Implemented Invoke expression.
685
686 2008-04-29  Marek Safar  <marek.safar@gmail.com>
687
688         * expression.cs: Fixed equality reference comparison regression.
689
690 2008-04-29  Marek Safar  <marek.safar@gmail.com>
691
692         * ecore.cs: Clean up EmptyCast hack.
693         
694         * expression.cs, nullable.cs: Implemented enum binary and unary operations
695         using correct conversion rules. Also fixes #383993.
696
697 2008-04-28  Martin Baulig  <martin@ximian.com>
698
699         * class.cs (Constructor.Emit): Don't emit debugging information
700         for generated default .ctor's.
701
702 2008-04-28  Marek Safar  <marek.safar@gmail.com>
703
704         * convert.cs: Empty-cast ushort to int conversion.
705
706 2008-04-28  Marek Safar  <marek.safar@gmail.com>
707
708         A fix for bug #384191
709         * ecore.cs, expression.cs: Fixed expression cloning.
710
711 2008-04-28  Marek Safar  <marek.safar@gmail.com>
712
713         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
714
715 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
716
717         Fix #381559, test-638.cs, test-639.cs
718         * assign.cs (CompoundAssign.Helper): New wrapper.
719         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
720         access.
721         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
722         Pass unconverted expressions to the params array creation expression.
723         (FieldExpr.EmitAssign): Don't special-case StringConcat.
724         (PropertyExpr.EmitAssign): Likewise.
725         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
726         element if it is of kind CompoundAssign.Helper.
727         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
728         first before anything else.
729         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
730         (ArrayAccess.LoadArrayAndArguments): Simplify.
731
732 2008-04-27  Marek Safar  <marek.safar@gmail.com>
733
734         * expression.cs: Fixed cloning of typeof(void).
735
736 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
737
738         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
739         (Assign.Emit): Likewise.  Move it to ...
740         (CompoundAssign.DoResolve): ... here and ...
741         (CompoundAssign.Emit): ... here.
742         (EventAddOrRemove): New helper to handle += and -= on events, and
743         avoid the use of BinaryDelegates.
744         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
745         (EventExpr.EmitAddOrRemove): Improve.
746         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
747
748         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
749         create VarExprs for 'foo.bar.var'.
750         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
751         is a highly inappropriate name for its functionality.
752
753 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
754
755         Simplify handling of multiple assignments
756         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
757         inheritable-only.
758         (SimpleAssign): New.  Class to be used for normal assignments.
759         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
760         * expression.cs, parameter.cs, statement.cs: Likewise.
761
762 2008-04-25  Marek Safar  <marek.safar@gmail.com>
763
764         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
765         for incompatible underlying types, more to come, uff.
766
767 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
768
769         Fix gtest-388.cs
770         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
771         Handle 'leave_copy'.
772
773 2008-04-25  Marek Safar  <marek.safar@gmail.com>
774
775         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
776
777 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
778
779         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
780         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
781         * statement.cs (While, Do, For): Allow test to have side effects.
782         (For.DoEmit): Always emit InitStatement.
783
784         Fix test-635.cs
785         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
786         Always create SideEffectConstant.
787         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
788         of type EnumConstant.
789
790         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
791         Handle 'right' being SideEffectConstant of type 'bool'.
792
793         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
794         Use left.EmitBranchable instead of open coding it, so as to
795         improve optimization opportunities.
796
797         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
798
799         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
800         assumptions.
801         (Expression.EmitSideEffect): Document.
802
803 2008-04-23  Marek Safar  <marek.safar@gmail.com>
804
805         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
806
807 2008-04-23  Marek Safar  <marek.safar@gmail.com>
808
809         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
810
811 2008-04-23  Marek Safar  <marek.safar@gmail.com>
812
813         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
814         conversion to expression tree.
815
816 2008-04-23  Marek Safar  <marek.safar@gmail.com>
817
818         * ecore.cs: Removed unused expression.
819
820 2008-04-22  Marek Safar  <marek.safar@gmail.com>
821
822         * expression.cs: Implemented NegateChecked and New expressions.
823
824 2008-04-22  Marek Safar  <marek.safar@gmail.com>
825
826         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
827
828 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
829
830         Fix #351102
831         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
832         needing final 'ret' instruction.
833
834 2008-04-22  Marek Safar  <marek.safar@gmail.com>
835
836         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
837
838 2008-04-21  Marek Safar  <marek.safar@gmail.com>
839
840         * expression.cs: Emit ldnull and not null expression as an instance argument
841          of static method expression calls.
842
843 2008-04-21  Marek Safar  <marek.safar@gmail.com>
844
845         A fix for bug #378200
846         * expression.cs: Fixed crash when creating parameterless expression tree
847         method call.
848
849 2008-04-21  Marek Safar  <marek.safar@gmail.com>
850
851         A fix for bug #375297
852         * anonymous.cs: Fixed crash when inferring from null argument anonymous
853         method.
854
855 2008-04-21  Marek Safar  <marek.safar@gmail.com>
856
857         A fix for bug #377596
858         * decl.cs, class.cs: Emit delegate type argument attributes.
859
860 2008-04-21  Marek Safar  <marek.safar@gmail.com>
861
862         A fix for bug #365314
863         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
864         
865 2008-04-21  Marek Safar  <marek.safar@gmail.com>
866
867         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
868         only.
869
870 2008-04-21  Marek Safar  <marek.safar@gmail.com>
871
872         * generic.cs (TypeParameter): Removed redundant location.
873
874 2008-04-19  Marek Safar  <marek.safar@gmail.com>
875
876         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
877         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
878         FullNamedExpression in all declaration type expression, statements will come
879         later.
880
881 2008-04-18  Marek Safar  <marek.safar@gmail.com>
882
883         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
884         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
885
886 2008-04-18  Marek Safar  <marek.safar@gmail.com>
887
888         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
889         code.
890
891 2008-04-17  Marek Safar  <marek.safar@gmail.com>
892
893         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
894         constraints.
895
896 2008-04-17  Marek Safar  <marek.safar@gmail.com>
897
898         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
899         name expressions.
900         Also fixes #340463.
901
902 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
903
904         Hook up 'EmitSideEffect'
905         * constant.cs (Constant.EmitSideEffect): New.
906         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
907         (SideEffectConstant.EmitSideEffect): New.
908         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
909         unconditional branch in EmitBranchable.
910         (FieldExpr.EmitBranchable): New.
911         * expression.cs (Unary.EmitSideEffect): New.
912         (Binary.EmitSideEffect): New.
913         (VariableReference.EmitSideEffect): New.  Do nothing.
914
915 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
916
917         Introduce 'EmitSideEffect'
918         * ecore.cs (Expression.EmitSideEffect): New.
919         (TypeCast): Rename from EmptyCast.
920         (EmptyCast): New.
921         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
922         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
923         * convert.cs, nullable.cs: Update to changes.
924
925 2008-04-16  Marek Safar  <marek.safar@gmail.com>
926
927         * class.cs, cs-parser.jay: Early check for base types expression.
928
929 2008-04-16  Marek Safar  <marek.safar@gmail.com>
930
931         * decl.cs (MemberName): Declare PrettyName as obsolete.
932
933 2008-04-16  Marek Safar  <marek.safar@gmail.com>
934
935         * namespace.cs: Use MemberName comparison.
936
937 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
938
939         Fix build break
940         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
941         FullName.
942         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
943         (MemberName.FullyQualifiedName): New.  Provides the functionality
944         that users assume FullName would have.
945         * ecore.cs, namespace.cs: Update to changes.
946
947         * statement.cs (Using.assign): Make into ExpressionStatement.
948         (Using.EmitPreTryBody): Simplify.
949
950 2008-04-16  Marek Safar  <marek.safar@gmail.com>
951
952         * report.cs: ColorFormat is protected.
953         
954         * rootcontext.cs: Unused fields clean-up.
955         
956         * namespace.cs: Made UsingEntry name private.
957
958 2008-04-16  Marek Safar  <marek.safar@gmail.com>
959
960         * cs-tokenizer.cs, location.cs: Removed unused field.
961
962 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
963             Raja R Harinath  <harinath@hurrynot.org>
964
965         Fix #379822
966         * constant.cs (SideEffectConstant.value): Rename from 'left'.
967         (SideEffectConstant.side_effect): Rename from 'right'.
968         (SideEffectConstant..ctor): Normalize 'side_effect'.
969         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
970         value of this constant.
971         * cfold.cs: Update to changes.
972
973 2008-04-15  Marek Safar  <marek.safar@gmail.com>
974
975         * cs-paser.jay: Removed unused variable.
976         
977         * driver.cs: Made Compile instance method.
978
979 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
980
981         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
982
983 2008-04-15  Marek Safar  <marek.safar@gmail.com>
984
985         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
986
987 2008-04-13  Jb Evain  <jbevain@novell.com>
988
989         * namespace.cs: update the System.Core fullname for 2.1
990         * driver.cs: update the list of required assemblies for 2.1.
991         Merged from the Moonlight 2 branch.
992
993 2008-04-11  Marek Safar  <marek.safar@gmail.com>
994
995         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
996         types and user defined operators. User operators arguments has to be checked
997         for null value before invocation, which also means no operator is called
998         when any argument is not convertible to unwrapped nullable type.
999         
1000 2008-04-09  Marek Safar  <marek.safar@gmail.com>
1001
1002         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
1003         of Unary expressions to follow operator overloading rules precisely.
1004         Also fixes #321794, #323794
1005         
1006 2008-04-08  Marek Safar  <marek.safar@gmail.com>
1007
1008         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
1009         expression.
1010         
1011 2008-04-08  Marek Safar  <marek.safar@gmail.com>
1012
1013         * expression.cs, ecore.cs: Implemented MemberInit expression.
1014         
1015 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
1016
1017         Fix mono/tests/exception4.cs
1018         * statement.cs (ExceptionStatement, TryCatch): Revert to using
1019         ec.NeedReturnLabel () rather emitting a 'nop'.
1020
1021         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
1022         simple heuristic.
1023         (TryCatch.SomeCodeFollows): Likewise.
1024         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
1025         for 'break', 'continue' and 'return' statements inside a try.
1026         We're fairly sure that the generated IL stream will have more
1027         instructions textually following the try.
1028         (FlowBranchingTryCatch): Likewise.
1029
1030         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
1031         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
1032         overrides.
1033
1034         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
1035         wrapper -- forward everything to CollectionForeach.
1036         (CollectionForeach.NonDisposableWrapper): New.
1037         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
1038         instead of a pop + branch to end.
1039
1040 2008-04-07  Marek Safar  <marek.safar@gmail.com>
1041
1042         A fix for bug #377485
1043         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
1044         Propagate location for extension method groups. Report conversion failure at
1045         right place.
1046
1047 2008-04-07  Marek Safar  <marek.safar@gmail.com>
1048
1049         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
1050         ListInit and Field expressions.
1051
1052 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
1053
1054         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
1055         Since $PC is always -1 inside the body of MoveNext, the fault
1056         handler is a no-op.
1057         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
1058         * statement.cs (ExceptionStatement.emit_finally): Likewise.
1059         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
1060
1061         The denouement!  Fix #324708
1062         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
1063         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
1064         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
1065         'finally' inside the finally clause.
1066
1067         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
1068         inside an iterator.  Don't emit the body of the 'finally' inside
1069         the finally clause yet.
1070
1071         Use the ResumableStatement infrastructure for MoveNext ()
1072         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
1073         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
1074         'old_resume_points'.  Move dispatcher upfront.
1075         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
1076         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
1077         in an enumerator.  This encodes the main fix in this patch series
1078         -- we can only jump into the first instruction of a try from the
1079         outside, but we want to emit try/finally regions in iterators and
1080         resume in the middle of them.
1081
1082 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
1083
1084         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
1085         of NeedReturnLabel here.
1086
1087         Introduce a common point for emitting try/finally to IL
1088         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
1089         features of the various subclasses, which are now driven by ...
1090         (ExceptionStatement.EmitPreTryBody): ... this and ...
1091         (ExceptionStatement.EmitTryBody): ... this and the original
1092         EmitFinallyBody.
1093         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
1094         Remove DoEmit and update to follow above protocol.
1095
1096         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
1097         of the dispatcher are the same, skip emitting the 'switch'.
1098         * iterator.cs (Iterator.EmitDispose): Update to changes.
1099
1100         Clean up handling of 'using' statement
1101         * statement.cs (UsingTemporary): New.  Carved out of ...
1102         (Using): ... this.  Simplify drastically.  Handle exactly
1103         one variable.
1104         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
1105         or Using as appropriate.  If there are multiple variable declared,
1106         create nested Using statements.
1107         (resource_acquisition): Kill.
1108
1109         * statement.cs (ExceptionStatement.EmitForDispose): Use
1110         EmitFinallyBody, not EmitFinally.
1111
1112         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
1113         * iterator.cs: Update to changes.
1114
1115         Start using the ResumableStatement infrastructure
1116         * statement.cs (ResumeableStatement.PrepareForDispose): New.
1117         (ResumableStatement.EmitForDispose): New.
1118         (ExceptionStatement): Override them.
1119         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
1120         EmitForDispose to create the body of the Dispose method.  Don't
1121         use OldResumePoint.
1122
1123         * iterator.cs (Iterator.AddResumePoint): Move here from ...
1124         * statement.cs (Toplevel.AddResumePoint): ... here.
1125         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
1126         * flowanalysis.cs (FlowBranchingIterator): New.
1127         * codegen.cs (EmitContext): Update to changes.
1128
1129         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
1130         (Iterator.old_resume_points): Rename from 'resume_points'.
1131         (Iterator.MoveNextStatement): Remove unused class.
1132
1133         New infrastructure for try/finally in iterators (still unused)
1134         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
1135         (FlowBranchingToplevel.AddResumePoint): Hook into
1136         ToplevelBlock.AddResumePoint.
1137         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
1138         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
1139         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
1140         resume points and assign program-counter values.
1141         (ExceptionBlock.AddResumePoint): Collect resume points for
1142         de-muxer at the top of try block.
1143         * iterators.cs (Yield.CheckContext): Simplify.
1144         (Yield.Resolve): Use FlowBranching.AddResumePoint.
1145
1146 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
1147
1148         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
1149         argument to an ExitStatement.
1150         (FlowBranchingException): Refactor saved origins code.
1151         * statement.cs (ExitStatement): Update to cahges.
1152         * iterator.cs (YieldBreak): Likewise.
1153
1154         * statement.cs (ResumableStatement): New.  Common base class for
1155         YieldReturn and ExceptionStatement.
1156         (ExitStatement): New.  Common base class for Return and YieldBreak.
1157         (Return): Update to changes.
1158         * iterator.cs (YieldBreak): Likewise.
1159         * lambda.cs (ContextualReturn): Likewise.
1160
1161         Fix #377028
1162         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
1163         emit a meaningful error message.
1164
1165         Fix #324765, #319508
1166         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
1167         (VariableInfo.SetAssigned): Set it.
1168         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
1169         determine if CS0219 or CS0168 is appropriate.  Don't use
1170         flow-analysis information.
1171         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
1172         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
1173         (EmitContext.EndFlowBranching): ... this.
1174
1175 2008-04-03  Marek Safar  <marek.safar@gmail.com>
1176
1177         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
1178
1179 2008-04-03  Marek Safar  <marek.safar@gmail.com>
1180
1181         A fix for bug #376508
1182         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
1183         ImplicitConversionExists.
1184
1185 2008-04-03  Marek Safar  <marek.safar@gmail.com>
1186
1187         * expression.cs (Binary): Added remaining binary operators to expression
1188         tree builder.
1189
1190         * nullable.cs: Optimize shift with null argument.
1191
1192 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
1193
1194         Fix minor IL regression
1195         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
1196         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
1197         * cs-parser.jay (try_statement): Update to changes.
1198
1199         * statement.cs (TryFinally.need_exc_block): Delete.
1200         (TryFinally): Update to changes.
1201
1202         Now all ExceptionStatements are unconditional
1203         * statement.cs (CollectionForeach.DisposableWrapper): New.
1204         Extract out the try/finally code into a new wrapper.
1205         (CollectionForeach.Resolve): Use it to simplify the code.
1206
1207 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
1208
1209         Start at simplifying ExceptionStatement semantics a bit
1210         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
1211         * cs-parser.jay (try_statement): Update to changes.
1212         (opt_catch_clauses): Remove.
1213         * flowanalysis.cs: Update to changes.
1214         (FlowBranching.BranchingType.TryCatch): New.
1215         (FlowBranchingTryCatch): New.
1216
1217         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
1218         (FlowBranching.CreateBranching): Update to changes.
1219         (FlowBranchingBlock.AddSibling): Add sanity check.
1220         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
1221         Update to changes.
1222
1223         * iterators.cs (Iterator.MarkFinally): Remove.
1224         * statement.cs (ExceptionStatement): Update to changes.
1225
1226         Add support for skipping over finally blocks at runtime.  First
1227         in a series to fix #324708
1228         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
1229         (Iterator.EmitMoveNext): Initialize it.
1230         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
1231         branch over the body of the 'finally' clause.
1232
1233 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
1234
1235         Avoid lopsided use of Foo/DoFoo names
1236         * statement.cs (ExpressionStatement.EmitFinallyBody):
1237         Rename from EmitFinally.
1238         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
1239         * iterator.cs: Update to changes.
1240
1241 2008-04-02  Marek Safar  <marek.safar@gmail.com>
1242
1243         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
1244         based on UserOperatorCall. More binary nullable operators clean up.
1245
1246 2008-04-02  Martin Baulig  <martin@ximian.com>
1247
1248         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
1249
1250 2008-04-02  Marek Safar  <marek.safar@gmail.com>
1251
1252         * nullable.cs: Merge user and empty conversions when lifting expression
1253         trees.
1254         
1255         * expression.cs (StringConcat): Implemented expression tree representation.
1256
1257 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1258
1259         * nullable.cs: When lifting null literal and a user operator exists, no call 
1260         is made.
1261         
1262 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1263
1264         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
1265         null.
1266
1267 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1268
1269         * nullable.cs, expression.cs: Use namespace instead heavily nested
1270         monster abstract class.
1271
1272 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1273
1274         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
1275         lifting of null literal and user operators. Clean up of some temporary
1276         nullable hacks.
1277
1278 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
1279
1280         Fix #368224, test-629.cs
1281         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
1282         if it crossed an unwind-protect boundary.
1283         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
1284         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
1285         inside an unwind-protected region.
1286         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
1287         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
1288         'leave' instead of a 'br' if unwind-protected.
1289         (Iterator.EmitYieldBreak): Likewise.
1290
1291 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
1292
1293         * driver.cs: Only define versioninfo resources if no win32 resource
1294         file was specified.
1295
1296 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1297
1298         A fix for bug #372375
1299         * convert.cs: Fixed boxing of nullable types.
1300
1301 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1302
1303         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
1304         type.
1305
1306 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1307
1308         A fix for bug #374619
1309         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
1310         
1311 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1312
1313         * lambda.cs: Check return type only for invocation.
1314         
1315 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1316
1317         A fix for bug #374214
1318         * ecore.cs: Correctly report argument type mismatch.
1319
1320 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1321
1322         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
1323         and not rely on broken IsEnum.
1324
1325 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1326
1327         * nullable.cs: New file, extracted from generic.cs.
1328         
1329         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1330
1331 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1332
1333         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1334         predefined comparison operators and null literals.
1335         
1336         * report.cs: New warning ID.
1337         
1338 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1339
1340         A fix for bug #370577
1341         * lambda.cs: Check return type too.
1342
1343 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1344
1345         A fix for bug #372846
1346         * class.cs: Automatic properties can be declared as unsafe.
1347
1348 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1349
1350         * location.cs: Use string based concatenation.
1351         
1352         * expression.cs: LiftedBinaryOperator is gmcs only.
1353         
1354 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1355
1356         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1357         conversions rules and expression trees.
1358
1359 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1360
1361         * delegate.cs: Use extension method source as delegate target.
1362
1363 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1364
1365         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1366         binary operations to be purely based on binary operations and optimized
1367         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1368         and other ET refactoring.
1369         
1370         * typemanager.cs: Fixed warning.
1371         
1372 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1373
1374         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1375         
1376         * symbolwriter.cs: Fixed.
1377
1378 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1379
1380         * anonymous.cs, driver.cs: Reset anonymous types counters.
1381
1382 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1383
1384         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1385         
1386         * class.cs: Use fullname for all type member definitions.
1387         
1388 2008-02-19  Martin Baulig  <martin@ximian.com>
1389
1390         * class.cs
1391         (IMethodData.EmitExtraSymbolInfo): New interface method.
1392         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1393         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1394         interface method here as an empty public virtual method.
1395
1396         * anonymous.cs
1397         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1398         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1399         CodeGen.SymbolWriter.SetRealMethodName().       
1400
1401 2008-02-18  Martin Baulig  <martin@ximian.com>
1402
1403         * anonymous.cs
1404         (ScopeInfo.EmitType): Override this and emit debugging
1405         information for captured variables.
1406         (RootScopeInfo.EmitType): Override this and emit symbol
1407         information for a captured `this'.
1408
1409 2008-02-15  Martin Baulig  <martin@ximian.com>
1410
1411         * iterators.cs: Emit debugging info.
1412
1413         * codegen.cs
1414         (EmitContext.Flags): Add `OmitDebuggingInfo'.
1415         (EmitContext.OmitDebuggingInfo): New public property.
1416
1417         * statement.cs
1418         (While): Override Emit() and don't emit symbol info there; do it
1419         inside DoEmit() instead.
1420         (Block.Emit): Omit symbol information while emitting the scope
1421         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
1422         block logic.
1423         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1424         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1425         .ctor to make `IsIterator' work.
1426
1427 2008-03-14  Martin Baulig  <martin@ximian.com>
1428
1429         * symbolwriter.cs: Added the new symbol writer function from the
1430         debugger's `terrania' branch; temporarily enclose them inside
1431         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1432         my vacations.
1433
1434 2008-03-14  Martin Baulig  <martin@ximian.com>
1435
1436         * symbolwriter.cs
1437         (SymbolWriter): Make this a public static class.
1438
1439         * codegen.cs
1440         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1441         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1442
1443 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1444
1445         A fix for bug #370577
1446         * statement.cs, lambda.cs: Added extra limitations when dealing with void
1447         return type.
1448         
1449 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1450
1451         * typemanager.cs (CSharpName): Made 250 times faster.
1452
1453 2008-03-13  Marek Safar  <marek.safar@gmail.com>
1454
1455         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1456         
1457 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1458
1459         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1460         crash when predefined field does not exist.
1461         
1462 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1463
1464         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1465         
1466 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1467
1468         * class.cs (FixedField): Don't crash when contructors are missing.
1469
1470 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1471
1472         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1473         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1474         check internal types accessibility for internal and external types.
1475         Replaced EnumToUnderlying by GetEnumUnderlyingType.
1476
1477 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1478
1479         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1480         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1481         attribute.cs, statement: Use corect instance of predefined types (work
1482         related to #364674).
1483
1484 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1485
1486         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1487         
1488 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1489
1490         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
1491         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1492         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1493         predefined types clean up, delayed predefined types members initialization
1494         (work related to #364674).
1495
1496 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1497
1498         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1499         
1500 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1501
1502         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1503         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1504         predefined types clean up (work related to #364674).
1505
1506 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1507
1508         * ecore.cs: Print an error message instead of throwing exception.
1509         
1510 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1511
1512         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1513         expression.cs, statement.cs: Unififed null literal representation.
1514
1515 2008-03-03  Marek Safar  <marek.safar@gmail.com>
1516
1517         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1518         expression.cs: Refactored binary operators resolve phase and improved speed.
1519         The nullable code is still missing and won't work correctly, more fixes
1520         required.
1521
1522         It also fixes #323726, #324312, #324248, and many other unreported issues.
1523
1524 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
1525
1526         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
1527         instead of 'gmcs'.
1528
1529 2008-02-27  Marek Safar  <marek.safar@gmail.com>
1530
1531         * ecore.cs: Clean-up and split BetterConversion.
1532         
1533 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
1534
1535         Fix #363791
1536         * enum.cs (EnumMember.Value): Only access 'value' if
1537         ResolveValue says it's ok.
1538         (EnumMember.DoResolveValue): Don't set prev_member.value.
1539         (Enum.GetDefinition): Reverse arguments of Equals --
1540         EnumMember.Value can return 'null'.
1541
1542         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1543
1544 2008-02-22  Marek Safar  <marek.safar@gmail.com>
1545
1546         * generic.cs, expression.cs: More ongoing work on expression trees.
1547         
1548 2008-02-21  Marek Safar  <marek.safar@gmail.com>
1549
1550         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1551         handle missing matches when mutiple operators exist.
1552         
1553 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1554
1555         A fix for bug #363218
1556         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1557         initializers.
1558         
1559 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1560
1561         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1562         update. This time to deal correctly with SideEffectConstant expression used
1563         as an argument for another constant folding.
1564
1565 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
1566
1567         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1568         MethodBuilder.
1569
1570 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1571
1572         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1573
1574 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1575
1576         A fix for bug #328136
1577         * expression.cs: Do not fold immediately LogicalAnd operators when the left
1578         side is a false constant, because we still need to evaluate the right-hand
1579         side.
1580
1581         * statement.cs (If): Emit two types of boolean constants (simple constant,
1582         side-effect constant).
1583
1584 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1585
1586         * constant.cs (SideEffectConstant): Don't emit boolean constant.
1587
1588         * expression.cs: Fold immediately LogicalAnd operators when both sides are
1589         constants.
1590
1591 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1592
1593         A fix for bug #361457
1594         * ecore.cs (IsApplicable): Params methods have lower priority.
1595
1596         * support.cs: Return correct parameter modifier for params types.
1597
1598 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1599
1600         * generic.cs (TypeParameter): Cache attribute target name.
1601
1602         * support.cs: Removed unused variable.
1603
1604         * typemanager.cs: Removed debugging leftover.
1605
1606         * ecore.cs: Use local type instead of a property;
1607
1608         * class.cs (VerifyMembers): Consider also parent to test whether type member
1609         is local or public.
1610
1611         * expression.cs (FullMethodDesc): Removed.
1612
1613         * attribute.cs (IsValidArgumentType): Made static.
1614
1615 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
1616
1617         Cleanup to be more readable.
1618         * Makefile (GMCS_PROFILE): Remove.
1619         (COMPILER_NAME): New helper.
1620
1621 2008-02-15  Miguel de Icaza  <miguel@novell.com>
1622
1623         * cs-tokenizer.cs: if a conditional expression happens inside a
1624         (...) this also means that we do not need to de-ambiguate between
1625         an parenthesized expression and a cast.
1626
1627         Fixes 346484.
1628
1629         * constant.cs (SideEffectConstant): a constant value that happens
1630         to have a side effect.
1631
1632         Fixes the build regressions introduced by the fix for #359789
1633
1634 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
1635
1636         * expression.cs (Conditional.Emit): when emitting the ternary
1637         operator, use local variables to generate code verifiable code.
1638
1639         The verifier cannot infer that the type on stack before the
1640         stloc.0 is executed is of type ParentB. This happens because the
1641         stack merge algorithm uses only parent types when deciding which
1642         is the common type.  This is described in Part III 1.8.1.3 of ECMA
1643         335.
1644
1645         This code compiled with mcs is not verifiable under MS. The MS
1646         verifier picks the first common interface of Foo and Bar, which is
1647         wrong, but doesn't use a full join type of the 2 interfaces.
1648
1649         CSC uses a clever hack to compile such code in a verifiable
1650         way. It stores the intermediate values in a local variable with
1651         the expected type.
1652
1653         Fixes: #358102
1654
1655 2008-02-14  Miguel de Icaza  <miguel@novell.com>
1656
1657         * expression.cs: Do not fold BitwiseAnd operators when the left
1658         side is a false constant, because we still need to evaluate the
1659         right-hand side.
1660
1661         Fixes #359789
1662
1663         * support.cs: Instead of throwing an InternalErrorException when
1664         the position of the stream is outside the boundary of our buffer,
1665         reset the state of the reader, and restart the reading from the
1666         beginning of the file.
1667
1668 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1669
1670         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1671
1672 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1673
1674         A fix for bug #361686
1675         * decl.cs: A protected types used inside a private class which parents
1676         derives from the protected class are accessible.
1677
1678 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1679
1680         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1681         the parameterless constructor.
1682
1683 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1684
1685         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1686         lookup methods to use standard member cache when doing member lookup.
1687
1688 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1689
1690         * driver.cs: Don't report full path for referenced module as assembly error.
1691
1692 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1693
1694         * Makefile: Fixed `qh' target to work on all machines.
1695
1696         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1697         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1698         and HasElementType with TypeManager implementation.
1699
1700 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1701
1702         A fix for bugs #325134, #359749
1703         * expression.cs, ecore.cs: Try to resolve an extension method even if the
1704         first binds point to non-method member expression.
1705
1706 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1707
1708         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1709
1710 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1711
1712         A fix for bugs #321394, #323028
1713         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1714         Reworked naive IsAccessibleAs implementation to handle nested types.
1715
1716 2008-02-05  Jb Evain  <jbevain@novell.com>
1717
1718         * class.cs: use generic type comparison for parameters
1719         as well.
1720
1721 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1722
1723         A fix for bug #325372
1724         * class.cs: Use generic type comparison when testing method signatures.
1725
1726 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1727
1728         A fix for bug #357047
1729         * ecore.cs: Applied C# 3.0 changes to better conversion.
1730
1731 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1732
1733         A fix for bug #358374
1734         * cs-parser.jay: Correctly set modifiers for all constructor types.
1735
1736 2008-02-04  Marek Safar  <marek.safar@gmail.com>
1737
1738         A fix for bug #355251
1739         * generic.cs: Added base class constraint based type inference.
1740
1741 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1742
1743         A fix for bug #357255
1744         * decl.cs: One more missing visibility check.
1745
1746 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1747
1748         * support.cs: Fixed broken return.
1749
1750 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1751
1752         * report.cs: Correctly reset warnings count after probing.
1753
1754 2008-01-25  Martin Baulig  <martin@ximian.com>
1755
1756         * namespace.cs
1757         (NamespaceEntry.SymbolFileID): Make this work again after
1758         MemberName.ToString() is gone.
1759
1760 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1761
1762         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1763         expressions.
1764
1765 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1766
1767         * generic.cs: Use full implicit conversion for type inference fixing.
1768
1769 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1770
1771         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1772         Fixed user operator conversions.
1773
1774 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1775
1776         * generic.cs: Do nullable type to null comparison optimization during
1777         resolve phase.
1778
1779 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1780
1781         A fix for bug #355163
1782         * generic.cs: Enabled l-value resolve on nullable expressions.
1783
1784 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1785
1786         A fix for bug #353986
1787         * class.cs: Ingore static ctors with parameters for any further checks.
1788
1789 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1790
1791         A fix for bug #354310
1792         * namespace.cs: Removed redundant check.
1793
1794 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1795
1796         A fix for bug #354928
1797         * expression.cs: ElementInitializers can be resolved only once.
1798
1799 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1800
1801         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1802         Condition expressions.
1803
1804 2008-01-23  Marek Safar  <marek.safar@gmail.com>
1805
1806         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1807
1808 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1809
1810         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1811         not allowed.
1812
1813         * generic.cs: Implemented coalesce expression.
1814
1815 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1816
1817         A fix for bug #355145
1818         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1819         expression tree type inference.
1820
1821 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
1822
1823         Fix #354663
1824         * expression.cs (Binary.IsUnsignedType): Fix typo.
1825
1826 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1827
1828         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1829
1830 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1831
1832         A fix for bug #355161
1833         * ecore.cs, expression.cs: Wider range of extension method supported
1834         expressions.
1835
1836 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
1837
1838         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1839         AssemblyBuilder to operate in compiler context. Fixes mcs part of
1840         bug #354970.
1841
1842 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1843
1844         A fix for bug #355148
1845         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1846
1847 2008-01-22  Miguel de Icaza  <miguel@novell.com>
1848
1849         * expression.cs (CreateExpressionTree): Add support for or and
1850         logical or, and indent following the coding conventions.
1851
1852         * typemanager.cs (LinqExpression): renamed from
1853         ExpressionTreeManager, for a shorter name.
1854
1855         Use TypeManager.CoreLookupType to lookup types from our core
1856         assemblies and turn those into "Type" variables.
1857
1858         Consumers that previously used "Namespace" and "Type" from this
1859         class should instead use the TypeExpression which is a type that
1860         is fully resolved (without involving the regular C# resolution
1861         rules). 
1862
1863         This typically looks like this:
1864
1865         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1866         new MemberAccess (texpr, name, type_arguments, loc)
1867
1868         This avoids the problem in: #355178
1869
1870 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1871
1872         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1873         feature in parser only as we do in other cases.
1874         
1875 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1876
1877         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1878         typemanager.cs: A refactoring of params arguments to reuse existing
1879         expressions (params -> array initializer) to emit params argument instead
1880         of specialized handling.
1881         It was required by expression tree implementation and it has other benefits
1882         as well, we now apply same optimization for params arguments as we do for
1883         array initializers.
1884         
1885 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1886
1887         A fix for bug #353526
1888         * generic.cs: A type inference of params arguments may not required any
1889         temporary array creation.
1890         
1891 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1892
1893         A fix for bug #353534
1894         * generic.cs, ecore.cs, expression.cs: A method group type inference is
1895         supported for delegates only.
1896         
1897 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1898
1899         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1900         type for more than 1 candidates.
1901         
1902 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1903
1904         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1905         expressions.
1906         
1907 2008-01-16  Marek Safar  <marek.safar@gmail.com>
1908
1909         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1910         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1911         operator) expressions. 
1912                 
1913 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
1914
1915         * statement.cs: Avoid declaring an IL variable for this_variable since it is
1916         not accessed from the generated IL.
1917
1918 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1919
1920         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1921         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1922         statement.cs: The first expression tree implementation drop, mostly
1923         infrastructure work.
1924
1925 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1926
1927         * ecore.cs (IsNestedChild): Refactored.
1928
1929 2008-01-11  Marek Safar  <marek.safar@gmail.com>
1930
1931         * lambda.cs: Don't use a cast on unknown expression statement.
1932
1933 2008-01-10  Geoff Norton  <gnorton@novell.com>
1934
1935         * cs-tokenizer.cs: One more token to distinguish between method and lambda
1936         arguments
1937
1938 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1939
1940         * doc.cs: Report better /doc crash details.
1941         
1942 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1943
1944         A fix for bug #352536
1945         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1946
1947 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1948
1949         A fix for bug #352287
1950         * ecore.cs, expression.cs: Do `this' access checking in all member access
1951         expressions.
1952         
1953 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1954
1955         * rootcontext.cs, driver.cs: Switch to linq mode by default.
1956         
1957         * report.cs: Reset message stacks.
1958         
1959 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1960
1961         * generic.cs (InferInPhases): Correctly calculate params position.
1962         
1963 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1964
1965         * cs-tokenizer.cs: No need to parse full string when parsing lambda
1966         arguments.
1967
1968 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1969
1970         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1971         
1972         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1973         
1974         * driver.cs: Updated --help option.
1975         
1976 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1977
1978         * generic.cs (InferParamsTypeArguments): Removed.
1979         (InferInPhases): Add params type inference.
1980         (LowerBoundInference): Fixed scoring mechanism.
1981         
1982         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1983         
1984 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
1985
1986         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1987         byte array for unsigned "baked" assemblies.
1988
1989 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
1990
1991         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1992         array for assemblies that are not strongnamed.
1993
1994 2008-01-04  Marek Safar  <marek.safar@gmail.com>
1995
1996         A fix for bug #351481
1997         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1998         declaring type for nested generic types.
1999         
2000 2008-01-04  Marek Safar  <marek.safar@gmail.com>
2001
2002         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
2003         instead of ToString.
2004         
2005 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2006
2007         A fix for bug #351047
2008         * expression.cs (Binary.ResolveOperator): Allow equality operators between
2009         null and structs only when equality and inequality operators are defined
2010         either as an user-operators or predefined operators.
2011         
2012 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2013
2014         A fix for bug #351047
2015         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
2016         
2017 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2018
2019         A fix for bug #351257
2020         * cs-tokenizer.cs: Advance line number for '\r' correctly.
2021         
2022 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2023
2024         A fix for bug #351157
2025         * class.cs (Using): Fixed yet another broken cloning.
2026         
2027         (Block): Put back more sensible default value for statements.
2028         
2029 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
2030
2031         * codegen.cs: Allow AssemblyVersion with only major version component.
2032         Fixes bug #351055.
2033
2034 2007-12-29  Marek Safar  <marek.safar@gmail.com>
2035
2036         A fix for bug #324654
2037         * class.cs: Use FullName property as member name.
2038
2039 2007-12-28  Marek Safar  <marek.safar@gmail.com>
2040
2041         A fix for bug #342117
2042         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
2043         constructor constraint.
2044
2045 2007-12-28  Marek Safar  <marek.safar@gmail.com>
2046
2047         A fix for bug #338273
2048         * class.cs (ProbertyBase): Access modifier checks are required for overrides
2049         only.
2050
2051 2007-12-28  Marek Safar  <marek.safar@gmail.com>
2052
2053         A fix for bug #350839
2054         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
2055
2056 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
2057
2058         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2059         GHOP:
2060         
2061         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
2062
2063         * statement.cs: Changed some Hashtables to use HybridDictionaries
2064         instead. It was observed that some HashTables only contained a few
2065         items in the vast majority of cases. Since HybridDictionary is
2066         more efficient on small sets (<10 elements), "known_variables"
2067         from class ExplicitBlock as well as "labels" and "constants " from
2068         class Block were changed to HybridDictionaries. 
2069
2070         Atsai results: (56216kb->54987kb)
2071
2072         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
2073
2074
2075 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
2076
2077         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2078         GHOP:
2079         
2080         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
2081         
2082         * expression.cs: foreach loop to for loop, saved on allocation of
2083         enumerator (59333kb->59141kb)
2084
2085         * statement.cs. Changed foreach loops to for loops, saved on
2086         allocation of enumerator (59141kb->59006kb)
2087
2088         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
2089         when constructed with no specified capacity. This was causing a
2090         few ArrayLists to allocate more memory than they would potentially
2091         need in the Block class and MemberCache class. Setting the
2092         ArrayLists to construct with a capacity of 1 saves some
2093         memory. (56216kb->55585kb)
2094
2095 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2096
2097         A fix for bug #347189 (2nd issue)
2098         * expression.cs (MemberAccess): Nested type can be found in base non-generic
2099         type.
2100
2101 2007-12-27  Miguel de Icaza  <miguel@novell.com>
2102         
2103         * report.cs: Do not use colors if stdout and stderr are not a
2104         terminal.
2105
2106 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2107
2108         A fix for bug #346998
2109         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
2110         overloads.
2111
2112 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2113
2114         A fix for bug #343465
2115         * class.cs: Explicit method name for nested types uses dots only.
2116
2117 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2118
2119         A fix for bug #343707
2120         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
2121
2122 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2123
2124         * ecore.cs: Report type inference errors only when arguments count matches
2125         parameter count.
2126         
2127         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
2128         
2129         * expression.cs, report.cs: New warning.
2130         
2131         * typemanager.cs: Catch anonymous method type too.
2132
2133 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2134
2135         A fix for bug #346379
2136         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
2137
2138 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2139
2140         A fix for bug #347359
2141         * expression.cs (Invocation): Don't resolve already resolved expression.
2142
2143 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2144
2145         A fix for bug #347189
2146         * class.cs (FixedField): Use non-dependent code only in the define phase.
2147
2148 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2149
2150         A fix for bug #348076
2151         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
2152
2153 2007-12-22  Marek Safar  <marek.safar@gmail.com>
2154
2155         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
2156         discovered extension methods.
2157
2158 2007-12-22  Marek Safar  <marek.safar@gmail.com>
2159
2160         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
2161         method.
2162
2163 2007-12-21  Miguel de Icaza  <miguel@novell.com>
2164
2165         * report.cs (ErrorMessage): Add support for using colors on
2166         terminals that support it. 
2167
2168 2007-12-21  Marek Safar  <marek.safar@gmail.com>
2169
2170         * ecore.cs: Use information about expanded params for error reporting.
2171
2172 2007-12-21  Marek Safar  <marek.safar@gmail.com>
2173
2174         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
2175         and logic for params overloads.
2176         
2177 2007-12-15  Miguel de Icaza  <miguel@novell.com>
2178
2179         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
2180         as this is also created from the parser.  Fixes #349034
2181
2182 2007-12-12  Miguel de Icaza  <miguel@novell.com>
2183
2184         * statement.cs (Throw.CloneTo): it is valid to have empty
2185         expressions for throw. 
2186
2187 2007-12-03  Marek Safar  <marek.safar@gmail.com>
2188
2189         * cs-parser.jay: Set delegate constraint parsing region correctly.
2190
2191 2007-12-03  Marek Safar  <marek.safar@gmail.com>
2192
2193         A fix for bug #345467
2194         * typemanager.cs (IsEqual): Compare generic parameters position only.
2195         
2196 2007-11-28  Marek Safar  <marek.safar@gmail.com>
2197
2198         * expression.cs (BaseAccess): Type arguments can be null.
2199
2200 2007-11-27  Raja R Harinath  <harinath@gmail.com>
2201
2202         * statement.cs (Block.Resolve): Ensure flow-branching tree is
2203         consistent even when an error has occured.
2204         (Switch.Resolve): Likewise.
2205
2206 2007-11-22  Marek Safar  <marek.safar@gmail.com>
2207
2208         A fix for bug #334505
2209         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
2210         overrides.
2211         
2212 2007-11-22  Marek Safar  <marek.safar@gmail.com>
2213
2214         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
2215         refactorings required to resolve extension methods correctly when mixing
2216         generics and non-generics members.
2217         
2218 2007-11-20  Marek Safar  <marek.safar@gmail.com>
2219
2220         A fix for bug #342584
2221         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
2222         conversion.
2223         
2224 2007-11-19  Marek Safar  <marek.safar@gmail.com>
2225
2226         A fix for bug #342512
2227         * delegate.cs: Use delegate argument expression when is available. Don't
2228         emit virtual call when class is sealed.
2229         
2230 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2231
2232         A fix for bug #325423
2233         * assign.cs (FieldInitializer): Use resolved expression for emit.
2234         
2235         * class.cs: Print less confusing error message.
2236         
2237 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2238
2239         * cs-tokenizer.cs: Removed GMCS ifdefs.
2240         
2241         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
2242         mcs.
2243         
2244         * cs-parser.jay: Disabled nullable check.
2245         
2246         * generic-mcs: Copied more generic stuff.
2247                 
2248 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2249
2250         * gcs-parser.jay: Merged to cs-parser.jay.
2251         
2252         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
2253         * *.csproj, *.sources: Updated to use only jay parser file.
2254
2255 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2256
2257         * gcs-parser.jay: Added nullable and default expression feature checks.
2258         
2259 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2260
2261         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
2262         it fixes many TODOs and hidden bugs.
2263         
2264         * expression: Removed duplicate error check.
2265
2266 2007-11-15  Marek Safar  <marek.safar@gmail.com>
2267
2268         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
2269         implicitly type local variable only when it is used in a declaration.
2270
2271 2007-11-15  Marek Safar  <marek.safar@gmail.com>
2272
2273         * attribute.cs: Use CS0612 for empty strings.
2274
2275 2007-11-14  Marek Safar  <marek.safar@gmail.com>
2276
2277         * lambda.cs, statement.cs: Contextual return may act as a statement.
2278
2279 2007-11-14  Marek Safar  <marek.safar@gmail.com>
2280
2281         A fix for a regression cause by #324222
2282         * class.cs: Don't report unused even when it implements an interface.
2283         
2284 2007-11-13  Marek Safar  <marek.safar@gmail.com>
2285
2286         A fix for bug #341205
2287         * ecore.cs, expression.cs: Method group expression cannot do static
2288         method access with an instance reference check before overloading takes
2289         a place.
2290         
2291 2007-11-13  Marek Safar  <marek.safar@gmail.com>
2292
2293         A fix for bug #325359
2294         * class.cs: Use predictable name for automatically generated property.
2295         
2296 2007-11-12  Marek Safar  <marek.safar@gmail.com>
2297
2298         A fix for bug #324996
2299         * expression.cs (Is): Handle case where D is nullable and T is not
2300         correctly.
2301         
2302         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
2303         
2304 2007-11-12  Marek Safar  <marek.safar@gmail.com>
2305
2306         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
2307         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
2308         Flush small error reporting changes.
2309         
2310 2007-11-09  Marek Safar  <marek.safar@gmail.com>
2311
2312         A fix for bug #324996
2313         * expression.cs: Rewrote Is expression implementation to work with
2314         generics, nullable types, anonymous method. A const result expression 
2315         uses existing infrastructure instead of custom not fully-featured one.
2316         
2317 2007-11-08  Marek Safar  <marek.safar@gmail.com>
2318
2319         A fix for bug #340202
2320         * class.cs: Consider generics for volatile field.
2321
2322 2007-11-08  Marek Safar  <marek.safar@gmail.com>
2323
2324         A fix for bug #335594
2325         * expression.cs: Use conversion rules when handling string addition.
2326         
2327 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2328
2329         A fix for bug #336651
2330         * expression.cs: Fixed a crash when probing is on.
2331         
2332 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2333
2334         A fix for bug #324242
2335         * covert.cs: Added a conversion from any nullable-type with an 
2336         underlying enum-type to the type System.Enum.
2337         
2338 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2339
2340         A fix for bug #324222
2341         * class.cs: Report all non-used event fields.
2342         
2343 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2344
2345         A fix for bug #325161
2346         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2347         qualifier for generic types.
2348         
2349 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2350
2351         A fix for bug #322971
2352         * expression.cs, ecore.cs: Added intermediate result value check for
2353         indexers. 
2354         
2355 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2356
2357         A fix for bug #324754
2358         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2359         when it was requested.
2360
2361 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2362
2363         A fix for bug #325101
2364         * expression.cs: Do type not value comparison for `is' expression.
2365
2366 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2367
2368         A fix for bug #320236
2369         * convert.cs: Don't apply user conversion on underlying target type.
2370
2371 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2372
2373         * expression.cs: Don't use unresolved expression for error reporting.
2374  
2375 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2376
2377         A fix for bugs #337712, #324490
2378         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2379         overloading resolution too.
2380         
2381         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2382         the process consistent and more robust.
2383         
2384         * expression.cs, linq.cs, report.cs: Update.
2385
2386 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2387
2388         A fix for bug #332909
2389         * attribute.cs: Resolve attributes in correct context using error
2390         handling procedure.
2391         
2392         * rootcontext.cs: Define Obsolete attribute members as core members.
2393         
2394 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2395
2396         * statement.cs: Removed unused methods.
2397         
2398 2007-10-31  Wade Berrier  <wberrier@novell.com>
2399
2400         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
2401         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2402         during 'make dist')
2403
2404 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2405
2406         A fix for bug #338102
2407         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2408         methods registered as non-generics.
2409         
2410 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2411
2412         A fix for bugs #337712, #324490
2413         * delegate.cs: Delegate covariance and contravariance is not allowed for
2414         value types.
2415         
2416 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2417
2418         A fix for bug #337719 
2419         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2420         `from' keyword.
2421         
2422 2007-10-30  Marek Safar  <marek.safar@gmail.com>
2423  
2424         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2425
2426 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2427  
2428         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2429         query expressions.
2430
2431 2007-10-29  Raja R Harinath  <rharinath@novell.com>
2432
2433         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2434
2435 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2436  
2437         A fix for bug #334652
2438         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2439         extension methods when we have not found the best candidate in normal
2440         container.
2441
2442 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2443
2444         * AssemblyInfo.cs: Keep up-to-date.
2445
2446 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2447
2448         * Makefile: Fixed generics compiler name.
2449         
2450 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2451
2452         * lambda.test: removed, lambda parsing is done differently.
2453         
2454         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2455
2456 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
2457
2458         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2459
2460 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2461
2462         * Makefile, *.sources : All C# compilers are in mcs folder.
2463         
2464         * *.cs: Use existing 2_1 define for smcs.
2465
2466 2007-10-26  Marek Safar  <marek.safar@gmail.com>
2467
2468         A fix for bug #335847
2469         * assign.cs, expression.cs: Couple of changes to avoid creating a
2470         temporary variable for each object initializer assignment statement. It
2471         simplifies struct initialization too, otherwise two temporary variables
2472         would be required.
2473         Implemented optimization of redundant default element initializers.
2474         
2475 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2476
2477         A fix for bug #336766
2478         * expression.cs (Class.CheckBase): Use generic name when method is
2479         generic.
2480         
2481 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2482
2483         A fix for bug #334737
2484         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2485         variable and not variable argument for prepared copies.
2486
2487 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2488
2489         A fix for bug #325110
2490         * class.cs, expression.cs, attribute.cs: Use open generic method when
2491         checking conditional attribute.
2492         
2493 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2494
2495         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
2496         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2497         FeatureIsNotAvailable.
2498
2499 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2500
2501         ** C# 3.0 Partial methods
2502         
2503         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2504         methods support. Because of member cache issue with generics only
2505         non-generics partial methods are fully supported.
2506         
2507 2007-10-23  Marek Safar  <marek.safar@gmail.com>
2508         
2509         * class.cs, decl.cs: Rewrote member overloads check to cope with 
2510         generics and to use member cache for member checking. It also improves
2511         performance and fixes remaining overloads issues.
2512         
2513 2007-10-20  Marek Safar  <marek.safar@gmail.com>
2514         
2515         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2516         roottypes.cs, typemanager.cs:
2517                 
2518         A member cache creation logic changed to add members immediately and
2519         not rely on fallback. The member cache is now only prefered way
2520         how to access and find type declaration members. It saves 5 MB of memory
2521         during MWF compilation and makes code ready for more optimizations and
2522         clean-ups, it's also a pre-requirement for partial methods.
2523         
2524 2007-10-18  Raja R Harinath  <harinath@gmail.com>
2525
2526         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2527         handling for generic parameters.
2528
2529 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2530         
2531         * class.cs (FixedField): Removed redundant volatile check.
2532         
2533 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2534         
2535         * class.cs, decl.cs: Fixed overload members verification to do only one
2536         check per possible collision.
2537         
2538 2007-10-13  Marek Safar  <marek.safar@gmail.com>
2539         
2540         A fix for bug #325478
2541         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2542         and create only one disposable flags container.
2543         
2544 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2545         
2546         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2547         * statement.cs (Fixed): Fixed variables cloning.
2548         
2549 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2550         
2551         A fix for bug #333342
2552         * class.cs (EventField): Don't mark value type event as synchronized. 
2553         
2554 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2555         
2556         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2557         inference to identify best candidate method correctly.
2558         (ProperyExpr): A range variable is read only and cannot be modified.
2559         
2560 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2561         
2562         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2563         logic to identify best candidate method correctly.
2564         
2565 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2566         
2567         * location.cs (Equals, GetHashCode): Removed.
2568         
2569 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2570         
2571         * report.cs: Implemented message recorder. It is used mainly for lambda
2572         expressions to capture otherwise swallowed error messages.
2573         
2574         * anonymous.cs, lambda.cs.cs: Do full parameters check.
2575
2576         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2577         and not at the top.
2578         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2579                 
2580         * expression.cs (MemberAccess): Always report lookup failure.
2581         
2582         * location.cs: Implemented Equals, GetHashCode.
2583         
2584         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2585         
2586 2007-10-10  Jb Evain  <jbevain@novell.com>
2587
2588         * codegen.cs: re-enable assembly version check.
2589
2590 2007-10-09  Marek Safar  <marek.safar@gmail.com>
2591         
2592         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2593         checks.
2594         
2595         * namespace.cs (UsingAlias): Do correct version check.
2596         
2597 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2598         
2599         * expresison.cs, ecore.cs: Issue extension method error message when
2600         appropriate.
2601         
2602         * rootcontext.cs: Added ISO_2 compiler mode option.
2603
2604 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2605         
2606         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2607          message.
2608         
2609 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2610         
2611         * attribute.cs (GetString, GetBoolean): Work with both literal and
2612         constant.
2613         
2614         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2615         Moved method overload specific methods to MethodGroupExpr.
2616         
2617         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2618         it should be less memory consuming.
2619         
2620 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2621
2622         * codegen.cs: remove the assembly version check until the buildbot is
2623         fixed.
2624
2625 2007-10-07  Jb Evain  <jbevain@novell.com>
2626
2627         * attribute.cs (Attribute.GetString): if the value
2628         expression is a StringConstant, return its string value.
2629
2630 2007-10-07  Jb Evain  <jbevain@novell.com>
2631
2632         * typemanager.cs: add `assembly_version_attribute_type`.
2633         * codegen.cs: on attribute emission, check that the
2634         AssemblyVersionAttribute doesn't overflow.
2635
2636 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2637         
2638         A fix for bug #324677
2639         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2640         parent container of a scope container with currently resolved one. 
2641         
2642 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2643         
2644         A fix for bug #325534
2645         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2646         only.
2647         
2648 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2649         
2650         A fix for bug #327504
2651         * class.cs (Operator.Define): Refactored implicit and explicit user
2652         operator conversion rules.
2653         
2654 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2655         
2656         A fix for bug #327520
2657         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2658         
2659 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2660         
2661         A fix for bug #328022
2662         * class.cs (MethodData.Define): Use correct method to check whether
2663         a method implementents an accessor.
2664         
2665 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2666         
2667         A fix for bug #330069
2668         * statement.cs (Fixed.Resolve): Read the first array element only when
2669         an array is instantiated. 
2670         
2671 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2672         
2673         * expression.cs, assign.cs, generics.cs: Print correct operator when
2674         compound assignment is used.
2675         
2676 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2677         
2678         A fix for bug #325841
2679         * expression.cs (ArrayAccess): Use full argument cloning only for
2680         string compound concatenation.
2681         
2682 2007-10-03  Marek Safar  <marek.safar@gmail.com>
2683         
2684         A fix for bug #328774
2685         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2686         assignment.
2687         (PropertyExpr.EmitAssign): Fixed string concatenation compound
2688         assignment.
2689
2690 2007-10-03  Raja R Harinath  <rharinath@novell.com>
2691
2692         Fix #328490
2693         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2694         Event accessibility checks here.  Remove some bogus code that
2695         accidently made GenericMethods work.
2696         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2697
2698 2007-09-25  Marek Safar  <marek.safar@gmail.com>
2699         
2700         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2701         
2702         * statement.cs (Block): Refactored AddVariable to allow error handling
2703         customization.
2704         
2705         * generic.cs: New stub.
2706         
2707 2007-09-23  Marek Safar  <marek.safar@gmail.com>
2708         
2709         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2710         flag.
2711         
2712 2007-09-17  Marek Safar  <marek.safar@gmail.com>
2713
2714         * class.cs: Use partial container to record whether any partial part
2715         contains static field initializer and therefore default contructor has
2716         to be defined.
2717         
2718 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2719
2720         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2721         mono-list when only one of two partial parts has defined accessibility
2722         modifier.
2723         
2724 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2725
2726         A fix for bug #82845
2727         
2728         * class.cs (TypeContainer): Set correct resolve context for all field
2729         initializers.
2730         
2731 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2732
2733         * assign.cs: Fixed a crash when field is resolved twice with an error.
2734         
2735         * codegen.cs: Changed InFieldInitializer to be flag.
2736         
2737         * anonymous.cs, ecore.cs, expression.cs: Update after
2738         IsInFieldInitializer rename.
2739         
2740         * const.cs: Removed unused parameter.
2741         
2742         * class.cs: Changed the way how we resolve and emit field initializers.
2743         The field initilizers have to have access to contructor block to emit
2744         compiler generated code.
2745
2746 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2747
2748         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2749         generics use TypeContainer instead.
2750         
2751 2007-09-12  Marek Safar  <marek.safar@gmail.com>
2752         
2753         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2754
2755         * lambda.cs (ResolveParameters): Use more powerful
2756         InflateGenericArgument.
2757         
2758         * parameters.cs: Better exception message.
2759                 
2760 2007-09-10  Marek Safar  <marek.safar@gmail.com>
2761
2762         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2763         correct expression block type. 
2764         
2765         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2766         
2767         * expression.cs (Invocation): Extracted method group resolve to
2768         DoResolveOverload.
2769         
2770 2007-09-07  Marek Safar  <marek.safar@gmail.com>
2771
2772         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2773         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2774         
2775         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2776         generic extension methods.
2777
2778 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2779
2780         A fix for bug #82676 (Do I get it right now?)
2781         * convert.cs (Binary.ResolveOperator): An interface is converted to the
2782         object before a standard conversion is applied.
2783         
2784 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2785
2786         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2787         #82676.
2788         
2789 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2790
2791         A fix for bug #82676
2792         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2793         non-generic interface types.
2794         
2795 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2796
2797         A fix for bug #82690
2798         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2799         
2800 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2801
2802         A fix for bug #82571
2803         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
2804         modifier for container based methods.
2805         
2806 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2807
2808         A fix for bug #82676
2809         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2810         any interface-type T means to any of interface type T.
2811
2812 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2813
2814         * namespace.cs: We have 2 versions of System.Core assembly.
2815
2816 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2817
2818         A fix for bug #82652
2819         * class.cs (Class.GetClassBases): Compare types and not expressions.
2820
2821 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2822
2823         A fix for bug #82620
2824         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2825         actually never worked before.
2826         (IndexerAccess): Emit prepared arguments before they are modified.
2827         
2828 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2829
2830         A fix for bug #82563
2831         * assign.cs: Revert wrong fix.
2832         
2833         * expression.cs (VariableReference.EmitAssign): Handle ref reference
2834         correctly.
2835         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2836         Instead of ldelema/stdind we have to use temporary variables to handle
2837         cases like String.Concat (params string[]).
2838         
2839 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2840
2841         * class.cs: EmitAttributes to Emit rename.
2842         
2843         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2844         null.
2845         (MemberCore.HasClsCompliantAttribute): Don't depend on 
2846         GetClsCompliantAttributeValue execution.
2847         
2848 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2849
2850         * anonymous.cs: Use shorter type prefix.
2851         
2852         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2853         when exist.
2854         
2855         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2856         variables when probing is on.
2857         
2858         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
2859         unresolved variables.
2860         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2861         handle transparent identifiers.
2862         
2863 2007-08-26  Marek Safar  <marek.safar@gmail.com>
2864
2865         * attribute.cs (IsClsCompliant): Add nullable types test.
2866         
2867 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2868
2869         * doc.cs : catch other types of exception than XmlException to
2870           report CS1570. Fixed bug #82565.
2871
2872 2007-08-23  Marek Safar  <marek.safar@gmail.com>
2873
2874         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
2875         The number of delegate parameters has to match.
2876         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2877         arrays.
2878
2879 2007-08-21  Marek Safar  <marek.safar@gmail.com>
2880
2881         * anonymous.cs (AnonymousMethod): Generate private anonymous method
2882         to fix problem with private arguments.
2883
2884 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2885
2886         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2887         
2888         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
2889         
2890         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2891         empty. Add cloning suport.
2892         
2893         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2894
2895 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2896
2897         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
2898         to create EmptyCast. It handles EmptyConstantCast specialization for
2899         constants.
2900         
2901 2007-08-18  Marek Safar  <marek.safar@gmail.com>
2902
2903         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2904         (EmitArrayArgument): One routine for array arguments.
2905         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
2906         
2907 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2908
2909         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2910
2911 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2912
2913         * anonymous.cs: MemberLookupFinal update.
2914
2915         * class.cs (ConstructorInitializer): Is expression based.
2916         
2917         * delegate.cs: MethodGroupExpr update.
2918         
2919         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
2920         messages.
2921         (Error_MemberLookupFailed): Customizable error override.
2922         (MethodGroupExpr): Keep queried type for later usage.
2923         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2924         resolve.
2925         
2926         * expression.cs: Error_MemberLookupFailed refactoring.
2927         (New.DoResolve): Resolve as much as possible.
2928         (ElementInitializer.Error_MemberLookupFailed): Object initializer
2929         customization for invalid member types.
2930
2931         * statement.cs: MethodGroupExpr update.
2932         
2933 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2934
2935         * modifier.cs (Check): Check all modifiers and not only accessibility
2936         ones.
2937
2938 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2939
2940         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2941         type and not an expression.
2942
2943 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2944
2945         * statement.cs (Catch.Clone): Type and variable can be null.
2946
2947 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2948
2949         A fix for bug #81979
2950         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2951         I am really not sure whether this is the best fix.
2952         
2953         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2954         only once.
2955         
2956 2007-08-14  Marek Safar  <marek.safar@gmail.com>
2957
2958         ** C# 3.0 Object and collection initializers (major re-write)
2959         
2960         * assign.cs (DoResolve): Initializers are not assign related.
2961         
2962         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2963         used during collection or object initialization.
2964         
2965         * expression.cs (Error_InvalidArguments): Add initializers specific
2966         messages. More will come later because it requires some general
2967         refactoring.
2968         (New.DoResolve): Better error handling for unsafe types.
2969         (EmptyExpressionStatement): New class.
2970         (ElementInitializer): An object initializer expression.
2971         (CollectionElementInitializer): A collection initializer expression.
2972         (CollectionOrObjectInitializers): A block of object or collection
2973         initializers.
2974         (NewInitialize): New expression with element/object initializers.
2975         
2976         * statement.cs: Reverted object/collection initializer hacks.
2977         
2978         * typemanager.cs (CSharpName): Filter __arglist type.
2979         
2980 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2981
2982         ** C# 3.0 Anonymous Types (update to the latest standard)
2983         
2984         * expression.cs (Binary.ResolveOperator): Threat all null based types
2985         same.
2986         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2987         (AnonymousTypeParameter): Updated.
2988         
2989         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2990         (AnonymousTypeClass): New anonymous type container.
2991         
2992         * class.cs (AddField): Return operation result.
2993         
2994         * generic.cs: Another empty TypeArguments overload.
2995         
2996         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2997         are stored at top of normal hierarchy.
2998         
2999         * typemanager.cs (CSharpName): Filter anonymous types.
3000         
3001 2007-08-09  Marek Safar  <marek.safar@gmail.com>
3002
3003         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
3004         as single Concat call. How could we miss that :-(
3005         
3006 2007-08-08  Marek Safar  <marek.safar@gmail.com>
3007
3008         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
3009         
3010 2007-08-07  Miguel de Icaza  <miguel@novell.com>
3011
3012         * expression.cs: Fix the previous commit, the creation of the
3013         arguments array list needs also to be conditional on the arguments
3014         not being null.
3015
3016         * class.cs: Add a little bit of help to help narrow down problems.
3017
3018         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
3019         not try to copy in that case. 
3020
3021         * driver.cs: When building SMCS, include a new different set of
3022         default assemblies here.   Do this here so we can control whether
3023         to include the default assemblies with /noconfig.
3024
3025 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3026
3027         A fix for bug #81979
3028         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
3029         only.
3030
3031 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3032
3033         A fix for bug #82300
3034
3035         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
3036         we are in probing scope.
3037
3038 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3039
3040         A fix for bug #82301
3041
3042         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
3043         (Statement.CloneTo): Clone and not map children blocks.
3044
3045 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3046
3047         A fix for bug #82299
3048
3049         * expression.cs (LocalVariableReference.CloneTo): Remap local info
3050         variable too.
3051         
3052         * statement.cs (Statement.CloneTo): Clone variables before statements
3053         to allow remaping of local variables.
3054
3055 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3056
3057         A fix for bug #82296
3058
3059         * anonymous.cs,
3060         * report.cs: Log crash details for future clone problems.
3061         
3062         * statement.cs (Return.Clone): Don't clone non-existent expression.
3063
3064 2007-08-03  Raja R Harinath  <harinath@gmail.com>
3065
3066         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
3067         (Class.AddBasesForPart): Move CS0537 check here from ...
3068         * cs-parser.jay (class_declaration): ... here.  Move calling of
3069         'AddBasesForPart' to ...
3070         (class_bases): ... here.
3071         (struct_declaration, interface_declaration): Update to changes.
3072
3073 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3074
3075         A fix for bug #81923
3076
3077         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
3078         conversion is allowed.
3079
3080 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3081
3082         A fix for bug #81564
3083
3084         * ecore.cs (EventExpr): Add IsBase handling.
3085
3086         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
3087         too.    
3088         
3089 2007-08-02  Raja R Harinath  <harinath@gmail.com>
3090
3091         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
3092         * cs-parser.jay: Some whitespace cleanups.
3093         (current_delegate): New.
3094         (type_name): New.
3095         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
3096         a dummy code block, and use 'type_name' instead of 'member_name'.
3097         (interface_declaration, class_declaration): Likewise.
3098         (delegate_declaration): Likewise.  Rearrange slightly and use
3099         'current_delegate'.
3100         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
3101         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
3102
3103 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3104
3105         A fix for bug #82039
3106
3107         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
3108         available.
3109
3110         * typemanager.cs (CSharpName): Split to string overload.
3111
3112 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3113
3114         * expression.cs,
3115         * report.cs: Updated warning CS0472.
3116
3117 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3118
3119         A fix for bug #82181
3120         * cs-parser.jay,
3121         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
3122
3123 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3124
3125         A fix for bug #82277
3126         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
3127
3128 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3129
3130         ** C# 3.0 Type Inference (major bits are working)
3131         
3132         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
3133         (.ImplicitStandardConversionExists): Uses compatible.
3134         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
3135         (.InferReturnType): New method.
3136         (.Compatible): Refactored.
3137         (.ResolveParameters): Uses factory to create resolved parameters.
3138         (.CompatibleMethod): Add probing mode support.
3139         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
3140         clearly distinguish between 2 different operations.
3141         (LambdaMethod): Moved to lambda.cs.
3142         (AnonymousMethod): Removed unused fields and methods.
3143         (AnonymousDelegate): Simplified.
3144         
3145         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
3146         
3147         * convert. cs (ImplicitConversionStandard): Compatible works differently.
3148         
3149         * delegate.cs (Delegate): New mehods to reduce code duplication.
3150         (.GetConstructor): New method.
3151         (.GetInvokeMethod): New method.
3152         (DelegateCreation): Updated.
3153         
3154         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
3155         does not exist.
3156         (OverloadResolve): Made probing little bit faster.
3157         
3158         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
3159         when probing is on.
3160         
3161         * generic.cs (TypeInferenceContext): Dummy implementation.
3162         
3163         * iterators.cs: Updated after Resolve/Define rename.
3164         
3165         * lambda.cs (LambdaExpression)
3166         (.ResolveParameters): Handles both type of arguments and type inference too.
3167         
3168         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
3169         (InflateTypes): Updated.
3170         
3171         * support.cs (InflateTypes): Changed signature and updated.
3172         
3173         * typemanager.cs (LookupMemberCache): Better dynamic type check.
3174         (MemberLookup_FindMembers): More MS tricks.
3175         (GetParameterData): Ditto.
3176         (GetDelegateParameters): Uses quick path for dynamic types.
3177         
3178 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3179
3180         * class.cs (MethodData.Define): EmitContext is required for generic stuff
3181         only.
3182
3183 2007-07-31  Marek Safar  <marek.safar@gmail.com>
3184
3185         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
3186         syntax.
3187         
3188 2007-07-26  Jb Evain  <jbevain@novell.com>
3189
3190         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
3191         which takes a boolean 'report_errors', similar to the GetMethod.
3192         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
3193         in .net 2.1, do not report errors here.
3194
3195         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
3196         System.Runtime.CompilerServices.RequiredAttributeAttribute and
3197         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
3198         in .net 2.1.
3199
3200         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
3201         of the type InternalsVisibleToAttribute before the first call
3202         to CoreLookupType which is allowed to fail (third boolean parameter
3203         to true). Because, during the resolution for a type that is not
3204         immediately found, we try to check if the type is not defined in
3205         a friend assembly, and to do so, we need the
3206         InternalVisibleToAttribute.
3207
3208 2007-07-23  Miguel de Icaza  <miguel@novell.com>
3209
3210         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
3211         feature that allows structs to be compared against null and inline
3212         the result as true or false.
3213
3214         Notice that the same code is not permitted inside a generic block
3215         of code that would do:
3216
3217         class Foo<T> where T : struct {
3218             bool Eval (T x)
3219             {
3220                  return x == null;
3221             }
3222         }
3223
3224         It is only allowed if the type of T is not bound (no where
3225         clause).   In my opinion, this CSC 2 behavior is broken but people
3226         seem to be using it (IronRuby does, a few bug reports on bugzilla
3227         have it and some people have complained about it).
3228
3229         All of the users that depend on this behavior have code that is
3230         very likely broken. 
3231         
3232         * report.cs (Warning, Error): make these take object arguments,
3233         not strings, as that allows us to take advantage of Format.
3234
3235 2007-07-20  William Holmes  <billholmes54@gmail.com>
3236
3237         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
3238           Left member variable for the Count.
3239         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
3240           MemberName.CountTypeArguments to avoid a NRE. 
3241
3242         This code is contributed under the MIT X11 license
3243
3244 2007-07-18  Marek Safar  <marek.safar@gmail.com>
3245
3246         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
3247
3248 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
3249
3250         * doc.cs : generic method arguments are written as ``x while generic
3251           type arguments are `x. Combined with the previous change, fixed bug
3252           #79706.
3253
3254 2007-07-18  Raja R Harinath  <rharinath@novell.com>
3255
3256         Fix #82120
3257         * expression.cs (Binary.ResolveOperator): When converting
3258         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
3259
3260 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
3261
3262         * doc.cs : when T: or whatever x: is specified, it does not really
3263           check the doc comment's syntax correctness. Fixed bug #82006.
3264
3265 2007-07-18  Marek Safar  <marek.safar@gmail.com>
3266
3267         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
3268         LambdaExpression better.
3269         
3270         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
3271         
3272         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
3273         
3274         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
3275         as it can be generated.
3276         
3277         * expression.cs (Invocation.Error_InvalidArguments): Show correct
3278         modifiers.
3279         
3280         * lambda.cs (LambdaExpression): Refactored to share same code with
3281         AnonymousMethodExpression.
3282         
3283 2007-07-17  Marek Safar  <marek.safar@gmail.com>
3284
3285         * anonymous.cs (MakeName): Include host name for easier debugging.
3286         (LambdaMethod): New class for lambda spcecific stuff.
3287         
3288         * attribute.cs: Set EmitContext return type.
3289
3290         * class.cs: Set EmitContext return type.
3291         
3292         * codegen.cs (EmitContext): Return type cannot be null to stop messing
3293         with null/void meaning.
3294         
3295         * iterators.cs (ContainerType): Implemented.
3296         
3297         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
3298         
3299         * statement.cs (Return): Updated to lambda expressions.
3300         (Block.CloneTo): Parent can be null.
3301                 
3302 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3303
3304         A fix for bug #81917
3305         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
3306         
3307         * class.cs (FixedField): Check whether field is in unsafe scope.
3308
3309         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
3310         (FieldExpr.Emit): Fixed buffers cannot be volatile.
3311
3312         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
3313         FieldExpr.
3314         
3315         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
3316                 
3317 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3318
3319         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
3320         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
3321         from Report class.
3322
3323 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3324
3325         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
3326         
3327 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3328
3329         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3330         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3331         
3332         * codegen.cs(EmitContext): Add ProbingMode flag.
3333         
3334         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3335         
3336         * driver.cs: For now set both warning values.
3337         
3338         * ecore.cs (SimpleName): Name is readonly.
3339         (MethodGroup.OverloadResolve): One quick path for probing.
3340         
3341         * expression.cs (Unary): Set Oper r/o.
3342         (Binary): Set Oper r/o.
3343         (ParameterReference): Set few instance variables as r/o.
3344         (ParameterReference.DoResolveBase): Don't capture aruments when 
3345         the probing is on.
3346         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3347         (Arglist): arguments are private.
3348         (SizeOf): type is private and r/o.
3349         (MemberAccess): arguments are private.
3350
3351         * report.cs: Enhanced reporting on/off capabilities.
3352         
3353         * lambda.cs: Uses ec.IsInProbingMode.
3354         (ContextualReturn): Derives from return.
3355         
3356         * rootcontext.cs: For now set both warning values.
3357         
3358         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3359         copy if one exists.
3360         (Return.Resolve): Don't die immediately.
3361         (Block.Resolve): Speed-up probing.
3362         (Block.CloneTo): Clone only child blocks.
3363
3364 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3365
3366         * iterators.cs: reverted Miguel's latest change (r81925) as it
3367         breaks the build in System.
3368
3369 2007-07-13  Miguel de Icaza  <miguel@novell.com>
3370
3371         * iterators.cs (Yield.CheckContext): Check for the iterator type
3372         also here as we can call into Yield even in codepaths that are not
3373         directly checked by
3374         (MethodOrOperator is the only path that was checked).
3375
3376         In addition to the standard check, use a more specific check for
3377         constructors to report a more verbose error. 
3378
3379 2007-07-12  Miguel de Icaza  <miguel@novell.com>
3380
3381         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3382         report the warning and continue 
3383
3384         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3385         values on the stack on the call to Emit.   Use EmitStatement if
3386         possible, or using Emit + Pop if not possible.   Fixes #82064
3387
3388 2007-07-12  Raja R Harinath  <rharinath@novell.com>
3389
3390         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3391         avoid try...finally in some cases.
3392
3393 2007-07-10  Marek Safar  <marek.safar@gmail.com>
3394
3395         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3396         
3397         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3398         instead of method. Re-use standard error handling.
3399         (ConstructorInitializer.Emit): Simplified.
3400         
3401         * delegate.cs: Updated after Invocation.EmitCall change.
3402         
3403         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3404         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3405         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3406         method and don't permanently changing input arguments.
3407         (MethodGroupExpr): Introduced resolved best_candidate, when method group
3408         is resolved it has one of the candidates is the best one which is later
3409         used to emit. Removed a few unused method.
3410         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3411
3412         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3413         (Binary.ResolveOperator): Ditto.
3414         (ConditionalLogicalOperator.DoResolve): Ditto.
3415         (Invocation): Uses method group.
3416         (Invocation.DoResolve): Simplified.
3417         (Invocation.EmitCall): Removed useless is_static.
3418         (Invocation.Emit): Delegate to method group.
3419         (Invocation.EmitStatement): Simplified.
3420         (New): Uses method group.
3421         (MemberAccess.DoResolve): Don't destroy original expression.
3422         
3423         * statement.cs (ForEach.Resolve): Use null for no method arguments.
3424         
3425 2007-07-04  Marek Safar  <marek.safar@gmail.com>
3426
3427         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3428         
3429         * anonymous.cs,
3430         * lambda.cs: Add custom error message type.
3431
3432 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3433
3434         * lambda.cs: Simplified little bit.
3435         
3436         * parameter.cs: Introduced ImplicitLambdaParameter.
3437         (Parameters.CreateFullyResolved): New factory instead of ctor.
3438         
3439         * anonymous.cs,
3440         * class.cs,
3441         * delegate.cs: Updated parameter creation.
3442         
3443 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3444
3445         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3446         arguments.
3447         
3448         * generic.cs: Synchronized with gmcs.
3449         
3450 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3451
3452         * class.cs (Indexer): Check return type as soon as possible.
3453         
3454         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3455         members too.
3456         
3457         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3458         
3459         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3460         
3461         * parameter.cs (Parameter): Use expression type when it is available.
3462         
3463         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3464         method modifier for the first parameter only.
3465
3466 2007-06-24  Marek Safar  <marek.safar@gmail.com>
3467
3468         A fix for bug #81938
3469         * typemanager.cs (ChangeType): Fixed couple of char conversions.
3470         
3471         * constant.cs: Tide up an exception message.
3472
3473 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3474
3475         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3476         an uninitialized variable is used.
3477         
3478         * expression.cs (LocalVariableReference.DoResolve): Ditto.
3479
3480 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3481
3482         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3483         not found error handling.
3484
3485         * expression.cs (ArrayCreation): Removed redundant fields and little bit
3486         simplified.
3487         (ArrayCreation.ResolveArrayElement): To be ready to customization.
3488         (ArrayCreation.DoResolve): Simplified.
3489         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3490         its own resolve process.
3491         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3492
3493 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3494
3495         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3496         more error details.
3497         
3498 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3499
3500         * cs-tokenizer.cs: Removed var related stuff.
3501         
3502         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3503         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3504         a type and a keyword at same time.
3505         
3506         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3507         matches to "var".
3508         
3509         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3510         implicitly typed arrays, more changes will follow.
3511         
3512         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3513         
3514 2007-06-19  Marek Safar  <marek.safar@gmail.com>
3515
3516         * ecore.cs (VarExpr): Removed Handled field.
3517         
3518         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3519         build-in assign functionality.
3520         (ForEach.Resolve): Removed all implicitly typed local variable code and
3521         simplified.
3522         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3523         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3524
3525 2007-06-18  Marek Safar  <marek.safar@gmail.com>
3526
3527         * assign.cs: Removed implicitly typed local variable check.
3528         
3529         * expression.cs (LocalVariableReference.DoResolve): Add check for self
3530         referencing implicitly typed local variable.
3531         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3532         variable here.
3533         
3534         * statement.cs (Fixed): Removed unsupported implicitly typed local
3535         variable code.
3536
3537 2007-06-15  Marek Safar  <marek.safar@gmail.com>
3538
3539         * decl.cs (MemberName): Moved all Unbound stuff to parser.
3540
3541 2007-06-14  Marek Safar  <marek.safar@gmail.com>
3542
3543         A fix for bugs #81855 and #76274
3544         * attribute.cs (AttachTo): Always set owner for global attributes to
3545         prefined owner.
3546         
3547         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3548         usefull too.
3549         
3550         * cs-parser.jay: Assembly and module attributes must precede all other
3551         elements except using clauses and extern alias declarations.
3552
3553 2007-06-13  Marek Safar  <marek.safar@gmail.com>
3554
3555         A fix for bug #81748
3556         * cs-tokenizer.cs,
3557         * expression.cs: More checks for non ISO-1 features.
3558
3559 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3560
3561         A fix for bug #81807
3562         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3563         present inside switch statement and it is required by nullable check.
3564
3565 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3566
3567         A fix for bug #81840
3568         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3569         when type matching fails.
3570         
3571         * namespace.cs: Tiny error message change.
3572
3573 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3574
3575         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3576         reporting. Added automatic property check.
3577         
3578         * class.cs: Updated after CheckAbstractAndExtern relocation.
3579         (AEventPropertyAccessor.GetSignatureForError): Customized.
3580         
3581 2007-06-11  Marek Safar  <marek.safar@gmail.com>
3582
3583         * class.cs (DefineBaseTypes): Base type can be undefined.
3584         
3585         * ecore.cs (TypeLookup): Minor refactoring.
3586         (DoResolveAsTypeStep): Removed redundant check.
3587
3588         * namespace.cs (Lookup): Removed redundant check.
3589                 
3590         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
3591         ResolveAsTypeTerminal step.
3592         (BootstrapCorlib_*): Simplified.
3593         (PopulateCoreType): Core types can be now external.
3594
3595 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3596
3597         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3598          verification only.
3599          (InferTypeArguments): Infers anonymous expression type arguments.
3600          (Compatible): Split to Compatible and InferTypeArguments. 
3601         
3602         * lambda.cs: Updated.
3603
3604 2007-06-08  Marek Safar  <marek.safar@gmail.com>
3605
3606         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3607
3608 2007-06-07  Raja R Harinath  <harinath@gmail.com>
3609
3610         Fix #80477, cs0135-2.cs, cs0135-3.cs
3611         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3612         names to the "known" variables list.
3613         (Block.CheckInvariantMeaningInBlock): Handle the fact the
3614         parameter names are also "known".
3615         (Block.CheckError136): Remove.
3616         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
3617         null.
3618
3619 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3620
3621         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3622
3623 2007-06-06  Marek Safar  <marek.safar@gmail.com>
3624
3625         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3626         internal error not an user error.
3627          
3628         * expression.cs (IsApplicable): Refactored to make debugging easier.
3629
3630         * support.cs: More tricks for non-mono runtimes.
3631         
3632         * typemanager.cs (CoreLookupType): Made public.
3633         (InitSystemCore): All linq specific stuff moved to linq.cs
3634
3635 2007-06-05  Marek Safar  <marek.safar@gmail.com>
3636
3637         * typemanager.cs (CSharpSignature): One more missing build-in types
3638         replacement.
3639         More tricks for non-mono runtime.
3640
3641 2007-06-05  Raja R Harinath  <harinath@gmail.com>
3642
3643         * statement.cs (Block.CheckError136_InParents): Remove.
3644         (Block.AddVariable): Use GetParameterInfo instead.
3645         (ToplevelBlock.ProcessArguments): Likewise.
3646
3647 2007-06-04  Raja R Harinath  <rharinath@novell.com>
3648
3649         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
3650         information too.
3651         (ToplevelBlock.GetParameterInfo): Split out of ...
3652         (ToplevelBlock.GetParameterRefernce): ... this.
3653         (ToplevelBlock.ParameterMap): Remove.
3654         * expression.cs (ParameterReference): Update to use
3655         ToplevelParameterInfo.
3656
3657         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3658         regression.
3659
3660         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3661         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3662
3663         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3664         (ToplevelBlock.ProcessParameters) ... here.
3665         (ToplevelBlock..ctor): Invoke it.
3666
3667         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3668         new parameters.
3669
3670         * statement.cs (IKnownVariable): New interface.
3671         (LocalInfo): Implement it.
3672         (ToplevelParameterInfo): New class.
3673         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3674         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
3675         GetKnownVariableInfo.
3676
3677 2007-06-03  Raja R Harinath  <harinath@gmail.com>
3678
3679         Partly speed up CS0136 error checks.
3680         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3681         'recurse' parameter.
3682         (Block.DoCheckError136): Only check errors in parameters.  Move
3683         local variable checks ...
3684         (Block.AddVariable): ... here, and ...
3685         (ToplevelBlock.ResolveMeta): ... here.
3686
3687 2007-06-02  Raja R Harinath  <harinath@gmail.com>
3688
3689         * statement.cs (Block.IsChildOf): Remove.
3690
3691         * statement.cs (Statement.Clone): Move special case code ...
3692         (Block.CloneTo): ... here.
3693
3694 2007-05-29  Raja R Harinath  <rharinath@novell.com>
3695
3696         * statement.cs (ToplevelBlock.container): Remove field.  It's
3697         redundant with 'Parent'.
3698         (ToplevelBlock.ContainerBlock): Remove accessor.
3699         (ToplevelBlock..ctor): Update to changes.  Register anonymous
3700         child with parent here, ...
3701         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
3702         current_block.
3703         (start_anonymous): Don't save current_block.
3704         (top_current_block): Remove.
3705
3706         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3707         (Block.Resolve): Update to changes.
3708         (Block..ctor): Move setting of "correct" 'Toplevel'
3709         and 'Explicit' fields to ...
3710         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3711
3712 2007-05-27  Raja R Harinath  <harinath@gmail.com>
3713
3714         Kill Block.Implicit
3715         * statement.cs (Block.Implicit): Remove.
3716         (Block): Update to changes.
3717         * flowanalysis.cs: Likewise.
3718
3719         Mildly speed up CheckInvariantMeaningInBlock
3720         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3721         Recursively call AddKnownVariable to all enclosing blocks.
3722         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3723         Remove recursive calls.
3724         (Block): Update to changes.
3725
3726         New ExplicitBlock invariants
3727         * statement.cs (Block.Explicit): New field.  It points to the
3728         immediately enclosing non-implicit block.
3729         (Block..ctor): Maintain the invariant.
3730         * cs-parser.jay: Take advantage of invariant.
3731
3732         Introduce ExplicitBlock
3733         * statement.cs (ExplicitBlock): New.
3734         (ToplevelBlock): Derive from it.
3735         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3736         sense of flag.
3737         (Block.Implicit): Update to changes.
3738         * cs-parser.jay: Update to changes.
3739
3740         Remove unused field
3741         * codegen.cs (EmitContext.IsLastStatement): Remove.
3742         * statement.cs (Block.DoEmit): Update to changes.
3743
3744 2007-05-25  Raja R Harinath  <rharinath@novell.com>
3745
3746         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3747         modifying current_block directly.
3748
3749 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
3750         
3751         * class.cs: Implemented automatic properties (C# 3.0)
3752           Thanks to Marek for the help.
3753
3754 2007-05-23  Raja R Harinath  <rharinath@novell.com>
3755
3756         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3757         variable as assigned, note also that all its components are
3758         assigned too.
3759         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
3760
3761 2007-05-19  Marek Safar  <marek.safar@gmail.com>
3762
3763         * anonymous.cs, class.cs: Emit Compiler generated attribute when
3764         member is marked as compiler generated.
3765         
3766         * decl.cs (MemberCore): Refactored ModFlags into property.
3767
3768         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3769         (Check): Check only accessibility modifiers.
3770
3771 2007-05-18  Raja R Harinath  <rharinath@novell.com>
3772
3773         Track all assignable slots in one bit array
3774         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3775         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
3776         logic from VariableMap constructor here.  Use the same 'offset'
3777         variable that's later used for computing offsets of local
3778         variables.
3779         * flowanalysis.cs (UsageVector.parameters): Remove.
3780         (UsageVector): Update to changes.
3781         (VariableMap): Remove.
3782
3783         Avoid creating ParameterMap in every block
3784         * statement.cs (Block.ParameterMap): Move ...
3785         (ToplevelBlock.ParameterMap): ... here.
3786         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3787         only once.
3788         * flowanalysis.cs (FlowBranching.param_map): Remove.
3789         (FlowBranching.UsageVector): Update to changes.
3790         (FlowBranchingToplevel.CheckOutParameters): Likewise.
3791
3792         * statement.cs (Block.CloneTo): Clone Toplevel field too.
3793
3794         * expression.cs (ParameterReference): Distinguish between block
3795         where parameter was referenced and declared.
3796
3797 2007-05-18  Marek Safar  <marek.safar@gmail.com>
3798
3799         * flowanalysis.cs, statement.cs: Put back improved error handling.
3800
3801 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
3802         
3803         * assign.cs:
3804         * expression.cs:
3805           Imporved object and collection initialization (C# 3.0).
3806
3807 2007-05-15  Marek Safar  <marek.safar@gmail.com>
3808
3809         A fix for bug #81380
3810         * expression.cs (Is.DoResolve): Only value types have constant `is'
3811         behaviour.
3812
3813 2007-05-15  Raja R Harinath  <rharinath@novell.com>
3814
3815         * statement.cs (ToplevelBlock.child): Remove.
3816
3817 2007-05-15  Raja R Harinath  <harinath@gmail.com>
3818
3819         Rationalize ResolveMeta: refactoring
3820         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
3821         out constant handling code into ...
3822         (Block.DoResolveConstants): ... this.
3823
3824         Rationalize ResolveMeta: kill local_map
3825         * statement.cs (Block.local_map, Block.LocalMap): Remove.
3826         (Block.AssignableSlots): New.
3827         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
3828         for locals -- move code from VariableMap here.  Avoid unnecessary
3829         allocations.
3830         * flowanalysis.cs (FlowBranching.local_map): Remove.
3831         (FlowBranching..ctor): Use Block.AssignableSlots.
3832         (VariableMap): Remove unused constructors.
3833
3834 2007-05-11  Raja R Harinath  <rharinath@novell.com>
3835
3836         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3837
3838 2007-05-11  Marek Safar  <marek.safar@gmail.com>
3839
3840         * typemanager.cs (IsFriendAssembly): Should not be called for building
3841         assembly.
3842
3843 2007-05-09  Marek Safar  <marek.safar@gmail.com>
3844
3845         * literal.cs (NullConstant): Print null in all cases.
3846         
3847         * expression.cs (Binary.ResolveOperator): Implemented delegate
3848          comparison based on C# 2.0 changes.
3849
3850 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
3851
3852         This code is contributed under the MIT X11 license
3853         
3854         The following enables support for several C# 3.0 language features:
3855         
3856         * cs-tokenizer.cs: Added support for the "var" keyword.
3857         
3858         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3859           Added VarExpr class to facilitate type inferencing.
3860         
3861         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3862           to support anonymous types.
3863         
3864         * assign.cs: Added support for type inferencing and initialization.
3865         
3866         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3867         
3868         * expression.cs: Added implicit array support to ArrayCreation.
3869           Added 5 types and 1 interface:
3870           
3871           IInitializable                Implementing classes can inject initializing
3872                                         statements after object instantiation.
3873           
3874           Initializer                   Stores data for object initialization.
3875           
3876           AnonymousType                 An expression for anonymous types.
3877           
3878           AnonymousTypeParameter        Stores data about an anonymous type's field.
3879           
3880           NewInitialize                 An expression for object initialization.
3881           
3882           CollectionInitialize          An expression for collection initialization.
3883         
3884         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3885           statements.
3886
3887 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3888
3889         A fix for bug #81500
3890         * cs-tokenizer.cs: Add special handling for coalescing operator.
3891
3892 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3893
3894         A fix for bug #81529
3895         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3896         its value from base class until it is redefined.
3897
3898 2007-05-02  Raja R Harinath  <rharinath@novell.com>
3899
3900         Fix regression in cs0631-3.cs
3901         * cs-parser.jay (operator_declarator): Add opt_attributes to error
3902         fallback.  Make error fallback catch more cases.
3903
3904 2007-05-01  Miguel de Icaza  <miguel@novell.com>
3905
3906         * cs-parser.jay: Allow parameters in operator declarations to have
3907         attributes. 
3908
3909 2007-04-27  Miguel de Icaza  <miguel@novell.com>
3910
3911         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3912         exists. 
3913
3914         * lambda.cs (ContextualReturn.Resolve): An expression is valid
3915         inside the ContextualReturn, it does not have to be an
3916         ExpressionStatement. 
3917
3918 2007-04-24  Miguel de Icaza  <miguel@novell.com>
3919
3920         * lambda.cs (ContextualReturn.Resolve): if the return type is not
3921         set, set it.
3922
3923 2007-04-23  Miguel de Icaza  <miguel@novell.com>
3924
3925         * anonymous.cs (AnonymousContainer): split the virtual Resolve
3926         method in two methods: ResolveNoDefine and Resolve.
3927
3928         ResolveNoDefine will stop just after ResolveTopBlock has been
3929         called.   
3930
3931         Resolve will then continue by creating a method and issuing the
3932         call to method.Define ().
3933
3934         (AnonymousMethod): Split and implement the new Resolve and
3935         ResolveNoDefine as well.
3936
3937         * lambda.cs (LambdaExpression): Split the anonymous method
3938         resolution code into a separate routine (CoreCompatibilityTest)
3939         from DoCompatibleTest.
3940
3941         (LambdaExpression.TryBuild): New method, this method tries to
3942         build the LambdaExpression with the given set of types to be used
3943         as the types for the various parameters of the lambda expression. 
3944
3945         If the compilation succeed with the given types, the infered type
3946         of the Anonymous method is returned, otherwise null is returned.
3947
3948 2007-04-23  Marek Safar  <marek.safar@gmail.com>
3949
3950         A fix for bug #81414
3951         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3952
3953 2007-04-22  Miguel de Icaza  <miguel@novell.com>
3954
3955         * cs-tokenizer.cs: Change various identifiers here from the
3956         camelCasing to the recommended Linux-like style for instance
3957         variables from the Coding Guidelines. 
3958
3959 2007-04-19  Martin Baulig  <martin@ximian.com>
3960
3961         * convert.cs
3962         (Convert.ImplicitReferenceConversionCore): Allow conversions from
3963         System.Enum to System.ValueType.
3964
3965 2007-04-13  Martin Baulig  <martin@ximian.com>
3966
3967         Rewrote implicit reference conversions.  We need to distinguish
3968         between implicit reference conversions (13.1.4) and implicit
3969         boxing conversions (13.1.5).
3970
3971         According to the spec, there's an an implicit conversion
3972         "From a one-dimensional array-type S[] to IList<T> and base
3973         interfaces of this interface, provided there is an implicit
3974         reference conversion from S to T."  Note that this does not
3975         include boxing conversions.
3976
3977         * convert.cs
3978         (Convert.ImplicitTypeParameterBoxingConversion): New method.
3979         (Convert.ImplicitReferenceConversion): Split into
3980         ImplicitReferenceConversionCore() and
3981         ImplicitBoxingConversionExist().
3982         (Convert.ImplicitReferenceConversionExists): Use the new
3983         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3984
3985 2007-04-12  Martin Baulig  <martin@ximian.com>
3986
3987         * convert.cs (Convert.ImplicitReferenceConversion): Move the
3988         `TypeManager.null_type' checks up to the top of the method.
3989
3990 2007-04-11  Marek Safar  <marek.safar@gmail.com>
3991
3992         A fix for bug #81350
3993         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3994         extension methods.
3995
3996 2007-04-11  Martin Baulig  <martin@ximian.com>
3997
3998         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3999         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
4000         to make this work for generic classes; fixes #79561.
4001
4002 2007-04-11  Martin Baulig  <martin@ximian.com>
4003
4004         * expression.cs (As): Add support for nullable types; fixes #79371.
4005
4006 2007-04-11  Martin Baulig  <martin@ximian.com>
4007
4008         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
4009         `type.FullName' is null; fixes #80243.
4010
4011 2007-04-11  Martin Baulig  <martin@ximian.com>
4012
4013         * expression.cs (Invocation.IsApplicable): Don't modify the method
4014         if type inference succeeded, but the method was not applicable.
4015         Fixes #81250.
4016
4017 2007-04-10  Marek Safar  <marek.safar@gmail.com>
4018
4019         A fix for bug #81324
4020         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
4021         internal and external namespaces containers.
4022
4023 2007-04-10  Martin Baulig  <martin@ximian.com>
4024
4025         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
4026         TypeManager.DropGenericMethodArguments() so we also call
4027         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
4028
4029 2007-04-10  Martin Baulig  <martin@ximian.com>
4030
4031         * iterators.cs (Iterator.CreateIterator): Don't crash if
4032         `method.ReturnType' is null.  This happens if something went wrong
4033         while resolving that typ (we already reported an error in this case).
4034
4035 2007-04-10  Martin Baulig  <martin@ximian.com>
4036
4037         * expression.cs (New.DoResolve): Don't call CheckComImport() on
4038         generic interfaces; report the CS0144 directly.
4039
4040 2007-04-10  Martin Baulig  <martin@ximian.com>
4041
4042         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
4043         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
4044
4045 2007-04-10  Martin Baulig  <martin@ximian.com>
4046
4047         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
4048
4049 2007-04-09  Raja R Harinath  <rharinath@novell.com>
4050
4051         A better fix
4052         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
4053         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
4054
4055         Fix #81338
4056         * statement.cs (For.Resolve): If resolution fails, use
4057         KillFlowBranching.
4058
4059 2007-04-08  Marek Safar  <marek.safar@gmail.com>
4060
4061         * anonymous.cs (MakeName): Make faster and zero-based.
4062         (VerifyExplicitParameterCompatibility): Back to mode where generic
4063         parameter is ignored.
4064         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
4065
4066         * class.cs (EmitType): Method can emit another new method.
4067
4068         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
4069
4070         * driver.cs: Updated.
4071
4072         * lambda.cs: Reuse predefined empty parameters.
4073
4074         * parameter.cs: Updated
4075
4076         * support.cs: Implemented InflateTypes.
4077
4078         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
4079         (InitSystemCore): Introduced to isolate 3.0 dependencies.
4080
4081 2007-04-03  Martin Baulig  <martin@ximian.com>
4082
4083         Fix #80632.
4084
4085         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
4086         version of TypeManager.IsOverride() which also works with generic
4087         types.  
4088
4089 2007-04-03  Martin Baulig  <martin@ximian.com>
4090
4091         Fix #81044.
4092
4093         * convert.cs
4094         (Convert.ExplicitReferenceConversion): We need to cast when
4095         converting from IList<T> to S[].
4096
4097 2007-04-01  Marek Safar  <marek.safar@gmail.com>
4098
4099         * decl.cs (FindExtensionMethods): Consider all candidates with same name
4100         at this level.
4101         
4102         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
4103
4104 2007-03-31  Marek Safar  <marek.safar@gmail.com>
4105
4106         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
4107         argument and return type inferring.
4108
4109         * codegen.cs (InferReturnType): Flag whether return can be inferred.
4110         (ReturnType): Turned to property.
4111
4112         * statement.cs (Return): Implemented return type inferring.
4113
4114         * support.cs (ReflectionParameters): Use local types if possible.
4115
4116 2007-03-30  Raja R Harinath  <rharinath@novell.com>
4117
4118         * flowanalysis.cs (FlowBranching.Reachability): Remove.
4119         (FlowBranching.UsageVector): Update to changes.
4120
4121         Prepare to kill 'Reachability'
4122         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
4123         argument of constructor.
4124
4125 2007-03-29  Raja R Harinath  <rharinath@novell.com>
4126
4127         Prepare to kill 'Reachability'
4128         * flowanalysis.cs (UsageVector.is_unreachable): New.
4129         (UsageVector): Update to maintain 'is_unreachable' in parallel to
4130         'reachability', and verify they're consistent.
4131
4132         Fix #81121
4133         * expression.cs (New.EmitStatement): Handle type parameters here too.
4134
4135 2007-03-29  Martin Baulig  <martin@ximian.com>
4136
4137         Fix #79148.
4138
4139         * anonymous.cs
4140         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
4141         CompilerGeneratedClass.
4142         (ScopeInfo.EmitScopeInstance): Make this protected.
4143         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
4144         `ec.CurrentAnonymousMethod.Scope == Scope'.
4145
4146         * statement.cs (Block.ScopeInfo): Make this a property.
4147
4148 2007-03-27  Raja R Harinath  <harinath@gmail.com>
4149
4150         Prepare to kill 'Reachability'
4151         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
4152         (FlowBranching.UsageVector.Reachability): Remove property.
4153         (FlowBranching.UsageVector.IsUnreachable): New property.
4154         (FlowBranching.UsageVector.ResetBarrier): New.
4155         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
4156         * codegen.cs, statement.cs: Update to changes.
4157
4158 2007-03-27  Martin Baulig  <martin@ximian.com>
4159
4160         Fix #81209.
4161
4162         * decl.cs
4163         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
4164         generic types.
4165
4166 2007-03-26  Raja R Harinath  <rharinath@novell.com>
4167
4168         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
4169         instead of TriState.  Remove all mention of TriState.
4170
4171         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
4172         replaced by a boolean.  Add boolean 'is_unreachable' field, check
4173         and maintain invariants.
4174
4175 2007-03-25  Marek Safar  <marek.safar@gmail.com>
4176
4177         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
4178
4179 2007-03-25  Marek Safar  <marek.safar@gmail.com>
4180
4181         * expression.cs: Stop using obsolete 2.0 opcodes.
4182
4183 2007-03-25  Marek Safar  <marek.safar@gmail.com>
4184
4185         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
4186         one of the latests Martin's fixes.
4187
4188 2007-03-23  Miguel de Icaza  <miguel@novell.com>
4189
4190         * expression.cs: On BigEndian systems, swap the bytes, temporary
4191         solution until we get a new bitconverter class.
4192
4193 2007-03-23  Martin Baulig  <martin@ximian.com>
4194
4195         Fix #81158.
4196
4197         * decl.cs (MemberCache.AddMembers): Add generic methods both as
4198         "Method" and "Method`1".  Normally, a cache lookup is done on the
4199         "Method" form (ie. without the generic arity), but this one makes
4200         lookups on the full form work as well.
4201
4202 2007-03-22  Raja R Harinath  <rharinath@novell.com>
4203
4204         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
4205         unused properties.
4206
4207 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
4208         * class.cs: 
4209         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
4210         ordered_member_list, to TypeBuilder to store members to be defined
4211         in the order they were parsed in.
4212         - ordered_explicit_member_list contains all properties indexers
4213           and methods that are defined as explicit implementation of an
4214           interface or base class.
4215         - ordered_member_list contains all properties indexers and methods
4216           that are not defined as explicit implementation of an interface
4217           or base class.
4218
4219         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
4220         functionality in these removed classes has been replaced with 
4221         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
4222         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
4223
4224         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
4225         to CheckForDuplications inside GetMethod and SetMethod Define Method
4226         to handle method property and indexer name conflicts.
4227
4228         Fixes #79434
4229
4230         All code is contributed under the MIT/X11 license.
4231
4232 2007-03-20  Martin Baulig  <martin@ximian.com>
4233
4234         * class.cs (TypeContainer.Interfaces): Removed; they're now
4235         included in `TypeContainer.Types'.
4236
4237 2007-03-20  Martin Baulig  <martin@ximian.com>
4238
4239         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
4240
4241         * class.cs (TypeContainer.CreateType): New public method.  This is
4242         now called before DefineType() to create the TypeBuilders.
4243         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
4244         has already been created by CreateType().
4245         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
4246         don't resolve our base classes here; this has been moved into
4247         DefineBaseTypes().  We're now called from CreateType().
4248         (TypeContainer.DefineBaseTypes): New private method; resolve our
4249         base classes here.  We're now called from DefineType().
4250
4251         * rootcontext.cs
4252         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
4253         our types first to create all the TypeBuilders.  After that, call
4254         TypeContainer.DefineType() on all the types which'll resolve their
4255         base classes and setup the resolve order.
4256
4257 2007-03-20  Martin Baulig  <martin@ximian.com>
4258
4259         * class.cs (TypeContainer.Enums): Removed; they're now included in
4260         `TypeContainer.Types'.  
4261
4262 2007-03-20  Martin Baulig  <martin@ximian.com>
4263
4264         * class.cs
4265         (TypeContainer.DefineType): Don't call ResolveMembers() here.
4266         (TypeContainer.DoResolveMembers): Call DefineType() on our
4267         `compiler_generated' classes; moved here from DefineNestedTypes().
4268
4269         * rootcontext.cs
4270         (RootContext.ResolveTree): Call ResolveMembers() on all
4271         TypeContainer's in the `type_container_resolve_order'.
4272
4273 2007-03-19  Marek Safar  <marek.safar@gmail.com>
4274
4275         * class.cs: Use corlib to handle InternalMethodImplAttribute.
4276
4277 2007-03-17  Marek Safar  <marek.safar@gmail.com>
4278
4279         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
4280         implementation flags.
4281
4282 2007-03-17  Marek Safar  <marek.safar@gmail.com>
4283
4284         * class.cs: More optimizations for type parameters.
4285
4286 2007-03-15  Marek Safar  <marek.safar@gmail.com>
4287
4288         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
4289
4290         * ecore.cs, parameter.cs: More common code for both corlibs.
4291
4292         * typemanager.cs (IsGenericMethod): Simplified.
4293
4294 2007-03-15  Raja R Harinath  <rharinath@novell.com>
4295
4296         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4297         'returns'.
4298         * statement.cs, iterators.cs, lambda.cs: Update to changes.
4299
4300         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
4301         unconditionally.  Simplify explanation.
4302         (Try.Resolve, Using.Resolve): Likewise.
4303
4304 2007-03-15  Martin Baulig  <martin@ximian.com>
4305
4306         Fix #80731.
4307
4308         * decl.cs (DeclSpace): If we're a partial class, use our
4309         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
4310
4311 2007-03-15  Raja R Harinath  <rharinath@novell.com>
4312
4313         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4314         'throws'.
4315         (FlowBranching.UsageVector): Update to changes.
4316         (FlowBranching.MergeSiblings): Likewise.
4317         * statement.cs: Likewise.
4318
4319 2007-03-15  Martin Baulig  <martin@ximian.com>
4320
4321         Fix #79302.
4322
4323         * decl.cs
4324         (MemberCache): Added a special .ctor for type parameters.
4325
4326         * typemanager.cs
4327         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
4328         `MemberCache'.  
4329
4330 2007-03-09  Martin Baulig  <martin@ximian.com>
4331
4332         * enum.cs (Enum): Make this a TypeContainer.
4333         (EnumMember): Derive from `Const'.
4334
4335         * const.cs
4336         (Const.DoResolveValue): New protected virtual method; move most of
4337         the functionality of ResolveValue() here so we can override it in
4338         `EnumMember'.
4339         (Const.CreateConstantReference): Make this virtual.
4340
4341         * class.cs (Kind): Add `Kind.Enum'.
4342         (TypeContainer.Emit): Don't emit the enums here; they're already
4343         in the `RootContext.typecontainer_resolve_order'.
4344
4345         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4346         here; they're already in the `typecontainer_resolve_order'.
4347
4348         * ecore.cs (EnumConstant.ConvertImplicitly): Add
4349         TypeManager.DropGenericTypeArguments().
4350
4351         * typemanager.cs
4352         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4353         (TypeManager.IsEnumType): Likewise.
4354         (TypeManager.EnumToUnderlying): Likewise.
4355         (TypeManager.IsEqual): Add support for enums.
4356
4357 2007-03-12  Raja R Harinath  <rharinath@novell.com>
4358
4359         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4360         DefaultParameterValueAttribute to be undefined, say if System.dll
4361         is not referenced.
4362
4363 2007-03-11  Marek Safar  <marek.safar@gmail.com>
4364
4365         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4366         any mscorlib.
4367
4368 2007-03-10  Marek Safar  <marek.safar@gmail.com>
4369
4370         * class.cs, parameter.cs: Unified parameters verification.
4371
4372 2007-03-08  Martin Baulig  <martin@ximian.com>
4373
4374         * cs-parser.jay (constructor_header): Pass the location to the
4375         newly created TopLevelBlock.
4376
4377 2007-03-07  Martin Baulig  <martin@ximian.com>
4378
4379         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4380
4381 2007-03-06  Miguel de Icaza  <miguel@novell.com>
4382
4383         * convert.cs (ExplicitReferenceConversionExists): Sync this method
4384         with the changes from David, fixes the build.
4385
4386 2007-03-05  David Mitchell  <dmitchell@logos.com>
4387
4388         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4389         and its base interfaces to a one-dimensional array type S[],
4390         provided there is an implicit or explicit reference conversion
4391         from S to T.
4392
4393 2007-03-03  Marek Safar  <marek.safar@gmail.com>
4394
4395         * cs-tokenizer.cs: Implemented basic linq grammar.
4396
4397         * driver.cs: Set linq lang version on demand.
4398
4399 2007-02-26  Marek Safar  <marek.safar@gmail.com>
4400
4401         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4402
4403 2007-02-25  Marek Safar  <marek.safar@gmail.com>
4404
4405         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4406         (Fixes #80455)
4407
4408         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4409         here.
4410         Check property and event extern attributes.
4411
4412         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4413         charset.
4414
4415 2007-02-24  Marek Safar  <marek.safar@gmail.com>
4416
4417         A fix for bug #80407
4418         * ecore.cs: Don't report ambiguity error when methods have same parent.
4419
4420 2007-02-23  Marek Safar  <marek.safar@gmail.com>
4421
4422         A fix for bug #80878
4423         * class.cs, cs-parser.jay: Event property can host anonymous methods.
4424
4425 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4426
4427         * attribute.cs: Enable ExtensionAttribute presence test.
4428
4429 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4430
4431         * class.cs: Warn about missing GetHashCode only when Equals is override.
4432
4433         * decl.cs: Check accessibility of type arguments.
4434
4435         * typemanager.cs: Correctly report nullable array.
4436
4437 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4438
4439         * class.cs, report.cs: Capture more details when things go wrong.
4440
4441 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4442
4443         A fix for bug #80650
4444         * cs-parser.jay: Anonymous container starts at constructor declaration
4445         and not at block beginning because it has to be usable in constructor
4446         initializer.
4447
4448         * statement.cs: Use context location and not block one for error reporting.
4449
4450 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4451
4452         A fix for bug #78712
4453         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4454         too.
4455
4456 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4457
4458         A fix for bug #80493 by Atsushi Enomoto
4459         * cs-parser.jay: Ignore invalid attribute target.
4460
4461 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4462  
4463         * cs-tokenizer.cs: Ignore '\0' as white space character.
4464
4465 2007-02-17  Miguel de Icaza  <miguel@novell.com>
4466
4467         * cs-parser.jay: Add support for lambda expressions to the mcs
4468         compiler as well.
4469
4470         * lambda.cs: Only clone when we are probing, not on the final call
4471         (Compatible is the final call). 
4472
4473         * statement.cs (CloneContext): Introduce class to provide block
4474         remapping during clone.
4475
4476         All statements Clone themselves now.
4477
4478         (Clone): special handling for blocks, when we clone a block, we
4479         register the block inside this routine, as children of the block
4480         might trigger a lookup. 
4481         
4482         * expression.cs: Add support for CloneContext in all expressions. 
4483         
4484 2007-02-17  Marek Safar  <marek.safar@gmail.com>
4485  
4486         A fix for bug #80493
4487         * statement.cs: Report ambiguous warning when interfaces are not related.
4488
4489 2007-02-15  Marek Safar  <marek.safar@gmail.com>
4490
4491         C# 3.0 extension methods.
4492
4493         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4494         cannot be used directly.
4495
4496         * class.cs (Class.Emit): Emit extension attribute if any class method
4497         is extension method.
4498         (Method.Define): Add basic extension method validation conditions.
4499         (Method.Emit): Emit extension attribute for method.
4500
4501         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4502         extension method exists. Currently we follow same approach as Microsoft
4503         does, emit even if a method or a class are private but this can change
4504         later.
4505
4506         * cs-parser.jay: Add handling of `this' keyword in method parameters
4507         context.
4508
4509         * decl.cs (DeclSpace.IsStaticClass): New property.
4510         (MemberCache.FindExtensionMethods): Looks for extension methods with
4511         defined name and extension type.
4512
4513         * doc.cs: Updated after OverloadResolve changes.
4514
4515         * driver.cs: Add new soft reference to System.Core.dll.
4516
4517         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4518         (ExtensionMethodGroupExpr): Represents group of extension methods.
4519
4520         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4521         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4522         to MethodGroupExpr and made non-static for easier customization.
4523         (Invocation.DoResolve): Add extension method lookup when no standard
4524         method was found.
4525         (MemberAccess.DoResolve): Try extension methods if no member exists.
4526
4527         * modifiers.cs: Add METHOD_EXTENSION modifier.
4528
4529         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4530         as well as candidate extension type.
4531         (ComputeNamespaces): When assembly constains extension methods registers
4532         them.
4533         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4534         extension method lookup.
4535         (Namespace.LookupExtensionMethod): Looks for extension method in this
4536         namespace.
4537         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4538         find a method which matches name and extensionType.
4539
4540         * parameter.cs (Parameter): Add This modifer.
4541         (HasExtensionMethodModifier): New property.
4542         (Resolve): Add extension parameter check.
4543         (ModFlags): turned to property to exclude this modifier as it is not real
4544         parameter modifier.
4545         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4546
4547         * support.cs (ParameterData): Add ExtensionMethodType.
4548         (ReflectionParameters): Implemented ExtensionMethodType interface property.
4549
4550         * typemanager.cs: Add type and ctor extension attribute type.
4551
4552 2007-02-15  Miguel de Icaza  <miguel@novell.com>
4553
4554         * report.cs (DisableErrors, EnableErrors): used to prevent error
4555         output when we are "trying" to compile various methods with
4556         different types. 
4557
4558         * ecore.cs (Expression): Add Clone method that calls the virtual
4559         CloneTo method.  The current CloneTo method in Expression throws
4560         an exception so we can track down all the places where this must
4561         be implemented (not using abstract, because that would be a lot of
4562         up-front-work before we can start testing the implementation
4563         idea). 
4564
4565         Important: we only need Clone capabilities for expressions created
4566         by the parser, as the expressions we will be cloning are
4567         expressions in the pre-resolved state.   This vastly simplifies
4568         the work required. 
4569         
4570         (SimpleName): Add CloneTo that does nothing.
4571         (EmptyCast): Add CloneTo.
4572         
4573         * expression.cs (Binary): Implement CloneTo.
4574         (Invocation.IsApplicable): Store the current ec in
4575         EmitContext.TempEc and restore it on return.  This is used so we
4576         do not have to sprinkle hundres of methods with an extra
4577         EmitContext, we know that the only user is the lambda expression
4578         ImplicitConversionExists code. 
4579         
4580         (Argument): Add Cloning capabilities.
4581         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4582         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4583         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4584         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4585         IndexerAccess): Add Clone capability.
4586
4587         (LocalVariableReference, This): TODO: needs cloned Block mapping.
4588
4589         (Argument): Add cloning capability.
4590
4591         * assign.cs (Assign): Implement CloneTo.
4592
4593         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4594         
4595         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4596         version by calling Convert with the EmitContext (that we are
4597         currently storing in ec, this is not great, but will do for now,
4598         to avoid passing EmitContext parameters to hundreds of functions
4599         that do not need them now).
4600
4601         (SetExpression): Remove, it is not needed.
4602         
4603         (ContextualReturn): Implement CloneTo.
4604
4605         * statement.cs (Statement): Implement cloning infrastructure,
4606         similar to expressions.
4607
4608         (Block): Partial implementation of Clone for statements.
4609
4610         (Return): Implement clone.
4611         
4612         * constant.cs (Constant.CloneTo): New method, does nothing.
4613
4614         * codegen.cs (TempEc): Add a static EmitContext as a temporary
4615         solution, until we decide how to exactly do this.  
4616         
4617 2007-02-14  Marek Safar  <marek.safar@gmail.com>
4618  
4619         A fix for bug #80493
4620         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4621         a property is override we need to use second accessor.
4622
4623 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4624  
4625         A fix for bug #80418
4626         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4627         methods.
4628
4629 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4630
4631         Another fix for bug #80749
4632         * pending.cs: Abstract class has priority over interfaces.
4633
4634 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4635
4636         Another fix for bug #80749
4637         * pending.cs: Abstract class has priority over interfaces.
4638
4639 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4640
4641         Another fix for bug #80749
4642         * pending.cs: Abstract class has priority over interfaces.
4643
4644 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4645
4646         Another fix for bug #80749
4647         * pending.cs: Abstract class has priority over interfaces.
4648
4649 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4650
4651         * class.cs Better error message.
4652
4653         * driver.cs: Add shorter versions of -optimize option.
4654
4655 2007-02-13  Martin Baulig  <martin@ximian.com>
4656
4657         * class.cs (Constructor.Emit): Check the return value of
4658         ec.ResolveTopBlock() and return on error.
4659
4660 2007-02-13  Raja R Harinath  <rharinath@novell.com>
4661
4662         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4663         message to fix error message regression.
4664
4665 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4666
4667         * delegate.cs: Delegate creation expression cannot be of Nullable type.
4668
4669 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4670
4671         A fix for bug #80749
4672         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4673         its parent container.
4674
4675         * class.cs (DefineFieldInitializers): Each initializer can has different
4676         resolve context.
4677
4678         * const.cs: Updated.
4679
4680 2007-02-11  Miguel de Icaza  <miguel@novell.com>
4681
4682         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4683         now all the heavy lifting to check that embedded statements or
4684         expressions have the right form is done in the ContextualReturn.
4685
4686         (ContextualReturn): New class.  
4687
4688         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4689         method that can be invoked to report 201, so we do not replicate
4690         this everywhere.
4691
4692         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4693         
4694         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4695         treating tabs as spaces. 
4696
4697 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4698
4699         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4700         * assign.cs: Use full implicit conversion for right side check.
4701
4702 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4703
4704         * statement.cs (Switch): Switch over boolean type is not standardized.
4705
4706 2007-02-08  Marek Safar  <marek.safar@gmail.com>
4707
4708         A fix for bug #80755
4709         * decl.cs (FindBaseEvent): Don't use method cache for events.
4710
4711 2007-02-07  Marek Safar  <marek.safar@gmail.com>
4712
4713         * cs-parser.jay: Better syntax error handling.
4714
4715         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4716         instead of underlying type value.
4717
4718 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4719
4720         * driver.cs: Check define identifier before is registered.
4721
4722         * namespace.cs: Use existing error message.
4723
4724         * report.cs: New warning.
4725
4726 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4727
4728         A fix for bug #80742
4729         * expression.cs: Delegate Invoke method can be called directly.
4730
4731 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4732
4733         A fix for bug #80676
4734         * class.cs (IsEntryPoint): The Main method can have params modifier.
4735
4736 2007-02-04  Miguel de Icaza  <miguel@novell.com>
4737
4738         * parameter.cs (Parameter, Parameters): Add Clone method.
4739
4740         * anonymous.cs (Compatible): Turn method into virtual method, so
4741         LambdaExpression can implement a different behavior.
4742
4743         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4744         out the basic checking here, so it can be used by
4745         LambdaExpressions.
4746         
4747         * lambda.cs: Introduce "Compatible" function that will do the
4748         heavy lifting.
4749
4750 2007-02-02  Marek Safar  <marek.safar@gmail.com>
4751
4752         * attribute.cs: Unified one error message.
4753
4754         * class.cs (Class): Use type attributes and not properties to test static
4755         class.
4756         (IsEntryPoint): Don's pass local variable.
4757
4758         * convert.cs: Removed duplicate check.
4759
4760         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4761
4762         * driver.cs: Don't crash when soft reference does not exist.
4763
4764         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4765         (UsingEntry): Removed redundant allocation.
4766
4767         * parameter.cs: Add fast path for type parameters.
4768
4769         * support.cs: Don't allocate attribute when it's not used.
4770
4771 2007-01-30  Miguel de Icaza  <miguel@novell.com>
4772
4773         * anonymous.cs
4774         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4775         this into a virtual method, so we can override it in LambdaExpression.
4776
4777         * driver.cs: Improve diagnostics in case of failure. 
4778
4779         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4780         write a function that is slightly more complex and that parses:
4781
4782         type identifier [, type identifier]* )
4783
4784         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4785         this expression:
4786
4787                 (canEmpty ? i >= 0 : i > 0)
4788
4789 2007-01-30  Raja R Harinath  <rharinath@novell.com>
4790
4791         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4792         exception on possibly valid code.
4793
4794 2007-01-29  Raja R Harinath  <rharinath@novell.com>
4795
4796         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4797         Push/PopPosition.
4798         (parse_opt_type_arguments): Remove.  It's almost the same as
4799         parse_less_than.
4800         (parse_namespace_or_typename): Use parse_less_than.
4801
4802 2007-01-28  Miguel de Icaza  <miguel@novell.com>
4803
4804         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4805         this bug took a few hours to find, because the state saved and
4806         restored by PushPosition and PopPosition was ignoring the state of
4807         parse_generic_less_than.
4808
4809         I can also now remove the handling of OP_LT and OP_GT, this solves
4810         the big mistery.
4811         
4812         * cs-tokenizer.cs: store the location for the ARROW token, we use
4813         that in the parser.
4814
4815         (PushPosition, PopPosition): save/restore also `current_token',
4816         restore `parse_generic_less_than' (was missing).
4817
4818         (parse_opt_type_arguments): use parse_type, not
4819         parse_namespace_or_typename to parse types.
4820
4821         * lambda.cs: Empty new file, will eventually have the lambda
4822         expression implementation.
4823
4824         * lambda.test: used to test the internal tokenizer. 
4825
4826         * report.cs (FeatureIsNotISO1): Rename from
4827         FeatureIsNotStandardized, because it was about the language level
4828         (1 vs 2) it was not about standarization.
4829
4830         (FeatureRequiresLINQ): New.
4831
4832         * support.cs (SeekableStreamReader): Only require that the reader
4833         is a TextReader, not a StreamReader, so we can plug StringReader. 
4834
4835         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4836         given position in the input stream the following tokens can be
4837         parsed as a type followed by an identifier.
4838
4839         (is_punct): after a '(' if parse_type_and_parameter returns true,
4840         then return a special token OPEN_PARENS_LAMBDA which is used to
4841         avoid reduce/reduce errors in the grammar for the
4842         lambda_expression rules.
4843
4844         (parse_type): implement a type parser inside the
4845         tokenizer, the parser only returns true or false depending on
4846         whether the input at a given position can be parsed as a type.
4847
4848         (peek_token): new method used during type parsing.
4849
4850 2007-01-28  Raja R Harinath  <rharinath@novell.com>
4851
4852         Fix #80531
4853         * anonymous.cs (ScopeInfo.InflateParameters): New.
4854         (AnonymousContainer.Resolve): Use it to redirect types of
4855         delegate parameters.
4856
4857 2007-01-27  Raja R Harinath  <rharinath@novell.com>
4858
4859         Fix #80530
4860         * expression.cs (Error_InvalidArguments): Don't use two different
4861         messages for CS1503.  Use ExtraInformation and
4862         SymbolRelatedToPreviousError instead.
4863
4864         Fix #80358
4865         * decl.cs (DeclSpace.initialize_type_params): Don't access
4866         'type_params' of a partial class directly.
4867
4868 2007-01-26  Miguel de Icaza  <miguel@novell.com>
4869
4870         * constant.cs: Removed a handful of out-of-range checks that were
4871         not necessary. 
4872
4873 2007-01-25  Marek Safar  <marek.safar@gmail.com>
4874
4875         * expression.cs (CheckUselessComparison): Add additional check for char
4876         constants.
4877
4878         * namespace.cs: Fixed typo.
4879
4880 2007-01-23  Miguel de Icaza  <miguel@novell.com>
4881
4882         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4883         gone, instead we inline the test, preventing the needless casts to
4884         longs, ulongs and doubles for the parameters, avoiding calls to
4885         methods that overchecked stuff, and instead inlined things
4886         nicely. 
4887
4888 2007-01-20  Marek Safar  <marek.safar@gmail.com>
4889
4890         * cs-parser.jay: Better parameter error handling.
4891
4892 2007-01-17  Marek Safar  <marek.safar@gmail.com>
4893
4894         A fix for bug #80368, #80522
4895         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4896         whether array initializer contains constants only.
4897         (ArrayCreation.Emit): Use better formula to decide when
4898         are array initializers for static initialization.
4899         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4900         have to emit even constants otherwise they are pre-initialized.
4901
4902 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
4903             Raja R Harinath  <rharinath@novell.com>
4904
4905         Fix emit order of 'get' vs. 'set'.
4906         * support.cs (Accessors): New.
4907         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4908         Note the order in which accessors are declared in the source.
4909         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4910         Refactored from Property.Define and Indexer.Define.
4911         (PropertyBase.DefineAccessors): New helper that calls the above in
4912         appropriate order as noted by the parser.
4913         (Property.Define, Indexer.Define): Update to changes.
4914         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4915
4916 2007-01-17  Raja R Harinath  <rharinath@novell.com>
4917
4918         Fix cs0029-6.cs and gcs0029-2.cs (regression)
4919         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4920         there's an implicit conversion from the current type to the target
4921         type before converting the underlying constant.
4922
4923 2007-01-16  Marek Safar  <marek.safar@gmail.com>
4924
4925         * const.cs (ResolveValue): Updated after constant conversion was made more
4926         generic.
4927
4928         * constant.cs (GetAttributableValue): constant to object conversion is
4929         used for attributes only.
4930         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4931         constant conversions.
4932         (LongConstant.ConvertImplicitly): Ditto.
4933
4934         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4935         (ImplicitConversionStandard): Handle constant conversion as extra step.
4936         It solves the issue when constant conversion was called indirectly like
4937         inside array initializer and constant folding was skipped.
4938
4939         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4940         this change.
4941
4942         * statement.cs(ImplicitConversionStandard): Updated after constant
4943         conversion was made more generic.
4944
4945 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
4946
4947         * expression.cs (As.DoResolve): Use GenericConstraints instead of
4948         Constraints, solves the problem where the compiler incorrectly
4949         reported that a type parameter was not constrained to a class (Bug
4950         80518)
4951
4952 2007-01-14  Marek Habersack  <grendello@gmail.com>
4953
4954         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4955
4956 2007-01-14  Marek Safar  <marek.safar@gmail.com>
4957
4958         A fix for bug #80368
4959         * assign.cs (FieldInitializer): New class implements field
4960         initializer statement.
4961
4962         * attribute.cs: Update after FieldMember rename.
4963
4964         * class.cs (PropertyBasedMember): New common class for property based
4965         types.
4966         (InterfaceMemberBase): New base class for all members which can be used as
4967         an interface members.
4968         (MethodCore): Moved really common code to InterfaceMemberBase.
4969         (Method.Define): Equal and GetHasCode detection is relevant for methods
4970         only.
4971         (MethodData.Define): Don't assume that public event implements an
4972         interface automatically.
4973         (MethodData.DefineMethodBuilder): Issue an error even if only extern
4974         modifier is used.
4975         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4976         (FieldMember): Merged with FieldBase.
4977         (EventProperty.AEventPropertyAccessor): New specialization to check whether
4978         event extern modifier can be used.
4979         (EventField.EventFieldAccessor): Moved event field specific code here.
4980         (Event.AllowedModifiers): Even event can be extern.
4981         (Event.FindOutBaseMethod): New override specific to events.
4982         (Indexer.parameters): Reintroduce parameters because base class holds
4983         only properties common data.
4984         (Indexer.CheckForDuplications): Indexers are threated as methods so we
4985         need do extra parameters check.
4986
4987         * const.cs: Update after FieldMember rename.
4988
4989         * decl.cs (MemberCache.FindBaseEvent): New method.
4990
4991         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4992         to reflect that indexer is now derived from PropertyBased.
4993
4994         * ecore.cs (GetMemberType): Made public.
4995         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4996         obsolete event.
4997
4998         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
4999         
5000         * typemanager.cs (CSharpSignature): Correctly print event accessors.
5001         (RegisterEvent): Removed.
5002         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
5003         (GetPrivateFieldOfEvent): Renamed to GetEventField.
5004
5005 2007-01-11  Raja R Harinath  <rharinath@novell.com>
5006
5007         Fix #80249
5008         * statement.cs (CollectionForeach.TryType): Prefer generic
5009         GetEnumerator over non-generic variant.  Fix code to follow comments.
5010
5011 2007-01-09  Raja R Harinath  <rharinath@novell.com>
5012
5013         Fix #80446
5014         * support.cs (ReflectionParameter): Don't use an invalid index on
5015         the generic parameter data.
5016
5017 2007-01-08  Miguel de Icaza  <miguel@novell.com>
5018
5019         * driver.cs: Just add a tiny bit of infrastructure.
5020
5021 2007-01-02  Marek Safar  <marek.safar@gmail.com>
5022
5023         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
5024         where field type is struct from current assembly.
5025         
5026         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
5027         it is possible.
5028
5029 2007-01-02  Marek Safar  <marek.safar@gmail.com>
5030
5031         A fix for bug #80381
5032         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
5033         the core types.
5034
5035         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
5036         messages.
5037         (Namespace.LookupType): Always use core types from corlib when speficied.
5038
5039         * report.cs: A new warning.
5040
5041         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
5042         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
5043         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
5044
5045         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
5046         (InitCoreTypes): Set expression type of object_type and value_type
5047         immediately after lookup.
5048
5049 2007-01-01  Miguel de Icaza  <miguel@novell.com>
5050
5051         * cs-tokenizer.cs: Accept Pc class characters (Connector
5052         Punctuation) as valid identifiers.  Fixes #78259
5053
5054         * expression.cs (Invocation.DoResolve): Moved the check for the
5055         use of `this' for doing method calls to the Invocation resolution
5056         step, after overload resolution has taken place instead of doing
5057         the check at the low-level `This.DoResolve' level.
5058
5059         The `This.DoResolve'(appens before overload resolution, so it has
5060         no way of knowing if the method that will be called will be
5061         instace or static, triggering an erroneous report for cs0188 (Bug
5062         78113).
5063
5064         We now do the check for instance method invocations after we know
5065         what method will be called.
5066
5067         (This.CheckThisUsage): Move the actual use of this structure
5068         checking into its own method and expose it. 
5069
5070         * Everywhere that called Error_ValueCannotBeConverted: pass a new
5071         EmitContext.
5072
5073         Exceptions: Null.ConvertImplicitly,
5074         Constant.ImplicitConversionRequired as there are too many call
5075         sites for passing the ec. 
5076
5077         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
5078         EmitContext, if the value is null, then we do not try to provide
5079         the extra information from the error (If a userdefined conversion
5080         exists, as UserDefinedConversion requires a non null-EmitContext).
5081
5082         Fixes: #80347
5083
5084 2006-12-30  Raja R Harinath  <rharinath@novell.com>
5085
5086         * flowanalysis.cs (MyBitVector): Document some invariants.
5087         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
5088         introduced below, and add a couple of others, 
5089
5090 2006-12-30  Marek Safar  <marek.safar@gmail.com>
5091
5092         * attribute.cs (GetMethodObsoleteAttribute): Uses new
5093         GetPropertyFromAccessor and GetEventFromAccessor.
5094         
5095         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
5096         overrides non-obsolete one.
5097         (Indexer.Define): Error message has been moved to the parser.
5098
5099         * cs-parser.jay: Better syntax errors handling.
5100
5101         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
5102         when an invocation has no arguments.
5103
5104         * ecore.cs: Removed not used caching.
5105
5106         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
5107         implementation.
5108
5109         * report.cs: Add a new warning.
5110
5111         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
5112
5113         * typemanager.cs (enumeration_type): Removed.
5114         (CSharpSignature): Reuses IsSpecialMethod.
5115         (IsEqual): Hack for MS BCL.
5116         (GetPropertyFromAccessor): New method.
5117         (GetEventFromAccessor): New method.
5118         (IsSpecialMethod): Fixed to handle more cases.
5119
5120 2006-12-30  Marek Safar  <marek.safar@gmail.com>
5121
5122         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
5123         Made white spaces array static.
5124
5125         * ecore.cs (RemoveGenericArity): Optimized.
5126
5127         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
5128         10 times faster).
5129         (MyBitVector.initialize_vector): Simplified.
5130
5131 2006-12-22  Miguel de Icaza  <miguel@novell.com>
5132
5133         * ecore.cs: Am not entirely happy with this hack, but it seems to
5134         address the issue in 80257 (a small test case for
5135         CreativeDocs.NET). 
5136
5137         I set the MethodGroupExpr.Type to an internal compiler type
5138         (itself in this case) to force the resolution to take place.   Why
5139         it does not take place with a null is beyond me.
5140
5141 2006-12-20  Marek Safar  <marek.safar@gmail.com>
5142
5143         A fix for bug #80288
5144         * expression.cs (ResolveOperator): Consider user defined conversion for
5145         logical and operator too.
5146         (EmitBranchable): Optimization for logical and when full constant folding
5147         could not be applied but one operand is constant.
5148
5149 2006-12-19  Marek Safar  <marek.safar@gmail.com>
5150
5151         * class.cs (GetClassBases): Write 5 times every day, will never use
5152         FullName for error reporting.
5153
5154         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
5155
5156 2006-12-19  Martin Baulig  <martin@ximian.com>
5157
5158         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
5159         the symbol file info here.
5160
5161 2006-12-18  Marek Safar  <marek.safar@gmail.com>
5162
5163         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
5164         of `elseif' is taking then following sections are not taking.
5165         Fixes an issue reported on mono mailing list.
5166
5167 2006-12-18  Marek Safar  <marek.safar@gmail.com>
5168
5169         A fix for bug #80300
5170         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
5171         a caller is not taking.
5172
5173 2006-12-18  Raja R Harinath  <rharinath@novell.com>
5174
5175         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
5176         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
5177         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
5178         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
5179         * class.cs: Update to changes.
5180
5181 2006-12-17  Marek Safar  <marek.safar@gmail.com>
5182
5183         A fix for bug #79934
5184         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
5185         partial container.
5186
5187         * class.cs (ResolveMembers): Register an iterator in current container and
5188         not in shared one.
5189
5190 2006-12-16  Raja R Harinath  <rharinath@novell.com>
5191
5192         Fix test-543.cs
5193         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
5194         satisfy a params annotated parameter.
5195
5196 2006-12-16  Marek Safar  <marek.safar@gmail.com>
5197
5198         A fix for bug #77014
5199         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
5200         paramters correctly and not rely on hacks in Parameters class.
5201         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
5202         at any possition.
5203         (Invocation.VerifyArgumentsCompat): Ditto.
5204         (Invocation.EmitArguments): Changed to correctly emit params arguments at
5205         any possition.
5206
5207         * parameter.cs (HasParams): Don't assume that params is the last one.
5208
5209         * support.cs (ReflectionParameters.ctor): Look for params attribute
5210         correctly.
5211         (ReflectionParameters.ParameterType): Removed hack when we returned last
5212         parameter for out of range parameters.
5213         (ParameterName, ParameterModifier): Ditto.
5214
5215 2006-12-14  Marek Safar  <marek.safar@gmail.com>
5216
5217         A fix for bug #79987
5218         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
5219         when assembly is not CLS compliant but type is. I have no idea why is this
5220         allowed.
5221
5222         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
5223
5224 2006-12-13  Miguel de Icaza  <miguel@novell.com>
5225
5226         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
5227         in struct constructors, they are basically no-ops.
5228
5229 2006-12-12  Marek Safar  <marek.safar@gmail.com>
5230
5231         * cs-tokenizer.cs (Position): Save preprocessor status too.
5232
5233 2006-12-12  Marek Safar  <marek.safar@gmail.com>
5234
5235         A fix for bug #77794
5236         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
5237
5238 2006-12-12  Marek Safar  <marek.safar@gmail.com>
5239
5240         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
5241         Fixes #69299.
5242         (pp_expr): Report error for an invalid expression.
5243         (handle_preprocessing_directive): Simplified; add more error checking.
5244
5245 2006-12-11  Marek Safar  <marek.safar@gmail.com>
5246
5247         A fix for bug #74939
5248         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
5249         directives handling.
5250
5251 2006-12-10  Marek Safar  <marek.safar@gmail.com>
5252
5253         A fix for bugs #80093, and #75984
5254         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
5255         logic, it seems to me as it worked before "by coincidence".
5256         (xtoken): Simplified to use reworked handle_preprocessing_directive.
5257         (cleanup): Enabled endif check.
5258
5259 2006-12-09  Marek Safar  <marek.safar@gmail.com>
5260
5261         A fix for bug #80162
5262         * statement.cs (CollectionForeach.TryType): Generics and non-generics
5263         enumerators are never ambiguous.
5264
5265 2006-12-08  Raja R Harinath  <rharinath@novell.com>
5266
5267         Fix #80060
5268         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
5269
5270 2006-12-06  Marek Safar  <marek.safar@gmail.com>
5271
5272         A fix for bug #80144
5273         * class.cs (EventProperty.Define): Explicit implementation means
5274         that an even is used.
5275
5276 2006-12-06  Marek Safar  <marek.safar@gmail.com>
5277
5278         Fixes the operators implementation (part II)
5279
5280         * cfold.cs (DoConstantNumericPromotions): Renamed to
5281         DoBinaryNumericPromotions and simplified.
5282         (BinaryFold): Couple of conversion fixes; simplified.
5283
5284         * constant.cs, ecore.cs, literal.cs
5285         (ToType): Renamed to ConvertImplicitly.
5286         (Reduce): Renamed to ConvertExplicitly.
5287
5288         * class.cs, convert.cs: Updated.
5289
5290         * expression.cs: TryReduce doesn't throw an exception.
5291
5292 2006-12-01  Marek Safar  <marek.safar@gmail.com>
5293
5294         A fix for bug #80108
5295         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
5296         compatible.
5297
5298 2006-11-30  Marek Safar  <marek.safar@gmail.com>
5299
5300         Fixes unary operators implementation (part I)
5301         Also fixes #80026
5302
5303         * cfold.cs (Error_CompileTimeOverflow): Made internal
5304
5305         * const.cs (IConstant): Changed to use reference to constant and
5306         not constant itself.
5307         Updated IConstant implementations.
5308
5309         * constant.cs (CreateConstant): New factory method.
5310         Updated IConstant implementation.
5311
5312         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
5313
5314         * ecore.cs: Updated to use CreateConstantReference.
5315
5316         * enum.cs: Reflects IConstant changes.
5317
5318         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
5319
5320         * literal.cs (NullConstant): Change to be independently usable.
5321
5322 2006-11-29  Martin Baulig  <martin@ximian.com>
5323
5324         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
5325         we need to emit the scope initializer before calling the base .ctor.
5326
5327         * anonymous.cs: Merged back from the new anonymous methods branch.
5328         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
5329
5330         * expression.cs (ParameterReference.DoResolveBase): Create a
5331         "normal" ScopeInfo when capturing parameters rather than using the
5332         root scope; this makes things work with anonymous methods having
5333         parameters.
5334
5335         * statement.cs
5336         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5337
5338 2006-11-22  Marek Safar  <marek.safar@gmail.com>
5339
5340         A fix for bug #79987
5341         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5342         check to a base class.
5343         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5344         only when assembly has missing attribute.
5345         * report.cs: Update.
5346
5347 2006-11-21  Marek Safar  <marek.safar@gmail.com>
5348
5349         * cs-tokenizer.cs: Merged with gmcs version.
5350
5351 2006-11-20  Marek Safar  <marek.safar@gmail.com>
5352
5353         * cs-tokenizer.cs,
5354         * cs-parser.jay: Better error message when partial keyword is misplaced.
5355
5356 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
5357
5358         A fix for bug #79810
5359         report.cs: CS1058 only applies to 2.0 profile (gmcs).
5360         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5361         a RuntimeWrappedException by default.
5362
5363 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5364
5365         A fix for bug #79843
5366         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5367         implementation.
5368         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5369
5370 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5371
5372         * driver.cs, namespace.cs: Uses faster IndexOf version.
5373
5374 2006-11-17  Marek Safar  <marek.safar@gmail.com>
5375
5376         A fix for bug #79941
5377         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5378         operators.
5379         (Operator.Define): Implicit/Explicit operator of same type is duplicate
5380         even if internal name is different.
5381         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5382         (UserDefinedConversion): Simplified as the operators cannot be internal.
5383         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5384         conversions.
5385         (MethodLookup): Replaced EmitContext with parentType.
5386         * expression.cs: Updated.
5387
5388 2006-11-09  Raja R Harinath  <rharinath@novell.com>
5389
5390         * driver.cs (BadAssembly): Handle all the ugliness of
5391         DefineDynamicAssembly.
5392
5393 2006-11-08  Raja R Harinath  <rharinath@novell.com>
5394
5395         Address parts of #58244 -- most of what's left is in the runtime
5396         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
5397         CS1509 error checks, and handle them for all assembly loads, not
5398         just the first invocation.
5399         (LoadModule): Likewise.  Move handling of 'adder_method' ...
5400         * codegen.cs (AssemblyClass.AddModule): ... here.
5401
5402 2006-11-02  Marek Safar  <marek.safar@gmail.com>
5403
5404         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5405         IEnumerable<T> is ambiguous.
5406
5407 2006-10-31  Marek Safar  <marek.safar@gmail.com>
5408
5409         A fix for bug #67689
5410         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5411         GetEnumerator is ambiguous.
5412
5413         * report.cs: Add new warning.
5414
5415 2006-10-29  Marek Safar  <marek.safar@gmail.com>
5416
5417         A fix for bug #78602
5418         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5419         to protected member can be nested type.
5420
5421 2006-10-28  Marek Safar  <marek.safar@gmail.com>
5422
5423         A fix for bug #78965
5424         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5425         to protected member must derive from current type.
5426
5427 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5428
5429         assign.cs: Reuses error method.
5430
5431         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5432         instead of type for constants.
5433         (Expression.Error_ValueAssignment): Common error method.
5434
5435         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5436         for any assignment.
5437
5438 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5439
5440         A fix for bug #79081
5441         * expression.cs (MemberAccess.DoResolve): Check nested type
5442         accessibility.
5443
5444 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
5445
5446         * doc.cs : nested delegates were not handled. Fixed bug #79754.
5447
5448 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5449
5450         A fix for bug #76591
5451         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5452
5453 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5454
5455         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5456         type forwarder of the same type multiple times.
5457
5458 2006-10-26  Raja R Harinath  <rharinath@novell.com>
5459
5460         Fix #78820
5461         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5462         instance as an rvalue, even when we later resolve as an lvalue.
5463
5464 2006-10-25  Martin Baulig  <martin@ximian.com>
5465
5466         * anonymous.cs: Fix #79673.
5467
5468 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
5469
5470         A fix for bug #79666
5471         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5472         ignored when is optimized (= default value) as its value is already set.
5473
5474 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5475
5476         A fix for bug #79724
5477         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5478         TypeContainer for type lookup.
5479
5480 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5481
5482         A fix for bug #79231
5483         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5484         * expression.cs (OverloadResolve): Always convert type name for
5485         an error message.
5486         (ResolveNamespaceOrType): Don't confuse a nested type with any 
5487         other member.
5488
5489 2006-10-18  Martin Baulig <martin@ximian.com>
5490
5491         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5492
5493 2006-10-17  Miguel de Icaza  <miguel@novell.com>
5494
5495         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5496         an int32, but requesting an int64 from the conversion
5497
5498 2006-10-12  Martin Baulig  <martin@ximian.com>
5499
5500         * anonymous.cs
5501         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
5502         
5503 2006-10-12  Martin Baulig  <martin@ximian.com>
5504
5505         * statement.cs
5506         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5507
5508 2006-10-11  Miguel de Icaza  <miguel@novell.com>
5509
5510         * convert.cs: Remove broken code: I was doing the "Existance"
5511         tests for Implicit conversions.
5512
5513 2006-10-10  Miguel de Icaza  <miguel@novell.com>
5514
5515         * convert.cs: Added one missing case in
5516         ImplicitStandardConversionExists uint64 to intptr.
5517
5518         Fixes #59800
5519         
5520         * typemanager.cs (uintptr_type): another core known type.   
5521
5522         * ecore.cs (OperatorCast): routine used to do cast operations that
5523         depend on op_Explicit.  We could change some of the Decimal
5524         conversions to use this.
5525
5526         This one has a probe mechanism that checks both types for an op_
5527         which it coudl be used to eliminate two classes: CastToDecimal
5528         and CastFromDecimal.
5529
5530         * convert.cs: Implement the conversions documented in #59800
5531         
5532 2006-10-10  Martin Baulig  <martin@ximian.com>
5533
5534         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5535         before RootScope.ResolveMembers().
5536
5537         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5538         `CurrentType' if appropriate.
5539
5540 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
5541
5542         A fix for bug #78568
5543         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5544         when contains binary operators.
5545         * cs-parser.jay: Updated.
5546
5547 2006-10-09  Martin Baulig  <martin@ximian.com>
5548
5549         * delegate.cs
5550         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5551         moved that into Define() and also do the other type parameter
5552         checks there.  Fixes #79094.  Added gtest-292.cs.
5553
5554         * expression.cs
5555         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5556         since that doesn't include type parameters; don't use `Ldelema'
5557         for type parameters.  Fixes #78980.  Added gtest-293.cs.
5558
5559 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
5560
5561         A fix for #77796
5562         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5563         conversion is allowed.
5564
5565 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5566
5567         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5568         error reporting when no error occurs.
5569
5570 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5571
5572         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5573         does not exist.
5574
5575 2006-10-06  Raja R Harinath  <rharinath@novell.com>
5576
5577         Fix #79584
5578         * class.cs (DefineTypeBuilder): Check circular dependencies before
5579         setting the parent of the TypeBuilder.
5580         (CheckRecursiveDefinition): Don't use 'BaseType', since
5581         it may not be valid until after DefineTypeBuilder.  Use
5582         'base_type' instead.
5583
5584 2006-10-04  Martin Baulig  <martin@ximian.com>
5585
5586         Merged the Anonymous Methods patch.
5587
5588         * anonymous.cs, iterators.cs: The new anonymous methods code.
5589
5590         * statement.cs (Variable): New public abstract class.
5591         (LocalInfo.Variable): New public property.
5592         (LocalInfo.ResolveVariable): New public method.
5593         (Block.Flags): Add `IsIterator'.
5594         (Block.AddVariable): Improved the CS0136 check.
5595         (Block.AnonymousChildren): New public property.
5596         (Block.AddAnonymousChild): New public method.
5597         (ToplevelBlock): Update to use the new anonymous method framework.
5598         (ToplevelBlock.ctor): `container' is now a `Block' and not a
5599         `ToplevelBlock'; this is required to correctly implement the
5600         CS0136 check.
5601         (Fixed, Using): Use `TemporaryVariable' instead of directly
5602         creating the `LocalBuilder'.
5603
5604         * parameter.cs (Parameter.ResolveVariable): New public method.
5605         (Parameters.ResolveVariable): Likewise.
5606
5607         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5608
5609         * class.cs (TypeContainer): Replaced the `iterators' list and
5610         corresponding methods with a list of `CompilerGeneratedClass'es.
5611         (TypeContainer.ResolveMembers): New public method.
5612         (Method): `IIteratorContainer' has been replaced by
5613         `IAnonymousHost'.
5614
5615         * expression.cs (VariableReference): New public abstract base
5616         class for `LocalVariableReference', `ParameterReference' and
5617         `This'.
5618
5619         * codegen.cs (EmitContext): Removed `capture_context',
5620         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5621         (EmitContext.EmitThis): Removed.
5622
5623         * cs-parser.jay: Replace `iterator_container' with
5624         `anonymous_host'.       
5625
5626 2006-10-04  Martin Baulig  <martin@ximian.com>
5627
5628         * generic.cs (GenericMethod): Don't make this abstract.
5629         (Constraints.Clone): Added dummy implementation.
5630
5631 2006-10-04  Raja R Harinath  <harinath@gmail.com>
5632
5633         Fix #79577
5634         * namespace.cs (LookForAnyGenericType): Avoid nullref on
5635         'declspaces'.  Avoid allocating arrays willy-nilly.
5636
5637         Fix #79553
5638         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5639         cases out of the switch.
5640
5641 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5642
5643         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5644         message when non-generic type is used with the type arguments.
5645         * expression.cs: Updated.
5646
5647 2006-09-28  Raja R Harinath  <rharinath@novell.com>
5648
5649         Fix #79013
5650         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5651         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5652         Change semantics slightly.  Don't insist on having only one
5653         temporary EmptyExpression -- just throttle the creation of new ones.
5654
5655         Fix #79451
5656         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5657         non-interfaces too.  If no methods are found, don't try to create
5658         a MethodGroupExpr.
5659
5660 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5661
5662         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5663         generic type.
5664
5665         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5666         us produce better error message.
5667
5668 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
5669
5670         * expression.cs (Binary.ResolveOperator): Warn about a side effect
5671         of the `|' operator.
5672
5673         * report.cs: A new warning added.
5674
5675 2006-09-27  Martin Baulig  <martin@ximian.com>
5676
5677         * generic.cs (GenericMethod): Don't make this abstract.
5678
5679 2006-09-27  Martin Baulig  <martin@ximian.com>
5680
5681         * report.cs
5682         (InternalErrorException): Added overloaded ctor taking a params array.
5683
5684 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
5685
5686         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5687         Fixed the cases when same error was reported twice.
5688
5689         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5690         now report symbol information.
5691
5692 2006-09-25  Martin Baulig  <martin@ximian.com>
5693
5694         * class.cs: Completely unified with the gmcs version.
5695
5696 2006-09-25  Martin Baulig  <martin@ximian.com>
5697
5698         * typemanager.cs (TypeManager.IsNullableType): New public function.
5699         (TypeManager.IsNullableTypeOf): Likewise.
5700         (TypeManager.IsNullableValueType): Likewise.
5701
5702         * class.cs (MethodCore): Added the `GenericMethod' argument from
5703         gmcs and also unified all classes derived from `MethodCore' with gmcs.
5704
5705 2006-09-24  Raja R Harinath  <harinath@gmail.com>
5706
5707         * convert.cs: Unify with gmcs version.
5708
5709 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5710
5711         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5712         verify them as well.
5713
5714         * report.cs: New warning.
5715
5716 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5717
5718         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5719         for anonymous block with out argument.
5720
5721 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5722
5723         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5724         not used private events only.
5725
5726 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
5727
5728         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5729
5730         * const.cs (Const.Define): Check for constant type.
5731         (Const.IsConstantTypeValid): Looks for valid constant types.
5732
5733         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5734
5735         * ecore.cs (EmptyConstantCast): New common class for all constant based
5736         EmptyCast(s).
5737
5738         * expression.cs (Is.DoResolve): Handle null constant especially.
5739         (New.DoResolve): Check for new void().
5740         (MemberAccess.DoResolve): Cope with all kind of nulls.
5741
5742         * literal.cs (NullConstant): Uses EmptyConstantCast.
5743         (NullDefault): Based on EmptyConstantCast.
5744         (NullLiteral): Uses EmptyConstantCast.
5745
5746         * statement.cs (Block.ResolveMeta): Check for constant type.
5747
5748 2006-09-22  Martin Baulig  <martin@ximian.com>
5749
5750         * delegate.cs, attribute.cs: Merged with the gmcs versions.
5751
5752 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5753
5754         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5755         not the null type.
5756
5757         Fix part of #79451
5758         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5759         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
5760         code slightly.
5761
5762 2006-09-22  Martin Baulig  <martin@ximian.com>
5763
5764         * ecore.cs: Merged with the gmcs version.
5765
5766         * generic.cs (ConstructedType): New dummy class.
5767         (TypeArguments): Don't make this abstract.
5768
5769         * typemanager.cs
5770         (TypeManager.IsGenericTypeDefinition): New method.
5771         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5772
5773 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5774
5775         * expression.cs (ComposedCast): Check for arrays of TypedReference
5776         before creating the type, not after.
5777
5778 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
5779
5780         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5781         after ToType change.
5782
5783         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5784         when constant must be implicitly convertible.
5785
5786         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5787
5788         * ecore.cs (NullCast): Derives from NullConstant.
5789
5790         * expression.cs (Is.DoResolve): Removed useless variables.
5791         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5792         (New.Constantify): Add enum support.
5793         (MemberAccess.DoResolve): Add warning when accessing null constant or
5794         variable.
5795
5796         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5797         property.
5798
5799         * literal.cs (NullConstant): New abstract class with common
5800         functionality for all null specializations.
5801         (NullDefault): Represents default(X) when result can be
5802         reduced to null.
5803         (NullLiteral): Updated.
5804
5805         * report.cs: Add new warning.
5806
5807 2006-09-21  Martin Baulig  <martin@ximian.com>
5808
5809         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5810
5811 2006-09-21  Martin Baulig  <martin@ximian.com>
5812
5813         * generic.cs (GenericConstraints): New dummy class.
5814         (Constraints): Likewise.
5815         (TypeParameter): Likewise.
5816         (TypeParameterName): Likewise.
5817         (GenericMethod): Likewise.
5818
5819         * typemanager.cs (TypeManager.GetGenericArguments): New method.
5820
5821         * decl.cs: Merged with the gmcs version.
5822
5823 2006-09-21  Raja R Harinath  <rharinath@novell.com>
5824
5825         * generic.cs (TypeParameter): Implement IMemberContainer.
5826         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
5827
5828         * rootcontext.cs: Unify with gmcs version.
5829
5830         * report.cs: Unify with gmcs version.
5831         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5832         from gmcs/generics.cs.
5833         * generics.cs (TypeParameter): New dummy class.
5834
5835         * support.cs: Unify with gmcs version.
5836
5837 2006-09-20  Raja R Harinath  <rharinath@novell.com>
5838
5839         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5840         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5841
5842         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5843         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5844         * mcs.exe.sources: Add generic.cs.
5845
5846         * codegen.cs: Unify with gmcs version.
5847
5848         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5849         (EmitContext): Add GenericDeclContainer implementation.
5850         * decl.cs (MemberCore, DeclSpace): Likewise.
5851         * namespace.cs: Remove #ifdef GMCS_SOURCE.
5852
5853         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5854         MCS TypeManager has a corresponding dummy method.
5855
5856 2006-09-19  Martin Baulig  <martin@ximian.com>
5857
5858         * expression.cs: Completely merged with the gmcs version.
5859
5860 2006-09-19  Martin Baulig  <martin@ximian.com>
5861
5862         * expression.cs (Invocation): Merged with the gmcs version.
5863         (ArrayAccess.GetStoreOpcode): Likewise.
5864
5865 2006-09-19  Martin Baulig  <martin@ximian.com>
5866
5867         * typemanager.cs
5868         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5869         (TypeManager.IsGenericMethodDefinition): Likewise.
5870
5871 2006-09-19  Martin Baulig  <martin@ximian.com>
5872
5873         * typemanager.cs
5874         (TypeManager.IsEqual): Moved the gmcs implementation here.
5875         (TypeManager.DropGenericTypeArguments): Likewise.
5876         (TypeManager.DropGenericMethodArguments): Likewise.
5877         (TypeManager.GetTypeArguments): Moved here from gmcs.
5878         (TypeManager.HasGenericArguments): Likewise.
5879
5880 2006-09-19  Martin Baulig  <martin@ximian.com>
5881
5882         * expression.cs (Binary): Merged with the gmcs version.
5883
5884 2006-09-19  Martin Baulig  <martin@ximian.com>
5885
5886         * expression.cs (Probe, As, Is): Merged with the gmcs version.
5887
5888 2006-09-19  Martin Baulig  <martin@ximian.com>
5889
5890         * typemanager.cs: Merged with the gmcs version.
5891
5892 2006-09-16  Raja R Harinath  <rharinath@novell.com>
5893
5894         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5895         * driver.cs: Likewise.
5896
5897 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
5898
5899         A fix for #79401
5900         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5901         only if parent type is class.
5902         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5903         update.
5904
5905 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
5906
5907         * cs-parser.jay,
5908         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5909         keywords are used.
5910         * typemanager.cs(CSharpName): Converts NullType to null.
5911
5912 2006-09-15  Martin Baulig  <martin@ximian.com>
5913
5914         * typemanager.cs
5915         (TypeManager.GetMethodName): Added mcs implementation.
5916         (TypeManager.IsEqual): Likewise.
5917
5918         * ecore.cs
5919         (SimpleName.RemoveGenericArity): Added dummy implementation.
5920
5921         * pending.cs: Merged with the gmcs version.     
5922
5923 2006-09-15  Martin Baulig  <martin@ximian.com>
5924
5925         * statement.cs: Merge with the gmcs version.
5926
5927 2006-09-15  Martin Baulig  <martin@ximian.com>
5928
5929         * statement.cs (Switch): Merge with the gmcs implementation
5930         (without nullables), which is newer.
5931
5932 2006-09-15  Martin Baulig  <martin@ximian.com>
5933
5934         * statement.cs (Block.Variables): Make this public.
5935         (ToplevelBlock.Parameters): Make this a property.
5936         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5937
5938 2006-09-15  Martin Baulig  <martin@ximian.com>
5939
5940         * namespace.cs: Merge with the gmcs version.
5941
5942 2006-09-15  Martin Baulig  <martin@ximian.com>
5943
5944         * decl.cs (MemberName): Minor code cleanups.
5945
5946 2006-09-15  Martin Baulig  <martin@ximian.com>
5947
5948         * parameter.cs: Merge with the gmcs version.
5949
5950 2006-09-15  Martin Baulig  <martin@ximian.com>
5951
5952         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5953         and an error in mcs.
5954
5955 2006-09-15  Martin Baulig  <martin@ximian.com>
5956
5957         * flowanalysis.cs: Merged from GMCS; added the generics code into
5958         a `GMCS_SOURCE' conditional so we can share this file.
5959
5960 2006-09-08  Martin Baulig  <martin@ximian.com>
5961
5962         * typemanager.cs (TypeManager.interlocked_type): New public field.
5963         (TypeManager.int_interlocked_compare-exchange): New public field.
5964         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5965         enumerator types here and call InitGenericCoreTypes().
5966         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5967         after calling InitEnumUnderlyingTypes().
5968
5969         * rootcontext.cs
5970         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5971         `classes_second_stage'. 
5972
5973 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
5974
5975         * assign.cs, ecore.cs, expression.cs: Share error message text.
5976         * class.cs (FieldMember.Define): Check for varible of static type.
5977         * driver.cs (LoadAssembly): Uses error output for errors.
5978         * statement.cs: Updated.
5979
5980 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
5981
5982         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5983         type instance.
5984
5985 2006-09-07  Martin Baulig  <martin@ximian.com>
5986
5987         * driver.cs
5988         (MainDriver): Revert r62663 from Marek; see #70506 for details.
5989
5990 2006-08-29  Miguel de Icaza  <miguel@novell.com>
5991
5992         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5993         
5994 2006-08-17  Miguel de Icaza  <miguel@novell.com>
5995
5996         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5997         #52019 and #79064, the use of the \uXXXX sequence in source code
5998         to represent unicode characters.
5999
6000 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
6001
6002         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
6003         support.
6004         * class.cs, ecore.cs, statement.cs: Merged to one error message.
6005
6006 2006-08-13  Miguel de Icaza  <miguel@novell.com>
6007
6008         * assign.cs: Catch attempts to assign to a method groups in += and
6009         report as 1656
6010
6011 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
6012
6013         A fix for #79056
6014         * cs-parser.jay: Don't destroy current array type by typeof of array's.
6015
6016 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
6017
6018         * class.cs (Method.Define): Issue a warning when generic method looks like
6019         an entry point.
6020         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
6021         as well.
6022
6023 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
6024  
6025         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
6026         looking for ctor.
6027         * decl.cs (MemberCache.FindMembers): When container is interface we need to
6028         search all base interfaces as a member can be ambiguous.
6029         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
6030         Constructor member type filter. 
6031         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
6032         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
6033         reporting for returned memberinfos.
6034         * report.cs: Updated.
6035         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
6036         version to work on all runtimes.
6037         (TypeManager.RealMemberLookup): Removed members filtering.
6038
6039 2006-08-08  Raja R Harinath  <rharinath@novell.com>
6040
6041         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
6042         (PropertyExpr.EmitAssign): Likewise.
6043         * expression.cs (Indirection.EmitAssign): Likewise.
6044         (LocalVariableReference.EmitAssign): Likewise.
6045         (ParameterReference.EmitAssign): Likewise.
6046         (Invocation.EmitArguments): Likewise.
6047         (ArrayAccess.EmitAssign): Likewise.
6048         (IndexerAccess.EmitAssign): Likewise.
6049         (This.EmitAssign): Likewise.
6050         (ConditionalLogicalOperator.Emit): Likewise.
6051
6052         Fix #79026
6053         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
6054         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
6055         leave it in after returning it.
6056         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
6057
6058 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
6059
6060         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
6061         message.
6062
6063 2006-08-03  Raja R Harinath  <rharinath@novell.com>
6064
6065         Fix cs0146-3.cs and cs0146-4.cs.
6066         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
6067         enclosing types don't depend on the current type.
6068
6069 2006-08-02  Raja R Harinath  <rharinath@novell.com>
6070
6071         Fix #77963
6072         * class.cs (TypeContainer.DoDefineMembers): Use
6073         FindBaseMemberWithSameName on Parent, since we're interested in
6074         whether we hide inherited members or not.
6075         (FindBaseMemberWithSameName): Make slightly more robust.
6076
6077         Fix the non-generic testcase from #77396
6078         * decl.cs (DeclSpace.DeclContainer): Remove override.
6079
6080         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
6081         declspaces for doppelgangers too.
6082         (UsingEntry): Implement IResolveContext.
6083         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
6084         'this' as the resolve context.
6085         (LocalAliasEntry): Likewise.
6086
6087         Implement parts of #77403
6088         * roottypes.cs (RootDeclSpace): New.  Used to represent the
6089         toplevel declaration space.  Each namespace declaration introduces
6090         a "partial" root declaretion space.
6091         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
6092         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
6093         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
6094         from 'current_namespace.SlaveDeclSpace'.
6095         (namespace_declaration): Likewise.
6096         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
6097         check.  It can't happen now.
6098         * decl.cs (DeclSpace.LookupType): Likewise.
6099         * driver.cs (MainDriver): Sanity check.
6100
6101 2006-08-01  Raja R Harinath  <rharinath@novell.com>
6102
6103         * decl.cs (DeclSpace.FindNestedType): Remove.
6104         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
6105         LookupTypeContainer to get the container of the nested type.
6106         * class.cs (TypeContainer.FindNestedType): Make non-override.
6107
6108 2006-07-31  Raja R Harinath  <rharinath@novell.com>
6109
6110         * decl.cs (DeclSpace.PartialContainer): Move field from ...
6111         * class.cs (TypeContainer.PartialContainer): ... here.
6112         (TypeContainer.AddBasesForPart): New helper.
6113         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
6114         instead.
6115         * cs-parser.jay (current_class): Convert to DeclSpace.
6116         (struct_declaration, interface_declaration, class_declaration):
6117         Use AddBasesForPart instead of .Bases directly.
6118         * const.cs, iterators.cs: Update to changes.
6119
6120 2006-07-28  Raja R Harinath  <rharinath@novell.com>
6121
6122         * class.cs (TypeContainer.AddMemberType): Rename from
6123         AddToTypeContainer.
6124         (TypeContainer.AddMember): Rename from AddToMemberContainer.
6125         (AddTypeContainer): New.  Combine AddClassOrStruct and
6126         AddInterface.
6127         (AddPartial): Update.  Add 'is_partial' argument.
6128         * roottypes.cs: Update to changes.
6129         * cs-parser.jay (push_current_class): New helper for handling
6130         current_container and current_class.
6131         (struct_declaration, interface_declaration, class_declaration):
6132         Use it.
6133
6134 2006-07-26  Raja R Harinath  <rharinath@novell.com>
6135
6136         * roottypes.cs: Rename from tree.cs.
6137
6138         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
6139         * tree.cs (Tree, ITreeDump): Remove types.
6140         * rootcontext.cs (tree, Tree): Remove fields.
6141         (root, ToplevelTypes): New.
6142         * *.cs: Update to rename.
6143
6144         * tree.cs (Tree.RecordDecl): Remove.
6145         (RootTypes.AddToTypeContainer): Record the toplevel type in its
6146         namespace here.
6147         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
6148
6149 2006-07-23  Raja R Harinath  <harinath@gmail.com>
6150
6151         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
6152         DoFlowAnalysis and OmitStructFlowAnalysis here.
6153         (ec.With): Rename from WithUnsafe and generalize.
6154         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
6155         (ec.WithFlowAnalyis): New.
6156         * ecore.cs, expression.cs, statement.cs: Update.
6157
6158 2006-07-22  Raja R Harinath  <harinath@gmail.com>
6159
6160         * statement.cs (Block.ResolveMeta): Simplify slightly.
6161
6162         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
6163         multiple boolean fields.  Convert InUnsafe, constant_check_state,
6164         check_state to flags.
6165         (CheckState, ConstantCheckState): Update.
6166         (InUnsafe): New read-only property.
6167         (FlagsHandle): Rename from CheckStateHandle and convert to handle
6168         arbitrary flags.
6169         (WithUnsafe): New helper similar to WithCheckState.
6170         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
6171         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
6172
6173 2006-07-21  Raja R Harinath  <rharinath@novell.com>
6174
6175         Make comparisons use the same IL irrespective of whether they're
6176         in a 'checked' or 'unchecked' context: one of the issues in #78899
6177         * codegen.cs (EmitContext.CheckState): Make read-only property.
6178         (EmitContext.ConstantCheckState): Likewise.
6179         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
6180         helper that implement a save/restore stack for CheckState
6181         values.  This is the only way to change check-state.
6182         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
6183         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
6184         (CheckedExpr.EmitBranchable): New forwarding method.
6185         (UnCheckedExpr): Likewise.
6186         * statement.cs (Block.ResolveMeta): Use WithCheckState.
6187         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
6188         (Checked.Resolve, checked.DoEmit): Likewise.
6189
6190 2006-07-20  Miguel de Icaza  <miguel@novell.com>
6191
6192         * anonymous.cs: Cache the resolved anonymous delegate, and return
6193         this so that the ResolveTopBlock is only triggered once, not
6194         twice.
6195
6196         Currently we trigger ResolvetopBlock twice due to a first pass of
6197         argument check compatibility, and a second pass that does the
6198         actual resolution.   
6199         
6200 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
6201
6202         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
6203         modifiers.
6204         * rootcontext.cs (Reset): Add helper_classes.
6205
6206 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
6207
6208         A fix for #78860
6209         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
6210         correctly.
6211
6212 2006-07-13  Miguel de Icaza  <miguel@novell.com>
6213
6214         * statement.cs (Lock): Handle expressions of type
6215         TypeManager.null_type specially.  Fixes #78770
6216
6217 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
6218
6219         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
6220         to an event.
6221
6222 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
6223
6224         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
6225         for accessors as well.
6226         * ecore.cs (EventExpr): Add AccessorTable.
6227
6228 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
6229
6230         A fix for #78738
6231         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
6232         for CS0122 where appropriate.
6233         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
6234         level attributes.
6235         (Filter): Assembly can be null in the case of top level attributes.
6236
6237 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
6238
6239         A fix for #78690
6240
6241         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
6242         is done at global level.
6243
6244 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
6245
6246         A fix for #77002, Implemented TypeForwarder support.
6247
6248         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
6249         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
6250         * typemanager.cs (): Add type_forwarder_attr_type.
6251
6252 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
6253
6254         * report.cs: Add CS0469 warning.
6255
6256 2006-06-21  Martin Baulig  <martin@ximian.com>
6257
6258         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
6259         the `try'-block, so we also report CS0016 etc. there.
6260
6261 2006-06-21  Martin Baulig  <martin@ximian.com>
6262
6263         * delegate.cs
6264         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
6265
6266 2006-06-21  Martin Baulig  <martin@ximian.com>
6267
6268         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
6269         also report CS1686 for parameters.
6270
6271 2006-06-21  Martin Baulig  <martin@ximian.com>
6272
6273         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
6274         instead of an error if the value is not implicitly convertible to
6275         the switch types; fixes #77964.
6276
6277 2006-06-21  Raja R Harinath  <rharinath@novell.com>
6278
6279         Fix #78673
6280         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
6281         FieldBuilder is null.
6282
6283         Fix #78662
6284         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
6285         'left' and 'right' before error-checking.
6286
6287 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
6288
6289         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
6290         Fixed bug #78601.
6291         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
6292         (FieldExpr.DoResolve): likewise.
6293         (PropertyExpr.InstanceResolve): likewise.
6294         (EventExpr.InstanceResolve): likewise. 
6295
6296 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
6297
6298         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
6299         attribute applicable tests for attribute argument.
6300
6301 2006-06-02  Raja R Harinath  <rharinath@novell.com>
6302
6303         Fix #78079
6304         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
6305         (Binary.OverloadResolve_PredefinedIntegral): New.
6306         (Binary.OverloadResolve_PredefinedFloating): New.
6307         (Binary.OverloadResolve_PredefinedString): New.
6308         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
6309         Follow the standard more closely, and treat numeric promotions in
6310         terms of overload resolution.
6311         (Binary.CheckShiftArguments): Simplify.
6312
6313 2006-06-01  Raja R Harinath  <rharinath@novell.com>
6314
6315         * flowanalysis.cs (MyBitVector): Simplify representation.
6316         (MyBitVector.Clone): Avoid allocating BitArray.
6317         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
6318         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
6319         (*): Update.  Change all references to MyBitVector.And and
6320         MyBitVector.Or to &= and |=.
6321
6322 2006-05-29  Raja R Harinath  <rharinath@novell.com>
6323
6324         Fix cs0231-[34].cs.
6325         * cs-parser.jay (formal_parameter_list): Extend the pattern below
6326         to param arguments too.
6327
6328 2006-05-26  Miguel de Icaza  <miguel@novell.com>
6329
6330         * cs-parser.jay: Catch another parsing form for arglist being
6331         followed by other arguments.  Fixes #78313.
6332
6333 2006-05-24  Raja R Harinath  <rharinath@novell.com>
6334
6335         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6336         checking of out parameters to ...
6337         (FlowBranchingToplevel.Merge): ... here.
6338         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6339         set, propagate the origin upward, and only complain if there was
6340         no other error.
6341         (FlowBranchingException.AddContinueOrigin): Likewise.
6342         (FlowBranchingException.AddReturnOrigin): Likewise.
6343         (FlowBranchingException.AddGotoOrigin): Likewise.       
6344
6345 2006-05-23  Raja R Harinath  <rharinath@novell.com>
6346
6347         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6348         unreachable, skip it.
6349         (FlowBranchingException.Merge): Always propagate jumps, even if
6350         the finally block renders subsequent code unreachable.
6351
6352 2006-05-18  Raja R Harinath  <rharinath@novell.com>
6353
6354         Fix #77601
6355         * statement.cs (Goto.Resolve): Move responsibility for resolving
6356         'goto' to FlowBranching.AddGotoOrigin.
6357         (Goto.SetResolvedTarget): New.  Callback to set the
6358         LabeledStatement that's the target of the goto.
6359         (Goto.DoEmit): Use Leave instead of Br when crossing an
6360         unwind-protect boundary.
6361         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6362         LookupLabel and adjust to new semantics.
6363         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6364         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6365         Goto.SetResolvedTarget to update target.
6366         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6367         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6368         AddBreakOrigin & co.  Delay propagation until ...
6369         (FlowBranchingException.Merge): ... this.
6370
6371         * statement.cs (Block.Resolve): Always depend on flow-branching to
6372         determine unreachability.  Kill workaround that originally emitted
6373         only one statement after an "unreachable" label (see infloop in
6374         test-515.cs).
6375
6376         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6377         This is still "wrong", but anything better would probably need a
6378         multi-pass algorithm.
6379         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6380         usage vector.  Force current usage vector to be reachable, to
6381         optimistically signify backward jumps.
6382         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6383         detected.
6384         (FlowBranchingLabeled.Merge): New.  If no backward jump was
6385         detected, return the original salted-away usage vector instead,
6386         updated with appropriate changes.  Print unreachable warning if
6387         necessary.
6388         * statement.cs (Block.Resolve): Don't print unreachable warning on
6389         a labeled statement.
6390
6391 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
6392
6393         * driver.cs: Pass filename without path to AssemblyBuilder's 
6394         AddResourceFile. Fixes bug #78407.
6395
6396 2006-05-17  Raja R Harinath  <rharinath@novell.com>
6397
6398         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6399         * flowanalysis.cs (FlowBranchingLabeled): ... here.
6400         (FlowBranching.MergeChild): Overwrite
6401         reachability information from Labeled branchings too.
6402
6403 2006-05-16  Raja R Harinath  <rharinath@novell.com>
6404
6405         * statement.cs (Goto.Resolve): Merge jump origins here ...
6406         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6407
6408         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6409         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
6410         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
6411         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6412         here, ...
6413         * statement.cs (Goto.Resolve): ... not here.
6414         (Goto.Emit): Remove CS1632 check.
6415
6416 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
6417
6418         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6419         error message.
6420
6421 2006-05-11  Raja R Harinath  <rharinath@novell.com>
6422
6423         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6424         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6425         (FlowBranchingException.Label): Likewise.
6426
6427         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
6428         given value.
6429         (MyBitVector.Or): Use it to avoid losing information (Count).
6430         (FlowBranching.MergeOrigins): Likewise.
6431
6432         * flowanalysis.cs (UsageVector.IsDirty): Remove.
6433         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6434         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6435         (UsageVector.ToString): Simplify.
6436         (UsageVector.MergeSiblings): Move here from ...
6437         (FlowBranching.Merge): ... here.
6438         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6439         not a MyBitVector.
6440
6441 2006-05-10  Raja R Harinath  <rharinath@novell.com>
6442
6443         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6444         null bitvector is treated as all-true.
6445
6446         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6447         (MyBitVector): Rationalize invariants.  'vector != null' implies
6448         that we have our own copy of the bitvector.  Otherwise,
6449         'InheritsFrom == null' implies all inherited bits are true.
6450
6451 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
6452
6453         * statement.cs (LocalInfo): Add IsConstant.
6454         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6455         local variable for constants.
6456
6457 2006-05-09  Raja R Harinath  <rharinath@novell.com>
6458
6459         * flowanalysis.cs (MyBitVector.Empty): New.
6460         (MyBitVector): Don't allow InheritedFrom to be null.
6461         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6462         (UsageVector, FlowBranching): Update to changes.
6463
6464         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6465         recursion.  The 'Parent == null' condition isn't sufficient for
6466         anonymous methods.
6467         (FlowBranching.AddBreakOrigin): Likewise.
6468         (FlowBranching.AddContinueOrigin): Likewise.
6469         (FlowBranching.AddReturnOrigin): Likewise.
6470         (FlowBranching.StealFinallyClauses): Likewise.
6471         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6472         (FlowBranching.CheckOutParameters): Likewise.
6473         (FlowBranchingToplevel): Terminate all the above recursions here.
6474         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6475         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6476
6477         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
6478         toplevel block.
6479         (FlowBranchingToplevel): New.  Empty for now.
6480         (FlowBranching.MergeTopBlock): Update.
6481         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6482         branching for the anonymous delegate.
6483         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6484
6485         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6486         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6487         information at the start of the merge.  Reorganize.
6488
6489 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6490
6491         * class.cs (MethodData.Define): Method cannot implement interface accessor.
6492
6493 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6494
6495         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6496         to newly introduced ctor.
6497
6498         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6499         message to one place.
6500         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6501         global namespace.
6502
6503 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6504
6505         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6506
6507         * ecore.cs (Expression.ResolveAsConstant): Updated.
6508
6509         * statement.cs (ResolveMeta): Updated.
6510
6511 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6512
6513         * cs-parser.jay: __arglist cannot be used in initializer.
6514
6515 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6516
6517         A fix for #77879
6518         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6519         private types.
6520
6521 2006-05-05  Raja R Harinath  <rharinath@novell.com>
6522
6523         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6524         (LabeledStatement): Add 'name' parameter.
6525         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6526         (Block.AddLabel): Update to changes.
6527         * cs-parser.jay (labeled_statement): Likewise.
6528
6529         * flowanalysis.cs (BranchingType.Labeled): New.
6530         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6531         (FlowBranchingLabeled): New.  Does nothing for now, but will
6532         eventually handle 'goto' flows.
6533         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6534         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6535         that's terminated ...
6536         (Block.Resolve): ... here.
6537
6538         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6539         (UsageVector.MergeFinallyOrigins): Likewise.
6540         (FlowBranching.InTryOrCatch): Likewise.
6541         (FlowBranching.AddFinallyVector): Likewise.
6542         (FlowBranchingException): Update to changes.
6543
6544         Fix #78290
6545         * statement.cs (Return.Resolve): Move error checking to ...
6546         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6547         (FlowBranchingException): Handle return origins like break and
6548         continue origins.
6549         (FlowBranching.UsageVector.CheckOutParameters): Remove.
6550
6551 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6552
6553         A fix for #76122
6554         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6555         filter.
6556
6557 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6558
6559         A fix for #77543
6560         * class.cs (MethodData.Define): Do public accessor check only when method
6561         implements an interface.
6562
6563 2006-05-04  Raja R Harinath  <rharinath@novell.com>
6564
6565         Remove special handling of 'break'
6566         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6567         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
6568         (UsageVector.Break): Remove.
6569         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6570         reachability.
6571         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6572
6573         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6574         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
6575
6576 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6577
6578         A fix for #75726
6579         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6580         be the interface member.
6581
6582 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6583
6584         A fix for #60069
6585         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6586         for emitting small (int) values.
6587
6588 2006-05-03  Raja R Harinath  <rharinath@novell.com>
6589
6590         Fix #59427
6591         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6592         control-flow passes through the 'finally' after merging-in all the
6593         control-flows from 'try' and the 'catch' clauses.
6594
6595         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6596         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
6597         always true at the only non-recursive entry point.
6598         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6599         FlowBranchingBreakable.
6600         (FlowBranchingLoop): Remove.
6601         * statement.cs (Return.DoResolve): Update to changes.
6602
6603         Fix #76471, #76665
6604         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6605         (FlowBranching.CreateBranching): Handle it: create a
6606         FlowBranchingContinuable.
6607         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6608         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6609         except that it handles the 'continue' command.
6610         (FlowBranching.UsageVector.MergeOrigins): Rename from
6611         MergeBreakOrigins.
6612         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6613         except that it overrides AddContinueOrigin.
6614         (FlowBranchingException): Override AddContinueOrigin, similar to
6615         AddBreakOrigin.
6616         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6617         Create a new branching around the embedded statement.
6618         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
6619         control flow after the embedded statement.
6620         (Continue.Resolve): Move all error checking to AddContinueOrigin.
6621
6622         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6623         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6624         FlowBranchingBreakable.
6625         (FlowBranchingSwitch): Remove.
6626
6627         Fix test-503.cs
6628         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
6629         error reporting to ...
6630         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6631         Rename from 'AddBreakVector'.  Add new location argument.  Return
6632         a bool indicating whether the 'break' crosses an unwind-protect.
6633         (FlowBranchingException.AddBreakOrigin): Add.
6634         (FlowBranchingException.Merge): Propagate 'break's to surrounding
6635         flowbranching after updating with the effects of the 'finally'
6636         clause.
6637         (FlowBranchingBreakable): New common base class for
6638         FlowBranchingLoop and FlowBranchingSwitch.
6639
6640         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6641         embedded statement.
6642         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6643
6644 2006-05-02  Raja R Harinath  <rharinath@novell.com>
6645
6646         * statement.cs (Do.Resolve): If the loop is infinite, set the
6647         barrier.
6648         (While.Resolve, For.Resolve): Set a barrier after the embedded
6649         statement.  There's no direct control flow that goes from the end
6650         of the embedded statement to the end of the loop.
6651         * flowanalysis.cs (FlowBranching.Infinite): Remove.
6652         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
6653         above ensure that the reachability is correctly computed.
6654
6655         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6656         (UsageVector.MergeBreakOrigins): If the current path is
6657         unreachable, treat it as if all parameters/locals are initialized.
6658         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
6659         infinite loops before merging-in break origins.
6660
6661         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6662         (Reachability.Reachable): Split part into ...
6663         (Reachability.Unreachable): ... this.  Simplify.
6664         (Reachability.IsUnreachable): Use 'Unreachable' instead.
6665
6666         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6667         (Reachability.SetThrowsSometimes): Likewise.
6668         (FlowBranchingBlock.MergeTopBlock): Don't compare against
6669         TriState.Always, use corresponding property.
6670         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6671         (Block.Resolve): Likewise.  Remove some redundant checks.
6672
6673 2006-05-02  Raja R Harinath  <harinath@gmail.com>
6674
6675         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6676         (Reachability.Meet): Don't bother checking AlwaysThrows --
6677         barrier is always set.
6678         (FlowBranchingBlock.Merge): Likewise.
6679
6680 2006-05-01  Raja R Harinath  <harinath@gmail.com>
6681
6682         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6683         checks for unreachable.
6684
6685 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
6686
6687         A fix for #77980
6688         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6689
6690         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6691         whether field is really assigned.
6692
6693 2006-04-30  Raja R Harinath  <harinath@gmail.com>
6694
6695         * flowanalysis.cs (Reachability): Make 4-argument constructor
6696         private.
6697         (Reachability.Meet): Rename from 'And'.  Remove static variant.
6698         (Reachability.Always): Rename from the highly misleading
6699         'Reachability.Never'.
6700         (FlowBranching.Merge): Update to changes.  Mark an impossible
6701         situation with a 'throw'.
6702         (*): Update to changes.
6703
6704 2006-04-29  Raja R Harinath  <harinath@gmail.com>
6705
6706         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6707         Remove 'Undefined'.
6708         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6709         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6710         (*): Update to changes.
6711         * statement.cs: Update to changes.
6712
6713 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
6714
6715         A fix for #78049
6716         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6717
6718 2006-04-28  Raja R Harinath  <harinath@gmail.com>
6719
6720         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6721         dummy UsageVector.
6722
6723         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6724         argument to two arguments: an usage-vector and a bool.  Move call
6725         to FlowBranching.Merge () ...
6726         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6727
6728         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6729         handling of loop and switch reachability to ...
6730         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6731
6732 2006-04-27  Raja R Harinath  <harinath@gmail.com>
6733
6734         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6735         handling to FlowBranchingLoop.InLoop.
6736         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6737
6738 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
6739
6740         A fix for #78115
6741         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6742         anonymous method is allowed from AnonymousContainer here.
6743
6744         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6745
6746 2006-04-24  Raja R Harinath  <rharinath@novell.com>
6747
6748         Fix #78156
6749         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6750
6751 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
6752
6753         A fix for #49011.
6754         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6755         (DoubleConstant.Reduce): Ditto.
6756
6757 2006-04-23  Raja R Harinath  <rharinath@novell.com>
6758
6759         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6760         Remove 'lvalue_right_side' argument.  Move parts to ...
6761         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6762         (LocalVariable.DoResolveLValue): ... these.
6763
6764 2006-04-21  Raja R Harinath  <rharinath@novell.com>
6765
6766         Fix cs1655.cs
6767         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6768         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6769         (LocalVariableReference.DoResolveBase): Use it to implement new
6770         CS1655 check.
6771         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6772         (Argument.Resolve): Simplify.  Move CS1510 check ...
6773         * ecore.cs (Expression.ResolveLValue): ... here.
6774         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6775         (PropertyExpr.DoResolveLValue): Likewise.
6776         (FieldExpr.Report_AssignToReadonly): Likewise.
6777         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
6778         LValueMemberAccess or LValueMemberOutAccess on instance depending
6779         on it.
6780         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6781         DoResolve as appropriate.
6782
6783 2006-04-20  Raja R Harinath  <rharinath@novell.com>
6784
6785         Fix #75800
6786         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6787         implicit conversions on 'out' and 'ref' arguments.
6788
6789         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6790         improve clarity.  Remove dead code.
6791
6792         Fix #66031
6793         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6794         (Catch.Resolve): Resolve VarBlock if it exists.
6795
6796 2006-04-19  Miguel de Icaza  <miguel@novell.com>
6797
6798         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6799         twice, this was some residual code, the enumerator was emitted
6800         properly in the two branche of if later.
6801
6802 2006-04-19  Raja R Harinath  <rharinath@novell.com>
6803
6804         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
6805         cast is never an lvalue.
6806         (Cast.DoResolve, Cast.ResolveRest): Combine.
6807         (Argument.Emit): Simplify slightly.  Move 'Expr is
6808         IMemoryLocation' check ...
6809         (Argument.Resolve): ... here.
6810         (Argument.Error_LValueRequired): Remove.  Inline into only user.
6811
6812         Simplifications.  Fix cs0191-2.cs
6813         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6814         CS1649 and CS1651 to ...
6815         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
6816         the actual selection of the error code and message to a lookup
6817         table.  Add a dummy return value to simplify callsites.
6818         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6819         readonly fields of other instances of the same type.  Move CS0197
6820         warning from ...
6821         * expression.cs (Argument.Resolve): ... here.  Simplify code.
6822         Ensure that ec.InRefOutArgumentResolving is only set during LValue
6823         resolution of an out or ref argument.  The code simplification
6824         above uses this invariant.
6825
6826 2006-04-18  Raja R Harinath  <rharinath@novell.com>
6827
6828         Possibly fix #77752.  Fix cs1690-[4-7].cs.
6829         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6830         CheckMarshallByRefAccess.  Drop parameter.
6831         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
6832         warning.
6833         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6834         InstanceExpression.
6835         * report.cs (AllWarnings): Add CS1690.
6836         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6837         for ref access too.
6838         (LocalVariableReference.DoResolveBase): Update.
6839
6840 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6841
6842         * class.cs (MethodOrOperator): Moved common parts from method class.
6843         detect obsolete attributes.
6844         (Method.Define): Simplified as it reuses code from base.
6845         (Constructor.ValidAttributeTargets): Fixed issue found during
6846         refactoring.
6847         (Destructor.ValidAttributeTargets): Fixed issue found during
6848         refactoring.
6849         (Operator): Finished refactoring set off by #78020. Operator class is now
6850         ordinary method class.
6851
6852         * anonymous.cs: Updated.
6853
6854         * decl.cs (DeclSpace): Add IsGeneric
6855
6856 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6857
6858         * class.cs (Constructor.Emit): Don't emit the attributes twice.
6859
6860 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6861
6862         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6863         detect obsolete attributes.
6864         (Method.CreateEmitContext): Moved to MethodOrOperator.
6865
6866 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6867
6868         A fix for #78048.
6869         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6870         customized exception to make crash detection easier.
6871         (MethodOrOperator): Started to work on new base class for methods and
6872         operators.
6873         (Method): Derives from MethodOrOperator.
6874         (Constructor.Emit): Emits its own attributes.
6875         (AbstractPropertyEventMethod.Emit): Ditto.
6876         (Operator): Derives from MethodOrOperator, will refactor fully in extra
6877         patch.
6878         (Operator.Emit): It's temporary more tricky than should be.
6879         
6880         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6881
6882         * report.cs (InternalErrorException): Add ctor with inner exception.
6883
6884 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
6885
6886         A fix for #76744.
6887         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6888         only not visible.
6889
6890 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
6891
6892         A fix for #77916.
6893         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6894         array.
6895
6896 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6897
6898         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6899         attribute is present and Guid not.
6900         (Interface.ApplyAttributeBuilder): Ditto.
6901
6902         * attribute.cs: Add error message.
6903
6904 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6905
6906         A fix for #78020.
6907
6908         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6909         sources (it's composite) so hold them in extra array as they are used in
6910         Emit phase only. It worked in the previous versions by mistake.
6911         (Attribute.Emit): Emit attribute for more owners when exist.
6912
6913         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6914         it has now different behaviour.
6915
6916 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
6917
6918         * constant.cs (Constant.IsDefaultInitializer): New method.
6919
6920         * class.cs: Updated.
6921
6922         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6923         re-initialize default values. It saves KBs almost for every assembly.
6924         Thanks Zoltan for the idea.
6925         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6926         (ArrayCreation.DoResolve): Resolve only once.
6927         (ArrayCreation.Emit): Emit static initializer only when it is faster.
6928         (ArrayCreation.GetAttributableValue): Cope with optimized values.
6929
6930 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
6931
6932         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6933         From #77961.
6934
6935 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6936
6937         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6938         in an embedded statement too.
6939
6940 2006-04-01  Raja R Harinath  <rharinath@novell.com>
6941
6942         Fix #77958
6943         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6944
6945 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6946
6947         A fix for #77966.
6948
6949         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6950         was not specified.
6951
6952         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6953
6954 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
6955
6956         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6957         phase.
6958
6959         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6960         LocalTemporary change.
6961
6962         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6963         TypeContainer.
6964         (ClassOrStruct.DefineFieldInitializers): Implemented static field
6965         initializers optimization.
6966         (ClassOrStruct.TypeAttr): Moved from modifiers.
6967         (Constructor.CheckBase): Don't crash when static ctor has parameters.
6968         (FieldBase.ResolveInitializer): Resolves initializer.
6969         (FieldBase.HasDefaultInitializer): New property.
6970
6971         * cs-parser.jay: Removed message.
6972
6973         * expression.cs (CompilerGeneratedThis): New specialization.
6974
6975         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6976
6977 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
6978
6979         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6980
6981 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6982
6983         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6984         be now EnumConstants only.
6985
6986 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6987
6988         * attribute.cs, driver.cs: Reset more caches.
6989
6990 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6991
6992         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6993
6994 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6995
6996         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6997         for easier reuse. Updated all overrides.
6998         (IntegralConstant): New base class for all integral constants.
6999         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
7000         of the constant range, report custom error.
7001         (UIntConstant.Reduce): Fixed uint conversion.
7002
7003         * ecore.cs, literal.cs: Reduce updates.
7004
7005 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
7006
7007         A fix for #75813.
7008
7009         * class.cs (Constructor.Define): Removed extra if for default ctors.
7010         A patch from Atsushi Enomoto.
7011
7012 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
7013
7014         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
7015         GetAttributableValue.
7016
7017         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
7018         when required.
7019
7020         * convert.cs (ImplicitConversionRequired): Error message moved to
7021         DoubleLiteral.
7022
7023         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
7024         automatic implicit conversion of an output value.
7025         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
7026
7027         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
7028         conversion.
7029         (TypeOf.GetAttributableValue): Add extra handling for object type.
7030
7031         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
7032         special error message.
7033
7034 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
7035
7036         * class.cs (Constructor.Emit): Don't crash when struct ctor is
7037         InternalCall.
7038         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
7039         compatible with MS runtime.
7040
7041 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
7042
7043         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
7044         attribute arguments here.
7045
7046         * class.cs (Indexer.Define): The check was moved to attribute class.
7047
7048 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
7049
7050         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
7051         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
7052         easier.
7053
7054 2006-03-22  Raja R Harinath  <rharinath@novell.com>
7055
7056         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
7057         mcs to keep code differences small.
7058         * attribute.cs (Attribute.GetParameterDefaultValue): New.
7059         * typemanager.cs (parameter_default_value_attribute_type): New.
7060         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
7061         CS1908 check.
7062
7063 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
7064
7065         * expression.cs (StringConcat.Append): Reverted back to no warning state.
7066
7067 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
7068
7069         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
7070
7071         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
7072         the blocks too.
7073
7074 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
7075
7076         * doc-bootstrap.cs : fix build.
7077
7078 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
7079
7080         * expression.cs (StringConcat.Append): Issue a warning when empty string
7081         is going to append.
7082
7083 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
7084
7085         * assign.cs (CompoundAssign.ResolveSource): Removed.
7086
7087         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
7088         clean up.
7089
7090         * class.cs (TypeContainer.FindMethods): Removed.
7091         (TypeContainer.CheckMemberUsage): Made static.
7092
7093         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
7094
7095         * constant.cs (CheckRange): Removed unused type argument.
7096         (CheckUnsigned): Removed unused type argument.
7097
7098         * cs-parser.jay: Updated after MemberAccess clean up.
7099         Uses Length for empty string test.
7100
7101         * cs-tokenizer.cs: Uses Length for empty string test.
7102         (IsCastToken): Made static.
7103         (is_hex): Made static.
7104         (real_type_suffix): Made static.
7105
7106         * decl.cs (SetupCache): Made static.
7107         (OnGenerateDocComment): Removed unused ds argument.
7108
7109         * delegate.cs (VerifyDelegate): Removed unused argument.
7110
7111         * doc.cs: Uses Length for empty string test.
7112
7113         * driver.cs: Uses Length for empty string test.
7114
7115         * enum.cs (IsValidEnumType): Made static
7116
7117         * expression.cs (EnumLiftUp): Removed unused argument.
7118         (ResolveMethodGroup): Ditto.
7119         (BetterConversion): Ditto.
7120         (GetVarargsTypes): Ditto.
7121         (UpdateIndices): Ditto.
7122         (ValidateInitializers): Ditto.
7123         (MemberAccess.ctor): Ditto.
7124         (GetIndexersForType): Ditto.
7125
7126         * flowanalysis.cs: (MergeFinally): Removed unused argument.
7127
7128         * iterators.cs: Updated after MemberAccess clean up.
7129
7130         * location.cs: Uses Length for empty string test.
7131
7132         * namespace.cs: Uses Length for empty string test.
7133
7134          * report.cs (CheckWarningCode): Made static.
7135
7136         * statement.cs (LabeledStatement): Removed unused argument.
7137
7138         * typemanager.cs (FilterNone): Removed.
7139
7140 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7141
7142         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
7143         obsolete.
7144
7145         * class.cs: Updated.
7146
7147 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7148
7149         * cs-parser.jay.cs: __arglist is not allowed for delegates.
7150
7151 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7152
7153         A fix for #77822.
7154
7155         * expression.cs (VerifyArgumentsCompat): Reverted to double error
7156         reporting, it's more tricky than I thought.
7157
7158 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7159
7160         A fix for #77816.
7161
7162         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
7163         host container.
7164         (AnonymousMethod.ImplicitStandardConversionExists): New method.
7165         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
7166         Add more error reporting; Fixed issue with params.
7167
7168         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
7169
7170         * cs-parser.jay: AnonymousMethod requires host container.
7171
7172         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
7173
7174 2006-03-18  Raja R Harinath  <harinath@gmail.com>
7175
7176         * class.cs: Change 'TypeContainer ds' constructor argument to
7177         'DeclSpace parent'.  Some classes were missed below due to
7178         different naming convention.
7179
7180         * class.cs (MemberCore.Parent): Delete.  This makes the
7181         ParentContainer changes below enforceable by the compiler.
7182
7183         Treat pointers to enclosing declaration space as 'DeclSpace', not
7184         'TypeContainer'.
7185         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
7186         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
7187
7188         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
7189         of TypeContainer.
7190         (Block.AddThisVariable): Likewise.
7191         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
7192         (AbstractPropertyEventMethod.Emit): Likewise.
7193         (AbstractPropertyEventMethod.EmitMethod): Likewise.
7194         (GetMethod.Define, SetMethod.Define): Likewise.
7195         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
7196         (DelegateMethod.EmitMethod): Likewise.
7197
7198         Fix regression test-partial-13.cs.
7199         Rationalize use of PartialContainer.  Ensure that the partial
7200         class semantics can be tied to type-correctness, i.e., any
7201         violation will cause a compile error.
7202         * class.cs, const.cs: Access all fields that belong to class
7203         TypeContainer via ParentContainer.  Arguments of EmitContexts and
7204         Resolve()-like functions still use 'Parent'.
7205
7206         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
7207         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
7208         (PropertyMethod.CheckModifiers): Remove unused argument.
7209         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
7210         DeclSpace.
7211
7212 2006-03-17  Raja R Harinath  <harinath@gmail.com>
7213
7214         Make semantics of PartialContainer simpler.
7215         * decl.cs (DeclSpace.IsPartial): Remove.
7216         * class.cs (TypeContainer.IsPartial): Likewise.
7217         (TypeContainer..ctor): Set PartialContainer to point to self.
7218         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
7219         (TypeContainer.FindNestedType): Likewise.
7220         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
7221
7222 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
7223
7224         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
7225
7226 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
7227
7228         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
7229         classes.
7230
7231 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
7232
7233         * class.cs (Operator.Define): An error for base conversion was not
7234         reported correctly.
7235
7236 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
7237
7238         * iterator.cs : yield break is allowed in try statement which has
7239           catch clauses. Fixed bug #77767.
7240
7241 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
7242
7243         A fix for #77593, #77574.
7244
7245         * class.cs (MethodCore.CheckBase): Another if for operator.
7246
7247 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
7248
7249         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
7250         were not resolved
7251
7252         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
7253         (DelegateCreation.ImplicitStandardConversionExists): New method for just
7254         conversion test.
7255         
7256         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
7257         not needed.
7258
7259         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
7260         Updated after another emitcontext usage was clean up. It should help us to
7261         synchronize with gmcs easier.
7262
7263 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
7264
7265         A fix for #77353.
7266
7267         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
7268         (Event.Define): ditto
7269         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
7270
7271         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
7272         Removed redundant code and set NewSlot for Invoke method too.
7273
7274         * parameter.cs (Parameters.ctor): Add custom, type ctor.
7275         (Parameters.MergeGenerated): New method. Use this method when you merge
7276         compiler generated argument with user arguments.
7277
7278 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
7279
7280         * attribute.cs (ResolveAsTypeTerminal): Removed.
7281
7282         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
7283         specialization for predefined types; 30% speed up.
7284         Finally placed obsolete check to right place.
7285         (Expression.ResolveType): Removed.
7286
7287         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
7288         Updated after ResolveType was removed.
7289
7290         * expression.cs (Cast.ctor): Check void cast.
7291         (Binary.ResolveAsTypeTerminal): Is never type.
7292         (Conditional.ResolveAsTypeTerminal): Is never type.
7293
7294         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
7295
7296 2006-03-01  Raja R Harinath  <rharinath@novell.com>
7297
7298         Fix #77679.
7299         * expression.cs (ParameterReference.DoResolveBase): Change return
7300         type to bool.
7301         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
7302         Update.
7303
7304         Fix #77628.
7305         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
7306
7307         Fix #77642.
7308         * typemanager.cs (GetFullNameSignature): Don't nullref on
7309         protected accessors.
7310
7311 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
7312
7313         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
7314         these two separated members to simplify the code.
7315         (Attribute.Resolve): Refactored to use new fields and methods.
7316         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
7317         implemented obsolete attribute checking.
7318         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
7319         implemented obsolete checking again. It look line never ending quest ;-)
7320         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
7321
7322         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
7323
7324         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
7325
7326         *class.cs (Property.Define): Add RegisterProperty call.
7327
7328         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
7329         argument groups (only 2).
7330
7331         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7332         encoding expression to arguments.
7333         (Expression.ExprClassToResolveFlags): Just turned to property.
7334
7335         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7336         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7337         optimized as well as implemented support for zero-length attributes.
7338
7339         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7340         Add caching of PropertyInfo's.
7341
7342 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7343
7344         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7345         error multiple times.
7346
7347 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7348
7349         New partial class implementation.
7350         A fix for #77027, #77029, #77403
7351
7352         * attribute.cs (Attributable): Made attributes protected.
7353
7354         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7355         the replacements of ClassPart and PartialContainer.
7356         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7357         (TypeContainer.AddInterface): Ditto.
7358         (TypeContainer.AddPartial): The main method for partial classes. It checks
7359         for errors and merges ModFlags and attributes. At the end class is added to
7360         partial_parts list.
7361         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7362         required here.
7363         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7364         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7365         from the rest of partial classes.
7366         (TypeContainer.GetClassBases): Simplified.
7367         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7368         DefineType.
7369         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7370         (TypeContainer.HasExplicitLayout): Uses Flags now.
7371         (PartialContainer): Removed.
7372         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7373         (StaticClass): Was merged with Class.
7374         (Class.GetClassBases): class and static class bases are verified here.
7375         (Class.TypeAttr): Added static attributes when class is static.
7376         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7377         (MemberBase): In some cases we need to call parent container for partial
7378         class. It should be eliminated but it's not easy now.
7379
7380         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7381
7382         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7383         partial classed to accumulate class comments.
7384         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7385
7386         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7387
7388         * driver.cs (MainDriver): Tree.GetDecl was removed.
7389
7390         * modifiers.cs (Modifiers): Add partial modifier.
7391
7392         * tree.cs (Tree.decl): Removed.
7393         (RootTypes): Started to use this class more often for root types
7394         specializations.
7395
7396 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7397
7398         A fix for #77615
7399
7400         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7401         external interface does not have an attribute.
7402
7403 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7404
7405         Another prerequisites for new partial classs implementation.
7406         
7407         * attribute.cs (Attribute.Equal): Implemented.
7408         (Attribute.Emit): Changed as attributes can be applied more than twice.
7409         (Attributes.Emit): Check for duplicate attributes here.
7410
7411         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7412         as a parameter, clean-up.
7413
7414 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7415
7416         A fix for #77485
7417
7418         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7419         contains obsolete attribute check which can in some cases look for base
7420         type of current class which is not initialized yet.
7421         (TypeContainer.BaseType): Replacement of ptype.
7422
7423         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7424
7425 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7426
7427         First of prerequisites for new partial classs implemention.
7428         
7429         * attribute.cs (Attributable): Extended by ResolveContext;
7430         Attributes finally have correct context for resolving in all cases.
7431         (AttachTo): Attribute owner is assigned here.
7432
7433         * codegen.cs (IResolveContext): Introduce new interface to hold
7434         all information needed in resolving phase.
7435         (EmitContext): Implements IResolveContext; more clean-up needed here.
7436         
7437         * decl.cs (MemberCore): Implemented IResolveContext.
7438
7439         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7440         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7441         parameter.cs, statement.cs, tree.cs, typemanager.cs:
7442         Refactored to use new IResolveContext instead of EmitContext; cleanup
7443
7444 2006-02-06  Miguel de Icaza  <miguel@novell.com>
7445
7446         * codegen.cs (EmitScopeInitFromBlock): check here the
7447         capture_context, there is no need to make two calls to the
7448         EmitContext. 
7449
7450         * anonymous.cs: Add some debugging messages that might help me
7451         track other instances of this problem in the future (the
7452         regression of test 467).
7453
7454         * cs-parser.jay: track the variable block, as we need to initalize
7455         any captured variables declared in this block for the "catch"
7456         portion of the "Try" statement.
7457
7458         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7459         scope initialization for captured variables. 
7460
7461         Also, move the emit for the variables after the block location has
7462         been marked.
7463
7464 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
7465
7466         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7467
7468 2006-02-02  Miguel de Icaza  <miguel@novell.com>
7469
7470         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7471         commit yesterday, the initialization for the roots is necessary.
7472         What is not necessary is the scope activation.
7473
7474 2006-02-02  Raja R Harinath  <rharinath@novell.com>
7475
7476         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7477         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7478         CS0206 checks.
7479         (Argument.Resolve): Remove CS0206 checks.
7480
7481 2006-02-01  Miguel de Icaza  <miguel@novell.com>
7482
7483         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7484         scopes for all the roots, the scopes will now be emitted when the
7485         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
7486
7487         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7488         code.  This reduces a lot of existing cruft.
7489         
7490         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7491         that the ScopeInfo is generated as we enter the scope, not at the
7492         time of use, which is what we used to do before.
7493
7494         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7495         every time a Block is about to be emitted if we have a
7496         CaptureContext. 
7497
7498 2006-02-01  Raja R Harinath  <rharinath@novell.com>
7499
7500         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7501         (Reset): Update.
7502         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7503
7504         * typemanager.cs (cons_param_array_attribute): Make private.
7505         (Reset): Set it to null.
7506         (InitCoreHelpers): Don't initialize it.
7507         (ConsParamArrayAttribute): New.  Initialize it as needed.
7508         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7509
7510 2006-01-31  Miguel de Icaza  <miguel@novell.com>
7511
7512         * expression.cs: There might be errors reported during the
7513         selection of applicable methods.  If there are errors, do not
7514         continue execution as it will lead the compiler to crash.
7515
7516 2006-01-30  Miguel de Icaza  <miguel@novell.com>
7517
7518         * expression.cs: Member access is not allowed on anonymous
7519         methods.  Fixes #77402.
7520
7521 2006-01-30  Raja R Harinath  <rharinath@novell.com>
7522
7523         Fix #77401
7524         * cs-parser.jay (VariableDeclaration): Don't set
7525         current_array_type to null.
7526         (field_declaration, event_declaration, declaration_statement):
7527         Set it to null here.
7528
7529 2006-01-28  Raja R Harinath  <harinath@gmail.com>
7530
7531         * typemanager.cs (GenericParameterPosition): New.
7532         * doc.cs: Use it.
7533
7534 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
7535
7536         * doc.cs : To process "include" elements, first we should create
7537           another list than XmlNodeList, because it could result in node
7538           removal, which could result in that the XmlNodeList gives up
7539           yielding next node.
7540
7541           (Also made code identical to gmcs again.)
7542
7543 2006-01-25  Miguel de Icaza  <miguel@novell.com>
7544
7545         * ecore.cs: Introduce an error report that we were not catching
7546         before, if not silent, we must report the error.  Gonzalo ran into
7547         it.
7548
7549 2006-01-23  Miguel de Icaza  <miguel@novell.com>
7550
7551         A fix for bug: #76957
7552         
7553         * iterators.cs (MoveNextMethod.CreateMethodHost): call
7554         ComputeMethodHost before creating the method, this is a new
7555         requirement. 
7556
7557         * anonymous.cs (AnonymousContainer): Now we track all the scopes
7558         that this method references (RegisterScope).  The actual scope
7559         where the method is hosted is computed with the ComputeMethodHost
7560         before we create the method.
7561
7562         Moved the Deepest routine here.
7563
7564         (AnonymousContainer.ComputeMethodHost): New routine used to
7565         compute the proper ScopeInfo that will host the anonymous method.
7566
7567         (ScopeInfo): Deal with multiple roots.  The problem was that we
7568         did not have a unique root where all ScopeInfos could be hanged
7569         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
7570         of roots.  
7571
7572         Remove AdjustMethodScope which is now computed at the end.  Remove
7573         LinkScope which did a partial link, instead link all ScopeInfos
7574         before code generation from the new "LinkScopes" routine. 
7575
7576         Simplify all the Add* routines as they no longer need to maintain
7577         the tree, they just need to record that they are using variables
7578         from a ScopeInfo.
7579
7580         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7581         routines to produce the forest of ScopeInfo trees.
7582
7583         * class.cs (TypeContainer.AppendMethod): This is just like
7584         AddMethod, but ensures that an interface implementation method
7585         (IEnumerable.XXX) is not inserted at the beginning of the queue of
7586         methods, but at the end.
7587
7588         We use this functionality to ensure that the generated MoveNext
7589         method in the iterator class is resolved/emitted before the
7590         enumerator methods created.   
7591
7592         This is required because the MoveNext method computes the right
7593         ScopeInfo for the method.  And the other methods will eventually
7594         need to resolve and fetch information computed from the anonymous
7595         method. 
7596
7597 2006-01-21  Raja R Harinath  <harinath@gmail.com>
7598             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
7599
7600         Fix rest of #76995.
7601         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7602         the 'aliases' hash.
7603         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7604         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7605
7606 2006-01-18  Raja R Harinath  <rharinath@novell.com>
7607
7608         Fix #76656, cs0231-2.cs.
7609         * cs-parser.jay (formal_parameter_list): Make error case catch
7610         more issues.
7611         (parenthesized_expression_0): Add CS1026 check.
7612         (invocation_expression): Remove unused { $$ = lexer.Location }.
7613
7614 2006-01-17  Raja R Harinath  <rharinath@novell.com>
7615
7616         Fix #76824.
7617         * cs-parser.jay (statement_expression): Don't list out the
7618         individual statement-expressions.  Convert syntax error into
7619         CS0201 check.
7620
7621 2006-01-16  Raja R Harinath  <rharinath@novell.com>
7622
7623         Fix #76874.
7624         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7625         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
7626         CheckIntermediateModification.
7627         (FieldExpr.DoResolve): Add new two-argument version that
7628         allows us to resolve the InstanceExpression as an lvalue.
7629         The one-argument variant is now just a wrapper.
7630         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7631         Resolve the lhs as an lvalue if the it has a value type.
7632         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7633         from Assign.DoResolve.
7634         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7635         resolved as an lvalue.
7636         (PropertyExpr.DoResolve): Update.
7637         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7638         has a value type.  Move CS1612 check here from
7639         CheckIntermediateModification.
7640         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7641         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
7642         'right_side' of a ResolveLValue on an 'out' argument.
7643         (EmptyExpression.LValueMemberAccess): New.  Used as the
7644         'right_side' of a propagated ResolveLValue on a value type.
7645         (LocalVariableReference.DoResolveBase): Recognize
7646         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7647         Add CS1654 check.
7648         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7649         EmptyExpression.Null.
7650
7651 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
7652
7653         * typemanager.cs : added IsGenericParameter(). In mcs it always
7654           return false.
7655         * doc.cs : for generic parameters, use GenericParameterPosition,
7656           not FullName.
7657
7658 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
7659
7660         * expression.cs: Fix Console.WriteLine ((this = x).foo);
7661
7662 2006-01-12  Miguel de Icaza  <miguel@novell.com>
7663
7664         This fixes the problem where we used ldfld instead of ldflda to
7665         load the "THIS" pointer on captured parameters, when THIS is a
7666         value type.  See bug #77205.
7667         
7668         * iterators.cs (CapturedThisReference.Emit): Pass false to
7669         EmitThis (we do not need the address).
7670
7671         * codegen.cs (EmitThis): it needs to know whether we need the
7672         address of `this' or not.  This is used by value types.  
7673
7674         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7675         every other call passes false.
7676
7677 2006-01-12  Raja R Harinath  <rharinath@novell.com>
7678
7679         Fix #77221.
7680         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7681         GetOverride.
7682         * expression.cs (Invocation.OverloadResolve): Update.
7683         (Invocation.DoResolve): Avoid double resolution of invocation.
7684
7685 2006-01-11  Raja R Harinath  <rharinath@novell.com>
7686
7687         Fix #77180.
7688         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7689         unary negation of floating point types as 0-expr; negation cannot
7690         overflow in floating point types.
7691
7692         Fix #77204.
7693         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7694         on operands of 'void' type.
7695
7696         Fix #77200.
7697         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7698         and ExclusiveOr for boolean constants too.
7699
7700 2006-01-09  Raja R Harinath  <rharinath@novell.com>
7701
7702         Fix #75636.
7703         * expression.cs (Invocation.OverloadResolve): Replace reflected
7704         override methods with their base virtual methods, rather than
7705         skipping over them.
7706         * typemanager.cs (TypeManager.GetOverride): New.
7707
7708 2006-01-05  Jb Evain  <jbevain@gmail.com>
7709
7710         * class.cs (Property.Define, Indexer.Define): do not tag the
7711         properties as SpecialName | RTSpecialName.
7712
7713 2006-01-04  Miguel de Icaza  <miguel@novell.com>
7714
7715         * class.cs (MethodCore.IsDuplicateImplementation): This method was
7716         doing a low-level comparission of parameter types.  It was lacking
7717         a check for __argslist. 
7718
7719 2005-12-30  Miguel de Icaza  <miguel@novell.com>
7720
7721         * expression.cs (ParameterReference.DoResolveBase): Allow
7722         reference parameters if they are local to this block. 
7723
7724         This allows the ref and out parameters of a delegate to be used in
7725         an anonymous method, for example:
7726
7727         delegate void set (out int x);
7728
7729         set s = delegate (out int x){
7730                 x = 0;
7731         };
7732
7733         This is used by functionality introduced late in the C# language.
7734         
7735         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7736         method that take ref and out parameters. 
7737
7738         Fixes #77119 which was a late change in the spec.
7739
7740 2005-12-23  Miguel de Icaza  <miguel@novell.com>
7741
7742         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7743         parent if its the same scope.  Fixes #77060.
7744
7745 2005-12-21  Miguel de Icaza  <miguel@novell.com>
7746
7747         * driver.cs: Report the case of no source files and no -out:
7748         argument provided.
7749
7750 2005-12-20  Raja R Harinath  <rharinath@novell.com>
7751
7752         Fix #77035.
7753         * expression.cs (ComposedCast.GetSignatureForError): Define.
7754
7755 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7756
7757         Fix #76995
7758
7759         * namespace.cs (NamespaceEntry): Add extern_aliases as a
7760         ListDictionary, to contain the ExternAliasEntry entries (in
7761         addition to the NamespaceEntry.aliases hashtable). This field is
7762         shared between the original entry and its doppelganger (bodyless 
7763         copy of it).
7764         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7765         extern_aliases field.
7766         (NamespaceEntry.Lookup): Move the IsImplicit check after the
7767         lookup in extern_aliases.
7768
7769 2005-12-16  Raja R Harinath  <rharinath@novell.com>
7770
7771         Fix #77006.
7772         * class.cs (TypeContainer.Mark_HasEquals): New.
7773         (TypeContainer.Mark_HasGetHashCode): New.
7774         (ClassPart): Override them.
7775         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7776
7777         Fix #77008.
7778         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7779         'parent' argument to the base constructor.
7780
7781         Remove all mention of TypeContainer from decl.cs.
7782         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7783         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7784         (DeclSpace.DeclSpace): Likewise.
7785         (DeclSpace.DefineMembers): Remove unused argument.
7786         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
7787         debugging check -- we don't care if the debug code throws an
7788         InvalidCastException instead of an InternalErrorException.
7789         * class.cs (TypeContainer.DefineMembers): Update to changes.
7790         (TypeContainer.DoDefineMembers): Likewise.
7791         (TypeContainer.GetMethods): Likewise.
7792         (PropertyMember.Define): Likewise.
7793         (MemberBase.Parent): New property that forwards to
7794         MemberCore.Parent, but ensures that we get a TypeContainer.
7795         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7796         (RootContext.PopulateTypes): Likewise.  Remove special case code
7797         for !RootContext.StdLib: DefineMembers is idempotent.
7798
7799 2005-12-14  Miguel de Icaza  <miguel@novell.com>
7800
7801         * convert.cs (ExplicitConversionCore): Check the return value from
7802         ExplicitConversionCore which can return null on failure.  Fixes #76914
7803
7804 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
7805
7806         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7807
7808 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
7809
7810         * doc.cs : The search for referenced namespace was insufficient to
7811           get global one as it used to do. Fixed bug #76965.
7812
7813 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
7814
7815         * doc.cs : check name in cref in the last phase that whether it is
7816           namespace or not.
7817
7818 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7819
7820         * cs-tokenizer.cs : reverted the latest change: it somehow broke
7821           Mono.C5.
7822
7823 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7824
7825         * doc.cs : so it turned out that we cannot skip override check for 
7826           interface members. Fixed bug #76954.
7827
7828 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7829
7830         * cs-tokenizer.cs : fixed bug #75984:
7831           - #warning and #error should not be handled when the source line
7832             is disabled.
7833           - #line is not checked strictly when the source line is disabled.
7834           - #define and #undef is on the other hand checked strictly at any
7835             state.
7836
7837 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
7838
7839         * cs-tokenizer.cs : missing Location (actually, filename) in one of
7840           CS1027 report.
7841
7842 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7843
7844         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7845
7846         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7847         event initializers.
7848         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7849         (FieldBase.Initializer): Initializer is now optional.
7850         (EventField.Define): Only event field can have initializer.
7851
7852         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7853
7854         * const.cs (Const): Reuse initializer.
7855
7856         * cs-parser.jay: Updated after FieldBase changes.
7857         Added current_array_type to simplify array initializers.
7858
7859         * ecore.cs (NullCast.IsDefaultValue): Implemented.
7860
7861         * expression.cs, iterators.cs: Updated.
7862
7863         * namespace.cs (NamespaceEntry): Made UsingFound private.
7864
7865 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7866
7867         * parameterCollection.cs: Obsolete, removed.
7868         * parser.cs: Obsolete, removed.
7869
7870 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7871
7872         Fix #76849.
7873         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7874
7875         * enum.cs (Enum.Define): Set obsolete context here.
7876
7877 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7878
7879         * doc.cs :
7880           - FindDocumentedMember() now expects 1) paramList as null
7881             when "we don't have to check the number of parameters" and
7882             2) Type.EmptyTypes when "there is no arguments".
7883           - Introduced FoundMember struct to hold the exact type which was
7884             used to find the documented member (the above change broke
7885             test-xml-044; it might be better just to use DeclaringType than
7886             what MS does, like this change does, but it depends on usage.)
7887
7888 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7889
7890         * doc.cs : documented member might be from DeclaringType for nested
7891           types. Fixed bug #76782.
7892
7893 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
7894
7895         * anonymous.cs: Have the param code handle leaving copies on the
7896         stack etc. Allows anonymous params to take part in the assignment
7897         code (++, +=, etc). Fixes bug #76550
7898
7899         * expression.cs: Handle the prepare_for_load/leave_copy by passing
7900         it down to the anon code.
7901
7902         * iterators.cs: Use dummy var here
7903
7904         * codegen.cs: Handle new vars
7905
7906 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7907
7908         Fix #76849.
7909         * class.cs (MethodData.Define): Set proper Obsolete context.
7910
7911         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7912         obsolete context.
7913         (FieldExpr.DoResolve): Ditto.
7914
7915 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7916
7917         Fix #76849.
7918         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7919         parent is not obsolete.
7920
7921 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
7922
7923         * doc.cs : (FindDocumentedMember) find parameterless members first
7924           and get CS0419 in the early stage. Fixed first case of bug #76727.
7925
7926 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
7927
7928         Fix #76859.
7929         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7930         no error was reported.
7931
7932         *expression.cs (Binary.DoResolve): left can be null.
7933
7934 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
7935
7936         Fix #76783.
7937         * class.cs (MethodData.Emit): Parameters should be labeled first.
7938
7939 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
7940
7941         Fix #76761.
7942         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7943
7944 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
7945
7946         * attribute.cs (AreParametersCompliant): Moved to Parameter.
7947
7948         * class.cs (MethodCore): Parameter clean up.
7949         (IMethodData): Added ParameterInfo.
7950         (MethodData): Parameter clean up.
7951         (Indexer.Define): Parameter clean up.
7952
7953         * anonymous.cs,
7954         * codegen.cs,
7955         * cs-parser.jay,
7956         * decl.cs,
7957         * doc.cs,
7958         * ecore.cs,
7959         * flowanalysis.cs,
7960         * iterators.cs,
7961         * pending.cs,
7962         * statement.cs,
7963         * typemanager.cs: Parameter clean up.
7964
7965         * delegate.cs (Define): Get rid of duplicated code.
7966
7967         * expression.cs (ParameterReference): Removed useless parameters
7968         and simplified.
7969         (Invocation): Ditto.
7970
7971         * parameter.cs (ParamsParameter): New class, params specialization.
7972         (ArglistParameter): Attemp to separate arglist.
7973         (Parameter): Refactored to be reusable and faster.
7974         (Parameter.Modifier): Made understandable.
7975         (Parameters): Changed to be used as a class for `this' assembly
7976         parameters. Refactored to use new specialized classes.
7977
7978         * support.cs (ParameterData): Added Types property.
7979         (InternalParameters): Deleted.
7980
7981 2005-08-20  Martin Baulig  <martin@ximian.com>
7982
7983         Merging this patch from GMCS to fix #75867.
7984
7985         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7986         scope if we don't already have it.
7987
7988 2005-11-17  Martin Baulig  <martin@ximian.com>
7989
7990         * anonymous.cs
7991         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7992         inherit the scope from our parent.  Fixes #76653.
7993
7994 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7995
7996         * doc.cs : the previous patch does not actually fix the bug.
7997           PropertyInfo override check is now implemented and really fixed it.
7998         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
7999
8000 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
8001
8002         * doc.cs : apply "override filter" also to properties.
8003           Fixed bug #76730.
8004
8005 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
8006
8007         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
8008           no need to check overrides. For classes, omit those results from 
8009           interfaces since they must exist in the class. Fixed bug #76726.
8010
8011 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
8012
8013         * typemanager.cs : (GetFullNameSignature) differentiate indexers
8014           with different parameters. Fixed the second problem in #76685.
8015
8016 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
8017
8018         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
8019           get expected 'protected' access in CheckValidFamilyAccess()).
8020           Fixed bug #76692.
8021
8022 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
8023
8024         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
8025           Fixed bug #76705.  CS1569 was incorrectly commented out.
8026
8027 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
8028
8029         * doc.cs : use Invocation.IsOverride() to do real override check.
8030         * expression.cs : made Invocation.IsOverride() internal.
8031
8032 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
8033
8034         * doc.cs : use TypeManager.FindMembers() instead of (possible)
8035           TypeBuilder.FindMembers() and filter overriden base members out.
8036           Fixed bug #76990.
8037
8038 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8039
8040         * doc.cs : ref/out parameters are represented as '@' (instead of
8041           '&' in type FullName). Fixed bug #76630 (additionally crefs).
8042
8043 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8044
8045         * doc.cs : when there was no '.' in cref to methods in doc comment,
8046           then parameters were missing in the output. Fixed bug #76691.
8047
8048 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8049
8050         * driver.cs : don't output docs when there is an error.
8051           Fixed bug #76693.
8052
8053 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8054
8055         * doc.cs :
8056           Now it should detect indexers. Fixed primary concern in bug #76685.
8057           Fixed CS0419 message to not show the identical member signature in
8058           the message.
8059
8060 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8061
8062         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
8063           instead of Type.FindMembers() since it does not handle events.
8064           Fixed bug #71604.
8065
8066 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
8067
8068         * codegen.cs: Fixed typo (speficied -> specified).
8069
8070 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
8071
8072         Fix #76369.
8073         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
8074
8075 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
8076
8077         * attribute.cs: Changed error message.
8078
8079         * cs-tokenizer.cs: One more check.
8080
8081 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
8082
8083         * statement.cs (Block.Resolve): Ignore empty statement.
8084
8085 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
8086
8087         * report.cs: Made error/warning methods more strict to avoid
8088         their misuse.
8089
8090         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
8091         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
8092         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
8093         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
8094
8095 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
8096
8097         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
8098         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
8099
8100         * class.cs (TypeContainer.IsComImport): New property.
8101         (Constructor.Define): Create proper ctor for ComImport types.
8102
8103         * expression.cs (New.CheckComImport): Fixed.
8104
8105 2005-11-07  Miguel de Icaza  <miguel@novell.com>
8106
8107         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
8108         that a parameter has been captured does not mean that we do not
8109         have to do the rest of the processing.  This fixes the second part
8110         of #76592.  If there was another anonymous method capturing
8111         values in the past, the Scope would never be set for the second
8112         method that captured the same parameter.
8113
8114         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
8115         properly manipulate the stack.   Second part of fix for #76592.
8116
8117         * expression.cs (New): Add support for invoking "new" on
8118         interfaces that have been flagged with the ComImport attribute and
8119         the CoClass.  Fixes #76637 
8120
8121         * statement.cs (Try.DoEmit): When a variable is captured, do not
8122         try to emit the vi.LocalBuilder variable as it has been captured.
8123         Create a temporary variable and store the results on the
8124         FieldBuilder.  Fixes #76642
8125
8126 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
8127
8128         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
8129
8130         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
8131
8132         * expression.cs (Binary.DoResolve): Added && optimalization.
8133     
8134         * typemanager.cs (AddUserType): Removed useless argument.
8135
8136 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
8137
8138         * statement.cs (Block.variables): Uses ListDictionary.
8139
8140 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
8141
8142         Fix #75969.
8143         * class.cs (PartialContainer.EmitType): Customized to emit
8144         security attributes.
8145         (ClassPart.ApplyAttributeBuilder): Transform security attribute
8146         for partial classes.
8147
8148 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
8149
8150         Fix #76599.
8151         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
8152         access has to be fixed.
8153         
8154         * typemanager.cs (IsUnmanagedType): Wrong common field type.
8155
8156 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
8157
8158         Fix #76590.
8159         * ecore.cs (NullCast.Reduce): Implemented.
8160
8161         * expression.cs (ArrayCreation.CheckIndices): Correcly check
8162         constant type.
8163         
8164         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
8165         properly.
8166         (Foreach.Resolve): Catch null properly.
8167
8168 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
8169  
8170         * cs-tokenizer.cs: Warning text fix.
8171
8172         * driver.cs: AllWarningNumbers exposed on public interface.
8173
8174         * report.cs (): Reviewed warning numbers.
8175         (IsValidWarning): Use binary search.
8176
8177 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
8178  
8179         * driver.cs: Implemeted resource visibility.
8180         (Resources): New class for code sharing between /res: and
8181         /linkres:
8182  
8183 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
8184
8185         Fix #76568.
8186         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
8187         folding.
8188         
8189         * convert (Convert.ImplicitReferenceConversion): NullCast holds
8190         contants only.
8191         
8192         * ecore.cs (NullCast): Child is contant only.
8193         
8194         * literal.cs (NullLiteral.Reduce): null can be converted to any
8195         reference type.
8196
8197 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
8198
8199         * driver.cs: Use Encoding.Default as default code page instead
8200           of ISO-28591.
8201
8202 2005-10-27  Raja R Harinath  <rharinath@novell.com>
8203
8204         Fix #76085.
8205         * expression.cs (Invocation.Error_InvalidArguments): Handle
8206         __arglist parameters.
8207         (Invocation.VerifyArgumentsCompat): Likewise.
8208         * support.cs (ReflectionParameters.GetSignatureForError): Print
8209         __arglist parameters.
8210         (InternalParamters.GetSignatureForError): Likewise.
8211         * parameter.cs (Parameters.GetSignatureForError): Likewise.
8212
8213 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
8214
8215         * attribute.cs (GetPropertyValue): Made public.
8216
8217         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
8218         Resolve.
8219         Add new property WrapNonExceptionThrows to handle 2.0 assembly
8220         attribute.
8221         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
8222         is not defined.
8223         
8224         * driver.cs: Reflect method name change.
8225         
8226         * statement.cs (Try.Resolve): Warn when try has both general
8227         exception handlers.
8228         
8229         * typemanager.cs: runtime_compatibility_attr_type new predefined
8230         type.
8231
8232 2005-10-26  Raja R Harinath  <harinath@gmail.com>
8233
8234         Fix #76419.
8235         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
8236         treat it as an empty parameter list.
8237
8238 2005-10-26  Raja R Harinath  <rharinath@novell.com>
8239
8240         Fix #76271.     
8241         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
8242         ResolveAsTypeStep silent.
8243         * statement.cs (Block.AddConstant): Mark block as used.
8244         (Block.ResolveMeta): Avoid piling on error messages
8245         if a constant initializer resolution fails.
8246
8247 2005-10-25  Raja R Harinath  <rharinath@novell.com>
8248
8249         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
8250         Remove.
8251         (NamespaceEntry.VerifyAllUsing): New.
8252         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
8253         behaviour.  Delegates actual resolution of alias to ...
8254         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
8255         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
8256         Update.
8257         * driver.cs (Driver.MainDriver): Update.
8258         
8259         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
8260         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
8261         property.
8262         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
8263         Remove.
8264         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
8265         RootNamespace.DefineNamespacesForAll.
8266
8267 2005-10-24  Raja R Harinath  <harinath@gmail.com>
8268
8269         * typemanager.cs (assemblies, external_aliases, modules)
8270         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
8271         (ComputeNamespaces, GetRootNamespace): Remove extra staging
8272         overhead.  Move resposibility ...
8273         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
8274         * driver.cs, attribute.cs, codegen.cs: Update to changes.
8275
8276 2005-10-23  Raja R Harinath  <harinath@gmail.com>
8277
8278         * namespace.cs (RootNamespace.all_namespaces): Renamed from
8279         cached_namespaces.  Improve usage.
8280         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
8281         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
8282         Move from GlobalRootNamespace and simplify.
8283         (RootNamespace.Global): Make instance variable.
8284         (RootNamespace.RootNamespace): Add "alias name" parameter.
8285         (GlobalRootNamespace): Simplify drastically.
8286         (Namespace.Lookup): Don't use GetNamespace.
8287         * typemanager.cs (GetRootNamespace): Rename from
8288         ComputeNamespaceForAlias.
8289         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
8290
8291 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8292
8293         * anonymous.cs (AnonymousContainer): Don't crash when container
8294         doesn't exist.
8295
8296 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8297
8298         * expression.cs (Binary.DoResolve): Warn when comparing same
8299         values.
8300
8301 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8302
8303         Fix #76486.
8304         * expression.cs (Binary.DoResolve): It looks like there are no
8305         convetsion rules in enum context.
8306
8307 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8308
8309         Add support for extern alias qualifiers.
8310         * typemanager.cs: Move some LookupTypeReflection code
8311         to namespace.cs, to have cleaner code. Added some methods
8312         to help us keep track of the extern aliased references.
8313         * driver.cs: Add suport for extern alias assemblies on command
8314         line and check for their warnings/errors. Also keep track of the
8315         extern aliased assemblies.
8316         * namespace.cs: Move the global functionality of Namespace
8317         to GlobalRootNamespace/RootNamespace. Now the global namespace
8318         is GlobalRootNamespace.Globa. Also the code moved from 
8319         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
8320         Finally added LocalAliasEntry (AliasEntry before) and
8321         ExternAliasEntry, to handle alias statements.
8322         * cs-parser.jay: Add support in the grammar for extern alias
8323         statement.
8324         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
8325         Update callings to Namespace (now in GlobalRootNamespace).
8326
8327 2005-10-18  Raja R Harinath  <rharinath@novell.com>
8328
8329         Fix #76371.
8330         * class.cs (TypeContainer.DefineType): Move updating of
8331         topological sort earlier in the code.
8332         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8333
8334 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
8335
8336         Fix #76273.
8337         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8338         
8339         * constant.cs (Constant.TryReduce): Moved from Cast class.
8340         (Reduce): Made little bit more OO and fixed missing conversions.
8341         
8342         * ecore.cs (Reduce): Implemented.
8343         (Binary.EnumLiftUp): New method to upgrade values to enum values.
8344         
8345         * literal.cs (Reduce): Implemented.
8346         
8347         * class.cs: Reverted Miguel's wrong commit.
8348
8349 2005-10-14  Miguel de Icaza  <miguel@novell.com>
8350
8351         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8352
8353 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
8354
8355         * cs-parser.jay, expression.cs : CS0214 was missing error location
8356           for constants. Fixed bug #76404.
8357
8358 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
8359
8360         Fix #76370.
8361         * convert.cs (ExplicitConversionCore): Fixed object->enum
8362         conversion.
8363
8364 2005-10-10  Raja R Harinath  <rharinath@novell.com>
8365
8366         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8367         InstanceExpression.
8368         (PropertyExpr.EmitCall): Likewise.
8369         * expression.cs (Invocation.EmitArguments): Handle case where
8370         arguments == null.
8371         (Invocation.EmitCall): Avoid allocating temporary variable if
8372         there are no arguments.
8373
8374 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8375
8376         Fix #76323.
8377         * convert.cs (ImplicitConversionStandard): Move conversion of
8378         void* to arbitrary pointer types ...
8379         (ExplicitConversionStandard): .. here.
8380         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8381         error to always print typenames.
8382
8383 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8384
8385         * convert.cs (GetConversionOperator): Rename from
8386         GetConversionOperators.  Move operator selection code from ...
8387         (UserDefinedConversion): ... here.
8388
8389 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
8390
8391         * convert.cs (ExplicitConversionCore): Removed duplicate enum
8392         conversion.
8393
8394 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
8395
8396         * assign.cs (Assign.DoResolve): Error method changed.
8397
8398         * cfold.cs (DoConstantNumericPromotions): Error method changed.
8399         
8400         * const.cs (ResolveValue): Reset in_transit immediately.
8401         
8402         * constant.cs: Error method changed.
8403         
8404         * convert.cs: Removed useless location parameter.
8405         (ExplicitNumericConversion): Don't do double enum check.
8406         (ExplicitConversionCore): Renamed from ExplicitConversion.
8407         (ExplicitUnsafe): Extracted from ExplicitConversion.
8408         (ExplicitConversion): Uses for error reporting.
8409         
8410         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8411         error messages.
8412         (ResolveBoolean): Uses common error method.
8413         (CastToDecimal): Get rid of ec.
8414         (CastFromDecimal): Optimized.
8415         (ConvCast): Get rid of ec.
8416         
8417         * enum.cs (ResolveValue): Reset in_transit immediately.
8418         (Emit): Return after first error.
8419         
8420         * expression.cs: Convert changes.
8421         
8422         * literal.cs: Error method changed.
8423         
8424         * statement.cs: Error method changed.
8425
8426 2005-10-03  Raja R Harinath  <rharinath@novell.com>
8427
8428         * support.cs (SeekableStreamReader.Position): Don't error out when
8429         the requested position is just beyond the end of the current
8430         buffered data.
8431
8432 2005-09-28  Raja R Harinath  <rharinath@novell.com>
8433
8434         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
8435         try to keep in sync with the byte count of the underlying Stream.
8436         However, this limits us to a window size of 2048 characters: i.e.,
8437         the maximum lookahead of our lexer/parser can be 2048 characters.
8438
8439 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
8440
8441         Fix #76255.
8442         * driver.cs: Fix compilation files with full root path.
8443
8444 2005-09-25  Miguel de Icaza  <miguel@novell.com>
8445
8446         * report.cs (SymbolRelatedToPreviousError): Format the output so
8447         it does not use an open parenthesis that is never closed. 
8448
8449         * driver.cs: Follow coding guidelines
8450
8451 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8452
8453         Fix #72930.
8454         * const.cs (Const.ResolveValue): Check for assigning non-null
8455         value to reference type.
8456
8457 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8458
8459         * anonymous.cs: Implemented ExprClassName.
8460         
8461         * assign.cs (Assign.DoResolve): Don't chrash when type is not
8462         delegate.
8463         
8464         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8465         check.
8466         
8467         * class.cs (StaticClass.DefineContainerMembers): Report protected
8468         members as error.
8469         
8470         * codegen.cs: if(ed) PRODUCTION.
8471         
8472         * convert.cs (Error_CannotImplicitConversion): Better error
8473         distinction.
8474         
8475         * cs-parser.jay: More error checks.
8476         
8477         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8478         
8479         * driver.cs (CSCParseOption): Enabled wrong option check.
8480         
8481         * ecore.cs (Expression.ExprClassName): Turned to property.
8482         (MemberExpr.CheckIntermediateModification): For checking boxed
8483         value types     modification.
8484         
8485         * statement.cs (Fixed.Resolve): Expression type must be
8486         convertible to fixed type.
8487         (CollectionForeach.GetEnumeratorFilter,TryType):
8488         Small refactoring for easier error checking.
8489
8490 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
8491
8492         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8493         attributes.
8494         
8495         * class.cs (GeneratedBaseInitializer): New class for customization
8496         compiler generated initializers.
8497         (MemberBase.DoDefine): Check Obsolete attribute here.
8498         (FieldMember.DoDefine): Ditto.
8499         
8500         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8501         constants.
8502         
8503         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8504         (MemberCore.GetObsoleteAttribute): Removed argument.
8505         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8506         (MemberCore.CheckObsoleteType): New helper.
8507         
8508         * delegate.cs,
8509         * enum.cs,
8510         * statement.cs: Updates after MemberCore changes.
8511         
8512         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8513         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8514         
8515         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8516         obsolete attribute for compiler construct.
8517         (As.DoResolve): Cache result.
8518         
8519         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8520
8521 2005-09-26  Raja R Harinath  <rharinath@novell.com>
8522
8523         Fix #76133.
8524         * expression.cs (This.VerifyFixed): In a value type T, the type of
8525         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
8526         value type R, 'this' is treated as a value parameter.
8527
8528 2005-09-22  Miguel de Icaza  <miguel@novell.com>
8529
8530         * statement.cs (Lock): Use the TemporaryVariable class instead of
8531         manually using local variables as those do not work when variables
8532         are captured.
8533
8534         * ecore.cs: Moved the TemporaryVariable class from being a nested
8535         class inside Foreach to be a public class that can be employed in
8536         other places. 
8537
8538 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
8539
8540         * cs-parser.jay: interface_accessors replaced by
8541         accessor_declarations.
8542
8543         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8544         location.
8545         
8546         * statement.cs (GotoCase.Resolve): Convert null constant to
8547         null case.
8548         (SwitchLabel.ResolveAndReduce): Ditto.
8549         (SwitchLabel.NullStringCase): Custom null stamp.
8550         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8551         
8552         typemanager.cs (CSharpSignature): Don't skip first argument
8553         for full names.
8554
8555 2005-09-18  Miguel de Icaza  <miguel@novell.com>
8556
8557         * driver.cs: Set InEmacs based on the environment variable EMACS. 
8558
8559         * location.cs (InEmacs): in this mode, do not report column
8560         location as it confuses Emacs.
8561
8562 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
8563
8564         * cfold.cs, constant.cs, convert.cs, ecore.cs,
8565         expression.cs, iterators.cs, literal.cs: Store constants and
8566         literals location.
8567         
8568         * class.cs (MemberBase.ShortName): Pass location.
8569         
8570         * cs-parser.jay: Some location fixes.
8571         
8572         * ecore.cs (Expression.Location): Made virtual.
8573
8574 2005-09-05  Miguel de Icaza  <miguel@novell.com>
8575
8576         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8577         if the underlying types are the same, otherwise we need to produce
8578         code that will do the proper cast.
8579
8580         This was exposed by Marek's constant rewrite which produced
8581         invalid code for the call site:
8582
8583         enum X : long { a }
8584         void Method (X v) {}
8585
8586         Method ((X) 5)
8587
8588         This fixes test-49.cs
8589
8590 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8591
8592         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8593           Type/Object should be allowed as well. Fixed bug #75968.
8594
8595 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8596
8597         * expression.cs : (Binary.DoResolve): when one is enum constant and
8598           another is constant 0, then return enum one *as enum type*.
8599           Fixed bug 74846.
8600
8601 2005-09-02  Raja R Harinath  <rharinath@novell.com>
8602
8603         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8604         internal.
8605
8606         Fix #75941.
8607         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8608         flow-branching for LocalVariableReferences in case we were invoked
8609         from a MemberAccess.
8610         * expression.cs (LocalVariableReference.VerifyAssigned): New.
8611         Carved out of ...
8612         (LocalVariableReference.DoResolveBase): ... this.
8613         (MemberAccess.Resolve): Do the check that was disabled during
8614         SimpleNameResolve.
8615
8616 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8617
8618         * class.cs :
8619           (PartialContainer.Create): check abstract/sealed/static strictly
8620           but abstract/sealed can exist only at one side. Fixed bug #75883.
8621
8622 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
8623
8624         Fix #75945.
8625         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8626         specified, don't default to UnmanagedType.I4.
8627
8628 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8629
8630         * expression.cs : conditional operator should check possibly
8631           incorrect assign expression. Fixed bug #75946.
8632
8633 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8634
8635         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8636           Reverting the change. gmcs is much complex than mcs on this matter.
8637
8638 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8639
8640         * cs-tokenizer.cs : To read another token ahead of the actual 
8641           consumption, use new SavedToken and cache token instead of moving
8642           back the stream with SeekableStreamReader (it seemed problematic).
8643         * cs-parser.jay,
8644           driver.cs : Thus use StreamReader directly.
8645         * support.cs : Thus removed SeekableStreamReader.
8646
8647 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8648
8649         Fix #75934.
8650         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8651         (ScopeInfo.EmitScopeType): Use it to construct field names from
8652         names of captured locals.
8653
8654         Fix #75929.
8655         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8656         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8657         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
8658         (ExplicitConversion): Remove enum cases already handled by
8659         implicit conversion.  Move implicit conversion check to the beginning.
8660         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8661         * expression.cs (ArrayCreation.EmitDynamicInitializers):
8662         Don't treat System.Enum as a struct.
8663
8664 2005-08-30  Jb Evain  <jbevain@gmail.com>
8665
8666         * attribute.cs: handles as expression in parameters.
8667
8668 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8669
8670         Fix #75802.
8671         * class.cs (TypeContainer.VerifyClsName): Don't use a
8672         PartialContainer when verifying CLS compliance.
8673         (AbstractPropertyEventMethod): Set Parent here, ...
8674         (PropertyMethod): ... not here.
8675
8676 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
8677
8678         * attribute.cs : escaped attribute name should not be allowed to be
8679           resolved (e.g. @class as classAttribute). Fixed bug #75930.
8680
8681 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8682
8683         Fix #75927.
8684         * convert.cs (ImplicitStandardConversionExists): Allow zero also
8685         when converting a long constant to unsigned long.
8686         * expression.cs (Invocation.OverloadResolve): Add sanity check to
8687         detect where IsApplicable and VerifyArgumentsCompat disagree.
8688
8689 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8690         and Carlos Alberto Cortez  <carlos@unixmexico.org>
8691
8692         Fix #75848.
8693         * class.cs (TypeContainer.CanElideInitializer): New helper.
8694         (TypeContainer.EmitFieldInitializers): Use it to determine if we
8695         can safely emitting the initializer of a field.
8696
8697 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8698
8699         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8700           allowed inside a switch (without loop). Fixed bug #75433.
8701
8702 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
8703
8704         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8705         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8706
8707 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8708
8709         * driver.cs : kinda reverting the default encoding changes (not exact 
8710           revert since I noticed that "codepage:reset" might not work fine).
8711
8712 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8713
8714         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8715           Location. Now getter and setter store location correctly.
8716           (errors/cs0111-12.cs now reports the expected location.)
8717
8718 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8719
8720         * driver.cs : Use default encoding on the environment.
8721           Removed (now that) extra parameter for SeekableStreamReader.
8722         * support.cs : (SeekableStreamReader) third .ctor() argument for
8723           StreamReader is not required (always true). preamble size could
8724           be acquired in simpler and safe way.
8725
8726 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
8727
8728         * cs-parser.jay: report CS0642 at warning level 3
8729           and report CS0642 for an if else statement also
8730           fixes bug #74745. Patch by John Luke (and a bit
8731           modified by me).
8732           Removed extra CS0642 warning check for "while",
8733           "for" and "fixed".
8734         * statement.cs: In Block.Resolve(), CS0642 check
8735           is reimplemented to check a sequence of an empty
8736           statement and a block.
8737
8738           Both fix bug #66777.
8739
8740 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
8741
8742         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8743         detection until I fix it.
8744         
8745         * cs-tokenizer.cs: Changed error message.
8746         
8747         * cs-parser.jay: Fixed 2 error locations.
8748         
8749         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8750         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8751         properties.
8752         
8753         * enum.cs (GetSignatureForError): Fixed.
8754         
8755         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8756         method detection.
8757         
8758         * class.cs,
8759         * typemanager.cs (RegisterProperty): Removed.
8760         
8761         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8762
8763 2005-08-24  Raja R Harinath  <rharinath@novell.com>
8764
8765         Fix #75874.
8766         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8767         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8768
8769 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8770
8771         * expression.cs : tiny fix is required for not warning positive ulong.
8772           See test-441.cs.
8773
8774 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8775
8776         * expression.cs : add CS0652 check for constant and integral
8777           expression. Fixed bug #53974.
8778
8779 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8780
8781         * expression.cs : in DoNumericPromotions(), check if there is implicit
8782           conversion overload for string (to check CS0034). Fixed bug #52492.
8783
8784 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8785
8786         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8787
8788 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8789
8790         * ecore.cs : report location when it is *not* Null.
8791
8792 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8793
8794         * codegen.cs,
8795           ecore.cs,
8796           flowanalysis.cs,
8797           expression.cs:
8798           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8799           correctly. Fixed bug #75721.
8800
8801 2005-08-23  Raja R Harinath  <rharinath@novell.com>
8802
8803         * support.cs (SeekableStreamReader.Position): Avoid an expensive
8804         loop that performs 'min (pos, char_count)'.
8805
8806         Fix #75862.
8807         * expression.cs (Unary.ResolveOperator): Don't discard implicit
8808         converted value in Operator.OnesComplement.
8809
8810 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
8811
8812         * anonymous.cs: If the anon method is pulled into a helper class,
8813         it needs to be `internal' not `private'. Fixes runtime behavior on
8814         msft. bug #75704
8815
8816 2005-08-20  Martin Baulig  <martin@ximian.com>
8817
8818         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8819         scope if we don't already have it.
8820
8821         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8822         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8823         fixes #75867.
8824
8825 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
8826
8827         Fix #75803
8828         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8829         is a partial class.
8830
8831 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
8832
8833         The big constants rewrite
8834         Fix #75746, #75685 and more
8835         As a side effect saved 1MB for MWF ;-)
8836         
8837         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8838         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8839         enum based for corlib compilation.
8840         
8841         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8842         subtractions.
8843         
8844         * class.cs (FixedField.Define): Use ResolveAsConstant.
8845         
8846         * const.cs (IConstant): Interface constants and enums.
8847         (Const.ResolveValue): New method for constant resolvning.
8848         (ExternalConstant): Constants from imported assemblies.
8849         
8850         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8851         conversion; like enums.
8852         (Constant.ToType): Converts this constant to different type.
8853         (Constant.Increment): Adds 1.
8854         
8855         * convert.cs (ImplicitConversionRequired): Simplified.
8856         
8857         * cs-parser.jay: Create EnumMember directly.
8858         
8859         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8860         
8861         * doc.cs (GenerateEnumDocComment): Removed.
8862         
8863         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8864         (ConvertIntLiteral): Removed.
8865         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8866         
8867         * enum.cs (EnumMember): Implement IConstant.
8868         (Enum.IsValidEnumConstant): Removed.
8869         (Enum.GetNextDefaultValue): Removed.
8870         (Enum.FindMembers): Updated.
8871         (Enum.GenerateDocComment): Iterate enum members.
8872         
8873         * expression.cs (Cast.TryReduce): Handle enums correctly.
8874         (New.Constantify): Made public.
8875         (MemberAccess.DoResolve): Removed contant specific if(s).
8876         
8877         * literal.cs (NullLiteral): Implement new abstract methods.
8878         
8879         * statement.cs (GotoCase.Resolve): Use new constant methods.
8880         (SwitchLabel.ResolveAndReduce): Use new constant methods.
8881         
8882         * typemanager.cs (LookupEnum): Removed.
8883         (IsEnumType): Fixed to work with corlib.
8884         (RegisterConstant): Removed.
8885         (LookupConstant): Removed.
8886         (GetConstant): Changed to work with IConstant.
8887
8888 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
8889
8890         * location.cs : Fixed overflown (>255) column number.
8891
8892 2005-08-03  Raja R Harinath  <rharinath@novell.com>
8893
8894         First cut of the qualified-alias-member feature.
8895         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8896         token.
8897         * cs-parser.jay (DOUBLE_COLON): New token.
8898         (namespace_or_type_name): Add rule for recognizing
8899         qualified-alias-members.
8900         (primary_expression): Likewise.
8901         (element_access): Allow QualifiedAliasMember as a possible
8902         type-bearing expression.
8903         (local_variable_type, local_variable_pointer_type): Likewise.
8904         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
8905         aliases in the current and enclosing namespace declarations.
8906         (NamespaceEntry.UsingAlias): Add CS0440 warning.
8907         * decl.cs (MemberName.is_double_colon): New.
8908         (MemberName.MemberName): Add new constructor for alias-member.
8909         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8910         * expression.cs (QualifiedAliasMember): New expression type.
8911
8912 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8913
8914         * location.cs : it borked when no argument was specified.
8915
8916 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8917
8918         * location.cs : tiny ToString() format fix.
8919
8920 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8921
8922         * statement.cs : oops, it was missing.
8923
8924 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8925
8926         A set of fixes for precise line/column location.
8927
8928         * location.cs :
8929           "token" field now holds a file/line "delta", a line number offset 
8930           from the segment, and a column number. See also:
8931           http://lists.ximian.com/pipermail/mono-devel-list/2004-
8932           December/009508.html
8933           Removed static IsNull. Use instance IsNull property instead.
8934         * cs-tokenizer.cs :
8935           For some tokens it stores Location. For Identifier it stores
8936           LocatedToken which is a pair of string name and location.
8937           Column numbers are adjusted only at getChar().
8938         * report.cs :
8939           Use Location.ToString() for reporting (it now contains column).
8940         * cs-parser.jay :
8941           Largely modified to use LocatedToken instead of
8942           string (IDENTIFIER), and to acquire Location from some tokens.
8943         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8944           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8945           codegen.cs :
8946           Now MemberName holds Location. DeclSpace.ctor() receives Location
8947           as a parameter. Removed extra parameters to all derived classes.
8948           Replaced Location.IsNull() with instance property.
8949         * assign.cs, expression.cs :
8950           Added .ctor() overload that omits Location.
8951         * attribute.cs :
8952           Added "nameEscaped" flag that indicates the identifier was escaped
8953           in the source file. This fixes bug #57047.
8954
8955 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
8956
8957         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8958         New method, looking for lo-case imported cls type.
8959
8960         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8961         here.
8962
8963         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8964
8965         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8966
8967         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8968         all_imported_types.
8969         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8970
8971         Optimized to save 3.5 MB for SWF compilation.
8972
8973 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8974
8975         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8976         (PartialContainer.Create): Moved logic AddToContainer.
8977         (PartialContainer.MarkForDuplicationCheck): Shares name.
8978         
8979         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8980         place.
8981         
8982         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8983         initialization.
8984         (Namespace.GetSignatureForError): New method.
8985         
8986         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8987         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8988
8989 2005-08-01  Raja R Harinath  <rharinath@novell.com>
8990
8991         Fix #75669.
8992         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8993         member lookup rather than qualifier_type, since qualifier_type can
8994         be null.
8995
8996 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8997
8998         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
8999         enum member.
9000
9001 2005-07-31  Miguel de Icaza  <miguel@novell.com>
9002
9003         * statement.cs: Copy the local exception into the exception
9004         captured local.  Fixes 75674
9005
9006 2005-07-31  Raja R Harinath  <harinath@gmail.com>
9007
9008         Fix #75658.
9009         * expression.cs (Invocation.OverloadResolve): Don't report error
9010         CS1501 if error CS1502 has been reported.
9011         (New.DoResolve): Delegate CS1501 reporting to
9012         Invocation.OverloadResolve.
9013
9014         Fix #75656.
9015         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
9016         invariant-meaning-in-block property in an enclosing block if
9017         necessary.
9018
9019 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
9020
9021         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
9022         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
9023         (Switch.CheckSwitch): Just save 50kb for SWF.
9024
9025 2005-07-27  Martin Baulig  <martin@ximian.com>
9026
9027         * anonymous.cs (CaptureContext.AddField): Added
9028         `AnonymousContainer am' argument; compute its toplevel scope if
9029         it's not already computed.  Fixes #75649.
9030
9031 2005-07-26  Raja R Harinath  <rharinath@novell.com>
9032
9033         Fix #75628.
9034         * class.cs (Constructor.Emit): Reset block to null if the block
9035         resolve fails.
9036
9037 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
9038
9039         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
9040
9041 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
9042
9043         * class.cs (MethodData.Define): Check whether accessor implementing
9044         interface is public.
9045
9046         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
9047
9048 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
9049
9050         Fix #57245
9051         * namespace.cs (LookupType): Moved same type check to...
9052         
9053         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
9054         with the same name.
9055
9056 2005-07-21  Raja R Harinath  <rharinath@novell.com>
9057
9058         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
9059         already found a typebuilder.
9060         * class.cs (MethodCore.IsDuplicateImplementation): Compare
9061         MemberNames, not strings.
9062
9063         * const.cs (Error_ExpressionMustBeConst): 
9064         Rename from Error_EpressionMustBeConst.
9065         * const.cs, class.cs, statement.cd: Update.
9066
9067 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
9068
9069         Fix #65573
9070
9071         * const.cs (Const.LookupConstantValue): Report missing contant expression
9072         everytime.
9073         (Error_EpressionMustBeConstant): Only one error method.
9074
9075         * class.cs, statement.c: Updated.
9076
9077 2005-07-20  Raja R Harinath  <rharinath@novell.com>
9078
9079         * statement.cs (Block.Flags): Add back HasVarargs.
9080         (Block.flags): Make protected.
9081         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
9082
9083         * typemanager.cs (types, typecontainers, user_types): Remove.
9084         (UserTypes, TypeContainers): Likewise.
9085         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
9086         (CleanUp, Reset): Update.
9087         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
9088         (GetNestedType): Use Type.GetNestedType.
9089         (CoreLookupType): Take two arguments, the namespace and the
9090         basename of the type.  Update to use the Namespace.Lookup
9091         mechanism.
9092         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
9093         (RealMemberLookup): Use IsNestedChildOf instead of playing with
9094         string concatenation and substring matches.
9095         * class.cs, enum.cs, delegate.cs: Update to changes.
9096
9097 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
9098
9099         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
9100         Expression and made virtual.
9101
9102         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
9103         (ImplicitStandardConversionExists): Fixed `byte' typo ?
9104
9105         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
9106
9107         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
9108         error message.
9109
9110         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
9111         change.
9112
9113 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
9114
9115         Fix #57707
9116         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
9117         AssemblyCultureAttribute is not used on executable.
9118
9119         * rootcontext.cs,
9120         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
9121
9122 2005-07-16  Raja R Harinath  <rharinath@novell.com>
9123
9124         Fix #60638.
9125         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
9126         New.  Reports CS0252/CS0253.
9127         Mostly taken from preliminary patch by Duncak Mak.
9128         (Binary.DoResolveOperator): Store results of operator lookup.
9129         Use them to detect if we need to warn about unintended reference
9130         comparisons.
9131
9132 2005-07-15  Raja R Harinath  <rharinath@novell.com>
9133
9134         Fix #72969.
9135         * namespace.cs (Namespace.Lookup): Add back location parameter.
9136         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
9137         * delegate.cs, ecore.cs, expression.cs: Update to changes.
9138
9139         * codegen.cs (EmitContext.DeclSpace): Make readonly.
9140         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
9141         (Namespace.LookupType): ... this.
9142         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
9143         of namespaces.
9144         * typemanager.cs (LookupTypeReflection): Remove buggy code that
9145         purported to handle pointers.
9146         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
9147         CoreLookupType.
9148
9149 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
9150
9151         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
9152         type as namespace.
9153
9154 2005-07-15  Raja R Harinath  <rharinath@novell.com>
9155
9156         * namespace.cs (Namespace.Lookup): Drop location parameter.
9157         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
9158         (NamespaceEntry.Lookup): ... this.
9159         (NamespaceEntry.Error_AmbiguousTypeReference):
9160         Move here from DeclSpace.
9161         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
9162         names ...
9163         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
9164         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
9165         Move to NamespaceEntry.
9166         * delegate.cs, expression.cs: Update to changes.
9167
9168 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
9169
9170         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
9171         CheckAttributeType and refactored.
9172         (Attribute.ResolvePossibleAttributeType): Changed to reuse
9173         ResolveAsTypeTerminal error handling.
9174         (ResolveAsTypeTerminal): Introduced because of global attributes extra
9175         handling.
9176         (GetSignatureForError): Print errors in same way.
9177
9178         * class.cs,
9179         * codegen.cs: Reflect attribute GetSignatureForError change.
9180
9181         * ecore.cs,
9182         * expression.cs: Add silent parameter to ResolveAsTypeStep.
9183
9184         * namespace.cs (UsingEntry): Refactored to make fields private.
9185
9186         * assign.cs,
9187         statement.cs: Error_UnexpectedKind has extra parameter.
9188
9189 2005-07-14  Raja R Harinath  <rharinath@novell.com>
9190
9191         * ecore.cs (IAlias): Remove.
9192         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
9193         that implement the interface.
9194         * namespace.cs (Namespace): Likewise.
9195         (Namespace.declspaces): Renamed from 'defined_names'.
9196         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
9197         DeclSpace instead of an IAlias.
9198         * tree.cs (Tree.AddDecl): Update.
9199
9200 2005-07-12  Raja R Harinath  <rharinath@novell.com>
9201
9202         * statement.cs (Block.Flags); Remove HasVarargs.
9203         (Block.HasVarargs): Move to ToplevelBlock.
9204         (Block.ThisVariable, Block.AddThisVariable): Likewise.
9205         (Block.Variables): Make protected.  Initialize variable hashtable
9206         if necessary.
9207         (Block.AddVariable): Update.
9208         (Block.Resolve): Update to changes.
9209         (ToplevelBlock.HasVarargs): New boolean.
9210         (ToplevelBlock.ThisVariable): Move here from Block.
9211         (ToplevelBlock.AddThisVariable): Likewise.
9212         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
9213         * expression.cs (This.ResolveBase): Update to changes.
9214         (ArglistAccess.DoResolve): Likewise.
9215
9216 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
9217
9218         Fix #75321
9219         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
9220
9221         * class.cs (TypeContainer.VerifyMembers): Distinguish between
9222         not used and not used & assigned.
9223         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
9224
9225 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
9226
9227         Fix #75053
9228         * expression.cs (Is.DoResolve): null is never provided type.
9229
9230 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
9231
9232         Fix #52496
9233         * cs-parser.jay: Less strict event error rule to catch more errors.
9234
9235 2005-07-08  Martin Baulig  <martin@ximian.com>
9236
9237         Fix test-iter-10.cs - distinguish whether we `yield' in a property
9238         gettter (allowed) or setter (not allowed).
9239
9240         * class.cs (Accessor): Implement IIteratorContainer.
9241         (Accessor.Yields): New public field.
9242         (PropertyBase.PropertyMethod.Define): Handle iterators on a
9243         per-accessor basis.
9244
9245         * cs-parser.jay
9246         (get_accessor_declaration, set_accessor_declaration): Set the
9247         `yields' flag on the accessor, not the property.
9248         (property_declaration): Do the iterators check on a per-accessor
9249         basis and not for the whole property.
9250
9251 2005-07-08  Martin Baulig  <martin@ximian.com>
9252
9253         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
9254         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
9255
9256 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
9257
9258         Fix #74975
9259         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
9260         (ExtractSecurityPermissionSet): Cope with self referencing security
9261         attributes properly.
9262
9263         * driver.cs (SetOutputFile): Made public property OutputFile.
9264
9265 2005-07-07  Raja R Harinath  <rharinath@novell.com>
9266
9267         Fix #75486.
9268         * class.cs (TypeContainer.first_nonstatic_field): Rename from
9269         has_nonstatic_fields.  Make into a FieldBase pointer.
9270         (TypeContainer.AddField): Add CS0282 check.
9271         (TypeContainer.EmitType): Update.
9272
9273 2005-07-06  Miguel de Icaza  <miguel@novell.com>
9274
9275         * cs-tokenizer.cs (consume_identifier): Do not create strings to
9276         compare if they start with __.
9277
9278 2005-07-06  Raja R Harinath  <rharinath@novell.com>
9279
9280         * statement.cs (Switch.SwitchGoverningType): Only look at
9281         UserCasts that don't need implicit standard conversions to one of
9282         the allowed switch types (Fixes test-322.cs).
9283         (LocalInfo.Resolve): Re-enable sanity-test.
9284
9285 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
9286
9287         * cs-tokenizer.cs (consume_identifier): Detect double undescores
9288         
9289         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
9290         
9291         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
9292
9293 2005-07-06  Raja R Harinath  <rharinath@novell.com>
9294
9295         Fix #75472.
9296         * ecore.cs (SimpleName.GetSignatureForError): Add.
9297         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
9298         (MemberAccess.GetSignatureForError): Add.
9299
9300 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
9301  
9302         The big error and warning messages review.
9303         
9304         * anonymous.cs,
9305         * assign.cs,
9306         * attribute.cs,
9307         * class.cs,
9308         * codegen.cs,
9309         * convert.cs,
9310         * cs-parser.jay,
9311         * cs-tokenizer.cs,
9312         * decl.cs,
9313         * delegate.cs,
9314         * doc.cs,
9315         * driver.cs,
9316         * ecore.cs,
9317         * enum.cs,
9318         * expression.cs,
9319         * flowanalysis.cs,
9320         * iterators.cs,
9321         * literal.cs,
9322         * location.cs,
9323         * modifiers.cs,
9324         * namespace.cs,
9325         * parameter.cs,
9326         * pending.cs,
9327         * report.cs,
9328         * rootcontext.cs,
9329         * statement.cs,
9330         * support.cs,
9331         * tree.cs,
9332         * typemanager.cs: Updated.
9333         
9334         * class.cs: (MethodCore.SetYields): Moved here to share.
9335         (PropertyMethod.Define): Moved iterator setup here.
9336         
9337         * iterators.cs: Add orig_method to have full access to parent
9338         container.
9339
9340 2005-07-05  Raja R Harinath  <rharinath@novell.com>
9341
9342         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9343         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9344         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9345         variable of struct type.
9346         * expression.cs (Unary.ResolveOperator): Update to change.
9347         (Indirection.VerifyFixed): Likewise.
9348         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9349         (ParameterReference.VerifyFixed): Value parameters are fixed.
9350         (This.VerifyFixed): Treat 'this' as a value parameter.
9351         * statement.cs (LocalInfo.IsFixed): Remove.
9352
9353 2005-07-01  Martin Baulig  <martin@ximian.com>
9354
9355         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9356         `ec.EmitThis ()' to get the correct scope.
9357
9358 2005-07-01  Martin Baulig  <martin@ximian.com>
9359
9360         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9361         instance is a ParameterReference; fixes #75299.
9362
9363 2005-07-01  Martin Baulig  <martin@ximian.com>
9364
9365         Reverted Marek's latest patch (r46725):
9366         - it contains structural changes which are neither mentioned in
9367           the ChangeLog nor explained anywhere; for example the additional
9368           argument of EmitContext's and Iterator's .ctor's and the
9369           TypeContainer.DefineMembers() change.
9370         - structural changes like this should go in in seperate patches
9371           and not be hidden in a huge patch which just seems to affect
9372           warnings and errors.
9373           a big and hard to understand patch.
9374         - it breaks iterators and causes regressions, for instance in
9375           test-iter-03.cs.      
9376
9377 2005-06-30  Raja R Harinath  <rharinath@novell.com>
9378
9379         Fix #75412.
9380         * expression.cs (Indexers.map): Remove.
9381         (Indexers.Append): Filter out inaccessible setters and getters.
9382         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9383
9384         Fix #75283.
9385         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
9386         Refactored from ...
9387         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9388         (FieldExpr.Emit, PropertyExpr.Emit): Update.
9389         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9390         * expression.cs (Invocation.EmitCall): Add CS0120 check.
9391
9392 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
9393
9394         Fix #75322
9395         * class.cs (FieldBase.GetInitializerExpression): One more field
9396         for backup.
9397
9398 2005-06-28  Miguel de Icaza  <miguel@novell.com>
9399
9400         * pending.cs: Do not define a proxy if the base method is virtual,
9401         it will be picked up by the runtime (bug 75270).
9402
9403 2005-06-08  Martin Baulig  <martin@ximian.com>
9404
9405         The big Iterators rewrite :-)
9406
9407         * iterators.cs: Rewrite this to use the anonymous methods framework.
9408
9409         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9410         before the TypeContainers; see 2test-21.cs.
9411
9412         * class.cs
9413         (TypeContainer.DefineType): Don't create a new EmitContext if we
9414         already have one (this only happens if we're an Iterator).
9415         (TypeContainer.Define): Also call Define() on all our iterators.
9416         (Method.CreateEmitContext): Added support for iterators.
9417
9418         * anonymous.cs
9419         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9420         (AnonymousContainer.CreateMethodHost): Moved here from
9421         AnonymousMethod and made abstract.
9422         (AnonymousContainer.CreateScopeType): New abstract method.
9423         (AnonymousContainer.IsIterator): New public property.
9424         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9425         get the ScopeTypeBuilder rather than manually defining it here. 
9426         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9427         iterators here.
9428
9429         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9430         before RootContext.DefineTypes().
9431
9432         * codegen.cs (EmitContext.RemapToProxy): Removed.
9433         (EmitContext.CurrentAnonymousMethod): Changed type from
9434         AnonymousMethod -> AnonymousContainer.
9435         (EmitContext.ResolveTopBlock): Protect from being called twice.
9436         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9437         (EmitContext.EmitThis): Removed the iterators hacks; use the
9438         anonymous methods framework for that.
9439
9440         * statement.cs
9441         (ToplevelBlock.Container): Make this a property, not a field.
9442         (ToplevelBlock.ReParent): New public method; move the
9443         ToplevelBlock into a new container.
9444         (Foreach.TemporaryVariable): Simplify.
9445
9446 2005-06-05  Martin Baulig  <martin@ximian.com>
9447
9448         * statement.cs (LocalInfo.CompilerGenerated): New flag.
9449         (Block.AddTemporaryVariable): New public method; creates a new
9450         `LocalInfo' for a temporary variable.
9451         (Block.EmitMeta): Create the LocalBuilders for all the temporary
9452         variables here.
9453         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9454         non-iterator variables.
9455
9456 2005-06-05  Martin Baulig  <martin@ximian.com>
9457
9458         * statement.cs (Foreach.TemporaryVariable): Create the
9459         LocalBuilder in the Emit phase and not in Resolve since in some
9460         situations, we don't have an ILGenerator during Resolve; see
9461         2test-19.cs for an example.
9462
9463 2005-06-04  Martin Baulig  <martin@ximian.com>
9464
9465         **** Merged r45395 from GCS ****
9466
9467         The big Foreach rewrite - Part II.
9468
9469         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9470         with `PropertyInfo ienumerator_getcurrent'.
9471
9472         * codegen.cs (VariableStorage): Removed.
9473
9474         * statement.cs
9475         (Foreach): Derive from Statement, not ExceptionStatement.
9476         (Foreach.CollectionForeach): New nested class.  Moved all the code
9477         dealing with collection foreach here.
9478         (Foreach.ForeachHelperMethods): Removed.
9479         (Foreach.TemporaryVariable): Implement IMemoryLocation.
9480
9481 2005-05-23  Martin Baulig  <martin@ximian.com>
9482
9483         * statement.cs (Try.DoResolve): Don't create a `finally' if we
9484         don't need to.  Fix #75014.
9485
9486 2005-05-20  Martin Baulig  <martin@ximian.com>
9487
9488         Merged r44808 from GMCS.
9489
9490         * class.cs (TypeContainer.CircularDepException): Removed.
9491         (TypeContainer.DefineType): Removed the `InTransit' stuff.
9492         (TypeContainer.CheckRecursiveDefinition): Check for circular class
9493         (CS0146) and interface (CS0529) dependencies here.
9494
9495 2005-06-21  Raja R Harinath  <rharinath@novell.com>
9496
9497         * expression.cs (Invocation.EmitCall): Fix initialization
9498         'this_call' to reflect current behaviour.  Fix indentation.
9499
9500         * convert.cs (FindMostEncompassedType): Add two trivial special
9501         cases (number_of_types == 0 || number_of_types == 1).
9502         (FindMostEncompasingType): Likewise.
9503
9504 2005-06-17  Raja R Harinath  <rharinath@novell.com>
9505
9506         Some cleanups preparing for the fix of #75283.
9507         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9508         error testing.
9509         (EventExpr.InstanceResolve): Likewise.
9510         (EventExpr.DoResolve): Remove redundant checks.
9511
9512 2005-06-10  Duncan Mak  <duncan@novell.com>
9513
9514         * cs-tokenizer.cs (process_directives): New flag for controlling
9515         the processing of preprocessor directives.
9516         (x_token): After seeing a '#', return Token.NONE instead of going
9517         to handle_preprocessing_directive() when not processing
9518         directives. This avoids unnecessary processing during the token peek in
9519         is_punct().
9520
9521         This fixes #74939.
9522
9523         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9524         the existing error reporting methods instead of Report.Error.
9525
9526         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9527         after Raja's rewrite.
9528
9529 2005-06-08  Miguel de Icaza  <miguel@novell.com>
9530
9531         * class.cs: Small fix.
9532
9533 2005-06-08  Raja R Harinath  <rharinath@novell.com>
9534
9535         Fix #75160.
9536         * class.cs (GetPartialBases): Fix return value check of
9537         part.GetClassBases.
9538
9539 2005-06-07  Raja R Harinath  <rharinath@novell.com>
9540
9541         Ensure that partial classes are registered in their enclosing
9542         namespace.  Initial part of fix of #75160.
9543         * tree.cs (Tree.RecordDecl): Add new namespace argument.
9544         Register declspace with namespace here, not in
9545         DeclSpace.RecordDecl.
9546         * cs-parser.jay: Pass namespace to RecordDecl.
9547         * class.cs (PartialContainer.Create): Likewise.
9548         (ClassPart.DefineType): New sanity-check.  Throws an exception if
9549         called.
9550         * decl.cs (Declspace.RecordDecl): Remove.
9551         * namespace.cs (NamespaceEntry.DefineName): Remove.
9552
9553 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
9554
9555         * rootcontext.cs: Reset TargetExt as well.
9556
9557 2005-06-03  Raja R Harinath  <rharinath@novell.com>
9558
9559         * ecore.cs (Expression.Resolve): Emit CS0654 error when
9560         -langversion:ISO-1.
9561
9562 2005-06-02  Raja R Harinath  <rharinath@novell.com>
9563
9564         Fix #75080, cs0119.cs.
9565         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
9566         of ...
9567         (Expression.Resolve): ... this.  Use it.  Remove bogus code
9568         allowing ExprClass.Type and ExprClass.Namespace for
9569         ResolveFlags.VariableOrValue.
9570         (Expression.Resolve) [1-argument variant]: Change default resolve
9571         flags based on language version.
9572         (Expression.Error_UnexpectedKind): Use a simple string array
9573         rather than an ArrayList.
9574         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9575         not ExprClass.Type.
9576         (TypeOfVoid.DoResolve): Likewise.
9577         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
9578         flags argument -- it always has the same value.
9579
9580 2005-05-31  Raja R Harinath  <rharinath@novell.com>
9581
9582         Fix #75081.
9583         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9584         Use it in the error message.
9585         * assign.cs, expression.cs, statement.cs: Update.
9586
9587 2005-05-30  Raja R Harinath  <rharinath@novell.com>
9588
9589         Fix #75088.
9590         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9591         the "almostMatchedMember" case too.
9592         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9593         that failed the accessibility checks to 'almost_match'.
9594
9595 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
9596
9597         * attribute.cs: Use internal MethodBuilder methods to set
9598         ExactSpelling and SetLastError on PInvoke methods, instead
9599         of passing them via charset.  Fixes #75060.
9600
9601 2005-05-27  Raja R Harinath  <rharinath@novell.com>
9602
9603         * parameter.cs (Parameter): Remove TODO comment.
9604         (Parameter.DefineParameter): Remove Location parameter.
9605         (Parameters.LabelParameters): Likewise.
9606         * class.cs (Constructor.Emit): Update to change.
9607         (MethodData.Emit): Likewise.
9608         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
9609         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9610
9611 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
9612
9613         * parameter.cs,
9614           Removed Parameters.Location and added Parameter.Location instead.
9615           Removed Location parameter from Emit() and GetSignature().
9616         * anonymous.cs,
9617           class.cs,
9618           cs-parser.jay,
9619           delegate.cs,
9620           iterators.cs,
9621           statement.cs :
9622           Modified all related calls.
9623
9624 2005-05-26  Raja R Harinath  <rharinath@novell.com>
9625
9626         Improve user-defined conversion handling.
9627         * convert.cs (GetConversionOperators): Rewrite.  Return only the
9628         applicable operators.
9629         (AddConversionOperators): New.  Helper for GetConversionOperators.
9630         (FindMostEncompassedType, FindMostEncompassingType): Verify that
9631         there is only one most encompassed/encompassing type.
9632         (FindMostSpecificSource, FindMostSpecificTarget): Remove
9633         "applicable operator" handling.
9634         (UserConversion): Move cache here from GetConversionOperators.
9635         Directly cache the chosen operator, rather than the whole
9636         MethodGroup.
9637         (ExplicitNumericConversion): Fix buggy implementation of Decimal
9638         case.  Allow conversion of decimal to sbyte and byte too.
9639         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9640         New static methods.  Used to avoid allocating EmptyExpressions in
9641         convert.cs.
9642
9643 2005-05-24  Duncan Mak  <duncan@novell.com>
9644
9645         * ecore.cs (CastFromDecimal): New class for casting a decimal to
9646         another class, used in Convert.ExplicitNumericConversion.
9647         (CastToDecimal): New class, similar to above, but casts to
9648         System.Decimal, used in Convert.ImplicitNumericConversion and also
9649         in explicit convesion from double/float to decimal.
9650
9651         * convert.cs (ImplicitNumericConversion): Handle implicit
9652         conversions to System.Decimal.
9653         (ExplicitNumericConversion): handle explicit conversions to
9654         System.Decimal.
9655
9656         This fixes #68711.
9657         
9658 2005-05-20  Miguel de Icaza  <miguel@novell.com>
9659
9660         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9661         know the type at this stage, just break through.   Fixes #75008 
9662
9663 2005-05-19  Martin Baulig  <martin@ximian.com>
9664
9665         * delegate.cs
9666         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9667         to disable error reporting.
9668
9669         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9670         here since we don't want to report an error; see the new test-336.cs.
9671
9672 2005-05-19  Raja R Harinath  <rharinath@novell.com>
9673
9674         * statement.cs (ToplevelBlock.GetParameterReference)
9675         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9676         Move here from class Block.
9677         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9678         * expression.cs (ParameterReference.DoResolveBase): Likewise.
9679
9680 2005-05-18  Martin Baulig  <martin@ximian.com>
9681
9682         Fix #74978.
9683
9684         * flowanalysis.cs
9685         (FlowBranching.Reachability): Add non-static public And() and Or()
9686         methods.
9687         (FlowBranchingSwitch): New class; do the `break_origins' thing
9688         like in FlowBranchingLoop.
9689         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9690         reachability, not just locals and parameters.
9691         (FlowBranching.MergeChild): Remove some of the hacks for loop and
9692         switch; MergeBreakOrigins() now takes care of that.
9693
9694 2005-05-18  Martin Baulig  <martin@ximian.com>
9695
9696         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9697         a loop and may leave it, reset the barrier; fixes #74974.
9698
9699 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
9700         
9701         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9702         is back.
9703         
9704         * cs-parser.jay: Catch more lexical errors.
9705         
9706         * report.cs: Add one more Error method.
9707         
9708         * rootcontext.cs,
9709         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9710
9711 2005-05-17  Martin Baulig  <martin@ximian.com>
9712
9713         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9714         #70970. 
9715
9716 2005-05-16  Raja R Harinath  <rharinath@novell.com>
9717
9718         Fix test-382.cs.  Emit values of decimal constants.
9719         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9720         Carved out of ...
9721         (TypeContainer.AddField): ... this.
9722         (TypeContainer.EmitFieldInitializers): Allow the list of fields
9723         with initializers to include 'Const's.
9724         (ClassPart.RegisterFieldForInitialization): Forward to
9725         PartialContainer.
9726         * const.cs (Const.Const): Pass initializer to base class.
9727         (Const.Define): In case of decimal constants, register them for
9728         initialization in a static constructor.
9729
9730 2005-05-14  Martin Baulig  <martin@ximian.com>
9731
9732         * statement.cs (Block.Resolve): Correctly handle unreachable code;
9733         do not call ResolveUnreachable() on unreachable statements in
9734         here, see the comment in the source code.
9735
9736 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9737
9738         Fix #74934.
9739         * expression.cs (BinaryResolveOperator): If one of the operands of
9740         an equality comparison is 'null' and the other is a pointer type,
9741         convert the null to a NullPointer.
9742         * convert.cs (ImplicitReferenceConversion): If the expression is a
9743         NullLiteral and the target type is a pointer type, return a
9744         NullPointer instead.
9745         (ImplicitConversionStandard): Likewise.
9746
9747 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
9748         
9749         * cs-parser.jay: Set readonly context based on special constructs.
9750         
9751         * expression.cs (LocalVariableReference.DoResolveBase): Improved
9752         readonly variable error handling.
9753         
9754         * rootcontext.cs (EmitCode): Don't verify members when error
9755         occurred.
9756         
9757         * statement.cs (LocalInfo): Add reaodnly context information.
9758         (SetReadOnlyContext, GetReadOnlyContext): New methods.
9759
9760 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9761
9762         * statement.cs (Block.Resolve): Revert change below.  Modify fix
9763         for #74041 to initialize 'resolved' to false only for explicit
9764         blocks.  Fixes #74873.
9765
9766 2005-05-12  Raja R Harinath  <harinath@gmail.com>
9767
9768         Fix #74920.
9769         * typemanager.cs (unmanaged_enclosing_types): New.
9770         (IsUnmanagedType): Avoid infloops by using
9771         'unmanaged_enclosing_types' to talk with recursive invocations.
9772
9773 2005-05-13  Martin Baulig  <martin@ximian.com>
9774
9775         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9776         instance variable, not a local.  Fix #74873.
9777         (Block.ResolveUnreachable): Set it to true here.
9778
9779 2005-05-11  Duncan Mak  <duncan@novell.com>
9780
9781         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9782         continuing to process for 'arg'.
9783         (handle_preprocessing_directive): Check the argument of the #endif
9784         directive and report error CS1025 if there are any trailing
9785         characters.
9786
9787         According to the C# spec, having even whitespace after the #endif
9788         directive is illegal; however, because we call arg.TrimEnd ()
9789         beforehand, we have the same behavior as csc, allowing whitespace
9790         after the directive.
9791
9792         Fixes #74892.
9793
9794 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
9795
9796         Fix #74863.
9797         
9798         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9799         (Constructor.GetObsoleteAttribute): Implemented correctly.
9800
9801 2005-05-10  Martin Baulig  <martin@ximian.com>
9802
9803         * support.cs (ReflectionParameters.ParameterModifier): Use
9804         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9805         and `ParameterAttributes.In'.  Fixes #74884.
9806
9807 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
9808
9809         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9810         
9811         * expression.cs (Argument.GetParameterModifier): Turned to property.
9812         (Invocation.Error_InvalidArguments): Add more descriptive errors.
9813         
9814         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9815         its C# equivalent.
9816         
9817 2005-05-09  Raja R Harinath  <rharinath@novell.com>
9818
9819         Fix #74852.
9820         * decl.cs (MemberCache.AddMethods): Register override methods,
9821         rather than non-override methods.
9822         * typemanager.cs (RegisterOverride): New.
9823         (IsOverride): Update.
9824
9825 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
9826
9827         Fix #73105.
9828         
9829         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9830         recursive declaration.
9831         
9832         * statement.cs (Block.ResolveMeta): Report any error in resolving.
9833         
9834 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
9835
9836         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9837         
9838         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9839
9840 2005-05-05  Raja R Harinath  <rharinath@novell.com>
9841
9842         Fix #74797.
9843         * decl.cs (DeclSpace.FamilyAccessible): 
9844         Use TypeManager.IsNestedFamilyAccessible.
9845
9846         Fix reopened #64812.
9847         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9848         internal'.
9849
9850 2005-05-04  Raja R Harinath  <rharinath@novell.com>
9851             Abin Thomas  <projectmonokochi@rediffmail.com>
9852             Anoob V E  <projectmonokochi@rediffmail.com>
9853             Harilal P R  <projectmonokochi@rediffmail.com>
9854
9855         Fix #64812.
9856         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9857         allow access to all static members.
9858
9859 2005-05-04  Martin Baulig  <martin@ximian.com>
9860
9861         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9862
9863 2005-05-04  Martin Baulig  <martin@ximian.com>
9864
9865         Fix #74655.
9866
9867         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9868         section at the end; make things work if `default' is not the last
9869         section.        
9870
9871 2005-05-04  Martin Baulig  <martin@ximian.com>
9872
9873         Fix #70400.
9874
9875         * statement.cs (Switch): Replaced the `got_default' field with a
9876         `default_section' one.
9877         (Switch.CheckSwitch): Set `default_section' here.
9878         (Switch.Resolve): If we're a constant switch and the constant is
9879         not found, use the default section.
9880
9881 2005-05-03  Martin Baulig  <martin@ximian.com>
9882
9883         * expression.cs (ArrayAccess.EmitGetLength): New public method.
9884
9885         * statement.cs (Foreach.ArrayForeach): New nested class.
9886         (Foreach.TemporaryVariable): New nested class.
9887         (Foreach.EmitArrayForeach): Removed; this is now in the new
9888         ArrayForeach class.
9889
9890 2005-05-03  Raja R Harinath  <rharinath@novell.com>
9891
9892         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
9893         more conservative.
9894         (VerifyPendingMethods): Revert change below.
9895
9896         * typemanager.cs (IsOverride, RegisterNonOverride): New.
9897         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9898         that used to trigger warning -28.  Remove warning -28.
9899         * expression.cs (Invocation.OverloadResolve): Use
9900         TypeManager.IsOverride to distinguish override methods.
9901
9902         Fix #74773.
9903         * pending.cs (VerifyPendingMethods): If a base type implements the
9904         requested interface, don't bother checking individual methods of
9905         the base type.  As a side-effect, this prevents the creation of
9906         unnecessary proxies.
9907
9908 2005-05-02  Martin Baulig  <martin@ximian.com>
9909
9910         Fix #70182.
9911
9912         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9913         Also `And' the locals if the old vector is null.
9914         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9915         null; in this case we basically reset all the variables.        
9916
9917 2005-05-02  Martin Baulig  <martin@ximian.com>
9918
9919         Fix #74529.
9920
9921         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9922         Added `FlowBranching branching' argument; always `and' the
9923         variables instead of `or'ing them unless we're an infinite loop.
9924
9925         * statement.cs (While.Resolve): Create a new sibling unless we're
9926         infinite.       
9927
9928 2005-05-02  Martin Baulig  <martin@ximian.com>
9929
9930         Fix #70140.
9931
9932         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9933         arguments; use it instead of creating a new TopLevelBlock.
9934         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9935         our ConstructorInitializer.
9936
9937         * statement.cs
9938         (TopLevelBlock.TopLevelBranching): New public property.
9939         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9940         and create our `TopLevelBranching'.
9941
9942         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9943         anonymous method host, use `block.TopLevelBranching' rather than
9944         creating a new branching.
9945
9946 2005-04-20  Miguel de Icaza  <miguel@novell.com>
9947
9948         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9949         a ScopeInfo, if any of the current children is a child of the new
9950         entry, move those children there.
9951
9952 2005-04-30  Martin Baulig  <martin@ximian.com>
9953
9954         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9955         at the beginning of a SwitchSection.  Fix #73335.
9956
9957 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
9958
9959         Fix #74378
9960         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9961         
9962         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9963         (FieldExpr.DoResolve): Obsolete members are ignored for field
9964         initializers.
9965         
9966 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
9967
9968         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9969         of arrays detection.
9970
9971         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9972         verification.
9973         (Field.VerifyClsCompliance): Volatile fields are not compliant.
9974
9975         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9976         arrays report.
9977
9978 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
9979
9980         * cs-parser.jay: Use the prefered version of -unsafe in error
9981         message.
9982
9983 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
9984
9985         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9986         circumstances.
9987
9988 2005-04-20  John Luke  <john.luke@gmail.com>
9989
9990         * driver.cs: fix typo in error message, --outout to --output
9991
9992 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
9993
9994         * codegen.cs (InRefOutArgumentResolving): New field.
9995         
9996         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9997         fields outside contructor.
9998         
9999         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
10000         
10001 2005-04-19  Miguel de Icaza  <miguel@novell.com>
10002
10003         * anonymous.cs (CaptureContext.EmitParameterInstance): The
10004         parameter code was not completed ever, so it was not as up-to-date
10005         as local variables.  Must finish it.
10006
10007         The bug fix was to compare the Toplevel of the block, not the
10008         current block.  Thanks for Ben for pointing this out. 
10009
10010 2005-04-19  Raja R Harinath  <rharinath@novell.com>
10011
10012         * decl.cs (AddMethods): Use the declaring type of the problem
10013         method to determine if we want to squash a warning.
10014
10015 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
10016
10017         * attribute.cs: Removed debug output.
10018
10019         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
10020         
10021         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
10022         Report.Stderr.
10023         
10024 2005-04-18  Raja R Harinath  <rharinath@novell.com>
10025
10026         Fix #74481.
10027         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
10028         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
10029         all null comparisons against reference types.
10030
10031 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
10032
10033         Fix# 74565
10034         * class.cs (TypeContainer.CircularDepException) New nested
10035         exception class.
10036         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
10037         (TypeContainer.DefineType): Removed error, reset InTransit before
10038         exit.
10039         (Class.DefineType): Throw exception when is in Transit.
10040         Catch exception and report error.
10041         (Struct.DefineType): Throw exception when is in Transit.
10042         Catch exception and report error.
10043         (Interface.DefineType): Throw exception when is in Transit.
10044         Catch exception and report error.
10045
10046         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
10047         handle nested exception handlers.
10048
10049         * flowanalysis.cs (InTryWithCatch): New method, search for try with
10050         a catch.
10051
10052         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
10053         InFinally and InCatch storage.
10054
10055         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
10056         (Catch.Resolve): Set and Restore ec.InCatch.
10057         (Try.Resolve): Set and Restore ec.InFinally.
10058         (Try.HasCatch): True when try has catch.
10059
10060 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
10061
10062         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
10063           for the same event member, so exclude such cases from warning 419.
10064           Fixed bug #74633.
10065
10066 2005-04-16  Miguel de Icaza  <miguel@novell.com>
10067
10068         * expression.cs (Binary.ResolveOperator): Apply patch from John
10069         Luke to fix bug 59864: operators &, | and ^ on enumerations
10070         require that the same enum type on both sides.
10071
10072         * driver.cs: Add warnings to old flag usage, this is to assist
10073         people who produce Makefiles and hope that the Makefiles will be
10074         used on Windows.
10075
10076         * class.cs (TypeContainer.EmitType): Moved the definition of the
10077         special $PRIVATE$ field from the resolve phase to the Emit phase.
10078         During resolve we do not know if we are a struct with
10079         HasExplicitLayout, we know this only after the attributes for the
10080         type are emitted.
10081
10082         Set the FieldOffset to zero on the dummy field that we create for
10083         the class.   Fixes 74590.
10084
10085 2005-04-16  Raja R Harinath  <rharinath@novell.com>
10086
10087         Fix #73834.
10088         * ecore.cs (PropertyExpr.resolved): New.
10089         (DoResolve): Use it to handle a case of double resolution here.
10090         Handle a case of identical-name-and-type-name.
10091         * expression.cs (ArrayCreation.CheckIndices): Avoid double
10092         resolution by storing the results of expression resolution back
10093         into the "probes" array.
10094
10095 2005-04-15  Raja R Harinath  <rharinath@novell.com>
10096
10097         Fix cs0208-7.cs and cs0208-8.cs.
10098         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
10099         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
10100         error reporting to point out the reason a struct is not unmanaged.
10101
10102 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10103
10104         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
10105           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
10106
10107 2005-04-13  Raja R Harinath  <rharinath@novell.com>
10108
10109         Fix #74528.
10110         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
10111         IdenticalNameAndTypeName here.
10112         (EventExpr.InstanceResolve): Likewise.
10113
10114 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
10115
10116         C# 2.0 DefaultCharSetAttribute implementation
10117         
10118         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
10119         which allows us to set GlobalNamespace for every resolve.
10120         (Attribute.ResolveArguments): Cut from Resolve.
10121         (Attribute.GetCharSetValue): Returns CharSet named argument.
10122         (Attribute.DefinePInvokeMethod): Gets default charset from
10123         module settings.
10124         (GlobalAttribute.ResolveAsTypeStep): Override.
10125         (GlobalAttribute.ResolveArguments): Override.
10126         
10127         * class.cs (TypeAttr): Is protected.
10128         
10129         * codegen.cs (ModuleClass.DefaultCharSet): New member.
10130         (ModuleClass.DefaultCharSetType): New memeber.
10131         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
10132         
10133         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
10134         charset from module.
10135         
10136         * delegate.cs (TypeAttr): Override.
10137         (Delegate.DefineType): Use this TypeAttr.
10138         
10139         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
10140         at very early stage (before types are defined) to resolve model
10141         module attributes. It will probably not work with corlib but it
10142         should be ok.
10143         
10144         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
10145         charset from module.
10146         
10147         * typemanager.cs (default_charset_type): New type.
10148
10149 2005-04-13  Raja R Harinath  <rharinath@novell.com>
10150
10151         * decl.cs (MemberCache.AddMethods): Don't warn if
10152         System.Object.Finalize has buggy MethodAttributes.
10153
10154         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
10155         removed below.
10156
10157 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10158
10159         * doc.cs : detect ambiguous reference to overloaded members.
10160           Fixed bug #71603. MS 1.1 csc does not detect it.
10161
10162 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10163
10164         * doc.cs : delegates must not be referenced with parameters.
10165           Fixed bug #71605.
10166
10167 2005-04-12  Miguel de Icaza  <miguel@novell.com>
10168
10169         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
10170
10171 2005-04-10  Miguel de Icaza  <miguel@novell.com>
10172
10173         * driver.cs (MainDriver): Stop processing if the CLS stage found
10174         errors. 
10175
10176         (CompilerCallableEntryPoint.InvokeCompiler): Always
10177         reset after execution;   Take a TextWriter argument for the
10178         output.
10179
10180         * report.cs: Use the error stream instead of hardcoding stderr. 
10181
10182 2005-04-09  Miguel de Icaza  <miguel@novell.com>
10183
10184         * class.cs: Reduce code paths to test, too small of an
10185         optimization to make it worth the extra testing.  Always perform
10186         it. 
10187
10188 2005-04-08  Raja R Harinath  <rharinath@novell.com>
10189
10190         Fix #74510.
10191         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
10192         operators that had errors reported on them.
10193
10194 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
10195
10196         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
10197         argument types.
10198         (Attribute.Resolve): Add named argument type checking.
10199         
10200         * class.cs (FixedField.Define): Use IsPrimitiveType
10201         
10202         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
10203         
10204         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
10205         unsafe parameter types.
10206         
10207         * statement.cs (Using.ResolveExpression): Add better error description.
10208         
10209         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
10210         
10211 2005-04-08  Raja R Harinath  <rharinath@novell.com>
10212
10213         Fix #74484.
10214         * attribute.cs (Attribute.GetAttributeUsage): Resolve
10215         AttributeUsageAttribute in the emitcontext of the attribute class,
10216         not in the emitcontext of the attributable entity it was attached to.
10217         * cs-parser.jay: Use 'current_class', not 'current_container',
10218         when creating a GlobalAttribute.
10219
10220 2005-04-08  Alp Toker  <alp@atoker.com>
10221
10222         * pending.cs: The fix to #58413 failed to compile methods implementing
10223         interfaces with/without params modifiers and vice versa, even though
10224         params modifiers aren't part of the signature. Make the modifier check
10225         less strict as in csc.
10226
10227 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
10228             Anoob V E  <projectmonokochi@rediffmail.com>
10229             Harilal P R  <projectmonokochi@rediffmail.com>
10230
10231         Fix #58413.
10232         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
10233         modifiers of pending methods.
10234         (PendingImplementation.PendingImplementation): Initialize it.
10235         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
10236         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
10237         with ParameterData.  Add check for modifiers.
10238         * class.cs (MethodData.Define): Update to changes.
10239
10240 2005-04-07  Raja R Harinath  <rharinath@novell.com>
10241
10242         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
10243
10244 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
10245
10246         * class.cs (PropertyMethod.Define): Check private accessor in abstract
10247         property.
10248         
10249         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
10250         
10251         * rootcontext.cs,
10252         * typemanager.cs: Registered RequiredAttributeAttribute.
10253         
10254 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
10255
10256         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
10257         Warning CS0169 is back at level 3.
10258         (IMethodData.SetMemberIsUsed): New method.
10259         
10260         * decl.cs (IsUsed): New value; moved from FieldBase.Status
10261         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
10262         
10263         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
10264
10265         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
10266         contants.
10267         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
10268         is used.
10269         
10270         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
10271         is used.
10272         
10273         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
10274         to avoid the problems with nested types.
10275
10276 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
10277             Anoob V.E  <projectmonokochi@rediffmail.com>
10278             Harilal P.R  <projectmonokochi@rediffmail.com>
10279             Raja R Harinath  <rharinath@novell.com>
10280
10281         Fix #73820.
10282         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
10283         attribute.
10284         * typemanager (GetConstructor): Make public.
10285
10286 2005-04-05  John Luke  <john.luke@gmail.com>
10287             Raja R Harinath  <rharinath@novell.com>
10288
10289         Fix #62232.
10290         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
10291         struct too.  Return false quicker in a few cases.
10292         (VerifyUnManaged): Use it.
10293
10294 2005-04-05  Raja R Harinath  <rharinath@novell.com>
10295
10296         Fix #74041.
10297         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
10298         not 'unreachable_seen'.
10299
10300 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
10301
10302         * attribute.cs (Attribute.GetValue): Removed unused.
10303         
10304         * codegen.cs (CodeGen.TrimExt): Removed unused.
10305         
10306         * cs-parser.jay (output): Removed unused.
10307         
10308         * cs-tokenizer.cs (hex_digits): Removed unused.
10309         
10310         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
10311         
10312         * expression.cs (Indirection.LoadExprValue): Removed unused.
10313         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
10314         
10315         * iterators.cs (Iterator.param_types): Removed unused.
10316         
10317         * statement.cs (Goto.block): Removed unused.
10318         (ToplevelBlock.did): Removed unused.
10319         (Switch.ResolveConstantSwitch): Removed unused.
10320
10321 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
10322
10323         * rootcontext.cs: Allow mcs to bootstrap with the compilation
10324         resetting thingy.
10325
10326 2005-04-01  Raja R Harinath  <rharinath@novell.com>
10327
10328         Fix #74232 and cs0208-3.cs.
10329         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10330         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10331         unmanaged type.  Don't use FieldBuilders when 't' is a
10332         TypeBuilder.  Use ModFlags and MemberType fields.
10333         * class.cs (MemberBase.member_type): Rename from MemberType.
10334         (MemberBase.MemberType): New property.  Determines member_type on
10335         demand.
10336         (MemberBase.DoDefine): Don't initialize MemberType here.
10337         (FieldMember.Define): Likewise.
10338
10339 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
10340
10341         Fix #74241
10342         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10343         Attributes are emitted there.
10344         
10345 2005-04-01  Raja R Harinath  <rharinath@novell.com>
10346
10347         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10348         keyword in 'partial enum' too.
10349         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10350         is not allowed).
10351         Report from Kamil Skalski <nazgul@omega.pl>.
10352
10353         Fix #74309.
10354         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10355         have partial containers too.
10356
10357         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10358         in block' checks to Block.CheckInvariantMeaningInBlock.
10359         * statement.cs (Block.GetKnownVariableInfo): Make private.
10360         (Block.IsVariableUsedInChildBlock): Remove.
10361         (Block.IsVariableUsedInBlock): Likewise.
10362         (Block.CheckInvariantMeaningInBlock): New.  Show location of
10363         conflicting declaration.
10364         (Block.AddVariable): Make error messages less long-winded and more
10365         specific.  Show location of conflicting declaration.
10366         * parameter.cs (Parameters.Location): New readonly property.
10367
10368 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10369
10370         Clean up semantics of invoking ResolveMemberAccess.
10371         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10372         can have an instance, ensure that we pass in a non-TypeExpression
10373         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
10374         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10375         argument.  Update to changes and simplify.
10376         (FieldExpr.Emitinstance): Remove CS0120 check.
10377         (PropertyExpr.EmitInstance): Likewise.
10378         * expression.cs (Argument.Resolve): Likewise.
10379         (Invocation.DoResolve): Update to changes in semantics of
10380         InstanceExpression.
10381
10382 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
10383
10384         Fix #74241
10385         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10386         customization.
10387         
10388         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10389
10390 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10391
10392         Fix difference in behaviour with commandline invocation.
10393         * driver.cs (Driver.Reset): New.
10394         (CompilerCallableEntryPoint): Call it.
10395
10396         * statement.cs (If.Resolve): Avoid spurious "uninitialized
10397         variable" warnings if the boolean expression failed to resolve.
10398
10399 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
10400
10401         * attribute.cs: Fix the union of several permissions when some of them
10402         are unrestricted (so the result isn't an unrestricted permission set).
10403         Fix #74036.
10404
10405 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10406
10407         * ecore.cs (MemberExpr): New class.  Convert from interface
10408         IMemberExpr.
10409         (MemberExpr.ResolveMemberAccess): Refactor and move here from
10410         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
10411         error checks.
10412         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10413         (MethodGroupExpr.IsExplicitImpl): Remove.
10414         (Expression.GetFieldFromEvent): Remove.
10415         (SimpleName.MemberStaticCheck): Remove.
10416         (SimpleName.DoSimpleNameResolve): Update to changes.
10417         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10418         (MemberAccess.IdenticalNameAndTypeName): Remove.
10419         (MemberAccess.error176): Move to MemberExpr.
10420         (MemberAccess.DoResolve): Update to changes.
10421         (BaseAccess.DoResolve): Likewise.
10422
10423 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
10424
10425         C# 2.0 Conditional attribute class implementation
10426         
10427         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10428         Analyzes class whether it has attribute which has ConditionalAttribute
10429         and its condition is not defined.
10430         
10431         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10432         (Class.IsExcluded): New method. Search for at least one defined
10433         condition in ConditionalAttribute of attribute class.
10434
10435 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10436
10437         * ecore.cs (PropertyExpr): Derive from Expression, not
10438         ExpressionStatement.
10439         (PropertyExpr.EmitStatement): Remove.
10440
10441 2005-03-29  Raja R Harinath  <rharinath@novell.com>
10442
10443         Fix #74060.
10444         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10445         internal field "value__" of an enum be private.  The examples for
10446         "value__" that I found on MSDN all used FieldAttributes.Private.
10447
10448         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10449         Don't mention IL method attribute names.
10450
10451         Fix #47991.  Remove a TODO.
10452         * statement.cs (Block.Toplevel): Make into a field.
10453         (Block.Parameters): Move into ToplevelBlock.
10454         (Block.known_variables): Rename from child_variable_names.
10455         (Block.Block): Remove variants that take Parameters.  Initialize
10456         'Toplevel' with the immediately surrounding toplevel block.
10457         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
10458         LocalInfo parameter.
10459         (Block.GetKnownVariableInfo): New.
10460         (Block.IsVariableNameUsedInChildBlock): Update.
10461         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
10462         the block, even though it may not be in scope.
10463         (Block.AddVariable): Remove Parameters parameter.  Use
10464         Toplevel.Parameters instead.
10465         (Block.AddConstant): Remove Parameters parameter.
10466         (Block.GetParameterReference): Update to use Toplevel.Parameters.
10467         (Block.IsParamaterReference): Likewise.
10468         (Block.IsLocalParameter): Likewise.  Simplify a lot.
10469         (ToplevelBlock.Parameters): New.  Moved from Block.
10470         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
10471         initialize Parameters to a non-null value.
10472         * cs-parser.jay: Update to changes.
10473         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10474         simple names that mean different things in the same block.  Use
10475         Block.IsVariableNameUsedInBlock.
10476
10477 2005-03-28  Raja R Harinath  <rharinath@novell.com>
10478
10479         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10480         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10481         GetTypeHandle.  It is possible for a reflected type to derive from
10482         a TypeBuilder (e.g., int[] derives from the TypeBuilder
10483         System.Array during mscorlib compilation).
10484         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10485         contain a method_hash, don't create one either.  Don't create a
10486         deep copy of the base cache's method_hash.
10487         (MemberCache.SetupCache): Rename back from DeepCopy.
10488         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10489         already initialized.  If we see an override function, add its
10490         underlying base virtual function to the member_hash too.
10491
10492         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10493
10494 2005-03-26  Raja R Harinath  <harinath@acm.org>
10495
10496         Fix #73038.
10497         * assign.cs (Assign.DoResolve): When the RHS of an assignment
10498         fails to resolve, ensure that the LHS is still resolved as an
10499         lvalue.
10500
10501 2005-03-25  Raja R Harinath  <harinath@acm.org>
10502
10503         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10504         ec.ContainerType.
10505         (Enum.current_ec): Remove.
10506         (Enum.LookupEnumValue): Remove EmitContext argument.
10507         Just uses the one created during DefineType.
10508         (Enum.FindMembers): Update.
10509         * expression.cs (MemberAccess.DoResolve): Update.
10510
10511 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
10512
10513         * assign.cs (Assign.DoResolve): Check for CS1717 when
10514         source and target are same (uses Equals).
10515
10516         * expression.cs (LocalVariableReference, ParameterReference,
10517         This): Implemented Equals, GetHashCode.
10518
10519         * statement.cs (Block.GetParameterReference): Removed useless
10520         local variable.
10521
10522 2005-03-22  Raja R Harinath  <rharinath@novell.com>
10523
10524         Fix cs0128.cs
10525         * statement.cs (Block.AddVariable): Ensure that we skip implicit
10526         blocks before deciding whether the error is cs0136 or cs0128.
10527
10528         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10529         (using_alias_directive, using_namespace_directive): Pass
10530         MemberName, not an expression to Namespace.UsingAlias and
10531         Namespace.Using.
10532         (MakeName): Use the MemberName of the namespace.
10533         * namespace.cs (Namespace.MemberName): New.
10534         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10535         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10536         Likewise.
10537         * decl.cs (MemberName.Name): Make readonly.
10538         (MemberName.FromDotted): New "constructor".
10539         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10540         (MemberCore.Name): Compute from MemberName on demand.
10541         (MemberCore.SetMemberName): Provide a way to change the
10542         MemberName.
10543         (MemberCore.AddToContainer): Don't take a fullname parameter.
10544         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10545         fully qualified name of the container to the member name.
10546         (TypeContainer.AddToTypeContainer): Use a fully qualified name
10547         only if the type is a member of the root container.
10548         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10549         MemberName.Left rather than searching for an embedded ".".
10550         (PartialContainer.CreatePart): Update to changes in RootContext.
10551         (MemberBase.ShortName): Turn into a property.  Use
10552         MemberCore.SetMemberName.
10553         (MemberBase.ExplicitInterfaceName): Remove.
10554         (MemberBase.UpdateMemberName): Remove.
10555         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10556         (PropertyBase.SetMemberName): New override.
10557         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10558         (Tree.GetDecl): New.
10559         (Tree.AllDecls): Rename from Decls.
10560         * attribute.cs, enum.cs, report.cs: Update to changes.
10561         * driver.cs (MainDriver): Use MemberName.FromDotted on
10562         RootContext.MainClass.
10563
10564 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
10565
10566         * class.cs (FixedField.Define): Check for CS1664 and more sanity
10567         checks.
10568
10569         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10570
10571 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
10572
10573         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10574         property accessor modifiers.
10575
10576         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10577         fixed buffer attribute (CS1716).
10578         (PropertyMethod.HasCustomAccessModifier): When property accessor
10579         has custom modifier.
10580
10581         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10582         modifiers.
10583         (PropertyExpr.DoResolveLValue): Add CS0272.
10584
10585 2005-03-17  Miguel de Icaza  <miguel@novell.com>
10586
10587         * convert.cs: When converting to a pointer, use the proper Conv.U
10588         or Conv.I depending on the source data type.
10589
10590         * cs-tokenizer.cs: Make the size for large decimal constants,
10591         fixes #72957.
10592
10593 2005-03-17  Martin Baulig  <martin@ximian.com>
10594
10595         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10596         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
10597
10598 2005-03-17  Martin Baulig  <martin@ximian.com>
10599
10600         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10601         to bool so we can return an error condition.
10602         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10603         returned an error.
10604
10605 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
10606
10607         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10608         attributes.
10609
10610 2005-03-16  Raja R Harinath  <rharinath@novell.com>
10611
10612         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10613         Refactor to avoid traversing the list of assemblies, and to avoid
10614         string concatenation.
10615         * typemanager.cs (guid_attr_type): Remove.
10616         (negative_hits, pointers, references): Remove hashes.
10617         (type_hash): New.
10618         (GetConstructedType): New.  Uses type_hash to handle constructed
10619         types (arrays, references, pointers).
10620         (GetReferenceType, GetPointerType): Use it.
10621         (GetNestedType): New.  Uses type_hash to handle nested types of
10622         reflected types.
10623         (LookupType, LookupTypeDirect): Remove.
10624         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
10625         'types' hash and LookupTypeReflection directly.
10626         (params_string, params_object): Use GetConstructedType.
10627         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
10628         top-level types.
10629         (Namespace.Lookup): Use cached_types.
10630         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10631         provided by old TypeManager.LookupType.
10632         * rootcontext.cs (MakeFQN): Remove.
10633         * decl.cs (DeclSpace.MakeFQN): Likewise.
10634         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10635         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10636         TypeManager.GetConstructedType.
10637         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10638
10639 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
10640
10641         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10642         indexers.
10643
10644         * cs-parser.jay: Reports CS1527 for any namespace element.
10645
10646         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10647         Added CS0407.
10648
10649         * expression.cs (ParameterReference.IsAssigned): Changed error to
10650         CS0269.
10651         (Error_WrongNumArguments): Moved CS0245 detection here.
10652
10653         * statement.cs (Return.Resolve): Add CS1622 report.
10654
10655 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
10656
10657         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10658
10659 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
10660
10661         * attribute.cs expression.cs: Get rid of some allocations.
10662
10663 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
10664
10665         * doc.cs : just eliminate the latest change.
10666
10667 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10668
10669         * doc.cs : commented out the latest change. It breaks xml-030.cs
10670
10671 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10672
10673         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10674           fail. So invoke CreateType() in FindDocumentedType().
10675
10676 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10677
10678         * cs-tokenizer.cs : added IsKeyword().
10679         * doc.cs : Detect keyword incorrectly used as identifier.
10680           Allow identifiers prefixed by @.
10681
10682 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
10683
10684         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10685         It caused exception in namespace resolving (again!).
10686         
10687         * class.cs (Class.ctor): Removed exit.
10688         (PropertyMethod.ctor): ditto.
10689         
10690         * codegen.cs (Codegen.Reset): Reset static data.
10691         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10692         
10693         * cs-tokenizer.cs (Cleanup): Removed.
10694         
10695         * driver.cs (GetSystemDir): Rewrote to one line command.
10696         It caused problem with unloaded dynamic modules.
10697         (UnixParseOption): Removed Exit.
10698         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10699         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10700         Now can be mcs used as library.
10701         
10702         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10703         empty location.
10704         
10705         * location.cs (Reset): Reset static data.
10706         
10707         * namespace.cs (Reset): Reset static data.
10708         
10709         * report.cs (Report.Reset): Reset static data.
10710         
10711         * rootcontext.cs (RootContext.Reset): Reset static data.
10712         
10713         * tree.cs (RootTypes.ctor): Use Location.Null
10714         
10715         * typemanager.cs (TypeManager.Reset): Reset static data.
10716         (CoreLookupType): Removed Exit.
10717         (TypeHandle.Reset): Reset static data.
10718         
10719 2005-03-10  Raja R Harinath  <rharinath@novell.com>
10720
10721         Fix #73516.
10722         * typemanager.cs (ComputeNamespaces): Import namespaces from
10723         referenced modules too.
10724
10725 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10726
10727         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10728         than '.'.
10729
10730 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10731
10732         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10733         enclosing DeclSpace.  This ensures that a name-lookup populates
10734         more caches and there are fewer 'TypeExpression's.  Carve out
10735         nested type lookup into ...
10736         (LookupNestedTypeInHierarchy): ... this.
10737
10738 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10739
10740         Clean up a few partial-class semantics.  
10741         Fixes test-357.cs and cs1618-2.cs.
10742         * cs-parser.jay (struct_declaration): Use 'current_class' as
10743         parent of newly-created struct.  Remove call to Register ().
10744         Use 'pop_current_class' to complete handing the current struct.
10745         (interface_declaration): Likewise.
10746         (class_declaration): Likewise.
10747         (enum_declaration): Use 'current_class' as parent of newly created
10748         enum.
10749         (delegate_declaration): Likewise.
10750         (pop_current_class): New function.  This is used to handle closing
10751         up the 'current_class' and 'current_container', and pointing them
10752         to the enclosing class/container.
10753         (CSharpParser): Initialize 'current_class' too.
10754         * decl.cs (MemberCore): Add check for invariant: a partial
10755         container is not a parsed entity, and thus does not enclose any
10756         parsed members.
10757         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10758         (DeclSpace.BaseTypeExpr): Use it.
10759         (DeclSpace.LookupType): Add check for invariant.
10760         * class.cs (TypeContainer): Add check for invariant: a nested
10761         class should have the same NamespaceEntry as its enclosing class.
10762         (TypeContainer.EmitFieldInitializers): Make virtual.
10763         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10764         MemberCore.
10765         (TypeContainer.Register): Remove.
10766         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10767         null.  Use TypeResolveEmitContext for resolving base types and
10768         interfaces.  Move initialization of Parts.TypeBuilder here from
10769         ...
10770         (TypeContainer.DefineNestedTypes): ... here.
10771         (PartialContainer): Take a Namespace not a NamespaceEntry.
10772         (PartialContainer.Create): Don't use Register.  Call the
10773         appropriate Add... function directly.
10774         (ClassPart): Take both the PartialContainer and the enclosing
10775         class as constructor arguments.
10776         (ClassPart.EmitFieldInitializers): Override.
10777         (ClassPart.PartFindNestedTypes): Remove.
10778         (FieldBase.GetInitializerExpression): Resolve the initializer
10779         expression in the emit context of the enclosing class.
10780         * tree.cs (RootTypes): Remove Register ().
10781         
10782 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
10783
10784         * cs-parser.jay: Removed CS0134.
10785         
10786         * driver.cs: Removed CS1901.
10787         
10788         * expression.cs (SizeOf.DoResolve): Don't report CS0233
10789         for predefined types.
10790
10791 2005-03-07  Duncan Mak  <duncan@novell.com>
10792
10793         * codegen.cs (Save):  Catch UnauthorizedAccessException as
10794         well. Fixes bug #73454.
10795
10796 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
10797
10798         * cs-tokenizer.cs (xtoken): Add CS1035.
10799         
10800         * class.cs (MethodData.Define): Add CS0683.
10801         (FieldMember.ctor): Add CS0681.
10802
10803 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10804
10805         * ecore.cs (SimpleName.DoResolve): Rename from
10806         SimpleName.DoResolveAllowStatic.
10807         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10808         Pass 'intermediate' flag to MemberStaticCheck.
10809         (SimpleName.MemberStaticCheck): Skip "static check" only in case
10810         of "intermediate" lookups via MemberAccess.
10811         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
10812         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10813
10814 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10815
10816         Fix #73394.
10817         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10818         slipped in because of variable names that are identical to a
10819         builtin type's BCL equivalent ('string String;', 'int Int32;').
10820         (PropertyExpr.EmitInstance): Likewise.
10821
10822 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
10823
10824         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10825         
10826         * report.cs (warning_ignore_table): Made public.
10827
10828 2005-03-04  Raja R Harinath  <rharinath@novell.com>
10829
10830         Fix #73282.
10831         * class.cs (MethodData.Emit): Pass 'container' to
10832         container.GetObsoleteAttribute instead of 'container.Parent'.
10833
10834 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
10835
10836         * cs-parser.jay: Add 1534 error test.
10837
10838         * iterators.cs (Yield.CheckContext): Add error 1629.
10839         (Iterator.ctor): Save unsafe modifier.
10840         (MoveNextMethod.DoEmit): Restore unsafe context.
10841
10842         * namespace.cs (UsingAlias): Better error message.
10843
10844 2005-03-03  Dan Winship  <danw@novell.com>
10845
10846         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10847         the warning message [#73219]
10848
10849 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10850
10851         Fix compile with MCS 1.0.0.0.
10852         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10853         w_restore to not depend on string constant folding.
10854
10855 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10856
10857         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
10858         CS0246 check to users who passed 'silent = false'.
10859         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10860         check.
10861         (SimpleName.SimpleNameResolve): Update.
10862         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10863         (MemberAccess.IdenticalNameAndTypeName): Update.
10864         * doc.cs (FindDocumentedTypeNonArray): Update.
10865
10866 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
10867
10868         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10869         * parameters.cs (ComputeAndDefineParameters): Remove.
10870         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10871         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10872         Use GetParameterInfo.
10873
10874 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
10875
10876         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10877
10878 2005-03-02  Raja R Harinath  <rharinath@novell.com>
10879
10880         Unify DeclSpace.LookupType and DeclSpace.FindType.
10881         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
10882         is in charge of defining nested types on demand.
10883         (DeclSpace.LookupType): Use it when the current_type is a
10884         TypeBuilder.  Use LookupTypeDirect for reflected types.
10885         (DeclSpace.FindType): Remove.
10886         (DeclSpace.LookupInterfaceOrClass): Likewise.
10887         (DeclSpace.DefineTypeAndParents): Likewise.
10888         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10889         DeclSpace.LookupType.
10890         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10891         * typemanager.cs (LookupType): Simplify.
10892         (AddUserType): Remove type from negative_hits.
10893         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10894         * class.cs (TypeContainer.FindMembers): Move handling of nested
10895         types ...
10896         (TypeContainer.FindMembers_NestedTypes): ... here.
10897         (TypeContainer.FindNestedType): Implement override.
10898         (ClassPart.FindNestedType): Delegate to PartialContainer.
10899         (ClassPart.PartFindNestedType): Looks up the nested types of the
10900         part alone.
10901
10902 2005-03-02  Martin Baulig  <martin@ximian.com>
10903
10904         * class.cs (TypeContainer.DoDefineMembers): We also need a default
10905         static constructor in static classes.
10906
10907 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
10908
10909         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10910         sizeParamIndex is not specified.
10911
10912 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
10913
10914         Fix #73117
10915         * report.cs (WarningMessage.IsEnabled): Missing null check.
10916
10917 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10918
10919         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10920         in the fields and not in the properties.
10921
10922 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
10923
10924         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
10925         fields as well.
10926
10927 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10928
10929         * attribute.cs: Small refactoring (improved robustness).
10930         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10931         (ValidateGuid): Removed.
10932         (Resolve): Removed referenced to above mentioned.
10933         (GetAttributeUsage): Made private and changed to work without
10934         class assistance.
10935         (GetIndexerAttributeValue): Don't crash.
10936         (GetConditionalAttributeValue): Ditto.
10937         (GetClsCompliantAttributeValue): Ditto.
10938         (ExtractSecurityPermissionSet): All attributes exceptions are
10939         error 648.
10940         (GetPropertyValue): New helper.
10941         (GetMethodImplOptions): New method.
10942         (DefinePInvokeMethod): Reuse common code. Implemented handling of
10943         some missing properties.
10944         
10945         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10946         (Method.ApplyAttributeBuilder): Updated.
10947         
10948         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10949         exception.
10950
10951 2005-02-28  Raja R Harinath  <rharinath@novell.com>
10952
10953         Fix #73052.
10954         * report.cs (Report.SymbolRelatedToPreviousError): Handle
10955         non-simple types (array, pointer, reference).
10956
10957 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10958
10959         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10960
10961         * class.cs (MethodCore.IsDuplicateImplementation): Special error
10962         for operators.
10963         (Method.CheckBase): Catch wrong destructor here.
10964         (MethodData.Define): Add errors 550, 668.
10965
10966         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10967
10968         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10969
10970         * pending.cs (VerifyPendingMethods): Add error 551.
10971
10972         * typemanager.cs (CSharpName): Next error report helper.
10973
10974 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
10975
10976         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10977         attributes. Removed useless attribute double check.
10978         It saves almost 2MBs for corlib.
10979
10980 2005-02-25  Raja R Harinath  <rharinath@novell.com>
10981
10982         Fix #72924.
10983         * statement.cs (ExpressionStatement.Resolve): Make robust to being
10984         called twice in case of error.
10985
10986 2005-02-23  Chris Toshok  <toshok@ximian.com>
10987
10988         Fix compiler portions of #72827.
10989         * statement.cs (Block.Emit): call Begin/EndScope on the
10990         EmitContext instead of the ILGenerator.
10991
10992         * codegen.cs (EmitContext.BeginScope): new method, call
10993         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10994         we have one.)
10995         (EmitContext.BeginScope): same, but EndScope and CloseScope
10996
10997         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10998         offset and call the superclass's OpenScope(int) with it.
10999         (SymbolWriter.CloseScope): get the current il
11000         offset and call superclass's CloseScope(int) with it.
11001
11002 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
11003
11004         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
11005         CS1677 for out and ref as well.
11006
11007         * class.cs (Method.Define): Add error CS1599 detection.
11008         
11009         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
11010         
11011         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
11012         
11013         * delegate.cs (Delegate.Define): Add error CS1599 detection.
11014         
11015         * support.cs.cs (ModifierDesc): New helper method.
11016
11017 2005-02-23  Raja R Harinath  <rharinath@novell.com>
11018             Abin Thomas  <projectmonokochi@rediffmail.com>
11019             Anoob V E  <projectmonokochi@rediffmail.com>
11020             Harilal P R  <projectmonokochi@rediffmail.com>
11021
11022         Fix #57851, #72718.
11023         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
11024         MemberLookup (used for error reporting) actually returns a result.
11025         Fix error report number (122, not 112).
11026
11027 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
11028             Anoob V E  <projectmonokochi@rediffmail.com>
11029             Harilal P R  <projectmonokochi@rediffmail.com>
11030
11031         Fix #71134.
11032         * pending.cs (PendingImplementation.GetAbstractMethods):
11033         Find NonPublic members too.
11034
11035 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
11036
11037         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
11038         Fixed error 217.
11039         
11040         * class.cs (MethodCore.CheckMethodAgainstBase):
11041         Add error 239 report.
11042
11043 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11044
11045         Fix #68955.
11046         * expression.cs (Invocation.IsApplicable): Make public.
11047         (Invocation.IsParamsMethodApplicable): Likewise.
11048         * delegate.cs (Delegate.VerifyApplicability): Don't use
11049         Invocation.VerifyArgumentCompat for parameter applicability
11050         testing.  Use Invocation.IsApplicable and
11051         Invocation.IsParamsMethodApplicable.
11052
11053 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
11054
11055         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
11056         
11057         * class.cs (Operator.Define): Add error 217 report.
11058         
11059 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11060
11061         * namespace.cs (UsingEntry.Resolve): Undo change below.
11062
11063 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11064
11065         Fix #72756.
11066         * ecore.cs (Expression.MemberLookupFailed): Add argument to
11067         disable the error message when the extended MemberLookup also
11068         fails.
11069         (Expression.MemberLookupFinal): Update.
11070         (SimpleName.DoSimpleNameResolve): Update.
11071         * expression.cs (MemberAccess.ResolveNamespaceOrType):
11072         Don't use MemberLookupFinal.
11073         (New.DoResolve): Update.
11074         (BaseAccess.CommonResolve): Update.
11075
11076 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11077
11078         Fix #72732.
11079         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
11080         occured previously, don't resolve again.
11081
11082 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
11083
11084         Fix #69949
11085         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
11086         argument. Call ResolveAttributeUsage for unresolved.
11087         when types doesn't match ctor arguments.
11088         
11089         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
11090         for nested attribute classes.
11091         (Class.attribute_usage): Removed.
11092         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
11093         for attribute class.
11094         
11095         * ecore.cs (IsAttribute): Removed.
11096         
11097         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
11098         
11099         * rootcontext.cs (RegisterAttribute): Removed, attributes are
11100         now normal types.
11101         (attribute_types): Removed.
11102         (EmitCode): Global attributes are emited as the latest.
11103
11104 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
11105
11106         * class.cs (EmitFieldInitializers): Don't emit field initializer
11107         for default values when optimilization is on.
11108         
11109         * constant.cs (Constant.IsDefaultValue): New property.
11110         
11111         * driver.cs: Add /optimize handling.
11112         
11113         * constant.cs,
11114         * ecore.cs,
11115         * literal.cs: Implement new IsDefaultValue property.
11116         
11117         * rootcontext.cs (Optimize): New field, holds /optimize option.
11118
11119 2005-02-18  Raja R Harinath  <rharinath@novell.com>
11120
11121         Fix crasher in re-opened #72347.
11122         * namespace.cs (Namespace.Lookup): Return null if
11123         DeclSpace.DefineType returns null.
11124
11125         Fix #72678.
11126         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
11127
11128 2005-02-18  Raja R Harinath  <rharinath@novell.com>
11129
11130         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
11131         now returns null if it cannot resolve to an lvalue.
11132         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
11133         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
11134         returned null.  Remove check for SimpleName.
11135         (EventExpr.DoResolveLValue): New.
11136         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
11137         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
11138         error from ...
11139         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
11140         avoid CS0131 error.
11141         (Unary.ResolveOperator): Move CS0211 check ...
11142         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
11143         CS0131 error.
11144         (Unary.DoResolveLValue): Simplify.
11145         (AddressOf.DoResolveLValue): New.
11146         (ArrayAccess.DoResolveLValue): New.
11147
11148 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
11149
11150         * attribute.cs (Attribute.Resolve): Add arguments casting for
11151         when types doesn't match ctor arguments.
11152
11153 2005-02-16  Raja R Harinath  <rharinath@novell.com>
11154
11155         Fix parts of #63202.
11156         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
11157         lookup of operator in base type.  Ensure that all checks happen
11158         when the operator resolves to an "op_..." method.
11159
11160 2005-02-15  Raja R Harinath  <rharinath@novell.com>
11161
11162         Fix #71992.
11163         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
11164         'ignore_cs0104' parameter.  Pass it to ...
11165         (NamespaceEntry.Lookup): ... this.
11166         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
11167         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
11168         (TypeLookupExpression.DoResolveAsTypeStep): Update.
11169         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
11170         Update.  Request that cs0104 errors be ignored.
11171         (ComposedCast.ResolveAsTypeStep): Update.
11172
11173 2005-02-14  Raja R Harinath  <rharinath@novell.com>
11174
11175         Fix #59209.
11176         * expression.cs (Invocation.BetterFunction): Remove support for
11177         comparing virtual functions and their overrides.
11178         (Invocation.IsOverride): New.
11179         (Invocation.OverloadResolve): Don't consider 'override' functions
11180         during candidate selection.  Store them in a lookaside list.
11181         If the selected method is a 'virtual' function, use the list to
11182         find any overrides that are closer to the LHS type.
11183
11184 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
11185
11186         * expression.cs (New.DoResolve): Add complex core type reduction.
11187         (New.Constantify): Converts complex core type syntax like 'new int ()'
11188         to simple constant.
11189         
11190 2005-02-14  Raja R Harinath  <rharinath@novell.com>
11191
11192         * decl.cs (EntryType.EntryType): New constructor to create an
11193         updated copy of a cache entry.
11194         (MemberCache.AddMethods): Use it.
11195         (MemberCache.ClearDeclaredOnly): Remove.
11196         (MemberCache.MemberCache): Update.
11197
11198 2005-02-11  Miguel de Icaza  <miguel@novell.com>
11199
11200         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
11201         variable.  This one is represents the actual low-level declaration
11202         of the method, as opposed to the semantic level `IsStatic'.   
11203
11204         An anonymous method which is hosted into a static method might be
11205         actually an instance method.  IsStatic would reflect the
11206         container, while MethodIsStatic represents the actual code
11207         generated.
11208
11209         * expression.cs (ParameterReference): Use the new MethodIsStatic
11210         instead of IsStatic.
11211
11212         * anonymous.cs (AnonymousMethod.Compatible): Pass the
11213         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
11214         set on the current EmitContext. 
11215
11216         * expression.cs (Cast): Overload DoResolveLValue so we can pass
11217         resolve our casted expression as an LValue.  This triggers the
11218         proper LValue processing that is later required by Assign.
11219
11220         This fixes 72347.
11221
11222         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
11223
11224 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
11225
11226         C# 2.0 Fixed buffer implementation
11227
11228         * anonymous.cs: Update after RegisterHelperClass renaming.
11229
11230         * attribute.cs (AttributeTester.fixed_buffer_cache):
11231         Cache of external fixed buffers.
11232         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
11233         implementation if field is fixed buffer else null.
11234
11235         * class.cs
11236         (TypeContainer.AddField): Accept FieldMember instead of Field.
11237         (FieldBase.IsFieldClsCompliant): Extracted code from
11238         VerifyClsCompliance descendant customization.
11239         (FixedField): New class handles fixed buffer fields.
11240         (FixedFieldExternal): Keeps information about imported fixed
11241         buffer.
11242         (IFixedField): Make access to internal or external fixed buffer
11243         same.
11244
11245         * cs-parser.jay: Add fixed buffer parsing.
11246
11247         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
11248         buffer.
11249
11250         * expression.cs (Indirection): Extended implementation to accept
11251         fixed buffer field.
11252         (PointerArithmetic.Emit): Get element from fixed buffer as well.
11253         (ElementAccess.MakePointerAccess): Get type as parameter.
11254         (DoResolve): Add fixed buffer field expression conversion.
11255         (DoResolveLValue): Ditto.
11256         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
11257         (ArrayPtr): Derives from FixedBufferPtr.
11258         (ArrayPtr.Emit): Add extra emit for array elements.
11259
11260         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
11261
11262         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
11263         for compiler generated types.
11264         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
11265
11266         * statement.cs (Fixed): Refactored to be easier add fixed buffer
11267         and consume less memory.
11268         (Fixed.Resolve): Add fixed buffer case.
11269
11270         * typemanager.cs (compiler_generated_attr_ctor,
11271         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
11272         (HasElementType): Add our own implementation to work on every
11273         runtime.
11274
11275 2005-02-11  Miguel de Icaza  <miguel@novell.com>
11276
11277         * anonymous.cs (CaptureContext): Track whether `this' has been
11278         referenced.   
11279
11280         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
11281         only captured `this' if it was implicitly done (instance
11282         methods/variables were used). 
11283
11284         * codegen.cs (EmitContext.CaptureThis): New method to flag that
11285         `this' must be captured.
11286
11287 2005-01-30  Miguel de Icaza  <miguel@novell.com>
11288  
11289         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
11290         is null it means that there has been no need to capture anything,
11291         so we just create a sibling.
11292
11293         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
11294
11295         Just a partial fix.  The other half is fairly elusive.
11296         
11297 2005-02-10  Raja R Harinath  <rharinath@novell.com>
11298
11299         Fix #52586, cs0121-4.cs.
11300         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
11301         and return a hashtable.
11302         (MemberCache.ClearDeclaredOnly): New.
11303         (MemberCache.MemberCache): Update to change.  Make a deep copy of
11304         the method_hash of a base type too.
11305         (MemberCache.AddMethods): Adapt to having a deep copy of the base
11306         type methods.  Overwrite entries with the same MethodHandle so
11307         that the ReflectedType is correct.  The process leaves in base
11308         virtual functions and their overrides as distinct entries.
11309         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
11310         matters since it was boxed in a ArrayList before.
11311         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
11312         modifier.
11313         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
11314         case of a virtual function and its override (choose the overload
11315         as better).
11316         (Invocation.OverloadResolve): Avoid 'override' members during
11317         'applicable_type' calculation.
11318
11319 2005-02-09  Raja R Harinath  <rharinath@novell.com>
11320
11321         Combine two near-redundant caches.
11322         * typemanager.cs (method_params): Rename from method_internal_params.
11323         (TypeManager.GetParameterData): New.  Replace
11324         Invocation.GetParameterData.
11325         (TypeManager.LookupParametersByBuilder): Remove.
11326         * expression.cs (Invocation.method_parameter_cache): Remove.
11327         (Invocation.GetParameterData): Remove.
11328         Update to changes.
11329         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11330         Update to changes.
11331
11332 2005-02-08  Raja R Harinath  <rharinath@novell.com>
11333
11334         Fix #72015.
11335         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11336         TypeManager.multicast_delegate_type is null, resolve it by looking
11337         up "System.MulticastDelegate".
11338         * rootcontext.cs (RootContext.ResolveCore): Simplify.
11339
11340 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
11341             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
11342             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
11343
11344         Fix cs0164.cs.
11345         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11346         (LabeledStatement.AddReference): New.  Set 'referenced'.
11347         (Goto.Resolve): Use it.
11348
11349 2005-02-05  John Luke  <john.luke@gmail.com>
11350
11351         * driver.cs: remove duplicate -doc line in Usage ()
11352
11353 2005-02-04  Raja R Harinath  <rharinath@novell.com>
11354
11355         * location.cs (Location.AddFile): Fix CS2002 error report.
11356
11357 2005-02-02  Martin Baulig  <martin@ximian.com>
11358
11359         * delegate.cs (Delegate.DefineType): Report an internal error if
11360         TypeManager.multicast_delegate_type is null.  See bug #72015 for
11361         details.        
11362
11363 2005-02-02  Raja R Harinath  <rharinath@novell.com>
11364
11365         Fix a crasher in a variant of #31984.
11366         * const.cs (Constant.CheckBase): New override that defers the
11367         new-or-override check in case the base type hasn't been populated
11368         yet.
11369         (Constant.Define): Ensure the new-or-override check is performed.
11370
11371 2005-02-01  Duncan Mak  <duncan@ximian.com>
11372
11373         * const.cs (LookupConstantValue): Check that `ce' is not null
11374         before calling GetValue ().
11375
11376 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11377
11378         Fix test-334.cs (#69519).
11379         * cs-parser.jay (using_alias_directive): Pass in an expression to
11380         NamespaceEntry.UsingAlias.
11381         (using_namespace_directive): Pass in an expression to
11382         NamespaceEntry.Using.
11383         (namespace_name): Don't flatten to a string.
11384         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11385         (NamespaceEntry.AliasEntry.Resolve): Lookup using
11386         ResolveAsTypeStep.
11387         (NamespaceEntry.UsingEntry): Likewise.
11388         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11389         changes.
11390         (NamespaceEntry.LookupForUsing): Remove.
11391         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11392         names.
11393         (NamespaceEntry.Lookup): Remove support for dotted names.
11394
11395 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11396
11397         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11398         split into two.
11399         (NamespaceEntry.ImplicitParent): Compute on demand.
11400         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11401         parallels the current.
11402         (NamespaceEntry.LookupForUsing): Use it.
11403         (NamespaceEntry.Lookup): If the current namespace-entry is
11404         implicit, don't search aliases and using tables.
11405
11406 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11407
11408         Fix #31984.
11409         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11410         BaseCache here.
11411         (TypeContainer.BaseCache): Compute on demand.
11412         (TypeContainer.FindMembers): Define constants and types if they're
11413         not already created.
11414         (FieldMember.Define): Move resetting of ec.InUnsafe before error
11415         check.
11416         * const.cs (Constant.Define): Make idempotent.
11417
11418 2005-01-29  Miguel de Icaza  <miguel@novell.com>
11419
11420         * pending.cs: Produce better code (no nops produced by using Ldarg
11421         + value).
11422         
11423         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11424         i - 1' it should be arg + 1.
11425
11426         Fixes bug #71819.
11427
11428 2005-01-28  Raja R Harinath  <rharinath@novell.com>
11429
11430         * attribute.cs (Attribute.CheckAttributeType): Make private
11431         non-virtual.
11432         (Attribute.ResolveType): Make virtual.
11433         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11434         handling of RootContext.Tree.Types.
11435
11436 2005-01-27  Raja R Harinath  <rharinath@novell.com>
11437
11438         Update attribute-handling to use the SimpleName/MemberAccess
11439         mechanisms.
11440         * cs-parser.jay (attribute): Pass in an expression to the
11441         constructors of Attribute and GlobalAttribute.
11442         * attribute.cs (Attribute): Take an expression for the name.
11443         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
11444         passed in attribute name expression.
11445         (Attribute.CheckAttributeType): Use it.
11446         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11447         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11448         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
11449         argument to prevent error messages if the lookup fails.
11450
11451 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
11452
11453         * expression.cs (Indirection): Implemented IVariable interface
11454         to support indirection in AddressOf operator.
11455         (PointerArithmetic.Emit): Add optimalization for case where
11456         result can be precomputed.
11457
11458 2005-01-26  Martin Baulig  <martin@ximian.com>
11459
11460         * class.cs (TypeContainer.AttributeTargets): Return the correct
11461         AttributeTargets depending on our `Kind' instead of throwing an
11462         exception; fixes #71632.
11463
11464 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
11465
11466         Fix #71257
11467         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11468         constant members.
11469
11470 2005-01-25  Raja R Harinath  <rharinath@novell.com>
11471
11472         Fix #71602.
11473         * expression.cs (MemberAccess.DoResolve): Don't complain with
11474         cs0572 when the LHS of a member access has identical name and type
11475         name.
11476
11477 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
11478
11479         Fix #71651, #71675
11480         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11481         CreatePermission.
11482         Create custom PermissionSet only for PermissionSetAttribute.
11483
11484 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
11485
11486         Fix #71649
11487         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11488         delegates in static class.
11489
11490 2005-01-24  Martin Baulig  <martin@ximian.com>
11491
11492         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11493         merging an implicit block, just use its reachability.
11494
11495         * statement.cs (Block.Resolve): Make the unreachable code check
11496         work wrt. implicit blocks; see test-337 from #63842.
11497
11498 2005-01-21  Alp Toker  <alp@atoker.com>
11499  
11500         * cs-parser.jay: destructor_declaration's container is PartialContainer
11501         not Class when partial types are used, so use Kind prop instead of
11502         'is'.
11503         
11504 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
11505
11506         * cs-parser.jay: Improve error reporting when an interface
11507         declares new types.
11508
11509 2005-01-20  Dick Porter  <dick@ximian.com>
11510
11511         * support.cs: SeekableStreamReader fix from Sandor Dobos
11512         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11513         chars are read.  Fixes bug 70369.
11514
11515 2005-01-20  Raja R Harinath  <rharinath@novell.com>
11516
11517         * cs-parser.jay (catch_clause): Simplify current_block handling
11518         somewhat.
11519
11520 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
11521
11522         * convert.cs (ImplicitStandardConversionExists): Synchronize the
11523         code with ImplicitStandardConversion to handle the implicit
11524         conversion of method groups into valid delegate invocations. 
11525
11526         The problem is that in parameter handling we were using this code
11527         path.  Fixes bug #64698
11528
11529 2005-01-19  Raja R Harinath  <rharinath@novell.com>
11530
11531         * cs-parser.jay: Fix several infelicities.
11532         - Avoid assigning to the parser value stack.  Code like 
11533           '$3 = null' is unclean.  Synthesize a value for the code block
11534           instead. 
11535         - Avoid using oob_stack for storing location information.  Use ...
11536         (_mark_): ... this.  New (empty) rule.  Saves the current location
11537         in $$.
11538         (foreach_statement): Avoid using oob_stack for current_block
11539         handling.  Use technique used in for_statement and
11540         using_statement.  Synthesize a value for the code block to store
11541         additional intermediate information.
11542
11543 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
11544
11545         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11546         of a different type is only allowed to private fields of a
11547         containing type, not on fields of a base class.
11548
11549         See test-174.cs and error cs0122-9.cs
11550
11551 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11552
11553         Fix test-335.cs (bug #58126).
11554         * cs-parser.jay (argument): Split out non-expression parts of the
11555         rule into 'non_simple_argument'.
11556         (invocation_expression): Support parenthesized invocations with
11557         multiple arguments, and with single non-simple arguments.
11558
11559 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11560
11561         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11562         places.
11563
11564 2005-01-12  Raja R Harinath  <rharinath@novell.com>
11565
11566         Fix cs0038-1.cs, cs1640-6.cs.
11567         * ecore.cs (Expression.Resolve): Remove special-case for
11568         SimpleName in error-handling.
11569         (Expression.almostMatchedMembers): Relax access permission to
11570         protected.
11571         (Expression.MemberLookupFailed): Handle duplicates in
11572         almostMatchedMembers list.
11573         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11574         * expression.cs (New.DoResolve): Report CS1540 for more cases.
11575         * typemanager.cs (GetFullNameSignature): Use the MethodBase
11576         overload if the passed in MemberInfo is a MethodBase.
11577
11578 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
11579
11580         Fix #70749
11581         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11582         for non-CAS & merge permission sets properly.
11583
11584 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11585
11586         Improve standard-compliance of simple name and member access 
11587         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
11588         * ecore.cs (FullNamedExpression): New abstract base class 
11589         for Namespaces and TypeExpressions.
11590         (ResolveFlags.SimpleName): Remove.
11591         (SimpleName): Remove support for dotted names.
11592         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
11593         DeclSpace.FindType and DeclSpace.LookupType.
11594         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11595         (Expression.ExprClassName): Make member function.
11596         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11597         a namespace.  Remove creation of dotted "SimpleName"s.
11598         (MemberAccess.DoResolve): Likewise.
11599         * decl.cs (DeclSpace.Cache): Make private.
11600         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11601         (DeclSpace.FindType): Update.
11602         (DeclSpace.LookupType): Move here from RootContext.  Return a 
11603         FullNamedExpression.
11604         * namespace.cs (Namespace): Derive from FullNamedExpression
11605         so that it can be part of expression resolution.
11606         (Namespace.Lookup): Return an FullNamedExpression.
11607         (NamespaceEntry.LookupAlias): Lookup aliases only in current
11608         namespace.
11609         * rootcontext.cs (NamespaceLookup): Remove.
11610         (LookupType): Move to DeclSpace.
11611         * attribute.cs (CheckAttributeType): Update.
11612         * doc.cs (FindDocumentedType): Remove allowAlias argument.
11613         (FindDocumentedTypeNonArray): Likewise.
11614
11615 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11616
11617         Fix cs0509.cs, cs1632.cs.
11618         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11619         is the same as IsInterface.
11620         (TypeContainer.GetClassBases): Likewise.
11621         * statement.cs (LabeledStatement.ig): New field.
11622         (LabeledStatement.LabelTarget): Save ILGenerator which created the
11623         label.
11624         (LabeledStatement.DoEmit): Check that the label was created with
11625         the same ILGenerator.
11626
11627 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11628
11629         Fix #71058
11630         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11631         accessors to its properties.
11632
11633         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11634         from accessors to property.
11635         
11636 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11637
11638         Fix #70722
11639         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11640         only for overrides.
11641         
11642 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
11643
11644         * attribute.cs: Check for null and empty strings.  
11645
11646         I have lost another battle to Paolo.
11647
11648 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
11649
11650         Fix #70942
11651         * class.cs (PropertyMethod): Set Parent field in ctors.
11652         (SetMethod.InternalParameters): Add unsafe switch hack.
11653         Override MarkForDuplicationCheck where it is appropriate.
11654
11655         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11656         It says whether container allows members with the same name.
11657         Base default is no.
11658         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11659         Removed is_method parameter.
11660
11661 2005-01-06  Duncan Mak  <duncan@ximian.com>
11662
11663         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11664         because the previous change led to incorrect reporting of CS1032
11665         ("Cannot define/undefine preprocessor symbols after first token in
11666         file"). Instead of using `tokens_seen' as the only flag that
11667         triggers CS1040, introduce `comments_seen'. This new flag is used
11668         to signify having seen comments on the current line, so it is
11669         unset after a newline.
11670
11671 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11672
11673         * doc.cs : When searching for a type, find nested type too.
11674           This fixes bug #71040.
11675
11676 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11677
11678         * doc.cs :
11679           - Warn missing member comment on those classes which also does not
11680             have doc comments. Fixed bug #71041.
11681           - Don't warn missing doc comment on default constructor.
11682             Fixed bug #71042.
11683
11684 2005-01-06  Duncan Mak  <duncan@ximian.com>
11685
11686         * cs-tokenizer.cs (xtoken): After handling traditional C-style
11687         comments, set `tokens_seen' to true. This allows us to detect
11688         misplaced preprocessor directives (i.e. not at the beginning of
11689         the a line, nor after whitespaces). In that case, report error
11690         CS1040. This fixes bug #56460.
11691
11692         * cs-parser.jay (interface_member_declaration): Add checks for
11693         IsExplicitImpl, and report CS0541 error if an interface member is
11694         defined as an explicit interface declaration.
11695
11696 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
11697
11698         Fix #70817
11699         * class.cs (PropertyMethod): Set Parent field in ctors.
11700         (SetMethod.InternalParameters): Add unsafe switch hack.
11701         
11702         * decl.cs (MemberCore.Parent): Cannot be readonly.
11703
11704 2005-01-06  Raja R Harinath  <rharinath@novell.com>
11705
11706         * decl.cs (DeclSpace.ResolveType): Remove.
11707         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11708         Merge in code from ...
11709         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
11710         * class.cs, enum.cs: Update to changes.
11711
11712 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
11713
11714         * anonymous.cs: Ensure that we init the scope of our parent if it
11715         has not been initialized yet.
11716
11717 2004-12-30  Duncan Mak  <duncan@ximian.com>
11718
11719         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11720         if field.FieldBuilder is null. Fixes #70758.
11721
11722         * convert.cs: Fixed some typos and updated some of the comments.
11723         (ImplicitStandardConversionExists):
11724         (TryImplicitIntConversion): If `target_type' is an interface and
11725         the type of `ic' implements this interface, return true or a new
11726         BoxedCast instead of null. This fixes #70468.
11727
11728 2004-12-29  Duncan Mak  <duncan@ximian.com>
11729
11730         * expression.cs (Argument.Emit): Check that Expr is
11731         IMemoryLocation before casting to it, and report CS1510 otherwise.
11732
11733         This fixes #70402.
11734
11735 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
11736
11737         * statement.cs (Block.ThisVariable): remove the recursion here, to
11738         make the --profile more sane.
11739
11740 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
11741
11742         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11743         assembly, by JB Evain.
11744
11745 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11746
11747         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
11748           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11749         "parent" refers to enclosing type/class.  "base" refers to superclass.
11750
11751 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11752
11753         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11754         Ensure that we only have GlobalAttributes.
11755         * attribute.cs (Attribute.Emit): Make non-virtual.
11756         (GlobalAttribute.Emit): Remove.
11757         (Attribute.Resolve): Make virtual.
11758         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
11759         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11760         the argument. Don't create one.
11761         (Attribute.GetObsoleteAttribute): Likewise.
11762         (Attribute.GetClsCompliantAttributeValue): Likewise.
11763         * class.cs, decl.cs: Update to changes.
11764
11765 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
11766
11767         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11768         
11769         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11770         
11771         * statement.cs (Foreach.Resolve): Add error 186 report.
11772
11773 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
11774
11775         * expression.cs (Conditional.DoResolve): Add warning 429.
11776         
11777         * statement.cs (If.Resolve): Add warning 665.
11778
11779 2004-12-16  Raja R Harinath  <rharinath@novell.com>
11780
11781         New invariant: RootContext.Tree.Types.NamespaceEntry == null
11782         except when in the parser, and in GlobalAttribute.
11783         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11784         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11785         RootContext.Tree.Types.NamespaceEntry once work is done.
11786         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
11787         and resets RootContext.Tree.Types.NamespaceEntry.
11788
11789 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
11790
11791         * cs-parser.jay: Don't create a block for every variable.
11792
11793 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
11794
11795         * location.cs: Provide extra information.
11796
11797         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11798         variables from the captured environment, it is the ldarg_0.
11799
11800 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11801
11802         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11803         find a conclusion.
11804         
11805         * class.cs: Changed warning level for 169 to avoid developer
11806         displeasure from warning flooding. It will be changed back when they
11807         fix most of current BCL warnings.
11808         
11809         * RootContext.cs: Pushed default WarningLevel to 3.
11810         
11811         * statement.cs: Removed unused variable.
11812
11813 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11814
11815         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11816         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11817         Add error 502 report.
11818         (StaticClass.DefineType): Add error 441 report.
11819         (Class.AllowedModifiersProp): New virtual property as temporary
11820         extension to AllowedModifiers.
11821         (Class.DefineType): Add error 418 report. Moved ModFlags check here
11822         to share implementation with StaticClass and don't call virtual
11823         methods from ctor.
11824         
11825         * driver.cs (MainDriver): Add error 1558 test.
11826
11827         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11828         report. Moved error 36 test here.
11829
11830         * statement.cs (Throw.Resolve): Add error 724 report.
11831
11832         * typemanager.cs: Add out_attribute_type core type.
11833         
11834 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
11835
11836         * class.cs (TypeContainer.VerifyClsCompliance): Add error
11837         3018 report.
11838         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11839
11840         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11841         3017 report.
11842         
11843         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11844
11845         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
11846         Add error 3023 report.
11847         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11848
11849         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11850         implementation.
11851
11852 2004-12-12  John Luke  <john.luke@gmail.com>
11853
11854         * driver.cs (AddArgs): take -- into account when
11855         adding arguments, fixes bug 65710 
11856
11857 2004-12-12  Martin Baulig  <martin@ximian.com>
11858
11859         * expression.cs (Unary.TryReduceNegative): Added support for
11860         SByteConstant and ByteConstant.
11861         (Unary.Reduce): Check error values from TryReduceNegative().
11862
11863 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
11864
11865         * attributes.cs (Attribute.Resolve): Avoid multiple error report
11866         and report exception as error 182.
11867
11868 2004-12-10  Raja R Harinath  <rharinath@novell.com>
11869
11870         * driver.cs (Main): Fix message when there are warnings.
11871
11872 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
11873
11874         * delegate.cs: Fixed my fix from yesterday, sorry about that.
11875
11876 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
11877
11878         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
11879         Reduced number of warnings.
11880         
11881         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11882
11883 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
11884
11885         * driver.cs: Removed message.
11886
11887         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11888
11889 2004-12-08    <vargaz@freemail.hu>
11890
11891         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11892
11893 2004-12-08  Martin Baulig  <martin@ximian.com>
11894
11895         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11896         instead of a CS3002 for properties and indexer.
11897
11898 2004-12-08  Martin Baulig  <martin@ximian.com>
11899
11900         * decl.cs (MemberName.ToString): Make this work again.
11901
11902 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
11903
11904         * attribute.cs (Resolve): Add error 591 detection.
11905
11906         * class.cs (FieldMember.Define): Add error 1547 detection.
11907         (Indexer.Define): Add error 620 detection.
11908         (Operator.Define): Add error 590 detection.
11909
11910         * ecore.cs: Missing argument for error 79.
11911
11912         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11913         detection.
11914
11915 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
11916
11917         Fix #70106
11918         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11919         only.
11920
11921 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
11922
11923         * cs-parser.jay : handle doc comments on implicit/explicit operators.
11924           Some operator comments were suppressed.
11925         * doc.cs : Implicit/explicit operator name in doc comments are like
11926           "op_Explicit(type)~returnType", so added suffix handling.
11927
11928 2004-12-07  Martin Baulig  <martin@ximian.com>
11929
11930         * decl.cs
11931         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11932         (MemberCore.GetClsCompliantAttributeValue): Likewise.
11933         (DeclSpace.ec): New protected field; store the EmitContext here.
11934         (DeclSpace.EmitContext): New public property; moved here from
11935         `TypeContainer'.
11936         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11937         EmitContext.
11938
11939         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11940         (Enum.Emit): Don't create a new EmitContext.
11941
11942         * delegate.cs (Delegate.DefineType): Always create the
11943         EmitContext.
11944
11945         * iterators.cs (Iterators.DefineIterator): Create a new
11946         EmitContext and store it in `ec'.
11947
11948 2004-08-24  Martin Baulig  <martin@ximian.com>
11949
11950         * typemanager.cs
11951         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11952         this for accessibility checks.
11953         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11954         IsNestedFamilyAccessible.
11955         (TypeManager.IsSubclassOf): New method, do what the name actually
11956         says.   
11957
11958 2004-12-06  Raja R Harinath  <rharinath@novell.com>
11959
11960         Fix crash on cs0657-17.cs.
11961         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11962         Use RootContext.Tree.Types, not 'new RootTypes ()'.
11963         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11964         the case where the NamespaceEntry gets overwritten.
11965
11966 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
11967
11968         Fixed #69195, #56821
11969         * ecore.cs (ResolveBoolean): Tiny refactoring.
11970
11971         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11972         of right expression resolving when left is false constant and
11973         operator is LogicalAnd OR true constant and operator is LogicalOr.
11974
11975         * statement.cs (ResolveUnreachable): Always reports warning.
11976
11977 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
11978
11979         * class.cs: Distinguish between 1721 and 1722 (just a little help
11980         for the programmer).
11981
11982 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
11983
11984         * delegate.cs: Only allow this on new versions of the language. 
11985
11986 2004-12-02  Duncan Mak  <duncan@ximian.com>
11987
11988         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11989         Expression class.
11990         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11991         here as a static method. Take an additional bool out parameter
11992         `must_do_cs1540_check' for signaling to InstanceResolve.
11993         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11994         member field from PropertyExpr class and made it an argument of
11995         the method instead.
11996         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11997         check for MarshalByRefObject, and report CS0122 instead of CS1540.
11998         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11999         and `remove_accessor' as well as InstanceResolve: report CS0122
12000         where applicable.
12001
12002         Fixes #70129.
12003
12004 2004-12-03  Raja R Harinath  <rharinath@novell.com>
12005
12006         Fix test-327.cs, test-328.cs, and put in early infrastructure
12007         for eventually fixing #52697.
12008         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
12009         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
12010         from other methods.
12011         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
12012         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
12013         (VerifyUsing, error246): Update.
12014         * rootcontext.cs (RootContext.NamespaceLookup): Just use
12015         'NamespaceEntry.LookupNamespaceOrType'.
12016
12017 2004-12-03  Martin Baulig  <martin@ximian.com>
12018
12019         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12020         method as our child, call AnonymousMethod.Compatible() on it.
12021
12022 2004-12-03  Raja R Harinath  <rharinath@novell.com>
12023
12024         Disable XML documentation support in 'basic' profile.
12025         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
12026         Redirect XmlElement to System.Object.
12027         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
12028         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
12029         * mcs.exe.sources: Add doc-bootstrap.cs.
12030         * doc-bootstrap.cs: New file.  Contains empty stub implementation
12031         of doc.cs.
12032
12033 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
12034
12035         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
12036           comments are allowed.
12037
12038 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12039
12040         * delegate.cs: Add checks for subtypes in paramaters and return values
12041         in VerifyMethod () to add support for Covariance/Contravariance
12042         in delegates.
12043         
12044 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
12045
12046         * report.cs: Remove extra closing parenthesis.
12047
12048         * convert.cs (Error_CannotImplicitConversion): If the name of the
12049         types are the same, provide some extra information.
12050
12051         * class.cs (FieldBase): Use an unused bit field from the field to
12052         encode the `has_offset' property from the FieldMember.  This saves
12053         a couple of Ks on bootstrap compilation.
12054
12055         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12056         method as our child, return the AnonymousMethod resolved
12057         expression.
12058
12059         * expression.cs (New.DoResolve): Allow return values from
12060         NewDelegate to also include AnonymousMethods.
12061
12062         Fixes #70150.
12063
12064 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
12065
12066         Fix bug #70102
12067         * attribute.cs (Resolve): Improved implementation of params
12068         attribute arguments.
12069
12070         * support.cs (ParameterData): Add HasParams to be faster.
12071
12072 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
12073
12074         all things are for /doc support:
12075
12076         * doc.cs: new file that supports XML documentation generation.
12077         * mcs.exe.sources: added doc.cs.
12078         * driver.cs:
12079           Handle /doc command line option.
12080           Report error 2006 instead of 5 for missing file name for /doc.
12081           Generate XML documentation when required, after type resolution.
12082         * cs-tokenizer.cs:
12083           Added support for picking up documentation (/// and /** ... */),
12084           including a new XmlCommentState enumeration.
12085         * cs-parser.jay:
12086           Added lines to fill Documentation element for field, constant,
12087           property, indexer, method, constructor, destructor, operator, event
12088           and class, struct, interface, delegate, enum.
12089           Added lines to warn incorrect comment.
12090         * rootcontext.cs :
12091           Added Documentation field (passed only when /doc was specified).
12092         * decl.cs:
12093           Added DocComment, DocCommentHeader, GenerateDocComment() and
12094           OnGenerateDocComment() and some supporting private members for
12095           /doc feature to MemberCore.
12096         * class.cs:
12097           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
12098         * delegate.cs:
12099           Added overriden DocCommentHeader.
12100         * enum.cs:
12101           Added overriden DocCommentHeader and GenerateDocComment().
12102
12103 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
12104
12105         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
12106         unwrapping the enumeration values, chain to
12107         DoConstantNumericPromotions again, so we can promote things to the
12108         fundamental types (takes care of enums that are bytes, sbytes).
12109
12110         Fixes bug #62054.
12111
12112 2004-12-01  Raja R Harinath  <rharinath@novell.com>
12113
12114         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
12115         Fix long-standing bug in type-lookup.  Use FindType instead of
12116         LookupType when ec.ResolvingTypeTree.
12117         (Attribute.ResolveType, Attribute.Resolve)
12118         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
12119         Update to changes.
12120         (Attributes.Search): Remove internal version.  Update.
12121         (Attributes.SearchMulti): Update.
12122         (Attributes.GetClsCompliantAttribute): Remove.
12123         (Attributes.GetIndexerNameAttribute): Remove.
12124         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
12125         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
12126         * class.cs (Indexer.Define): Likewise.
12127
12128 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
12129
12130         Fix bug #68790
12131         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
12132         MarshallByReference members access.
12133
12134         * expression.cs: Use CheckMarshallByRefAccess;
12135         Better error CS0197 message.
12136
12137         * report.cs: Print whole related error message.
12138
12139 2004-11-30  Raja R Harinath  <rharinath@novell.com>
12140
12141         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
12142         the current directory to help debugging.
12143
12144 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
12145
12146         * class (GetClassBases): Better error 60 report.
12147         (EventProperty): Disabled warning 67 detection.
12148
12149 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
12150
12151         Fix bug #60324
12152         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
12153
12154         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
12155         precise values.
12156
12157 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
12158
12159         Fix bug #49488
12160         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
12161
12162         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
12163
12164 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
12165
12166         * attribute.cs (Attribute.Resolve): Refine error reporting and
12167         report a cs0117 if the identifier does not exist, to distinguish
12168         from 0617 which is a miss-use of the actual identifier.
12169
12170         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
12171         between cs0070 and cs0079.
12172
12173         * class.cs (MemberBase.DoDefine): When reporting a wrong
12174         accessibility level, we use MethodCore to compare instead of
12175         Method (this was a regression in some refactoring effort).
12176
12177         So now we correctly report cs0056 again.
12178
12179         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
12180         testing the target_type (which was known to be object_type) and
12181         not the source type (which is anonymous_method).
12182
12183         Fixed reporting of error cs1660.
12184
12185         * expression.cs (UserCast.Source): Expose the underlying cast.
12186
12187         * statement.cs (Switch.SwitchGoverningType): Sort the list of
12188         allowed types to find a match to int32 first (most common).
12189
12190         In addition, it ignores any ImplicitUserConversions that did an
12191         internal implicit conversion (as the switch statement allows only
12192         one integral conversion to exist).
12193
12194         * class.cs (PartialContainer.Create): rename `name' to
12195         `member_name' for clarity.  Then replace the string calls with a
12196         call to MemberName.GetPartialName, as now using
12197         MemberName.ToString is an error (this is due to the side effects
12198         it had, that were fixed in the past).
12199
12200         This will restore the error reporting on a number of partial class
12201         errors that were missusing this (and getting an exception as a
12202         results, which is now just a plain textual warning, because
12203         yyparse debug output would crash otherwise).
12204
12205 2004-11-26  Raja R Harinath  <rharinath@novell.com>
12206
12207         * Makefile (PROGRAM_INSTALL_DIR): Remove.
12208
12209 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
12210
12211         * rootcontext.cs (LookupType): Make sure to cache lookups that
12212         don't give us a negative result. This saves about 5% of corlib
12213         compilation time.
12214
12215 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
12216
12217         * report.cs (AbstractMessage.Print): messages are sent to stderr
12218
12219         * class.cs (TypeContainer.GetClassBases): It is an error to have a
12220         non-interface in the list of interfaces (at this point, either
12221         parent was properly set, or a base class is being listed in the
12222         interfaces section).
12223
12224         This flags error 1722, and resolves the crash from bug 69259.
12225
12226 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
12227
12228         * statement.cs (Using.EmitExpressionFinally): make this work right
12229         for valuetypes. Fixes 69926.
12230
12231 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
12232
12233         * const.cs (Const.ChangeType): Cope with the "0 literal can be
12234         converted to an enum" here, before we try to change the underlying
12235         type.  This code exists, but it is a different code path than the
12236         one used while encoding constants.
12237
12238         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
12239         old bug: when converting from the null literal to a pointer,
12240         return an EmptyCast, not the NullLiteral.
12241
12242         This fixes #69921, the recent null_type changes probably made this
12243         bug more prominent.
12244
12245         (ImplicitReferenceConversionExists): In addition, resynchronized
12246         the code here, so it matches the same code in
12247         ImplicitReferenceConversionExists for the `from any class-type S
12248         to any interface-type T'.
12249         
12250
12251 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
12252
12253         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
12254
12255 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
12256
12257         * cs-parser.jay: Use verbosity accordingly. 
12258
12259 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
12260
12261         * expression.cs (Unary.ResolveOperator): Do not report warning;
12262         AddressOf reads from variable.
12263         
12264         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
12265
12266 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
12267
12268         Fix bug #69462
12269
12270         * attribute.cs (Attributable): Removed CheckTargets.
12271         (Attributes.Emit): Explicit attribute targets are tested here.
12272
12273         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
12274         not enabled for interfaces.
12275
12276         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
12277         (GetAssemblyName): Ouch next bug there.
12278
12279 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12280
12281         * expression.cs: Error 275 added.
12282         
12283 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
12284
12285         Fix bug #69177 (Implemented decimal constant support)
12286
12287         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
12288         (BinaryFold): Add DecimalConstant.
12289
12290         * const.cs (Define): Decimal constant 
12291         (is not constant.
12292         (ChangeType): Add decimal type handling.
12293         (LookupConstantValue): Don't set value for decimal type but
12294         emit DecimalConstantAttribute. Needed for constant optimization.
12295
12296         * constant.cs (ToDecimal): New method.
12297         (ConvertToDecimal): New method.
12298         (IntConstant): Implemented ConvertToDecimal.
12299         (DecimalConstant.Emit): Emit optimized version for decimals in
12300         int range.
12301
12302         * expression.cs (ResolveOperator): Changed order of constant
12303         reduction to work correctly with native types which have
12304         overloaded operators.
12305         (ResolveMemberAccess): Extract constant value from attribute
12306         for decimal type.
12307
12308         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
12309
12310         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
12311         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
12312         (ChangeType): Decimal is special.
12313         (TypeToCoreType): Add decimal type.
12314
12315 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
12316
12317         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
12318         decimal types.
12319
12320 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
12321
12322         * class.cs (EventField.ApplyAttributeBuilder): Fix error
12323         test cs1667-5.cs.
12324
12325 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
12326
12327         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
12328
12329         * pending.cs (PendingImplementation): Grab only interfaces.
12330
12331 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
12332
12333         * statement.cs (ForeachHelperMethods): Add location member and
12334         error 202 detection.
12335
12336 2004-11-19  Raja R Harinath  <rharinath@novell.com>
12337
12338         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
12339         automatically handled by executable.make.
12340         (PROGRAM): Make profile-specific.
12341
12342 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
12343
12344         * expression.cs (DoResolveBase): Fixed wrong warning for out
12345         variables.
12346
12347 2004-11-18  Martin Baulig  <martin@ximian.com>
12348
12349         Merged latest changes into gmcs.  Please keep this comment in
12350         here, it makes it easier for me to see what changed in MCS since
12351         the last time I merged.
12352
12353 2004-11-17  Raja R Harinath  <rharinath@novell.com>
12354
12355         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12356         (TypeHandle.GetMemberCache): New.
12357         (TypeHandle.TypeHandle): Update.
12358         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12359         (TypeManager.LookupParentInterfacesCache):
12360         Rename from LookupInterfaceCache.  Optimize slightly.
12361         (TypeManager.MemberLookup_FindMembers): Update.
12362         * decl.cs (MemberCache.MemberCache): Set Container to null in the
12363         multi-type variant.
12364         (AddCacheContents): Rename from AddHashtable.
12365         * class.cs (TypeContainer.parent_container): Remove.
12366         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12367         (TypeContainer.DoDefineMembers): Don't initialize it.
12368         Update to name changes.
12369         
12370 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
12371
12372         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12373         that factors the code to check access modifiers on override.  
12374
12375         (PropertyBase): Use the code here.
12376
12377         Patch from Lluis S'anchez, fixes bug #69361.
12378
12379 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
12380
12381         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12382         routine that is used to report the use of a captured variable
12383         whose address has been taken.
12384
12385         There are two checks: one when variables are being captured and
12386         the other check is when the address of a variable is taken. 
12387         
12388         (because an anonymous methods might be resolved before *or* after
12389         the address has been taken) and 
12390
12391         * expression.cs (Conditional.DoResolve): Remove the special
12392         casing that Martin added to trueExpr and falseExpr being both
12393         NullLiteral.  We get the right behavior now just by introducing
12394         the null_type into the compiler. 
12395
12396         * convert.cs (ExplicitConversion): Change the code to use
12397         null_type instead of testing `expr is NullLiteral'.
12398         (ImplicitConversionStandard): use null_type too.
12399         (ImplicitReferenceConversionExists): use null_type too.
12400         (ImplicitReferenceConversion): use null_type too.
12401
12402         * literal.cs: The type of `NullLiteral' is now null_type instead
12403         of object_type. 
12404         (Resolve): Set the type here.
12405
12406         * typemanager.cs: Introduce null_type.
12407
12408 2004-11-17  Martin Baulig  <martin@ximian.com>
12409
12410         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12411         direction, like FindMembers() does.  Fixes #69546, testcase is in
12412         test-315.cs.    
12413
12414 2004-11-16  Martin Baulig  <martin@ximian.com>
12415
12416         This is based on a patch from Marek Safar, see bug #69082.
12417         Fixes bugs #63705 and #67130.
12418
12419         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12420         method; create a MemberCache for an interface type and cache the
12421         result.
12422
12423         * decl.cs (IMemberContainer.ParentContainer): Removed.
12424         (IMemberContainer.ParentCache): New property.
12425         (MemberCache.SetupCacheForInterface): Removed.
12426         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12427         to create a cache for an interface's "parent".
12428
12429         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12430         interfaces too.
12431
12432 2004-11-16  Martin Baulig  <martin@ximian.com>
12433
12434         Merged back from gmcs; these changes already went into gmcs a
12435         couple of weeks ago.
12436
12437         * typemanager.cs
12438         (TypeManager.AddUserType): Removed the `ifaces' argument.
12439         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12440         `TypeExpr []'.
12441         (TypeManager.AddUserInterface): Removed.
12442         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12443         `TypeExpr []'.
12444         (TypeManager.GetInterfaces): Likewise.
12445         (TypeManager.GetExplicitInterfaces): Likewise.
12446
12447         * ecore.cs (TypeExpr.GetInterfaces): Removed.
12448
12449         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12450         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12451
12452 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
12453
12454         * statement.cs: Avoid adding bools to a hashtable.
12455
12456 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
12457
12458         * expression.cs (Invocation.OverloadResolve): Flag error if we are
12459         calling an unsafe method from a safe location.
12460
12461 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
12462
12463         Fix #69167
12464         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12465
12466 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
12467
12468         * namespace.cs (VerifyUsing): use GetPartialName instead of
12469         ToString. 
12470
12471 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * statement.cs (Return.Resolve): Fix regression in typo: if
12474         `in_exc', we have to request a NeedReturnLabel, this was a typo
12475         introduced in the anonymous method check-in.  Fixes #69131.
12476
12477         * Indexers were using the ShortName when defining themselves,
12478         causing a regression in the compiler bootstrap when applying the
12479         patch from 2004-11-02 (first part), now they use their full name
12480         and the bug is gone.
12481
12482 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
12483
12484         * driver.cs: Strip the path from the names of embedded resources. Fixes
12485         #68519.
12486
12487 2004-11-04  Raja R Harinath  <rharinath@novell.com>
12488
12489         Fix error message regression: cs0104-2.cs.
12490         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12491         (AliasEntry.Resolve): Update.
12492         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
12493         'silent' flag.
12494         (RootContext.LookupType): Update.
12495
12496 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
12497
12498         * cs-parser.jay: Add support for handling accessor modifiers
12499         * class: Add support port accessor modifiers and error checking,
12500         define PropertyMethod.Define as virtual (not abstract anymore)
12501         * ecore.cs: Add checking for proeprties access with access modifiers
12502         * iterators.cs: Modify Accessor constructor call based in the modified
12503         constructor
12504 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
12505
12506         * expression.cs (StringConcat): Handle being called twice,
12507         as when we have a concat in a field init with more than two
12508         ctors in the class
12509
12510 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
12511
12512         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12513         special case explicit implementations, we should always produce
12514         the .property or .event declaration.
12515         
12516         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12517         since it will not return correct data if people use this
12518         unresolved in the presence of using statements (see test-313).
12519
12520         * class.cs (MethodData.Define): If we are an explicit interface
12521         implementation, set the method name to the full name of the
12522         interface plus the name of the method.  
12523
12524         Notice that using the method.MethodName.GetFullName() does not
12525         work, as it will only contain the name as declared on the source
12526         file (it can be a shorthand in the presence of using statements)
12527         and not the fully qualifed type name, for example:
12528
12529         using System;
12530
12531         class D : ICloneable {
12532                 object ICloneable.Clone ()  {
12533                 }
12534         }
12535
12536         Would produce a method called `ICloneable.Clone' instead of
12537         `System.ICloneable.Clone'.
12538
12539         * namespace.cs (Alias.Resolve): Use GetPartialName.
12540         
12541 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12542
12543         * cs-parser.jay: Add error 1055 report.
12544
12545 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
12546
12547         * assign.cs (Assign.DoResolve): Only do the transform of
12548         assignment into a New if the types are compatible, if not, fall
12549         through and let the implicit code deal with the errors and with
12550         the necessary conversions. 
12551
12552 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12553
12554         * cs-parser.jay: Add error 1031 report.
12555
12556         * cs-tokenizer.cs: Add location for error 1038.
12557
12558 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12559
12560         * cs-parser.jay: Add error 1016 report.
12561
12562 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12563
12564         * cs-parser.jay: Add errors 1575,1611 report.
12565
12566 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12567
12568         * cs-parser.jay: Add error 1001 report.
12569
12570 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12571
12572         Fix #68850
12573         * attribute.cs (GetMarshal): Add method argument for
12574         caller identification.
12575
12576         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12577         agument for GetMarshal and RuntimeMissingSupport.
12578
12579 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12580
12581         * attribute.cs (ExtractSecurityPermissionSet): Removed
12582         TypeManager.code_access_permission_type.
12583
12584         * typemanager.cs: Removed TypeManager.code_access_permission_type.
12585
12586 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
12587
12588         * expression.cs (LocalVariableReference.DoResolveLValue): Check
12589         for obsolete use of a variable here.   Fixes regression on errors
12590         cs0619-25 and cs0619-26.
12591
12592 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
12593
12594         Fix #62358, implemented security attribute encoding.
12595
12596         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12597         Tests permitted SecurityAction for assembly or other types.
12598         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12599         data from SecurityPermissionAttribute to PermisionSet class.
12600
12601         * class.cs (ApplyAttributeBuilder): Added special handling
12602         for System.Security.Permissions.SecurityAttribute based types.
12603
12604         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12605         special handling for System.Security.Permissions.SecurityAttribute
12606         based types.
12607
12608         * enum.cs (ApplyAttributeBuilder): Added special handling
12609         for System.Security.Permissions.SecurityAttribute based types.
12610
12611         * parameter.cs (ApplyAttributeBuilder): Added special handling
12612         for System.Security.Permissions.SecurityAttribute based types.
12613
12614         * rootcontext.cs: Next 2 core types.
12615
12616         * typemanager.cs (TypeManager.security_permission_attr_type):
12617         Built in type for the SecurityPermission Attribute.
12618         (code_access_permission_type): Build in type.
12619
12620 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
12621
12622         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12623         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12624         all of this information into
12625         EmitContext.EmitCapturedVariableInstance.
12626         
12627         * codegen.cs (EmitCapturedVariableInstance): move here the
12628         funcionality of emitting an ldarg.0 in the presence of a
12629         remapping.   This centralizes the instance emit code.
12630
12631         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12632         then emit a load of this: it means that we have reached the
12633         topmost ScopeInfo: the one that contains the pointer to the
12634         instance of the class hosting the anonymous method.
12635
12636         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12637         captures to the topmost CaptureContext.
12638
12639 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
12640
12641         * expression.cs (LocalVariableReference): Move the knowledge about
12642         the iterators into codegen's EmitCapturedVariableInstance.
12643
12644 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
12645
12646         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12647         all code paths return a value from an anonymous method (it is the
12648         same as the 161 error, but for anonymous methods).
12649
12650 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
12651
12652         The introduction of anonymous methods in the compiler changed
12653         various ways of doing things in the compiler.  The most
12654         significant one is the hard split between the resolution phase
12655         and the emission phases of the compiler.
12656
12657         For instance, routines that referenced local variables no
12658         longer can safely create temporary variables during the
12659         resolution phase: they must do so from the emission phase,
12660         since the variable might have been "captured", hence access to
12661         it can not be done with the local-variable operations from the runtime.
12662         
12663         * statement.cs 
12664
12665         (Block.Flags): New flag `IsTopLevel' to indicate that this block
12666         is a toplevel block.
12667
12668         (ToplevelBlock): A new kind of Block, these are the blocks that
12669         are created by the parser for all toplevel method bodies.  These
12670         include methods, accessors and anonymous methods.
12671
12672         These contain some extra information not found in regular blocks:
12673         A pointer to an optional CaptureContext (for tracking captured
12674         local variables and parameters).  A pointer to the parent
12675         ToplevelBlock.
12676         
12677         (Return.Resolve): Catch missmatches when returning a value from an
12678         anonymous method (error 1662).
12679         Invoke NeedReturnLabel from the Resolve phase instead of the emit
12680         phase.
12681
12682         (Break.Resolve): ditto.
12683
12684         (SwitchLabel): instead of defining the labels during the
12685         resolution phase, we now turned the public ILLabel and ILLabelCode
12686         labels into methods called GetILLabelCode() and GetILLabel() that
12687         only define the label during the Emit phase.
12688
12689         (GotoCase): Track the SwitchLabel instead of the computed label
12690         (its contained therein).  Emit the code by using
12691         SwitchLabel.GetILLabelCode ().
12692
12693         (LocalInfo.Flags.Captured): A new flag has been introduce to track
12694         whether the Local has been captured or not.
12695
12696         (LocalInfo.IsCaptured): New property, used to tell whether the
12697         local has been captured.
12698         
12699         * anonymous.cs: Vastly updated to contain the anonymous method
12700         support.
12701
12702         The main classes here are: CaptureContext which tracks any
12703         captured information for a toplevel block and ScopeInfo used to
12704         track the activation frames for various local variables.   
12705
12706         Each toplevel block has an optional capture context associated
12707         with it.  When a method contains an anonymous method both the
12708         toplevel method and the anonymous method will create a capture
12709         context.   When variables or parameters are captured, they are
12710         recorded on the CaptureContext that owns them, for example:
12711
12712         void Demo () {
12713              int a;
12714              MyDelegate d = delegate {
12715                  a = 1;
12716              }
12717         }
12718
12719         Here `a' will be recorded as captured on the toplevel
12720         CapturedContext, the inner captured context will not have anything
12721         (it will only have data if local variables or parameters from it
12722         are captured in a nested anonymous method.
12723
12724         The ScopeInfo is used to track the activation frames for local
12725         variables, for example:
12726
12727         for (int i = 0; i < 10; i++)
12728                 for (int j = 0; j < 10; j++){
12729                    MyDelegate d = delegate {
12730                         call (i, j);
12731                    }
12732                 }
12733
12734         At runtime this captures a single captured variable `i', but it
12735         captures 10 different versions of the variable `j'.  The variable
12736         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12737         recorded on a child.  
12738
12739         The toplevel ScopeInfo will also track information like the `this'
12740         pointer if instance variables were referenced (this is necessary
12741         as the anonymous method lives inside a nested class in the host
12742         type of the method). 
12743
12744         (AnonymousMethod): Expanded to track the Toplevel, implement
12745         `AnonymousMethod.Compatible' to tell whether an anonymous method
12746         can be converted to a target delegate type. 
12747
12748         The routine now also produces the anonymous method content
12749
12750         (AnonymousDelegate): A helper class that derives from
12751         DelegateCreation, this is used to generate the code necessary to
12752         produce the delegate for the anonymous method that was created. 
12753
12754         * assign.cs: API adjustments for new changes in
12755         Convert.ImplicitStandardConversionExists.
12756
12757         * class.cs: Adjustments to cope with the fact that now toplevel
12758         blocks are of type `ToplevelBlock'. 
12759
12760         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12761         insteda of standard blocks.
12762
12763         Flag errors if params arguments are passed to anonymous methods.
12764
12765         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12766         `CurrentAnonymousMethod' which points to the current Anonymous
12767         Method.  The variable points to the AnonymousMethod class that
12768         holds the code being compiled.  It is set in the new EmitContext
12769         created for the anonymous method.
12770
12771         (EmitContext.Phase): Introduce a variable and an enumeration to
12772         assist in enforcing some rules about when and where we are allowed
12773         to invoke certain methods (EmitContext.NeedsReturnLabel is the
12774         only one that enfonces this right now).
12775
12776         (EmitContext.HaveCaptureInfo): new helper method that returns
12777         whether we have a CapturedContext initialized.
12778
12779         (EmitContext.CaptureVariable): New method used to register that a
12780         LocalInfo must be flagged for capturing. 
12781
12782         (EmitContext.CapturedParameter): New method used to register that a
12783         parameters must be flagged for capturing. 
12784         
12785         (EmitContext.CapturedField): New method used to register that a
12786         field must be flagged for capturing. 
12787
12788         (EmitContext.HaveCapturedVariables,
12789         EmitContext.HaveCapturedFields): Return whether there are captured
12790         variables or fields. 
12791
12792         (EmitContext.EmitMethodHostInstance): This is used to emit the
12793         instance for the anonymous method.  The instance might be null
12794         (static methods), this (for anonymous methods that capture nothing
12795         and happen to live side-by-side with the current method body) or a
12796         more complicated expression if the method has a CaptureContext.
12797
12798         (EmitContext.EmitTopBlock): Routine that drives the emission of
12799         code: it will first resolve the top block, then emit any metadata
12800         and then emit the code.  The split is done so that we can extract
12801         any anonymous methods and flag any captured variables/parameters.
12802         
12803         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12804         during this phase, the ILGenerator should not be used as labels
12805         and local variables declared here might not be accessible to any
12806         code that is part of an anonymous method.  
12807
12808         Exceptions to this include the temporary variables that are
12809         created by some statements internally for holding temporary
12810         variables. 
12811         
12812         (EmitContext.EmitMeta): New routine, in charge of emitting all the
12813         metadata for a cb
12814
12815         (EmitContext.TemporaryReturn): This method is typically called
12816         from the Emit phase, and its the only place where we allow the
12817         ReturnLabel to be defined other than the EmitMeta.  The reason is
12818         that otherwise we would have to duplicate a lot of logic in the
12819         Resolve phases of various methods that today is on the Emit
12820         phase. 
12821
12822         (EmitContext.NeedReturnLabel): This no longer creates the label,
12823         as the ILGenerator is not valid during the resolve phase.
12824
12825         (EmitContext.EmitThis): Extended the knowledge in this class to
12826         work in anonymous methods in addition to iterators. 
12827
12828         (EmitContext.EmitCapturedVariableInstance): This emits whatever
12829         code is necessary on the stack to access the instance to a local
12830         variable (the variable will be accessed as a field).
12831
12832         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12833         EmitContext.EmitAddressOfParameter): Routines to support
12834         parameters (not completed at this point). 
12835         
12836         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
12837         will also remove the parameters.
12838
12839         * convert.cs (Convert): Define a `ConstantEC' which points to a
12840         null.  This is just to prefity some code that uses
12841         ImplicitStandardConversion code and do not have an EmitContext
12842         handy.
12843
12844         The idea is to flag explicitly that at that point in time, it is
12845         known that the conversion will not trigger the delegate checking
12846         code in implicit conversions (which requires a valid
12847         EmitContext). 
12848
12849         Everywhere: pass new EmitContext parameter since
12850         ImplicitStandardConversionExists now requires it to check for
12851         anonymous method conversions. 
12852
12853         (Convert.ImplicitStandardConversionExists): If the type of an
12854         expression is the anonymous_method_type, and the type is a
12855         delegate, we invoke the AnonymousMethod.Compatible method to check
12856         whether an implicit conversion is possible. 
12857
12858         (Convert.ImplicitConversionStandard): Only do implicit method
12859         group conversions if the language level is not ISO_1.
12860
12861         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12862         MethodInfo for the Invoke method.  used by Delegate and
12863         AnonymousDelegate.
12864
12865         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12866         method conversions if the target type is a delegate.
12867
12868         Removed extra debugging nops.
12869
12870         (LocalVariableReference): Turn the `local_info' into a public
12871         field. 
12872
12873         Add `prepared' field, the same hack used for FieldExprs to cope
12874         with composed assignments, as Local variables do not necessarily
12875         operate purely on the stack as they used to: they can be captured
12876         fields. 
12877
12878         Add `temp' for a temporary result, like fields.
12879
12880         Refactor DoResolve and DoResolveLValue into DoResolveBase.
12881
12882         It now copes with Local variables that are captured and emits the
12883         proper instance variable to load it from a field in the captured
12884         case. 
12885
12886         (ParameterReference.DoResolveBase): During the resolve phase,
12887         capture parameters if we are in an anonymous method.
12888
12889         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12890         anonymous method, use the EmitContext helper routines to emit the
12891         parameter reference.
12892
12893         * iterators.cs: Set RemapToProxy to true/false during the
12894         EmitDispose class.
12895
12896         * parameters.cs (GetParameterByName): New helper method. 
12897
12898         * typemanager.cs (anonymous_method_type) a new type that
12899         represents an anonyous method.  This is always an internal type,
12900         used as a fencepost to test against the anonymous-methodness of an
12901         expression. 
12902         
12903 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
12904
12905         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12906         561 report.
12907         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12908
12909 2004-10-18  Martin Baulig  <martin@ximian.com>
12910
12911         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12912         `Type' directly, but call ResolveType() on it.
12913         (Catch.Resolve): Likewise.
12914         (Foreach.Resolve): Likewise.
12915
12916 2004-10-18  Martin Baulig  <martin@ximian.com>
12917
12918         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12919         `Type' directly, but call ResolveType() on it.
12920         (Probe.DoResolve): Likewise.
12921         (ArrayCreation.LookupType): Likewise.
12922         (TypeOf.DoResolve): Likewise.
12923         (SizeOf.DoResolve): Likewise.
12924
12925 2004-10-18  Martin Baulig  <martin@ximian.com>
12926
12927         * expression.cs (Invocation.BetterFunction): Put back
12928         TypeManager.TypeToCoreType().
12929
12930 2004-10-18  Raja R Harinath  <rharinath@novell.com>
12931
12932         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12933         the ResolveType.
12934
12935 2004-10-18  Martin Baulig  <martin@ximian.com>
12936
12937         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
12938         `Type' directly, but call ResolveType() on it.
12939
12940 2004-10-18  Martin Baulig  <martin@ximian.com>
12941
12942         * class.cs (FieldMember.Define): Don't access the TypeExpr's
12943         `Type' directly, but call ResolveType() on it.
12944         (MemberBase.DoDefine): Likewise.
12945
12946         * expression.cs (New.DoResolve): Don't access the TypeExpr's
12947         `Type' directly, but call ResolveType() on it.
12948         (ComposedCast.DoResolveAsTypeStep): Likewise.
12949
12950         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12951         `Type' directly, but call ResolveType() on it.
12952
12953 2004-10-17  John Luke  <john.luke@gmail.com>
12954
12955         * class.cs (Operator.GetSignatureForError): use CSharpName
12956
12957         * parameter.cs (Parameter.GetSignatureForError): Returns
12958         correct name even if was not defined.
12959
12960 2004-10-13  Raja R Harinath  <rharinath@novell.com>
12961
12962         Fix #65816.
12963         * class.cs (TypeContainer.EmitContext): New property.
12964         (DefineNestedTypes): Create an emitcontext for each part.
12965         (MethodCore.DoDefineParameters): Use container's emitcontext.
12966         Pass type array to InternalParameters.
12967         (MemberBase.DoDefine): Use container's emitcontext.
12968         (FieldMember.Define): Likewise.
12969         (Event.Define): Likewise.
12970         (SetMethod.GetParameterInfo): Change argument to EmitContext.
12971         Pass type array to InternalParameters.
12972         (SetIndexerMethod.GetParameterInfo): Likewise.
12973         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12974         * delegate.cs (Define): Pass emitcontext to
12975         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
12976         array to InternalParameters.
12977         * expression.cs (ParameterReference.DoResolveBase): Pass
12978         emitcontext to GetParameterInfo.
12979         (ComposedCast.DoResolveAsTypeStep): Remove check on
12980         ec.ResolvingTypeTree.
12981         * parameter.cs (Parameter.Resolve): Change argument to
12982         EmitContext.  Use ResolveAsTypeTerminal.
12983         (Parameter.GetSignature): Change argument to EmitContext.
12984         (Parameters.ComputeSignature): Likewise.
12985         (Parameters.ComputeParameterTypes): Likewise.
12986         (Parameters.GetParameterInfo): Likewise.
12987         (Parameters.ComputeAndDefineParameterTypes): Likewise.
12988         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
12989         * support.cs (InternalParameters..ctor): Remove variant that takes
12990         a DeclSpace.
12991         * typemanager.cs (system_intptr_expr): New.
12992         (InitExpressionTypes): Initialize it.
12993
12994 2004-10-12  Chris Toshok  <toshok@ximian.com>
12995
12996         * cs-parser.jay: fix location for try_statement and catch_clause.
12997
12998 2004-10-11  Martin Baulig  <martin@ximian.com>
12999
13000         * report.cs: Don't make --fatal abort on warnings, we have
13001         -warnaserror for that.
13002
13003 2004-10-07  Raja R Harinath  <rharinath@novell.com>
13004
13005         More DeclSpace.ResolveType avoidance.
13006         * decl.cs (MemberCore.InUnsafe): New property.
13007         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
13008         with newly created EmitContext.
13009         (FieldMember.Define): Likewise.
13010         * delegate.cs (Delegate.Define): Likewise.
13011         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
13012         only if normal name-lookup fails.
13013         (TypeExpr.DoResolve): Enable error-checking.
13014         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
13015         (SizeOf.DoResolve): Likewise.
13016         (ComposedCast.DoResolveAsTypeStep): Likewise.
13017         (StackAlloc.DoResolve): Likewise.
13018         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
13019         (Block.Unsafe): New property.
13020         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
13021         (Unsafe): Set 'unsafe' flag of contained block.
13022         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
13023         (Fixed.Resolve): Likewise.
13024         (Catch.Resolve): Likewise.
13025         (Using.ResolveLocalVariableDecls): Likewise.
13026         (Foreach.Resolve): Likewise.
13027
13028 2004-10-05  John Luke <john.luke@gmail.com>
13029
13030         * cs-parser.jay: add location to error CS0175
13031
13032 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
13033
13034         * ecore.cs (Expression.Constantity): Add support for turning null
13035         into a constant.
13036
13037         * const.cs (Const.Define): Allow constants to be reference types
13038         as long as the value is Null.
13039
13040 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
13041
13042         * namespace.cs (NamespaceEntry.Using): No matter which warning
13043         level is set, check if this namespace name has already been added.
13044
13045 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
13046
13047         * expression.cs: reftype [!=]= null should always use br[true,false].
13048         # 67410
13049
13050 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
13051
13052         Fix #67108
13053         * attribute.cs: Enum conversion moved to 
13054         GetAttributeArgumentExpression to be applied to the all
13055         expressions.
13056
13057 2004-10-01  Raja R Harinath  <rharinath@novell.com>
13058
13059         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
13060         * class.c (TypeContainer.DefineType): Flag error if
13061         base types aren't accessible due to access permissions.
13062         * decl.cs (DeclSpace.ResolveType): Move logic to
13063         Expression.ResolveAsTypeTerminal.
13064         (DeclSpace.ResolveTypeExpr): Thin layer over
13065         Expression.ResolveAsTypeTerminal.
13066         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
13067         Refactor code into NestedAccess.  Use it.
13068         (DeclSpace.NestedAccess): New.
13069         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
13070         argument to silence errors.  Check access permissions.
13071         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
13072         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
13073         (Cast.DoResolve): Likewise.
13074         (New.DoResolve): Likewise.
13075         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
13076         (TypeOf.DoResolve): Likewise.
13077
13078         * expression.cs (Invocation.BetterConversion): Return the Type of
13079         the better conversion.  Implement section 14.4.2.3 more faithfully.
13080         (Invocation.BetterFunction): Make boolean.  Make correspondence to
13081         section 14.4.2.2 explicit.
13082         (Invocation.OverloadResolve): Update.
13083         (Invocation): Remove is_base field.
13084         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
13085         (Invocation.Emit): Likewise.
13086
13087 2004-09-27  Raja R Harinath  <rharinath@novell.com>
13088
13089         * README: Update to changes.
13090
13091 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
13092
13093         * cs-parser.jay: Reverted 642 warning fix.
13094
13095 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13096
13097         Fix bug #66615
13098         * decl.cs (FindMemberWithSameName): Indexer can have more than
13099         1 argument.
13100
13101 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13102
13103         * expression.cs (LocalVariableReference.DoResolveLValue):
13104         Do not report warning 219 for out values.
13105         (EmptyExpression.Null): New member to avoid extra allocations.
13106
13107 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13108
13109         * cs-parser.jay: Fix wrong warning 642 report.
13110
13111         * cs-tokenizer.cs (CheckNextToken): New helper;
13112         Inspect next character if is same as expected.
13113
13114 2004-09-23  Martin Baulig  <martin@ximian.com>
13115
13116         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
13117         (Convert.ImplicitReferenceConversionExists): Likewise.
13118
13119 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13120
13121         * class.cs (Operator.Define): Add error 448 and 559 report.
13122
13123 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13124
13125         * class.cs (MemberBase.IsTypePermitted): New protected
13126         method for checking error CS0610.
13127
13128 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13129
13130         * class.cs (TypeContainer.HasExplicitLayout): New property
13131         Returns whether container has StructLayout attribute set Explicit.
13132         (FieldMember): New abstract class for consts and fields.
13133         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
13134         (Field): Reuse FieldMember.
13135
13136         * const.cs (Const): Reuse FieldMember.
13137
13138         * rootcontext.cs: EmitConstants call moved to class.
13139
13140 2004-09-22  Martin Baulig  <martin@ximian.com>
13141
13142         Thanks to Peter Sestoft for this bug report.
13143
13144         * expression.cs (Conditional): If both the `trueExpr' and the
13145         `falseExpr' is a NullLiteral, return a NullLiteral.
13146
13147 2004-09-22  Martin Baulig  <martin@ximian.com>
13148
13149         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
13150         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
13151         for the "get_Current" call.
13152
13153 2004-09-22  Martin Baulig  <martin@ximian.com>
13154
13155         Marek and me just fixed one of our oldest bugs: #28562 :-)
13156
13157         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
13158
13159         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
13160         we're an EnumConstant, just return that.
13161         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
13162         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
13163         to get the value which'll actually be written into the attribute.
13164         However, we have to use GetValue() to access the attribute's value
13165         in the compiler.        
13166
13167 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13168
13169         * constant.cs (Constant.IsNegative): New abstract property
13170         IsNegative.
13171
13172         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
13173         (StackAlloc.DoResolve): Reused IsNegative.
13174
13175 2004-09-21  Martin Baulig  <martin@ximian.com>
13176
13177         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
13178         if we're used in an iterator, we may be called from different
13179         methods.
13180
13181         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
13182         we actually have an exception block.
13183
13184 2004-09-20  John Luke <jluke@cfl.rr.com>
13185
13186         * class.cs, cs-parser.jay: Improve the error report for 1520:
13187         report the actual line where the error happens, not where the
13188         class was declared.
13189
13190         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
13191         Pass location information that was available elsewhere.
13192
13193 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
13194
13195         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
13196         runtime to delay sign assemblies.
13197
13198 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
13199
13200         * cs-parser.jay: Do not report the stack trace, this is barely
13201         used nowadays.
13202
13203 2004-08-22  John Luke  <john.luke@gmail.com>
13204  
13205         * driver.cs : check that a resource id is not already used
13206         before adding it, report CS1508 if it is, bug #63637
13207
13208 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
13209
13210         * ecore.cs: Removed dead code.
13211
13212 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
13213
13214         * class.cs: Do not report warning CS0067 on the interfaces.
13215
13216 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
13217
13218         * cs-parser.jay: Add error 504 report.
13219
13220 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
13221
13222         * rootcontext.cs: WarningLevel is 4 by default now.
13223
13224         * statement.cs (Fixed.Resolve): Do not null
13225         VariableInfo.
13226
13227 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
13228
13229         Fixed bug #55780
13230         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
13231         deep search when property is not virtual.
13232         (PropertyExpr.ResolveAccessors): Make one call for both
13233         accessors.
13234
13235 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13236
13237         Fixed bug #65766
13238         * statement.cs: Error 152 report constains also location.
13239
13240 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13241
13242         Fixed bug #65766
13243         * const.cs: Explicitly set constant as static.
13244
13245 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13246
13247         Fixed bug #64226
13248         * cs-parser.jay: Add error 1017 report.
13249
13250 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13251
13252         Fixed bug #59980, #64224
13253         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
13254
13255         * typemanager.cs (IsSpecialMethod): Simplified
13256
13257 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13258
13259         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
13260         condition with better params.
13261
13262 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13263
13264         Fixed bug #65238
13265         * attribute.cs (Resolve): Property has to have both
13266         accessors.
13267
13268 2004-09-14  Martin Baulig  <martin@ximian.com>
13269
13270         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
13271
13272 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13273
13274         Fixed bug #61902
13275         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
13276         called and is obsolete then this member suppress message
13277         when call is inside next [Obsolete] method or type.
13278
13279         * expression.cs: Use TestObsoleteMethodUsage member.
13280
13281 2004-09-14  Martin Baulig  <martin@ximian.com>
13282
13283         * cs-parser.jay: Sync a bit with the GMCS version.
13284
13285 2004-09-14  Martin Baulig  <martin@ximian.com>
13286
13287         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
13288         (CSharpParser.yacc_verbose_flag): New public field.
13289
13290         * genericparser.cs: Removed.
13291
13292 2004-09-14  Raja R Harinath  <rharinath@novell.com>
13293
13294         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
13295
13296 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
13297
13298         * class.cs (MethodCore.CheckBase): Fix bug #65757.
13299
13300 2004-09-10  Martin Baulig  <martin@ximian.com>
13301
13302         Backported my MemberName changes from GMCS into MCS.
13303
13304         - we are now using a special `MemberName' class instead of using
13305         strings; in GMCS, the `MemberName' also contains the type
13306         arguments.
13307
13308         - changed the grammar rules a bit:
13309           * the old `member_name' is now a `namespace_or_type_name':
13310             The rule is that we use `namespace_or_type_name' everywhere
13311             where we expect either a "member name" (GetEnumerator) or a
13312             "member name" with an explicit interface name
13313             (IEnumerable.GetEnumerator).
13314             In GMCS, the explicit interface name may include type arguments
13315             (IEnumerable<T>.GetEnumerator).
13316           * we use `member_name' instead of just `IDENTIFIER' for
13317             "member names":
13318             The rule is that we use `member_name' wherever a member may
13319             have type parameters in GMCS.       
13320
13321         * decl.cs (MemberName): New public class.
13322         (MemberCore.MemberName): New public readonly field.
13323         (MemberCore.ctor): Take a `MemberName' argument, not a string.
13324         (DeclSpace): Likewise.
13325
13326         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
13327         * enum.cs (Enum.ctor): Likewise.
13328
13329         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13330         MemberName.     
13331         (AliasEntry.ctor): Take a MemberName, not an Expression.
13332         (AliasEntry.UsingAlias): Likewise.
13333
13334         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13335         (IMethodData.MemberName): Changed type from string to MemberName.
13336         (MemberBase.ExplicitInterfaceName): Likewise.
13337         (AbstractPropertyEventMethod.SetupName): Make this private.
13338         (AbstractPropertyEventMethod.ctor): Added `string prefix'
13339         argument; compute the member name here.
13340         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13341         on the `member.MemberName' and the `prefix'.
13342
13343         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13344         not `type_name'.
13345         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13346         thus, we get a `MemberName' instead of a `string'.  These
13347         declarations may have type parameters in GMCS.
13348         (interface_method_declaration, delegate_declaration): Likewise.
13349         (class_declaration, interface_declaration): Likewise.
13350         (method_header): Use `namespace_or_type_name' instead of
13351         `member_name'.  We may be an explicit interface implementation.
13352         (property_declaration, event_declaration): Likewise.
13353         (member_name): This is now just an `IDENTIFIER', not a
13354         `namespace_or_type_name'.
13355         (type_name, interface_type): Removed.
13356         (namespace_or_type_name): Return a MemberName, not an Expression.
13357         (primary_expression): Use `member_name' instead of `IDENTIFIER';
13358         call GetTypeExpression() on the MemberName to get an expression.
13359         (IndexerDeclaration.interface_type): Changed type from string to
13360         MemberName.
13361         (MakeName): Operate on MemberName's instead of string's.
13362
13363 2004-09-13  Raja R Harinath  <rharinath@novell.com>
13364
13365         Fix bug #55770.
13366         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13367         (NamespaceEntry.Lookup): Add new argument to flag if we want the
13368         lookup to avoid symbols introduced by 'using'.
13369         * rootcontext.cs (NamespaceLookup): Update.
13370
13371 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13372
13373         * class.cs (TypeContainer.DoDefineMembers): Do not call
13374         DefineDefaultConstructor for static classes.
13375
13376 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13377
13378         * attribute.cs (Attribute.Resolve): Add error 653 report.
13379
13380         * class.cs (Class.ApplyAttributeBuilder): Add error 641
13381         report.
13382         (Method.ApplyAttributeBuilder): Add error 685 report.
13383         (Operator.Define): Add error 564 report.
13384
13385         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13386
13387         * expression.cs (Invocation.DoResolve): Add error
13388         245 and 250 report.
13389
13390         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13391         error 674 report.
13392
13393 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13394
13395         * class.cs (ConstructorInitializer.Resolve):
13396         Wrong error number (515->516).
13397
13398 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13399
13400         * class.cs (Indexer.Define): Add error 631 report.
13401
13402 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13403
13404         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13405
13406 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13407
13408         * expression.cs (Probe.DoResolve): Add error CS0241 report.
13409
13410 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
13411
13412         * cs-parser.jay: Added error CS0241 report.
13413
13414 2004-09-10  Raja R Harinath  <rharinath@novell.com>
13415
13416         * cs-parser.jay (fixed_statement): Introduce a scope for the
13417         declaration in the 'fixed' statement.
13418
13419 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13420
13421         * cs-parser.jay: Added CS0230 error report.
13422
13423 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13424
13425         * cs-parser.jay: Added errors CS0231 and CS0257 report.
13426
13427 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13428
13429         * expression.cs (Argument.Resolve): Added error CS0192 and
13430         CS0199 report.
13431
13432 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13433
13434         C# 2.0 #pragma warning feature
13435
13436         * cs-tokenizer.cs (PreProcessPragma): New method; 
13437         Handles #pragma directive.
13438
13439         * report.cs (WarningRegions): New class; Support
13440         class for #pragma warning directive. It tests whether
13441         warning is enabled for a given line.
13442
13443 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
13444
13445         * const.cs: Add more descriptive error report, tahnks to
13446         Sebastien. 
13447
13448 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
13449
13450         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13451
13452 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
13453
13454         * expression.cs: Apply patch from Ben: Remove dead code from
13455         ArrayCreation, and remove the TurnintoConstant call in const.cs,
13456         as that code just threw an exception anwyays.
13457
13458         * const.cs: Remove the call to the turnintoconstant, for details
13459         see bug: #63144
13460         
13461         * literal.cs: The type of the null-literal is the null type;  So
13462         we use a placeholder type (literal.cs:System.Null, defined here)
13463         for it.
13464
13465         * expression.cs (Conditional.DoResolve): Remove some old code that
13466         is no longer needed, conversions have been fixed.
13467
13468         (ArrayCreationExpression.DoResolve): Return false if we fail to
13469         resolve the inner expression.
13470
13471 2004-09-07  Raja R Harinath  <rharinath@novell.com>
13472
13473         Fix test-290.cs.
13474         * cs-parser.jay (delegate_declaration): Record a delegate
13475         declaration as a type declaration.
13476         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13477
13478 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
13479
13480         * parameter.cs: Do not crash if the type can not be resolved. 
13481
13482         * expression.cs: Report errors with unsafe pointers, fixes #64896
13483
13484 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
13485
13486         * expression.cs: Pointer arith always needs to do a conv.i
13487         if the operand is a long. fix 65320
13488
13489 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13490
13491         Fixed cs0619-37.cs, cs0619-38.cs
13492
13493         * enum.cs (GetObsoleteAttribute): Removed.
13494
13495         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13496         on Enum member is double staged. The first is tested member
13497         and then enum.
13498
13499 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13500
13501         Fixed #56986, #63631, #65231
13502
13503         * class.cs: (TypeContainer.AddToMemberContainer): New method,
13504         adds member to name container.
13505         (TypeContainer.AddToTypeContainer): New method, adds type to
13506         name container.
13507         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13508         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13509         AddOperator): Simplified by reusing AddToMemberContainer.
13510         (TypeContainer.UserDefinedStaticConstructor): Changed to property
13511         instead of field.
13512         (Method.CheckForDuplications): Fixed implementation to test all
13513         possibilities.
13514         (MemberBase): Detection whether member is explicit interface
13515         implementation is now in constructor.
13516         (MemberBase.UpdateMemberName): Handles IndexerName.
13517         (Accessor): Changed to keep also location information.
13518         (AbstractPropertyEventMethod): Is derived from MemberCore.
13519         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13520         will be emited or not.
13521         (PropertyBase.AreAccessorsDuplicateImplementation):
13522         Tests whether accessors are not in collision with some method.
13523         (Operator): Is derived from MethodCore to simplify common
13524         operations.
13525
13526         * decl.cs (Flags.TestMethodDuplication): Test for duplication
13527         must be performed.
13528         (DeclSpace.AddToContainer): Adds the member to defined_names
13529         table. It tests for duplications and enclosing name conflicts.
13530
13531         * enum.cs (EnumMember): Clean up to reuse the base structures
13532
13533 2004-09-03  Martin Baulig  <martin@ximian.com>
13534
13535         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13536         into TypeContainer, to make partial classes work again.
13537
13538 2004-09-03  Martin Baulig  <martin@ximian.com>
13539
13540         * rootcontext.cs (RootContext.V2): Removed.
13541
13542 2004-03-23  Martin Baulig  <martin@ximian.com>
13543
13544         * expression.cs (Invocation.OverloadResolve): Added `bool
13545         may_fail' argument and use it instead of the Location.IsNull() hack.
13546
13547 2004-09-03  Martin Baulig  <martin@ximian.com>
13548
13549         Merged latest changes into gmcs.  Please keep this comment in
13550         here, it makes it easier for me to see what changed in MCS since
13551         the last time I merged.
13552
13553 2004-09-03  Raja R Harinath  <rharinath@novell.com>
13554
13555         Fix #61128.
13556         * expression.cs (BetterConversion): Don't allow either conversion 
13557         to be null.  Remove redundant implicit conversion test when 'q ==
13558         null' -- when this function is invoked, we already know that the
13559         implicit conversion exists.
13560         (BetterFunction): Assume that 'best' is non-null.  Remove
13561         redundant reimplementation of IsApplicable when 'best' is null.
13562         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13563         number of arguments.
13564         (IsAncestralType): Extract from OverloadResolve.
13565         (OverloadResolve): Make robust to the MethodGroupExpr being
13566         unsorted.  Implement all the logic of Section 14.5.5.1, and
13567         support overloading of methods from multiple applicable types.
13568         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
13569
13570         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13571         (RealError, Warning): Append type of report to related symbol.
13572
13573 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
13574
13575         * enum.cs: Fixed CLS-Compliance checks for enum members.
13576         Error tests cs3008-8.cs, cs3014-8.cs
13577
13578 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13579
13580         Fixed bug #62342, #63102
13581         * class.cs: ImplementIndexer uses member.IsExplicitImpl
13582         like ImplementMethod.
13583
13584 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13585
13586         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13587         Fixed bug #65170.
13588
13589 2004-09-02  Martin Baulig  <martin@ximian.com>
13590
13591         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13592         TypeManager.GetArgumentTypes() rather than calling GetParameters()
13593         on the MethodBase.
13594
13595 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
13596
13597         C# 2.0 Static classes implemented
13598
13599         * class.cs (TypeContainer): instance_constructors,
13600         initialized_fields, initialized_static_fields,
13601         default_constructor, base_inteface_types are protected to be
13602         accessible from StaticClass.
13603         (TypeContainer.DefineDefaultConstructor): New virtual method
13604         for custom default constructor generating
13605         (StaticClass): New class to handle "Static classes" feature.
13606
13607         * cs-parser.jay: Handle static keyword on class like instance
13608         of StaticClass.
13609
13610         * driver.cs: Added "/langversion" command line switch with two
13611         options (iso-1, default).
13612
13613 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
13614
13615         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13616
13617 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
13618
13619         * delegate.cs: Style.
13620
13621 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13622
13623         * delegate.cs: Add seperate instance expr field for miguel.
13624
13625 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13626
13627         * PointerArithmetic (Resolve): make sure we are not doing
13628         pointer arith on void*. Also, make sure we are resolved
13629         by not setting eclass until resolve.
13630
13631         All callers: Make sure that PointerArithmetic gets resolved.
13632
13633 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13634
13635         * ArrayCreation (LookupType): If the type does not resolve 
13636         to an array, give an error.
13637
13638 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
13639
13640         * statement.cs (Try.Resolve): Fixed bug #64222
13641
13642 2004-08-27  Martin Baulig  <martin@ximian.com>
13643
13644         * class.cs
13645         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13646         crash here.     
13647
13648 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13649
13650         * ecore.cs (Constantify): Get underlying type via
13651         System.Enum.GetUnderlyingType to avoid StackOverflow on the
13652         Windows in special cases.
13653
13654 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13655
13656         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13657         for obtaining also private methods.
13658         (GetRemoveMethod): Used GetRemoveMethod (true)
13659         for obtaining also private methods.
13660
13661 2004-08-24  Martin Baulig  <martin@ximian.com>
13662
13663         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13664         MethodAttributes.HideBySig for operators.
13665
13666 2004-08-23  Martin Baulig  <martin@ximian.com>
13667
13668         Back to the old error reporting system :-)
13669
13670         * report.cs (Message): Removed.
13671         (Report.MessageData, ErrorData, WarningData): Removed.
13672         (Report.Error, Warning): Back to the old system.
13673
13674 2004-08-23  Martin Baulig  <martin@ximian.com>
13675
13676         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13677
13678         * class.cs (TypeContainer.ParentContainer): New public virtual
13679         method; replaces the explicit interface implementation.
13680         (ClassPart.ParentContainer): Override.
13681
13682 2004-08-23  Martin Baulig  <martin@ximian.com>
13683
13684         * statement.cs (Switch): Added support for constant switches; see
13685         #59428 or test-285.cs.
13686
13687 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13688
13689         Fixed bug #62740.
13690         * statement.cs (GetEnumeratorFilter): Removed useless
13691         logic because C# specs is strict. GetEnumerator must be
13692         public.
13693
13694 2004-08-22  Martin Baulig  <martin@ximian.com>
13695
13696         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13697         a switch and may break, reset the barrier.  Fixes #59867.
13698
13699 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13700
13701         CLS-Compliance speed up (~5% for corlib)
13702
13703         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13704         New method. Tests container for CLS-Compliant names
13705
13706         * class.cs (TypeContainer.VerifyClsName): New method.
13707         Checks whether container name is CLS Compliant.
13708         (Constructor): Implements IMethodData.
13709
13710         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13711         low-case table for CLS Compliance test.
13712         (MemberCache.VerifyClsParameterConflict): New method.
13713         Checks method parameters for CS3006 error.
13714
13715         * enum.cs (EnumMember): Is derived from MemberCore.
13716         (Enum.VerifyClsName): Optimized for better performance.
13717
13718 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13719
13720         * report.cs: Renamed Error_T to Error and changed all
13721         references.
13722
13723 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13724
13725         * class.cs (TypeContainer.IndexerArrayList): New inner class
13726         container for indexers.
13727         (TypeContainer.DefaultIndexerName): New constant for default
13728         indexer name. Replaced all "Item" with this constant.
13729         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13730
13731         * typemanager.cs (TypeManager.default_member_ctor): Cache here
13732         DefaultMemberAttribute constructor.
13733
13734 2004-08-05  Martin Baulig  <martin@ximian.com>
13735
13736         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13737         Fix bug #59429.
13738
13739 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
13740
13741         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13742         multi platforms problem.
13743
13744         * compiler.csproj: Included shared files.
13745
13746 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13747
13748         Fix bug 60333, 55971 in the more general way
13749         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13750         Added arg_type argument for constant conversion.
13751         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13752
13753 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13754
13755         Fix bug #59760
13756         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
13757         OperatorArrayList, MethodCoreArrayList for typecontainer
13758         containers. Changed class member types to these new types.
13759         (MethodArrayList.DefineMembers): Added test for CS0659.
13760
13761 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
13762
13763         * cfold.cs: Synchronize the folding with the code in expression.cs
13764         Binary.DoNumericPromotions for uint operands.
13765
13766         * attribute.cs: Revert patch from Raja, it introduced a regression
13767         while building Blam-1.2.1 (hard to isolate a test case).
13768
13769 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13770
13771         Fix for #55382
13772         * class.cs:
13773         (TypeContainer.Define): Renamed to DefineContainerMembers because of
13774         name collision.
13775         (MethodCore.parent_method): New member. The method we're overriding
13776         if this is an override method.
13777         (MethodCore.CheckBase): Moved from Method class and made common.
13778         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13779         private.
13780         (MethodCore.CheckForDuplications): New abstract method. For custom
13781         member duplication search in a container
13782         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13783         method and its return type.
13784         (Event.conflict_symbol): New member. Symbol with same name in the
13785         parent class.
13786
13787         * decl.cs:
13788         (MemberCache.FindMemberWithSameName): New method. The method
13789         is looking for conflict with inherited symbols.
13790
13791 2004-08-04  Martin Baulig  <martin@ximian.com>
13792
13793         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13794
13795         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13796
13797 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13798
13799         * report.cs (Message): New enum for better error, warning reference in
13800         the code.
13801         (MessageData): New inner abstract class. It generally handles printing of
13802         error and warning messages.
13803         Removed unused Error, Warning, Message methods.
13804
13805 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13806
13807         Fix for cs0592-8.cs test
13808         * attribute.cs
13809         (Attributable.ValidAttributeTargets): Made public.
13810         (Attribute.ExplicitTarget): New member for explicit target value.
13811         (Attribute.CheckTargets): Now we translate explicit attribute
13812         target to Target here.
13813
13814 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
13815
13816         * ecore.cs (MethodGroupExpr): new IsBase property.
13817
13818         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13819
13820         * delegate.cs (DelegateCreation): store a MethodGroupExpr
13821         rather than an instance expr.
13822
13823         (DelegateCreation.Emit): Use the method group rather than
13824         the instance expression. Also, if you have base.Foo as the
13825         method for a delegate, make sure to emit ldftn, not ldftnvirt.
13826
13827         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
13828
13829         (NewDelegate.DoResolve): Only check for the existance of Invoke
13830         if the method is going to be needed. Use MethodGroupExpr.
13831
13832         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
13833
13834         * expression.cs: For pointer arith., make sure to use
13835         the size of the type, not the size of the pointer to
13836         the type.
13837
13838 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13839
13840         Fix for #60722
13841         * class.cs (Class): Added error CS0502 test.
13842
13843 2004-08-03  John Luke  <jluke@cfl.rr.com>
13844             Raja R Harinath  <rharinath@novell.com>
13845
13846         Fix for #60997.
13847         * attribute.cs (Attribute.complained_before): New flag.
13848         (Attribute.ResolveType, Attribute.Resolve),
13849         (Attribute.DefinePInvokeMethod): Set it.
13850         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13851         
13852 2004-08-03  Martin Baulig  <martin@ximian.com>
13853
13854         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13855         use a user-defined operator; we still need to do numeric
13856         promotions in case one argument is a builtin type and the other
13857         one has an implicit conversion to that type.  Fixes #62322.
13858
13859 2004-08-02  Martin Baulig  <martin@ximian.com>
13860
13861         * statement.cs (LocalInfo.Flags): Added `IsThis'.
13862         (LocalInfo.IsThis): New public property.
13863         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13864
13865 2004-08-01  Martin Baulig  <martin@ximian.com>
13866
13867         * class.cs (TypeContainer.GetClassBases): Don't set the default
13868         here since we may get called from GetPartialBases().
13869         (TypeContainer.DefineType): If GetClassBases() didn't return a
13870         parent, use the default one.
13871
13872 2004-07-30  Duncan Mak  <duncan@ximian.com>
13873
13874         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13875
13876 2004-07-30  Martin Baulig  <martin@ximian.com>
13877
13878         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13879
13880         * class.cs (SourceMethod): New public class, derive from the
13881         symbol writer's ISourceMethod.
13882         (Method): Use the new symbol writer API.
13883
13884         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13885         as argument and use the new symbol writer.
13886
13887         * location.cs
13888         (SourceFile): Implement the symbol writer's ISourceFile.
13889         (Location.SymbolDocument): Removed.
13890         (Location.SourceFile): New public property.
13891
13892         * symbolwriter.cs: Use the new symbol writer API.
13893
13894 2004-07-30  Raja R Harinath  <rharinath@novell.com>
13895
13896         * Makefile (install-local): Remove.  Functionality moved to
13897         executable.make.
13898
13899 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
13900
13901         * Makefile: Install mcs.exe.config file together with mcs.exe.
13902         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13903         correct runtime version.
13904         
13905 2004-07-25  Martin Baulig  <martin@ximian.com>
13906
13907         * class.cs
13908         (TypeContainer.RegisterOrder): Removed, this was unused.
13909         (TypeContainer, interface_order): Removed.
13910         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13911         TypeContainer as argument since we can also be called with a
13912         `PartialContainer' for a partial class/struct/interface.
13913         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13914         of checking whether we're an `Interface' - we could be a
13915         `PartialContainer'.
13916         (PartialContainer.Register): Override; call
13917         AddClass()/AddStruct()/AddInterface() on our parent.
13918
13919         * cs-parser.jay (interface_member_declaration): Add things to the
13920         `current_container', not the `current_class'.
13921
13922         * rootcontext.cs (RegisterOrder): The overloaded version which
13923         takes an `Interface' was unused, removed.
13924
13925         * typemanager.cs (TypeManager.LookupInterface): Return a
13926         `TypeContainer', not an `Interface'.
13927         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13928         contain a `PartialContainer' for an interface, so check it's
13929         `Kind' to figure out what it is.
13930
13931 2004-07-25  Martin Baulig  <martin@ximian.com>
13932
13933         * class.cs (Class.DefaultTypeAttributes): New public constant.
13934         (Struct.DefaultTypeAttributes): Likewise.
13935         (Interface.DefaultTypeAttributes): Likewise.
13936         (PartialContainer.TypeAttr): Override this and add the
13937         DefaultTypeAttributes.
13938
13939 2004-07-25  Martin Baulig  <martin@ximian.com>
13940
13941         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13942         we can just use the `Parent' field instead.
13943
13944 2004-07-25  Martin Baulig  <martin@ximian.com>
13945
13946         * class.cs (TypeContainer.Emit): Renamed to EmitType().
13947
13948 2004-07-25  Martin Baulig  <martin@ximian.com>
13949
13950         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13951         our parts before defining any methods.
13952         (TypeContainer.VerifyImplements): Make this virtual.
13953         (ClassPart.VerifyImplements): Override and call VerifyImplements()
13954         on our PartialContainer.
13955
13956 2004-07-25  Martin Baulig  <martin@ximian.com>
13957
13958         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13959
13960         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13961         argument, we can just use the `Parent' field instead.
13962
13963         * class.cs
13964         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
13965         (MemberBase.DoDefine): Likewise.
13966
13967 2004-07-24  Martin Baulig  <martin@ximian.com>
13968
13969         * decl.cs (MemberCore.Parent): New public field.
13970         (DeclSpace.Parent): Moved to MemberCore.
13971
13972         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13973         (MemberBase.ctor): Added TypeContainer argument, pass it to our
13974         parent's .ctor.
13975         (FieldBase, Field, Operator): Likewise.
13976         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13977         (EventField, Event): Likewise.
13978
13979 2004-07-23  Martin Baulig  <martin@ximian.com>
13980
13981         * class.cs (PartialContainer): New public class.
13982         (ClassPart): New public class.
13983         (TypeContainer): Added support for partial classes.
13984         (TypeContainer.GetClassBases): Splitted some of the functionality
13985         out into GetNormalBases() and GetPartialBases().
13986
13987         * cs-tokenizer.cs (Token.PARTIAL): New token.
13988         (Tokenizer.consume_identifier): Added some hacks to recognize
13989         `partial', but only if it's immediately followed by `class',
13990         `struct' or `interface'.
13991
13992         * cs-parser.jay: Added support for partial clases.
13993
13994 2004-07-23  Martin Baulig  <martin@ximian.com>
13995
13996         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13997         a `DeclSpace' and also made it readonly.
13998         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13999         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
14000         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
14001
14002         * cs-parser.jay: Pass the `current_class', not the
14003         `current_container' (at the moment, this is still the same thing)
14004         to a new Method, Property, Event, Indexer or Constructor.
14005
14006 2004-07-23  Martin Baulig  <martin@ximian.com>
14007
14008         * cs-parser.jay (CSharpParser): Added a new `current_class' field
14009         and removed the `current_interface' one.
14010         (struct_declaration, class_declaration, interface_declaration):
14011         Set `current_class' to the newly created class/struct/interface;
14012         set their `Bases' and call Register() before parsing their body.
14013
14014 2004-07-23  Martin Baulig  <martin@ximian.com>
14015
14016         * class.cs (Kind): New public enum.
14017         (TypeContainer): Made this class abstract.
14018         (TypeContainer.Kind): New public readonly field.
14019         (TypeContainer.CheckDef): New public method; moved here from
14020         cs-parser.jay.
14021         (TypeContainer.Register): New public abstract method.
14022         (TypeContainer.GetPendingImplementations): New public abstract
14023         method.
14024         (TypeContainer.GetClassBases): Removed the `is_class' and
14025         `is_iface' parameters.
14026         (TypeContainer.DefineNestedTypes): Formerly known as
14027         DoDefineType().
14028         (ClassOrStruct): Made this class abstract.
14029
14030         * tree.cs (RootTypes): New public type. 
14031
14032 2004-07-20  Martin Baulig  <martin@ximian.com>
14033
14034         * tree.cs (Tree.RecordNamespace): Removed.
14035         (Tree.Namespaces): Removed.
14036
14037         * rootcontext.cs (RootContext.IsNamespace): Removed.
14038
14039         * cs-parser.jay (namespace_declaration): Just create a new
14040         NamespaceEntry here.
14041
14042 2004-07-20  Martin Baulig  <martin@ximian.com>
14043
14044         * statement.cs (ExceptionStatement): New abstract class.  This is
14045         now used as a base class for everyone who's using `finally'.
14046         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
14047         our local variables before using them.
14048
14049         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
14050         virtual method.  This is used by Yield.Resolve() to "steal" an
14051         outer block's `finally' clauses.
14052         (FlowBranchingException): The .ctor now takes an ExceptionStatement
14053         argument.
14054
14055         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
14056         version which takes an ExceptionStatement.  This version must be
14057         used to create exception branchings.
14058
14059         * iterator.cs
14060         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
14061         (Iterator.EmitMoveNext): Added exception support; protect the
14062         block with a `fault' clause, properly handle 'finally' clauses.
14063         (Iterator.EmitDispose): Run all the `finally' clauses here.
14064
14065 2004-07-20  Martin Baulig  <martin@ximian.com>
14066
14067         * iterator.cs: This is the first of a set of changes in the
14068         iterator code.  Match the spec more closely: if we're an
14069         IEnumerable, then GetEnumerator() must be called.  The first time
14070         GetEnumerator() is called, it returns the current instance; all
14071         subsequent invocations (if any) must create a copy.
14072
14073 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
14074
14075         * expression.cs: Resolve the constant expression before returning
14076         it. 
14077
14078 2004-07-19  Martin Baulig  <martin@ximian.com>
14079
14080         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
14081         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
14082         the return type of the new EmitContext.
14083
14084 2004-07-18  Martin Baulig  <martin@ximian.com>
14085
14086         * class.cs (Property.Define): Fix iterators.
14087
14088         * iterators.cs (Iterator.Define): Moved the
14089         `container.AddInterator (this)' call here from the .ctor; only do
14090         it if we resolved successfully.
14091
14092 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
14093
14094         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
14095         `true' for preprocessing directives that we parse.  The return
14096         value indicates whether we should return to regular tokenizing or
14097         not, not whether it was parsed successfully.
14098
14099         In the past if we were in: #if false ... #line #endif, we would
14100         resume parsing after `#line'.  See bug 61604.
14101
14102         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
14103         building: IsEnumType should return true only for enums, not for
14104         enums or System.Enum itself.  This fixes #61593.
14105
14106         Likely what happened is that corlib was wrong: mcs depended on
14107         this bug in some places.  The bug got fixed, we had to add the
14108         hack, which caused bug 61593.
14109
14110         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
14111         that was a workaround for the older conditions.
14112
14113 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
14114
14115         * assign.cs: IAssignMethod has a new interface, as documented
14116         inline. All assignment code now uses this new api.
14117
14118         * ecore.cs, expression.cs: All classes which implement
14119         IAssignMethod now use the new interface.
14120
14121         * expression.cs (Invocation): add a hack to EmitCall so that
14122         IndexerAccess can be the target of a compound assignment without
14123         evaluating its arguments twice.
14124
14125         * statement.cs: Handle changes in Invocation api.
14126
14127 2004-07-16  Martin Baulig  <martin@ximian.com>
14128
14129         * iterators.cs: Rewrote this.  We're now using one single Proxy
14130         class for both the IEnumerable and the IEnumerator interface and
14131         `Iterator' derives from Class so we can use the high-level API.
14132
14133         * class.cs (TypeContainer.AddIterator): New method.
14134         (TypeContainer.DoDefineType): New protected virtual method, which
14135         is called from DefineType().
14136         (TypeContainer.DoDefineMembers): Call DefineType() and
14137         DefineMembers() on all our iterators.
14138         (TypeContainer.Emit): Call Emit() on all our iterators.
14139         (TypeContainer.CloseType): Call CloseType() on all our iterators.
14140
14141         * codegen.cs (EmitContext.CurrentIterator): New public field.
14142
14143 2004-07-15  Martin Baulig  <martin@ximian.com>
14144
14145         * typemanager.cs
14146         (TypeManager.not_supported_exception_type): New type.   
14147
14148 2004-07-14  Martin Baulig  <martin@ximian.com>
14149
14150         * iterators.cs: Use real error numbers.
14151
14152 2004-07-14  Martin Baulig  <martin@ximian.com>
14153
14154         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
14155         requires this to be a System.Collection.IEnumerable and not a
14156         class implementing that interface.
14157         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
14158
14159 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
14160
14161         * class.cs: Fixed previous fix, it broke some error tests.
14162
14163 2004-07-12  Martin Baulig  <martin@ximian.com>
14164
14165         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
14166         Fixes #61293.
14167
14168 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
14169
14170         * assign.cs (LocalTemporary): Add new argument: is_address,If
14171         `is_address' is true, then the value that we store is the address
14172         to the real value, and not the value itself.
14173         
14174         * ecore.cs (PropertyExpr): use the new local temporary
14175         stuff to allow us to handle X.Y += z (where X is a struct)
14176
14177 2004-07-08  Martin Baulig  <martin@ximian.com>
14178
14179         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
14180         not always return, just like we're doing in Using.Resolve().
14181
14182 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
14183
14184         * cs-parser.jay (fixed_statement): flag this as Pinned.
14185
14186 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
14187
14188         * typemanager.cs (TypeManager): Removed MakePinned method, this
14189         mechanism is replaced with the .NET 2.x compatible mechanism of
14190         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
14191
14192         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
14193         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
14194         `IsFixed' property which has a different meaning.
14195
14196 2004-07-02  Raja R Harinath  <rharinath@novell.com>
14197
14198         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
14199         visible from inside a nested class, not just the names of the
14200         immediately enclosing class.
14201         Fix for bug #60730.
14202
14203 2004-06-24  Raja R Harinath  <rharinath@novell.com>
14204
14205         * expression.cs (BetterConversion): Remove buggy special-case
14206         handling of "implicit constant expression conversions".  At this
14207         point, we already know that the conversion is possible -- we're
14208         only checking to see which is better.
14209
14210 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14211
14212         * cs-parser.jay: Added error CS0210 test.
14213
14214 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14215
14216         * cs-parser.jay: Added error CS0134 test.
14217
14218 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14219
14220         Fix bug #52507
14221         * cs-parser.jay: Added error CS0145 test.
14222
14223 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14224
14225         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
14226
14227 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
14228         
14229         * expression.cs (StackAlloc.Resolve): The argument may not
14230         be a constant; deal with this case.
14231         
14232 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
14233
14234         * attribute.cs (IndexerName_GetIndexerName): Renamed to
14235         GetIndexerAttributeValue.
14236         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
14237
14238         * class.cs (Indexer.Define): Added error tests for CS0415,
14239         CS0609.
14240
14241 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
14242
14243         * attribute.cs (Attribute.Resolve): Keep field code in sync with
14244         property code.
14245
14246 2004-06-23  Martin Baulig  <martin@ximian.com>
14247
14248         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
14249         neither return nor throw, reset the barrier as well.  Fixes #60457.
14250
14251 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
14252
14253         * class.cs : EventAttributes is now set to None by default.
14254           This fixes bug #60459.
14255
14256 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
14257
14258         Fix bug #60219
14259         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14260         Don't throw exception but return null (it's sufficient now).
14261
14262 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
14263
14264         * typemanager.cs (GetArgumentTypes): Faster implementation.
14265
14266 2004-06-18  Martin Baulig  <martin@ximian.com>
14267
14268         * attribute.cs (Attribute.Resolve): Check whether we're an
14269         EmptyCast which a Constant child.  Fixes #60333.
14270
14271 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
14272
14273         * statement.cs (EmitCollectionForeach): Account for the fact that
14274         not all valuetypes are in areas which we can take the address of.
14275         For these variables, we store to a temporary variable. Also, make
14276         sure that we dont emit a `callvirt' on a valuetype method.
14277
14278 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14279
14280         * expression.cs (StackAlloc.DoReSolve): Added test for
14281         negative parameter (CS0247).
14282
14283 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14284
14285         Fix bug #59792
14286         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
14287
14288 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14289
14290         Fix bug #59781
14291         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
14292         ulong.
14293
14294 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
14295
14296         Fix bug #58254 & cs1555.cs, cs1556.cs
14297         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
14298
14299 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
14300
14301         * cs-parser.jay: Added error CS1669 test for indexers.
14302
14303 2004-06-11  Martin Baulig  <martin@ximian.com>
14304
14305         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
14306         call this twice: for params and varargs methods.
14307
14308 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14309
14310         * class.cs:
14311         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
14312
14313 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14314
14315         * attribute.cs (Attribute.GetValidTargets): Made public.
14316
14317         * class.cs: 
14318         (AbstractPropertyEventMethod): New class for better code sharing.
14319         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
14320         CS1667 report.
14321         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
14322
14323 2004-06-11  Raja R Harinath  <rharinath@novell.com>
14324
14325         Fix bug #59477.
14326         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
14327         that the call to Resolve is part of a MemberAccess.
14328         (Expression.Resolve): Use it for SimpleName resolution.
14329         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14330         Add 'intermediate' boolean argument.
14331         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
14332         error message when the SimpleName can be resolved ambiguously
14333         between an expression and a type.
14334         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14335         public.
14336         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14337         call on the left-side.
14338
14339 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14340
14341         * class.cs:
14342         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14343
14344 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14345
14346         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14347
14348 2004-06-11  Martin Baulig  <martin@ximian.com>
14349
14350         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14351         varargs methods if applicable.
14352
14353 2004-06-11  Martin Baulig  <martin@ximian.com>
14354
14355         * expression.cs (Invocation.EmitCall): Don't use
14356         `method.CallingConvention == CallingConventions.VarArgs' since the
14357         method could also have `CallingConventions.HasThis'.
14358
14359 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14360
14361         * class.cs (Event.GetSignatureForError): Implemented.
14362         Fixed crash in error test cs3010.cs
14363
14364 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
14365
14366         * cs-tokenizer.cs: Change the way we track __arglist to be
14367         consistent with the other keywords.
14368
14369 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
14370
14371         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14372         tomorrow.
14373
14374 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
14375
14376         * codegen.cs: Check that all referenced assemblies have a strongname
14377         before strongnaming the compiled assembly. If not report error CS1577.
14378         Fix bug #56563. Patch by Jackson Harper.
14379         * typemanager.cs: Added a method to return all referenced assemblies.
14380         Fix bug #56563. Patch by Jackson Harper.
14381
14382 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14383
14384         * class.cs:
14385         (Method.ApplyAttributeBuilder): Moved and added conditional
14386         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14387
14388         * delegate.cs:
14389         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14390
14391 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14392
14393         Fixed #59640
14394         * class.cs: (EventField.attribute_targets): Changed default target.
14395
14396 2004-06-08  Martin Baulig  <martin@ximian.com>
14397
14398         * expression.cs (Invocation.EmitCall): Enable varargs methods.
14399
14400 2004-06-08  Martin Baulig  <martin@ximian.com>
14401
14402         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14403
14404 2004-06-07  Martin Baulig  <martin@ximian.com>
14405
14406         Added support for varargs methods.
14407
14408         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14409         keyword.
14410
14411         * cs-parser.jay: Added support for `__arglist'.
14412
14413         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14414
14415         * expression.cs (Argument.AType): Added `ArgList'.
14416         (Invocation): Added support for varargs methods.
14417         (ArglistAccess): New public class.
14418         (Arglist): New public class.
14419
14420         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14421
14422         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
14423         a method's top-level block if the method has varargs.
14424
14425         * support.cs (ReflectionParameters, InternalParameters): Added
14426         support for varargs methods.    
14427
14428 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
14429
14430         * class.cs: Provide location in indexer error report.
14431
14432         * driver.cs: Use standard names.
14433
14434         * namespace.cs: Catch the use of using after a namespace has been
14435         declared also on using aliases.
14436
14437 2004-06-03  Raja R Harinath  <rharinath@novell.com>
14438
14439         Bug #50820.
14440         * typemanager.cs (closure_private_ok, closure_invocation_type)
14441         (closure_qualifier_type, closure_invocation_assembly)
14442         (FilterWithClosure): Move to ...
14443         (Closure): New internal nested class.
14444         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14445         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14446         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14447         (MemberLookup, MemberLookupFailed): Use it.
14448         * expression.cs (New.DoResolve): Treat the lookup for the
14449         constructor as being qualified by the 'new'ed type.
14450         (Indexers.GetIndexersForTypeOrInterface): Update.
14451
14452 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
14453
14454         * attribute.cs
14455         (GetConditionalAttributeValue): New method. Returns
14456         condition of ConditionalAttribute.
14457         (SearchMulti): New method.  Returns all attributes of type 't'.
14458         Use it when attribute is AllowMultiple = true.
14459         (IsConditionalMethodExcluded): New method.
14460
14461         * class.cs
14462         (Method.IsExcluded): Implemented. Returns true if method has conditional
14463         attribute and the conditions is not defined (method is excluded).
14464         (IMethodData): Extended interface for ConditionalAttribute support.
14465         (PropertyMethod.IsExcluded): Implemented.
14466
14467         * decl.cs
14468         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14469
14470         * expression.cs
14471         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14472         on the method.
14473
14474 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
14475
14476         * expression.cs (ArrayCreationExpression): Make this just an
14477         `expression'. It can't be a statement, so the code here was
14478         dead.
14479
14480 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14481
14482         Fixed #59072
14483         * typemanager.cs (GetFullNameSignature): New method for
14484         MethodBase types.
14485
14486 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14487
14488         Fixed #56452
14489         * class.cs (MemberBase.GetSignatureForError): New virtual method.
14490         Use this method when MethodBuilder is null.
14491         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14492         Added test for error CS0626 (MONO reports error for this situation).
14493         (IMethodData.GetSignatureForError): Extended interface.
14494
14495 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14496
14497         * attribute.cs
14498         (AttributeTester.GetObsoleteAttribute): Returns instance of
14499         ObsoleteAttribute when type is obsolete.
14500
14501         * class.cs
14502         (TypeContainer.VerifyObsoleteAttribute): Override.
14503         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14504         (MethodCode.VerifyObsoleteAttribute): Override.
14505         (MemberBase.VerifyObsoleteAttribute): Override.
14506
14507         * decl.cs
14508         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14509         and report proper error.
14510
14511         *delegate.cs
14512         Delegate.VerifyObsoleteAttribute): Override.
14513
14514         * ecore.cs
14515         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14516         and report proper error.
14517         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14518
14519         * enum.cs
14520         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14521         and enum member.
14522
14523         * expression.cs
14524         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14525         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14526         Added test for ObsoleteAttribute.
14527
14528         * statement.cs
14529         (Catch): Derived from Statement.
14530
14531 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14532  
14533         Fixed bug #59071 & cs0160.cs
14534  
14535         * statement.cs (Try.Resolve): Check here whether order of catch
14536         clauses matches their dependencies.
14537
14538 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
14539
14540         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
14541         caused a regression: #59343.  Referencing nested classes from an
14542         assembly stopped working.
14543
14544 2004-05-31  Martin Baulig  <martin@ximian.com>
14545
14546         MCS is now frozen for beta 2.
14547
14548 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14549
14550         * convert.cs: add a trivial cache for overload operator resolution.
14551
14552 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14553
14554         * decl.cs: If possible, use lookuptypedirect here. We can only do
14555         this if there is no `.' after the namespace. Avoids using
14556         LookupType, which does lots of slow processing.
14557         (FindNestedType) New method, does what it says :-).
14558         * namespace.cs: use LookupTypeDirect.
14559         * rootcontext.cs: use membercache, if possible.
14560         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14561
14562 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14563
14564         * expression.cs:
14565         According to the spec, 
14566
14567         In a member access of the form E.I, if E is a single identifier,
14568         and if the meaning of E as a simple-name (§7.5.2) is a constant,
14569         field, property, localvariable, or parameter with the same type as
14570         the meaning of E as a type-name (§3.8), then both possible
14571         meanings of E are permitted.
14572
14573         We did not check that E as a simple-name had the same type as E as
14574         a type name.
14575
14576         This trivial check gives us 5-7% on bootstrap time.
14577
14578 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14579
14580         * expression.cs (Invocation.OverloadResolve): Avoid the
14581         use of hashtables and boxing here by allocating on demand.
14582
14583 2004-05-30  Martin Baulig  <martin@ximian.com>
14584
14585         * rootcontext.cs (RootContext.LookupType): Don't cache things if
14586         we're doing a silent lookup.  Don't try to lookup nested types in
14587         TypeManager.object_type (thanks to Ben Maurer).
14588
14589 2004-05-30  Martin Baulig  <martin@ximian.com>
14590
14591         Committing a patch from Ben Maurer.
14592
14593         * rootcontext.cs (RootContext.LookupType): Cache negative results.
14594
14595 2004-05-29  Martin Baulig  <martin@ximian.com>
14596
14597         * class.cs (IMethodData.ShouldIgnore): New method.
14598
14599         * typemanager.cs (TypeManager.MethodFlags): Don't take a
14600         `Location' argument, we don't need it anywhere.  Use
14601         `IMethodData.ShouldIgnore ()' instead of
14602         `MethodData.GetMethodFlags ()'.
14603         (TypeManager.AddMethod): Removed.
14604         (TypeManager.AddMethod2): Renamed to AddMethod.
14605
14606 2004-05-29  Martin Baulig  <martin@ximian.com>
14607
14608         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14609
14610         * convert.cs (Convert.ImplicitReferenceConversion): If we're
14611         converting from a class type S to an interface type and we already
14612         have an object on the stack, don't box it again.  Fixes #52578.
14613
14614 2004-05-29  Martin Baulig  <martin@ximian.com>
14615
14616         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14617         Added support for `params' parameters.  Fixes #59267.
14618
14619 2004-05-29  Martin Baulig  <martin@ximian.com>
14620
14621         * literal.cs (NullPointer): Provide a private .ctor which sets
14622         `type' to TypeManager.object_type.  Fixes #59048.
14623
14624 2004-05-29  Martin Baulig  <martin@ximian.com>
14625
14626         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14627         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
14628
14629         * ecore.cs (EventExpr.instance_expr): Make the field private.
14630
14631 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
14632
14633         Fixed bug #50080 & cs0214-2.cs
14634         * expression.cs (Cast.DoResolve): Check unsafe context here.
14635         
14636         * statement.cs (Resolve.DoResolve): Likewise.
14637
14638 2004-05-26  Martin Baulig  <martin@ximian.com>
14639
14640         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14641
14642         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14643         (RootContext.LookupType): Pass down the `silent' flag.
14644
14645 2004-05-25  Martin Baulig  <martin@ximian.com>
14646
14647         * expression.cs
14648         (MethodGroupExpr.IdenticalTypeName): New public property.
14649         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14650         expression actually refers to a type.
14651
14652 2004-05-25  Martin Baulig  <martin@ximian.com>
14653
14654         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14655         for #56176 and made it actually work.
14656
14657 2004-05-25  Martin Baulig  <martin@ximian.com>
14658
14659         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14660         (FieldExpr, PropertyExpr): Override and implement
14661         CacheTemporaries.  Fixes #52279.
14662
14663 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
14664
14665         * location.cs: In the new compiler listing a file twice is a
14666         warning, not an error.
14667
14668 2004-05-24  Martin Baulig  <martin@ximian.com>
14669
14670         * enum.cs (Enum.DefineType): For the `BaseType' to be a
14671         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
14672
14673 2004-05-24  Martin Baulig  <martin@ximian.com>
14674
14675         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14676         walking the `using' list.  Fixes #53921.
14677
14678 2004-05-24  Martin Baulig  <martin@ximian.com>
14679
14680         * const.cs (Const.LookupConstantValue): Added support for
14681         EmptyCast's; fixes #55251.
14682
14683 2004-05-24  Martin Baulig  <martin@ximian.com>
14684
14685         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14686         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14687         which does the CS0135 check.  The reason is that we first need to
14688         check whether the variable actually exists.
14689
14690 2004-05-24  Martin Baulig  <martin@ximian.com>
14691
14692         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14693         than RootContext.LookupType() to find the explicit interface
14694         type.  Fixes #58584.
14695
14696 2004-05-24  Raja R Harinath  <rharinath@novell.com>
14697
14698         * Makefile: Simplify.  Use executable.make.
14699         * mcs.exe.sources: New file.  List of sources of mcs.exe.
14700
14701 2004-05-24  Anders Carlsson  <andersca@gnome.org>
14702
14703         * decl.cs:
14704         * enum.cs:
14705         Use the invariant culture when doing String.Compare for CLS case
14706         sensitivity.
14707         
14708 2004-05-23  Martin Baulig  <martin@ximian.com>
14709
14710         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14711         don't have any dots.  Fixes #52622, added cs0246-8.cs.
14712
14713         * namespace.cs (NamespaceEntry.Lookup): Likewise.
14714         
14715 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14716
14717         * class.cs (MemberBase.Define): Reuse MemberType member for 
14718         resolved type. Other methods can use it too.
14719
14720 2004-05-23  Martin Baulig  <martin@ximian.com>
14721
14722         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14723         the variable also exists in the current block (otherwise, we need
14724         to report a CS0103).  Fixes #58670.
14725
14726 2004-05-23  Martin Baulig  <martin@ximian.com>
14727
14728         * flowanalysis.cs (Reachability.Reachable): Compute this
14729         on-the-fly rather than storing it as a field.
14730
14731 2004-05-23  Martin Baulig  <martin@ximian.com>
14732
14733         * flowanalysis.cs (Reachability.And): Manually compute the
14734         resulting `barrier' from the reachability.      
14735        
14736 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14737
14738         Fix bug #57835
14739         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14740         instance of ObsoleteAttribute when symbol is obsolete.
14741
14742         * class.cs
14743         (IMethodData): Extended interface for ObsoleteAttribute support.
14744
14745 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14746
14747         * attribute.cs: Fix bug #55970
14748
14749 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14750
14751         Fix bug #52705
14752         * attribute.cs
14753         (GetObsoleteAttribute): New method. Creates the instance of
14754         ObsoleteAttribute.
14755         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14756         ObsoleteAttribute when member is obsolete.
14757         (AttributeTester.Report_ObsoleteMessage): Common method for
14758         Obsolete error/warning reporting.
14759
14760         * class.cs
14761         (TypeContainer.base_classs_type): New member for storing parent type.
14762
14763         * decl.cs
14764         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14765         for this MemberCore.
14766
14767 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14768
14769         * attribute.cs, const.cs: Fix bug #58590
14770
14771 2004-05-21  Martin Baulig  <martin@ximian.com>
14772
14773         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14774         out parameters if the end of the method is unreachable.  Fixes
14775         #58098. 
14776
14777 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14778
14779         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14780         Hari was right, why extra method.
14781
14782 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14783
14784         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14785
14786 2004-05-20  Martin Baulig  <martin@ximian.com>
14787
14788         Merged this back from gmcs to keep the differences to a minumum.
14789
14790         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14791         instead of a Declspace.
14792         (Attribute.ResolveType): Likewise.
14793         (Attributes.Search): Likewise.
14794         (Attributes.Contains): Likewise.
14795         (Attributes.GetClsCompliantAttribute): Likewise.
14796
14797         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14798         argument.
14799         (MethodData.ApplyAttributes): Take an EmitContext instead of a
14800         DeclSpace.
14801
14802 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
14803
14804         Fix bug #58688 (MCS does not report error when the same attribute
14805         is assigned twice)
14806
14807         * attribute.cs (Attribute.Emit): Distinction between null and default.
14808
14809 2004-05-19  Raja R Harinath  <rharinath@novell.com>
14810
14811         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14812         of a top-level attribute without an attribute target.
14813         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
14814         Make non-static.
14815         (Attribute.Conditional_GetConditionName), 
14816         (Attribute.Obsolete_GetObsoleteMessage): Update.
14817         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
14818         part of ScanForIndexerName.
14819         (Attribute.CanIgnoreInvalidAttribute): New function.
14820         (Attribute.ScanForIndexerName): Move to ...
14821         (Attributes.ScanForIndexerName): ... here.
14822         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14823         (Attributes.Search): New internal variant that can choose not to
14824         complain if types aren't resolved.  The original signature now
14825         complains.
14826         (Attributes.GetClsCompliantAttribute): Use internal variant, with
14827         complaints suppressed.
14828         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14829         only if it not useful.
14830         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14831         top-level for attributes that are shared between the assembly
14832         and a top-level class.
14833         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14834         * class.cs: Update to reflect changes.
14835         (DefineIndexers): Fuse loops.
14836         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
14837         a couple more variants of attribute names.
14838
14839 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
14840
14841         Fix bug #52585 (Implemented explicit attribute declaration)
14842
14843         * attribute.cs:
14844         (Attributable.ValidAttributeTargets): New abstract method. It gets
14845         list of valid attribute targets for explicit target declaration.
14846         (Attribute.Target): It holds target itself.
14847         (AttributeSection): Removed.
14848         (Attribute.CheckTargets): New method. It checks whether attribute
14849         target is valid for the current element.
14850
14851         * class.cs:
14852         (EventProperty): New class. For events that are declared like
14853         property (with add and remove accessors).
14854         (EventField): New class. For events that are declared like field.
14855         class.cs
14856
14857         * cs-parser.jay: Implemented explicit attribute target declaration.
14858
14859         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
14860         Override ValidAttributeTargets.
14861
14862         * parameter.cs:
14863         (ReturnParameter): Class for applying custom attributes on 
14864         the return type.
14865         (ParameterAtribute): New class. Class for applying custom
14866         attributes on the parameter type.
14867
14868 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
14869
14870         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14871         definitions. 
14872
14873         (Method): Allow UNSAFE here.
14874
14875         * modifiers.cs: Support unsafe reporting.
14876
14877 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
14878
14879         * decl.cs: Fix bug #58478.
14880
14881 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14882
14883         * statement.cs: When checking for unreachable code on an EmptyStatement,
14884         set the location. Fixes bug #58488.
14885
14886 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
14887
14888         * driver.cs: Add -pkg handling.
14889
14890         From Gonzalo: UseShelLExecute=false
14891
14892 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
14893
14894         * attribute.cs:
14895         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14896         for attribute.
14897         (Attribute.IsClsCompliaceRequired): Moved to base for better
14898         accesibility.
14899         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14900         when attribute is AttributeUsageAttribute.
14901         (Attribute.GetValidTargets): Simplified.
14902         (Attribute.GetAttributeUsage): New method returns AttributeUsage
14903         attribute for this type.
14904         (Attribute.ApplyAttributes): Method renamed to Emit and make
14905         non-static.
14906         (GlobalAttributeSection): New class for special handling of global
14907         attributes (assembly, module).
14908         (AttributeSection.Emit): New method.
14909
14910         * class.cs: Implemented Attributable abstract methods.
14911         (MethodCore.LabelParameters): Moved to Parameter class.
14912         (Accessor): Is back simple class.
14913         (PropertyMethod): Implemented Attributable abstract class.
14914         (DelegateMethod): Implemented Attributable abstract class.
14915         (Event): New constructor for disctintion between normal Event
14916         and Event with accessors.
14917
14918         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14919
14920         * codegen.cs, const.cs, decl.cs, delegate.cs:
14921         (CommonAssemblyModulClass): Implemented Attributable abstract class
14922         and simplified.
14923
14924         * enum.cs: Implement IAttributeSupport interface.
14925         (EnumMember): New class for emum members. Implemented Attributable
14926         abstract class
14927
14928         * parameter.cs:
14929         (ParameterBase): Is abstract.
14930         (ReturnParameter): New class for easier [return:] attribute handling.
14931
14932         * typemanager.cs: Removed builder_to_attr.
14933
14934 2004-05-11  Raja R Harinath  <rharinath@novell.com>
14935
14936         Fix bug #57151.
14937         * attribute.cs (Attribute.GetPositionalValue): New function.
14938         * class.cs (TypeContainer.VerifyMembers): New function.
14939         (TypeContainer.Emit): Use it.
14940         (ClassOrStruct): New base class for Class and Struct.
14941         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
14942         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14943         class.
14944         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14945         then each non-static field should have a FieldOffset attribute.
14946         Otherwise, none of the fields should have a FieldOffset attribute.
14947         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
14948         and FieldOffset attributes.
14949         * typemanager.cs (TypeManager.struct_layout_attribute_type)
14950         (TypeManager.field_offset_attribute_type): New core types.
14951         (TypeManager.InitCoreTypes): Initialize them.
14952
14953 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
14954
14955         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14956         Return correct type.
14957         From bug #58270.
14958
14959 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
14960
14961         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14962         be implicitly converted to ulong.
14963         
14964         * expression.cs: The logic for allowing operator &, | and ^ worked
14965         was wrong, it worked before because we did not report an error in
14966         an else branch.  Fixes 57895.
14967
14968         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14969         allow volatile fields to be reference types.
14970
14971 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
14972
14973         * driver.cs: Add support for /debug-
14974
14975 2004-05-07  Raja R Harinath  <rharinath@novell.com>
14976
14977         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
14978         Add a 'complain' parameter to silence errors.
14979         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
14980         silently overlooked type-resolutions.
14981         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14982         to reflect changes.
14983         (Attributes.Search): New function.
14984         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14985         (Attributes.GetAttributeFullName): Remove hack.
14986         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
14987         Update to reflect changes.
14988         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14989         Use Attributes.Search instead of nested loops.
14990
14991 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
14992
14993         * decl.cs:
14994         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14995         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14996         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14997
14998         * report.cs: (Report.Warning): Renamed to Warning_T because of
14999         parameter collision.
15000
15001 2004-05-05  Raja R Harinath  <rharinath@novell.com>
15002
15003         * expression.cs (MemberAccess.ResolveMemberAccess):
15004         Exit with non-zero status after Report.Error.
15005         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
15006         Likewise.
15007         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
15008
15009 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
15010
15011         * support.cs: Don't hang when the file is empty.
15012
15013 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
15014
15015         * support.cs: In SeekableStreamReader, compute the preamble size of the
15016           underlying stream. Position changes should take into account that initial
15017           count of bytes.
15018
15019 2004-05-03  Todd Berman  <tberman@sevenl.net>
15020
15021         * driver.cs: remove unused GetSysVersion function.
15022
15023 2004-05-03  Todd Berman  <tberman@sevenl.net>
15024
15025         * driver.cs: Remove the hack from saturday, as well as the hack
15026         from jackson (LoadAssemblyFromGac), also adds the CWD to the
15027         link_paths to get that bit proper.
15028
15029 2004-05-01  Todd Berman  <tberman@sevenl.net>
15030
15031         * driver.cs: Try a LoadFrom before a Load, this checks the current
15032         path. This is currently a bug in mono that is be fixed, however, this
15033         provides a workaround for now. This will be removed when the bug
15034         is fixed.
15035
15036 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
15037
15038         * CryptoConvert.cs: Updated to latest version. Fix issue with 
15039         incomplete key pairs (#57941).
15040
15041 2004-05-01  Todd Berman  <tberman@sevenl.net>
15042
15043         * driver.cs: Remove '.' from path_chars, now System.* loads properly
15044         from the GAC
15045
15046 2004-04-30  Jackson Harper  <jackson@ximian.com>
15047
15048         * codegen.cs: Open keys readonly.
15049         
15050 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15051
15052         * typemanager.cs: don't report cyclic struct layout when a struct
15053         contains 2 or more fields of the same type. Failed for Pango.AttrShape
15054         which has 2 Pango.Rectangle fields.
15055
15056 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15057
15058         * expression.cs: Handle IntPtr comparisons with IL code
15059         rather than a method call.
15060
15061 2004-04-29  Martin Baulig  <martin@ximian.com>
15062
15063         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
15064         the list of PropertyInfo's in class hierarchy and find the
15065         accessor.  Fixes #56013.
15066
15067 2004-04-29  Martin Baulig  <martin@ximian.com>
15068
15069         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
15070
15071 2004-04-29  Martin Baulig  <martin@ximian.com>
15072
15073         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15074
15075         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
15076
15077 2004-04-29  Martin Baulig  <martin@ximian.com>
15078
15079         * class.cs (ConstructorInitializer.Resolve): Check whether the
15080         parent .ctor is accessible.  Fixes #52146.
15081
15082 2004-04-29  Martin Baulig  <martin@ximian.com>
15083
15084         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15085
15086         * statement.cs (Using.EmitLocalVariableDecls): Use
15087         TypeManager.idisposable_type, not typeof (IDisposable).
15088         (Foreach.EmitCollectionForeach): Added support for valuetypes.
15089
15090 2004-04-29  Martin Baulig  <martin@ximian.com>
15091
15092         * class.cs (Event.Define): Don't emit the field and don't set
15093         RTSpecialName and SpecialName for events on interfaces.  Fixes
15094         #57703. 
15095
15096 2004-04-29  Raja R Harinath  <rharinath@novell.com>
15097
15098         Refactor Attribute.ApplyAttributes.
15099         * attribute.cs (Attributable): New base class for objects that can
15100         have Attributes applied on them.
15101         (Attribute): Make AttributeUsage fields public.
15102         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
15103         (Attribute.IsInternalCall): New property.
15104         (Attribute.UsageAttr): Convert to a public read-only property.
15105         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
15106         (Attribute.ResolveType, Attribute.Resolve)
15107         (Attribute.ScanForIndexerName): Update to reflect changes.
15108         (Attribute.CheckAttributeTarget): Re-format.
15109         (Attribute.ApplyAttributes): Refactor, to various
15110         Attributable.ApplyAttributeBuilder methods.
15111         * decl.cs (MemberCore): Make Attributable.
15112         * class.cs (Accessor): Make Attributable.
15113         (MethodData.ApplyAttributes): Use proper attribute types, not
15114         attribute names.
15115         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
15116         (TypeContainer.ApplyAttributeBuilder)
15117         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
15118         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
15119         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
15120         (Operator.ApplyAttributeBuilder): New factored-out methods.
15121         * const.cs (Const.ApplyAttributeBuilder): Likewise.
15122         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
15123         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
15124         * parameter.cs (ParameterBase): New Attributable base class
15125         that can also represent Return types.
15126         (Parameter): Update to the changes.
15127
15128 2004-04-29  Jackson Harper  <jackson@ximian.com>
15129
15130         * driver.cs: Prefer the corlib system version when looking for
15131         assemblies in the GAC. This is still a hack, but its a better hack
15132         now.
15133         
15134 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
15135
15136         * decl.cs, enum.cs: Improved error 3005 reporting.
15137   
15138         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
15139         (related_symbols): New private member for list of symbols
15140         related to reported error/warning.
15141         
15142         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
15143
15144 2004-04-29  Martin Baulig  <martin@ximian.com>
15145
15146         * ecore.cs (Expression.Constantify): If we're an enum and
15147         TypeManager.TypeToCoreType() doesn't give us another type, use
15148         t.UnderlyingSystemType.  Fixes #56178.  
15149
15150 2004-04-29  Martin Baulig  <martin@ximian.com>
15151
15152         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
15153         interfaces and for each interface, only add members directly
15154         declared in that interface.  Fixes #53255.
15155
15156 2004-04-28  Martin Baulig  <martin@ximian.com>
15157
15158         * expression.cs (ConditionalLogicalOperator): Use a temporary
15159         variable for `left' to avoid that we evaluate it more than once;
15160         bug #52588.
15161
15162 2004-04-28  Martin Baulig  <martin@ximian.com>
15163
15164         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
15165         `void[]' (CS1547).
15166
15167 2004-04-28  Martin Baulig  <martin@ximian.com>
15168
15169         * statement.cs (LocalInfo.Resolve): Check whether the type is not
15170         void (CS1547).
15171
15172         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
15173         whether the type is not void (CS1547).
15174
15175 2004-04-28  Martin Baulig  <martin@ximian.com>
15176
15177         * expression.cs (Unary.DoResolveLValue): Override this and report
15178         CS0131 for anything but Operator.Indirection.
15179
15180 2004-04-28  Martin Baulig  <martin@ximian.com>
15181
15182         Committing a patch from Ben Maurer; see bug #50820.
15183
15184         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15185         check for classes.
15186
15187         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15188         classes.        
15189
15190 2004-04-28  Martin Baulig  <martin@ximian.com>
15191
15192         Committing a patch from Ben Maurer; see bug #50820.
15193
15194         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15195         check for classes.
15196
15197         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15198         classes.        
15199
15200 2004-04-28  Martin Baulig  <martin@ximian.com>
15201
15202         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
15203         (Block.AddLabel): Call DoLookupLabel() to only search in the
15204         current block.
15205
15206 2004-04-28  Martin Baulig  <martin@ximian.com>
15207
15208         * cfold.cs (ConstantFold.BinaryFold): Added special support for
15209         comparing StringConstants and NullLiterals in Equality and Inequality.
15210
15211 2004-04-28  Jackson Harper  <jackson@ximian.com>
15212
15213         * driver.cs: Attempt to load referenced assemblies from the
15214         GAC. This is the quick and dirty version of this method that
15215         doesnt take into account versions and just takes the first
15216         canidate found. Will be good enough for now as we will not have more
15217         then one version installed into the GAC until I update this method.
15218
15219 2004-04-28  Martin Baulig  <martin@ximian.com>
15220
15221         * typemanager.cs (TypeManager.CheckStructCycles): New public
15222         static method to check for cycles in the struct layout.
15223
15224         * rootcontext.cs (RootContext.PopulateTypes): Call
15225         TypeManager.CheckStructCycles() for each TypeContainer.
15226         [Note: We only need to visit each type once.]
15227
15228 2004-04-28  Martin Baulig  <martin@ximian.com>
15229
15230         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
15231
15232         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
15233         success and added `out object value'.  Use a `bool resolved' field
15234         to check whether we've already been called rather than
15235         `ConstantValue != null' since this breaks for NullLiterals.
15236
15237 2004-04-28  Raja R Harinath  <rharinath@novell.com>
15238
15239         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
15240         setting of this flag, since the 'set' method may be non-public.
15241
15242 2004-04-28  Raja R Harinath  <rharinath@novell.com>
15243
15244         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
15245         check on current_vector.Block.
15246
15247 2004-04-27  Martin Baulig  <martin@ximian.com>
15248
15249         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
15250         a field initializer.  Fixes #56459.
15251
15252 2004-04-27  Martin Baulig  <martin@ximian.com>
15253
15254         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
15255         we're not attempting to use an indexer.  Fixes #52154.
15256
15257 2004-04-27  Martin Baulig  <martin@ximian.com>
15258
15259         * statement.cs (Return): Don't create a return label if we don't
15260         need it; reverts my change from January 20th.  Thanks to Ben
15261         Maurer for this.
15262
15263 2004-04-27  Martin Baulig  <martin@ximian.com>
15264
15265         According to the spec, `goto' can only leave a nested scope, but
15266         never enter it.
15267
15268         * statement.cs (Block.LookupLabel): Only lookup in the current
15269         block, don't recurse into parent or child blocks.
15270         (Block.AddLabel): Check in parent and child blocks, report
15271         CS0140/CS0158 if we find a duplicate.
15272         (Block): Removed this indexer for label lookups.
15273         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
15274         this already does the error reporting for us.
15275
15276         * flowanalysis.cs
15277         (FlowBranching.UsageVector.Block): New public variable; may be null.
15278         (FlowBranching.CreateSibling): Added `Block' argument.
15279         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
15280         label for the target of a `goto' and check whether we're not
15281         leaving a `finally'.
15282
15283 2004-04-27  Martin Baulig  <martin@ximian.com>
15284
15285         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15286         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
15287         just for returns).
15288
15289 2004-04-27  Martin Baulig  <martin@ximian.com>
15290
15291         * statement.cs (Block.AddLabel): Also check for implicit blocks
15292         and added a CS0158 check.
15293
15294 2004-04-27  Martin Baulig  <martin@ximian.com>
15295
15296         * flowanalysis.cs (FlowBranchingLoop): New class.
15297         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
15298         UsageVector's instead of an ArrayList.
15299         (FlowBranching.Label): Likewise.
15300         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
15301         (FlowBranching.AddBreakVector): New method.
15302
15303 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
15304
15305         * attribute.cs: Small regression fix: only convert the type if we
15306         the type is different, fixes System.Drawing build.
15307
15308 2004-04-27  Martin Baulig  <martin@ximian.com>
15309
15310         * attribute.cs (Attribute.Resolve): If we have a constant value
15311         for a named field or property, implicity convert it to the correct
15312         type.
15313
15314 2004-04-27  Raja R Harinath  <rharinath@novell.com>
15315
15316         * statement.cs (Block.Block): Implicit blocks share
15317         'child_variable_names' fields with parent blocks.
15318         (Block.AddChildVariableNames): Remove.
15319         (Block.AddVariable): Mark variable as "used by a child block" in
15320         every surrounding block.
15321         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
15322         been used in a child block, complain about violation of "Invariant
15323         meaning in blocks" rule.
15324         * cs-parser.jay (declare_local_variables): Don't use
15325         AddChildVariableNames.
15326         (foreach_statement): Don't create an implicit block: 'foreach'
15327         introduces a scope.
15328
15329 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
15330
15331         * convert.cs (ImplicitNumericConversion): 0 is also positive when
15332         converting from 0L to ulong.  Fixes 57522.
15333
15334 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15335
15336         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15337         derived class hides via 'new' keyword field from base class (test-242.cs).
15338         TODO: Handle this in the more general way.
15339         
15340         * class.cs (CheckBase): Ditto.
15341
15342 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15343
15344         * decl.cs (caching_flags): New member for storing cached values
15345         as bit flags.
15346         (MemberCore.Flags): New enum where bit flags for caching_flags
15347         are defined.
15348         (MemberCore.cls_compliance): Moved to caching_flags.
15349         (DeclSpace.Created): Moved to caching_flags.
15350
15351         * class.cs: Use caching_flags instead of DeclSpace.Created
15352         
15353 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
15354
15355         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15356         if we are only a derived class, not a nested class.
15357
15358         * typemanager.cs: Same as above, but do this at the MemberLookup
15359         level (used by field and methods, properties are handled in
15360         PropertyExpr).   Allow for the qualified access if we are a nested
15361         method. 
15362
15363 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
15364
15365         * class.cs: Refactoring.
15366         (IMethodData): New inteface; Holds links to parent members
15367         to avoid member duplication (reduced memory allocation).
15368         (Method): Implemented IMethodData interface.
15369         (PropertyBase): New inner classes for get/set methods.
15370         (PropertyBase.PropertyMethod): Implemented IMethodData interface
15371         (Event): New inner classes for add/remove methods.
15372         (Event.DelegateMethod): Implemented IMethodData interface.
15373
15374         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15375         EmitContext (related to class.cs refactoring).
15376
15377 2004-04-21  Raja R Harinath  <rharinath@novell.com>
15378
15379         * delegate.cs (Delegate.VerifyApplicability): If the number of
15380         arguments are the same as the number of parameters, first try to
15381         verify applicability ignoring  any 'params' modifier on the last
15382         parameter.
15383         Fixes #56442.
15384
15385 2004-04-16  Raja R Harinath  <rharinath@novell.com>
15386
15387         * class.cs (TypeContainer.AddIndexer): Use
15388         'ExplicitInterfaceName' to determine if interface name was
15389         explicitly specified.  'InterfaceType' is not initialized at this time.
15390         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
15391         Indexers array is already in the required order.  Initialize
15392         'IndexerName' only if there are normal indexers.
15393         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15394         (TypeContainer.Emit): Emit DefaultMember attribute only if
15395         IndexerName is initialized.
15396         Fixes #56300.
15397
15398 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
15399
15400         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15401         Fixes #57007
15402
15403 2004-04-15  Raja R Harinath  <rharinath@novell.com>
15404
15405         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15406         attributes.
15407         Fix for #56456.
15408
15409         * attribute.cs (Attribute.Resolve): Check for duplicate named
15410         attributes.
15411         Fix for #56463.
15412
15413 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
15414
15415         * iterators.cs (MarkYield): track whether we are in an exception,
15416         and generate code accordingly.  Use a temporary value to store the
15417         result for our state.
15418
15419         I had ignored a bit the interaction of try/catch with iterators
15420         since their behavior was not entirely obvious, but now it is
15421         possible to verify that our behavior is the same as MS .NET 2.0
15422
15423         Fixes 54814
15424
15425 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
15426
15427         * iterators.cs: Avoid creating temporaries if there is no work to
15428         do. 
15429
15430         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15431         Enumerations, use TypeManager.EnumToUnderlying and call
15432         recursively. 
15433
15434         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15435         bug #57013
15436
15437         (This.Emit): Use EmitContext.EmitThis to emit our
15438         instance variable.
15439
15440         (This.EmitAssign): Ditto.
15441
15442         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15443         codepaths, we will move all the functionality into
15444         Mono.CSharp.This 
15445
15446         (FieldExpr.EmitAssign): Ditto.
15447
15448         This fixes several hidden bugs that I uncovered while doing a code
15449         review of this today.
15450
15451         * codegen.cs (EmitThis): reworked so the semantics are more clear
15452         and also support value types "this" instances.
15453
15454         * iterators.cs: Changed so that for iterators in value types, we
15455         do not pass the value type as a parameter.  
15456
15457         Initialization of the enumerator helpers is now done in the caller
15458         instead of passing the parameters to the constructors and having
15459         the constructor set the fields.
15460
15461         The fields have now `assembly' visibility instead of private.
15462
15463 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
15464
15465         * expression.cs (Argument.Resolve): Check if fields passed as ref
15466         or out are contained in a MarshalByRefObject.
15467
15468         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15469         another compiler type.
15470
15471 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15472
15473         * class.cs (Indexer.Define): use the new name checking method.
15474         Also, return false on an error.
15475         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15476         (is_identifier_[start/part]_character): make static.
15477
15478 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
15479
15480         * expression.cs (Binary.ResolveOperator): Do no append strings
15481         twice: since we can be invoked more than once (array evaluation)
15482         on the same concatenation, take care of this here.  Based on a fix
15483         from Ben (bug #56454)
15484
15485 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
15486
15487         * codegen.cs: Fix another case where CS1548 must be reported (when 
15488         delay-sign isn't specified and no private is available #56564). Fix
15489         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
15490         error when MCS is used on the MS runtime and we need to delay-sign 
15491         (which seems unsupported by AssemblyBuilder - see #56621).
15492
15493 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
15494
15495         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15496         (TypeManager.ComputeNamespaces): Faster implementation for
15497         Microsoft runtime.
15498
15499         * compiler.csproj: Updated AssemblyName to mcs.
15500
15501 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
15502
15503         * rootcontext.cs: Add new types to the boot resolution.
15504
15505         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15506         MulticastDelegate is not allowed.
15507
15508         * typemanager.cs: Add new types to lookup: System.TypedReference
15509         and ArgIterator.
15510
15511         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15512         check for TypedReference or ArgIterator, they are not allowed. 
15513
15514         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15515         makes us properly catch 1510 in some conditions (see bug 56016 for
15516         details). 
15517
15518 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
15519
15520         * CryptoConvert.cs: update from corlib version
15521         with endian fixes.
15522
15523 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
15524
15525         * class.cs (Indexer.Define): Check indexername declaration
15526
15527 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
15528
15529         * attribute.cs (IsClsCompliant): Fixed problem with handling
15530         all three states (compliant, not-compliant, undetected).
15531
15532 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
15533
15534         * attribute.cs (Attribute): Location is now public.
15535         (Resolve): Store resolved arguments (pos_values) in attribute class.
15536         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15537         (GetClsCompliantAttributeValue): New method that gets
15538         CLSCompliantAttribute value.
15539         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15540         if exists else null.
15541         (AttributeTester): New class for CLS-Compliant verification routines.
15542
15543         * class.cs (Emit): Add CLS-Compliant verification.
15544         (Method.GetSignatureForError): Implemented.
15545         (Constructor.GetSignatureForError): Implemented
15546         (Constructor.HasCompliantArgs): Returns if constructor has
15547         CLS-Compliant arguments.
15548         (Constructor.Emit): Override.
15549         (Construcor.IsIdentifierClsCompliant): New method; For constructors
15550         is needed to test only parameters.
15551         (FieldBase.GetSignatureForError): Implemented.
15552         (TypeContainer): New member for storing base interfaces.
15553         (TypeContainer.FindMembers): Search in base interfaces too.
15554
15555         * codegen.cs (GetClsComplianceAttribute): New method that gets
15556         assembly or module CLSCompliantAttribute value.
15557         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15558         for assembly.
15559         (ModuleClass.Emit): Add error 3012 test.
15560
15561         * const.cs (Emit): Override and call base for CLS-Compliant tests.
15562
15563         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15564         state for all decl types.
15565         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15566         if CLS-Compliant tests are required.
15567         (IsClsCompliaceRequired): New method. Analyze whether code
15568         must be CLS-Compliant.
15569         (IsExposedFromAssembly): New method. Returns true when MemberCore
15570         is exposed from assembly.
15571         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15572         value or gets cached value.
15573         (HasClsCompliantAttribute): New method. Returns true if MemberCore
15574         is explicitly marked with CLSCompliantAttribute.
15575         (IsIdentifierClsCompliant): New abstract method. This method is
15576         used to testing error 3005.
15577         (IsIdentifierAndParamClsCompliant): New method. Common helper method
15578         for identifier and parameters CLS-Compliant testing.
15579         (VerifyClsCompliance): New method. The main virtual method for
15580         CLS-Compliant verifications.
15581         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15582         null. I don't know why is null (too many public members !).
15583         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15584         and get value of first CLSCompliantAttribute that found.
15585
15586         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15587         (VerifyClsCompliance): Override and add extra tests.
15588
15589         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15590         clscheck- disable CLS-Compliant verification event if assembly is has
15591         CLSCompliantAttribute(true).
15592
15593         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15594         ApllyAttribute is now called in emit section as in the other cases.
15595         Possible future Emit integration.
15596         (IsIdentifierClsCompliant): New override.
15597         (VerifyClsCompliance): New override.
15598         (GetEnumeratorName): Returns full enum name.
15599
15600         * parameter.cs (GetSignatureForError): Implemented.
15601
15602         * report.cs (WarningData): New struct for Warning message information.
15603         (LocationOfPreviousError): New method.
15604         (Warning): New method. Reports warning based on the warning table.
15605         (Error_T): New method. Reports error based on the error table.
15606
15607         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15608         verifications are done here.
15609
15610         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15611
15612         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15613         CLSCompliantAttribute.
15614         (all_imported_types): New member holds all imported types from other
15615         assemblies.
15616         (LoadAllImportedTypes): New method fills static table with exported types
15617         from all referenced assemblies.
15618         (Modules): New property returns all assembly modules.
15619
15620 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
15621
15622         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15623         throwing a parser error.
15624
15625         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15626         which removes the hardcoded get_/set_ prefixes for properties, as
15627         IL allows for the properties to be named something else.  
15628
15629         Bug #56013
15630
15631         * expression.cs: Do not override operand before we know if it is
15632         non-null.  Fix 56207
15633
15634 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15635
15636         * typemanager.cs: support for pinned variables.
15637
15638 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15639
15640         * decl.cs, typemanager.cs: Avoid using an arraylist
15641         as a buffer if there is only one result set.
15642
15643 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15644
15645         * expression.cs: Make sure you cant call a static method
15646         with an instance expression, bug #56174.
15647
15648 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
15649
15650         * class.cs (IsDuplicateImplementation): Improve error reporting to
15651         flag 663 (method only differs in parameter modifier).
15652
15653         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15654         in preprocessor directives.
15655
15656         * location.cs (LookupFile): Allow for the empty path.
15657
15658         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
15659         better approach for some of that patch, but its failing with the
15660         CharSet enumeration.  For now try/catch will do.
15661
15662         * typemanager.cs: Do not crash if a struct does not have fields.
15663         Fixes 56150.
15664
15665 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15666
15667         * expression.cs: cs0213, cant fix a fixed expression.
15668         fixes 50231.
15669
15670 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15671
15672         * cs-parser.jay: detect invalid embeded statements gracefully.
15673         bug #51113.
15674
15675 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15676
15677         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15678         As a regex:
15679         s/
15680         the invocation type may not be a subclass of the tye of the item/
15681         The type of the item must be a subclass of the invocation item.
15682         /g
15683
15684         Fixes bug #50820.
15685
15686 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
15687
15688         * attribute.cs: Added methods to get a string and a bool from an
15689         attribute. Required to information from AssemblyKeyFileAttribute,
15690         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15691         * codegen.cs: Modified AssemblyName creation to include support for
15692         strongnames. Catch additional exceptions to report them as CS1548.
15693         * compiler.csproj: Updated include CryptoConvert.cs.
15694         * compiler.csproj.user: Removed file - user specific configuration.
15695         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
15696         Mono.Security assembly. The original class is maintained and tested in
15697         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15698         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15699         like CSC 8.0 (C# v2) supports.
15700         * Makefile: Added CryptoConvert.cs to mcs sources.
15701         * rootcontext.cs: Added new options for strongnames.
15702
15703 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
15704
15705         * driver.cs: For --expect-error, report error code `2'
15706         if the program compiled with no errors, error code `1' if
15707         it compiled with an error other than the one expected.
15708
15709 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
15710
15711         * compiler.csproj: Updated for Visual Studio .NET 2003.
15712         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15713         * compiler.sln: Updated for Visual Studio .NET 2003.
15714
15715 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
15716
15717         * expression.cs: Fix bug #47234. We basically need to apply the
15718         rule that we prefer the conversion of null to a reference type
15719         when faced with a conversion to 'object' (csc behaviour).
15720
15721 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15722
15723         * statement.cs: Shorter form for foreach, eliminates
15724         a local variable. r=Martin.
15725
15726 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15727
15728         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15729         checks if we can use brtrue/brfalse to test for 0.
15730         * expression.cs: use the above in the test for using brtrue/brfalse.
15731         cleanup code a bit.
15732
15733 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15734
15735         * expression.cs: Rewrite string concat stuff. Benefits:
15736
15737         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15738         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15739         rather than a concat chain.
15740
15741         * typemanager.cs: Add lookups for more concat overloads.
15742
15743 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15744
15745         * expression.cs: Emit shorter il code for array init.
15746
15747         newarr
15748         dup
15749         // set 1
15750
15751         // set 2
15752
15753         newarr
15754         stloc.x
15755
15756         ldloc.x
15757         // set 1
15758
15759         ldloc.x
15760         // set 2
15761
15762 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
15763
15764         * statement.cs: Before, two switch blocks would be merged if the
15765         total size of the blocks (end_item - begin_item + 1) was less than
15766         two times the combined sizes of the blocks.
15767
15768         Now, it will only merge if after the merge at least half of the
15769         slots are filled.
15770
15771         fixes 55885.
15772
15773 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
15774
15775         * class.cs : csc build fix for GetMethods(). See bug #52503.
15776
15777 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
15778
15779         * expression.cs: Make sure fp comparisons work with NaN.
15780         This fixes bug #54303. Mig approved this patch a long
15781         time ago, but we were not able to test b/c the runtime
15782         had a related bug.
15783
15784 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
15785
15786         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
15787
15788 2004-03-19  Martin Baulig  <martin@ximian.com>
15789
15790         * class.cs (MemberCore.IsDuplicateImplementation): Report the
15791         error here and not in our caller.
15792
15793 2004-03-19  Martin Baulig  <martin@ximian.com>
15794
15795         * interface.cs: Completely killed this file.
15796         (Interface): We're now a TypeContainer and live in class.cs.
15797
15798         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15799         argument; we're now also called for interfaces.
15800         (TypeContainer.DefineMembers): Allow this method being called
15801         multiple times.
15802         (TypeContainer.GetMethods): New public method; formerly known as
15803         Interface.GetMethod().  This is used by PendingImplementation.
15804         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15805         it's now private and non-static.
15806         (Interface): Moved this here; it's now implemented similar to
15807         Class and Struct.
15808         (Method, Property, Event, Indexer): Added `bool is_interface'
15809         argument to their .ctor's.
15810         (MemberBase.IsInterface): New public field.
15811
15812         * cs-parser.jay: Create normal Method, Property, Event, Indexer
15813         instances instead of InterfaceMethod, InterfaceProperty, etc.
15814         (opt_interface_base): Removed; we now use `opt_class_base' instead.
15815         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15816
15817 2004-03-19  Martin Baulig  <martin@ximian.com>
15818
15819         * class.cs (MethodCore.IsDuplicateImplementation): New private
15820         method which does the CS0111 checking.
15821         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15822         Use IsDuplicateImplementation().
15823
15824 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
15825
15826         * decl.cs (FindMemberToOverride): New method to find the correct
15827         method or property to override in the base class.
15828         * class.cs
15829             - Make Method/Property use the above method to find the
15830               version in the base class.
15831             - Remove the InheritableMemberSignatureCompare as it is now
15832               dead code.
15833
15834         This patch makes large code bases much faster to compile, as it is
15835         O(n) rather than O(n^2) to do this validation.
15836
15837         Also, it fixes bug 52458 which is that nested classes are not
15838         taken into account when finding the base class member.
15839
15840         Reviewed/Approved by Martin.
15841
15842 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
15843
15844         * interface.cs: In all interface classes removed redundant
15845         member initialization.
15846
15847 2004-03-16  Martin Baulig  <martin@ximian.com>
15848
15849         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15850
15851 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
15852
15853         * decl.cs (DefineTypeAndParents): New helper method to define a
15854         type's containers before the type itself is defined;  This is a
15855         bug exposed by the recent changes to Windows.Forms when an
15856         implemented interface was defined inside a class that had not been
15857         built yet.   
15858
15859         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15860
15861         (Check): Loop correctly to report errors modifiers
15862         (UNSAFE was not in the loop, since it was the same as TOP).
15863
15864         * interface.cs: Every interface member now takes a ModFlags,
15865         instead of a "is_new" bool, which we set on the base MemberCore. 
15866
15867         Every place where we called "UnsafeOk" in the interface, now we
15868         call the proper member (InterfaceMethod.UnsafeOK) instead to get
15869         the unsafe settings from the member declaration instead of the
15870         container interface. 
15871
15872         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
15873
15874         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15875         `set_indexer_name' to the pending bits (one per type).
15876
15877         We fixed a bug today that was picking the wrong method to
15878         override, since for properties the existing InterfaceMethod code
15879         basically ignored the method name.  Now we make sure that the
15880         method name is one of the valid indexer names.
15881
15882 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
15883  
15884         * support.cs (SeekableStreamReader): Keep track of stream byte
15885         positions and don't mix them with character offsets to the buffer.
15886
15887         Patch from Gustavo Giráldez
15888
15889 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
15890
15891         * interface.cs (InterfaceSetGetBase): Removed double member
15892         initialization, base class does it as well.
15893
15894 2004-03-13  Martin Baulig  <martin@ximian.com>
15895
15896         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15897         when compiling corlib.
15898
15899 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
15900
15901         * convert.cs (ExplicitConversion): We were reporting an error on
15902         certain conversions (object_type source to a value type, when the
15903         expression was `null') before we had a chance to pass it through
15904         the user defined conversions.
15905
15906         * driver.cs: Replace / and \ in resource specifications to dots.
15907         Fixes 50752
15908
15909         * class.cs: Add check for duplicate operators.  Fixes 52477
15910
15911 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
15912
15913         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15914         that are in the middle of the statements, not only at the end.
15915         Fixes #54987
15916
15917         * class.cs (TypeContainer.AddField): No longer set the
15918         `HaveStaticConstructor' flag, now we call it
15919         `UserDefineStaticConstructor' to diferentiate the slightly
15920         semantic difference.
15921
15922         The situation is that we were not adding BeforeFieldInit (from
15923         Modifiers.TypeAttr) to classes that could have it.
15924         BeforeFieldInit should be set to classes that have no static
15925         constructor. 
15926
15927         See:
15928
15929         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15930
15931         And most importantly Zoltan's comment:
15932
15933         http://bugzilla.ximian.com/show_bug.cgi?id=44229
15934
15935         "I think beforefieldinit means 'it's ok to initialize the type sometime 
15936          before its static fields are used', i.e. initialization does not need
15937          to be triggered by the first access to the type. Setting this flag
15938          helps the JIT to compile better code, since it can run the static
15939          constructor at JIT time, and does not need to generate code to call it
15940          (possibly lots of times) at runtime. Unfortunately, mcs does not set
15941          this flag for lots of classes like String. 
15942          
15943          csc sets this flag if the type does not have an explicit static 
15944          constructor. The reasoning seems to be that if there are only static
15945          initalizers for a type, and no static constructor, then the programmer
15946          does not care when this initialization happens, so beforefieldinit
15947          can be used.
15948          
15949          This bug prevents the AOT compiler from being usable, since it 
15950          generates so many calls to mono_runtime_class_init that the AOT code
15951          is much slower than the JITted code. The JITted code is faster, 
15952          because it does not generate these calls if the vtable is type is
15953          already initialized, which is true in the majority of cases. But the
15954          AOT compiler can't do this."
15955
15956 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
15957
15958         * class.cs (MethodData.Emit): Refactor the code so symbolic
15959         information is generated for destructors;  For some reasons we
15960         were taking a code path that did not generate symbolic information
15961         before. 
15962
15963 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15964
15965         * class.cs: Create a Constructor.CheckBase method that
15966         takes care of all validation type code. The method
15967         contains some code that was moved from Define.
15968
15969         It also includes new code that checks for duplicate ctors.
15970         This fixes bug #55148.
15971
15972 2004-03-09  Joshua Tauberer <tauberer@for.net>
15973
15974         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15975         a { ... }-style array creation invokes EmitStaticInitializers
15976         which is not good for reference-type arrays.  String, decimal
15977         and now null constants (NullCast) are not counted toward
15978         static initializers.
15979
15980 2004-03-05  Martin Baulig  <martin@ximian.com>
15981
15982         * location.cs (SourceFile.HasLineDirective): New public field;
15983         specifies whether the file contains or is referenced by a "#line"
15984         directive.
15985         (Location.DefineSymbolDocuments): Ignore source files which
15986         either contain or are referenced by a "#line" directive.        
15987
15988 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
15989
15990         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15991         direct access to our parent, so check the method inline there.
15992
15993 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15994
15995         * expression.cs (Invocation.EmitCall): Miguel's last commit
15996         caused a regression. If you had:
15997
15998             T t = null;
15999             t.Foo ();
16000
16001         In Foo the implict this would be null.
16002
16003 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
16004
16005         * expression.cs (Invocation.EmitCall): If the method is not
16006         virtual, do not emit a CallVirt to it, use Call.
16007
16008         * typemanager.cs (GetFullNameSignature): Improve the method to
16009         cope with ".ctor" and replace it with the type name.
16010
16011         * class.cs (ConstructorInitializer.Resolve): Now the method takes
16012         as an argument the ConstructorBuilder where it is being defined,
16013         to catch the recursive constructor invocations.
16014
16015 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
16016
16017         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
16018         routines to check if a type is an enumerable/enumerator allow
16019         classes that implement the IEnumerable or IEnumerator interfaces.
16020
16021         * class.cs (Property, Operator): Implement IIteratorContainer, and
16022         implement SetYields.
16023
16024         (Property.Define): Do the block swapping for get_methods in the
16025         context of iterators.   We need to check if Properties also
16026         include indexers or not.
16027
16028         (Operator): Assign the Block before invoking the
16029         OperatorMethod.Define, so we can trigger the Iterator code
16030         replacement. 
16031
16032         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
16033         Property and Operator classes are not created when we parse the
16034         declarator but until we have the block completed, so we use a
16035         singleton SimpleIteratorContainer.Simple to flag whether the
16036         SetYields has been invoked.
16037
16038         We propagate this setting then to the Property or the Operator to
16039         allow the `yield' to function.
16040
16041 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
16042
16043         * codegen.cs: Implemented attribute support for modules.
16044         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
16045         Assembly/Module functionality.
16046
16047         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
16048         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
16049         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
16050
16051 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
16052
16053         * interface.cs (FindMembers): The operation is performed on all base
16054         interfaces and not only on the first. It is required for future CLS Compliance patch.
16055
16056 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
16057
16058         * statement.cs, codegen.cs:
16059         This patch deals with patterns such as:
16060
16061         public class List : IEnumerable {
16062
16063                 public MyEnumerator GetEnumerator () {
16064                         return new MyEnumerator(this);
16065                 }
16066
16067                 IEnumerator IEnumerable.GetEnumerator () {
16068                         ...
16069                 }
16070                 
16071                 public struct MyEnumerator : IEnumerator {
16072                         ...
16073                 }
16074         }
16075
16076         Before, there were a few things we did wrong:
16077         1) we would emit callvirt on a struct, which is illegal
16078         2) we emited ldarg when we needed to emit ldarga
16079         3) we would mistakenly call the interface methods on an enumerator
16080         type that derived from IEnumerator and was in another assembly. For example:
16081
16082         public class MyEnumerator : IEnumerator
16083
16084         Would have the interface methods called, even if there were public impls of the
16085         method. In a struct, this lead to invalid IL code.
16086
16087 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
16088
16089         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
16090           renamed to Emit.
16091
16092         * delegate.cs (Define): Fixed crash when delegate type is undefined.
16093
16094 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
16095
16096         * cs-parser.jay: Fix small regression: we were not testing V2
16097         compiler features correctly.
16098
16099         * interface.cs: If the emit context is null, then create one
16100
16101 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
16102
16103         * decl.cs (GetSignatureForError): New virtual method to get full name
16104           for error messages.
16105
16106         * attribute.cs (IAttributeSupport): New interface for attribute setting.
16107           Now it is possible to rewrite ApplyAttributes method to be less if/else.
16108
16109         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
16110           Duplicated members and code in these classes has been removed.
16111           Better encapsulation in these classes.
16112
16113 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
16114
16115         * assign.cs (Assign.DoResolve): When dealing with compound
16116         assignments, there is a new rule in ECMA C# 2.4 (might have been
16117         there before, but it is documented here) that states that in:
16118
16119         a op= b;
16120
16121         If b is of type int, and the `op' is a shift-operator, then the
16122         above is evaluated as:
16123
16124         a = (int) a op b 
16125
16126         * expression.cs (Binary.ResolveOperator): Instead of testing for
16127         int/uint/long/ulong, try to implicitly convert to any of those
16128         types and use that in pointer arithmetic.
16129
16130         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
16131         method to print information for from the type, not from the
16132         null-method we were given.
16133
16134 2004-02-01  Duncan Mak  <duncan@ximian.com>
16135
16136         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
16137         parsing for cmd, fixes bug #53694.
16138
16139 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
16140
16141         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
16142         in the member name duplication tests. Property and operator name duplication
16143         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
16144
16145 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
16146
16147         * interface.cs (PopulateMethod): Fixed crash when interface method
16148         returns not existing type (error test cs0246-3.cs).
16149
16150 2004-02-02  Ravi Pratap M <ravi@ximian.com>
16151
16152         * cs-parser.jay (interface_accessors): Re-write actions to also
16153         store attributes attached to get and set methods. Fix spelling
16154         while at it.
16155
16156         (inteface_property_declaration): Modify accordingly.
16157
16158         (InterfaceAccessorInfo): New helper class to store information to pass
16159         around between rules that use interface_accessors.
16160
16161         * interface.cs (Emit): Apply attributes on the get and set
16162         accessors of properties and indexers too.
16163
16164         * attribute.cs (ApplyAttributes): Modify accordingly to use the
16165         right MethodBuilder when applying attributes to the get and set accessors.
16166
16167 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
16168
16169         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
16170
16171 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
16172
16173         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
16174
16175 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
16176
16177         * cs-parser.jay: Remove YIELD token, instead use the new grammar
16178         changes that treat `yield' specially when present before `break'
16179         or `return' tokens.
16180
16181         * cs-tokenizer.cs: yield is no longer a keyword.
16182
16183 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
16184
16185         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
16186         setting for default constructors.
16187         For default constructors are almost every time set wrong Modifier. The
16188         generated IL code has been alright. But inside mcs this values was
16189         wrong and this was reason why several of my CLS Compliance tests
16190         failed.
16191
16192 2004-01-22  Martin Baulig  <martin@ximian.com>
16193
16194         * cs-parser.jay (namespace_or_type_name): Return an Expression,
16195         not a QualifiedIdentifier.  This is what `type_name_expression'
16196         was previously doing.
16197         (type_name_expression): Removed; the code is now in
16198         `namespace_or_type_name'.
16199         (qualified_identifier): Removed, use `namespace_or_type_name'
16200         instead.
16201         (QualifiedIdentifier): Removed this class.      
16202
16203 2004-01-22  Martin Baulig  <martin@ximian.com>
16204
16205         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
16206         not a string as alias name.
16207
16208 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
16209
16210         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
16211         #52730 bug, and instead compute correctly the need to use a
16212         temporary variable when requesting an address based on the
16213         static/instace modified of the field and the constructor.
16214  
16215 2004-01-21  Martin Baulig  <martin@ximian.com>
16216
16217         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
16218         class and namespace before looking up aliases.  Fixes #52517.
16219
16220 2004-01-21  Martin Baulig  <martin@ximian.com>
16221
16222         * flowanalysis.cs (UsageVector.Merge): Allow variables being
16223         assinged in a 'try'; fixes exception4.cs.
16224
16225 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16226         * class.cs : Implemented parameter-less constructor for TypeContainer
16227
16228         * decl.cs: Attributes are now stored here. New property OptAttributes
16229
16230         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
16231
16232         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
16233
16234 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16235
16236         * typemanager.cs (CSharpSignature): Now reports also inner class name.
16237           (CSharpSignature): New method for indexer and property signature.
16238
16239 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16240
16241         * pending.cs (IsVirtualFilter): Faster implementation.
16242
16243 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16244
16245         * typemanager.cs: Avoid inclusion of same assembly more than once.
16246
16247 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16248
16249         * cs-parser.jay: Fixed problem where the last assembly attribute
16250           has been applied also to following declaration (class, struct, etc.)
16251           
16252 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16253
16254         * class.cs: Added error CS0538, CS0539 reporting.
16255         Fixed crash on Microsoft runtime when field type is void.
16256
16257         * cs-parser.jay: Added error CS0537 reporting.
16258
16259         * pending.cs: Added error CS0535 reporting.
16260         Improved error report for errors CS0536, CS0534.
16261
16262 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
16263
16264         Merge a few bits from the Anonymous Method MCS tree.
16265
16266         * statement.cs (ToplevelBlock): New class for toplevel methods,
16267         will hold anonymous methods, lifted variables.
16268
16269         * cs-parser.jay: Create toplevel blocks for delegates and for
16270         regular blocks of code. 
16271
16272 2004-01-20  Martin Baulig  <martin@ximian.com>
16273
16274         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
16275         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
16276         and `NeedExplicitReturn'; added `IsLastStatement'.
16277         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
16278         have a `ReturnLabel' or we're not unreachable.
16279
16280         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
16281         child's reachability; don't just override ours with it.  Fixes
16282         #58058 (lluis's example).
16283         (FlowBranching): Added public InTryOrCatch(), InCatch(),
16284         InFinally(), InLoop(), InSwitch() and
16285         BreakCrossesTryCatchBoundary() methods.
16286
16287         * statement.cs (Return): Do all error checking in Resolve().
16288         Unless we are the last statement in a top-level block, always
16289         create a return label and jump to it.
16290         (Break, Continue): Do all error checking in Resolve(); also make
16291         sure we aren't leaving a `finally'.
16292         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
16293         statement in a top-level block.
16294         (Block.Flags): Added `IsDestructor'.
16295         (Block.IsDestructor): New public property.
16296
16297 2004-01-20  Martin Baulig  <martin@ximian.com>
16298
16299         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
16300
16301 2004-01-20  Martin Baulig  <martin@ximian.com>
16302
16303         * statement.cs (Statement.ResolveUnreachable): New public method.
16304         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
16305         (Block.Resolve): Resolve unreachable statements.
16306
16307 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
16308
16309         * expression.cs: We need to fix the case where we do
16310         not have a temp variable here.
16311
16312         * assign.cs: Only expression compound assignments need
16313         temporary variables.
16314
16315 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
16316
16317         * flowanalysis.cs: Reduce memory allocation in a few ways:
16318           - A block with no variables should not allocate a bit
16319             vector for itself.
16320           - A method with no out parameters does not need any tracking
16321             for assignment of the parameters, so we need not allocate
16322             any data for it.
16323           - The arrays:
16324                 public readonly Type[] VariableTypes;
16325                 public readonly string[] VariableNames;
16326             Are redundant. The data is already stored in the variable
16327             map, so we need not allocate another array for it.
16328           - We need to add alot of checks for if (params | locals) == null
16329             due to the first two changes.
16330
16331 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
16332
16333         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16334         implement IMemoryLocation, we store a copy on a local variable and
16335         take the address of it.  Patch from Benjamin Jemlich
16336
16337         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16338         to use a special "type_name_expression" rule which reduces the
16339         number of "QualifiedIdentifier" classes created, and instead
16340         directly creates MemberAccess expressions.
16341
16342 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
16343
16344         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16345         that fixes #52853.  Null literal assignment to ValueType
16346
16347         * class.cs (MethodData.Emit): Instead of checking the name of the
16348         method to determine if its a destructor, create a new derived
16349         class from Method called Destructor, and test for that.  
16350
16351         * cs-parser.jay: Create a Destructor object instead of a Method.  
16352
16353         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16354
16355         Fixes: 52933
16356
16357 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
16358
16359         * expression.cs (Binary.ResolveOperator): Perform an implicit
16360         conversion from MethodGroups to their delegate types on the
16361         Addition operation.
16362
16363         * delegate.cs: Introduce a new class DelegateCreation that is the
16364         base class for `NewDelegate' and `ImplicitDelegateCreation',
16365         factor some code in here.
16366
16367         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16368         conversion from MethodGroups to compatible delegate types. 
16369
16370         * ecore.cs (Expression.Resolve): Do not flag error 654
16371         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16372         we allow conversions from MethodGroups to delegate types now.
16373
16374         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16375         assignments in v2 either.
16376
16377 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
16378
16379         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16380         static read-only fields in ctors.
16381
16382         Applied patch from Benjamin Jemlich 
16383
16384         * expression.cs (UnaryMutator): Avoid leaking local variables. 
16385
16386 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
16387
16388         * cs-tokenizer.cs (IsCastToken): Allow the various native types
16389         here to return true, as they can be used like this:
16390
16391                 (XXX) int.MEMBER ()
16392
16393         Fixed 49836 and all the other dups
16394
16395 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
16396
16397         * driver.cs: Implement /win32res and /win32icon.
16398
16399 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
16400
16401         * cs-parser.jay: Add a rule to improve error handling for the
16402         common mistake of placing modifiers after the type.
16403
16404 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
16405
16406         * cs-parser.jay (interface_event_declaration): Catch
16407         initialization of events on interfaces, and report cs0068
16408
16409         * cs-parser.jay (interface_event_declaration): Catch
16410         initialization of events. 
16411
16412         * ecore.cs: Better report missing constructors.
16413
16414         * expression.cs (Binary.ResolveOperator): My previous bug fix had
16415         the error reporting done in the wrong place.  Fix.
16416
16417         * expression.cs (Binary.ResolveOperator): Catch the 
16418         operator + (E x, E y) error earlier, and later allow for implicit
16419         conversions in operator +/- (E e, U x) from U to the underlying
16420         type of E.
16421
16422         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16423         52596, if the container class is abstract, the default constructor
16424         is protected otherwise its public (before, we were always public).
16425
16426         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16427         fixed statement.
16428
16429         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16430         Jemlich that fixes bug #52597, MCS was generating invalid code for
16431         idisposable structs.   Thanks to Ben for following up with this
16432         bug as well.
16433
16434 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
16435
16436         * driver.cs: Allow assemblies without code to be generated, fixes
16437         52230.
16438
16439 2004-01-07  Nick Drochak <ndrochak@gol.com>
16440
16441         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16442
16443 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
16444
16445         * cs-parser.jay: Add rules to improve error reporting if fields or
16446         methods are declared at the namespace level (error 116)
16447
16448         * Add rules to catch event add/remove
16449
16450 2004-01-04  David Sheldon <dave-mono@earth.li>
16451
16452   * expression.cs: Added matching ")" to error message for 
16453   CS0077
16454
16455 2004-01-03 Todd Berman <tberman@gentoo.org>
16456
16457         * ecore.cs, attribute.cs:
16458         Applying fix from #52429.
16459
16460 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16461
16462         * ecore.cs, expression.cs, statement.cs:
16463         Total rewrite of how we handle branching. We
16464         now handle complex boolean expressions with fewer
16465         jumps. As well if (x == 0) no longer emits a ceq.
16466
16467         if (x is Foo) is much faster now, because we generate
16468         better code.
16469
16470         Overall, we get a pretty big improvement on our benchmark
16471         tests. The code we generate is smaller and more readable.
16472
16473         I did a full two-stage bootstrap. The patch was reviewed
16474         by Martin and Miguel.
16475
16476 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16477
16478         * cs-parser.jay: Make primary_expression not take a QI.
16479         we dont need this because the member_access rule covers
16480         us here. So we replace the rule with just IDENTIFIER.
16481
16482         This has two good effects. First, we remove a s/r conflict.
16483         Second, we allocate many fewer QualifiedIdentifier objects.
16484
16485 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16486
16487         * attribute.cs: Handle MarshalAs attributes as pseudo, and
16488         set the correct information via SRE. This prevents
16489         hanging on the MS runtime. Fixes #29374.
16490
16491 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16492
16493         * convert.cs: correctly handle conversions to value types
16494         from Enum and ValueType as unboxing conversions.
16495
16496         Fixes bug #52569. Patch by Benjamin Jemlich.
16497
16498 2004-01-02  Ravi Pratap  <ravi@ximian.com>
16499
16500         * expression.cs (BetterConversion): Prefer int -> uint
16501         over int -> ulong (csc's behaviour). This fixed bug #52046.
16502
16503 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16504
16505         * decl.cs (MemberCache.FindMembers): now returns a
16506         MemberInfo [].
16507
16508         * typemanager.cs: In general, go with with ^^.
16509         (CopyNewMethods): take an IList.
16510         (RealMemberLookup): Only allocate an arraylist
16511         if we copy from two sets of methods.
16512
16513         This change basically does two things:
16514         1) Fewer array lists allocated due to CopyNewMethods.
16515         2) the explicit cast in MemberList costed ALOT.
16516
16517 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
16518
16519         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16520         a hashtable to avoid needless string allocations when an identifier is
16521         used more than once (the common case).
16522
16523 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16524
16525         * pending.cs: MS's TypeBuilder.GetInterfaces ()
16526         is broken, it will not return anything. So, we
16527         have to use the information we have in mcs to
16528         do the task.
16529
16530         * typemanager.cs: Add a cache for GetInterfaces,
16531         since this will now be used more often (due to ^^)
16532
16533         (GetExplicitInterfaces) New method that gets the
16534         declared, not effective, interfaces on a type
16535         builder (eg, if you have interface IFoo, interface
16536         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16537         { IBar }.
16538
16539         This patch makes MCS able to bootstrap itself on
16540         Windows again.
16541
16542 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16543
16544         * expression.cs: Remove the Nop's that Miguel put
16545         in by mistake.
16546
16547 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16548
16549         * report.cs, codegen.cs: Give the real stack trace to
16550         the error when an exception is thrown.
16551
16552 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16553
16554         * decl.cs: only allocate hashtables for ifaces if 
16555         it is an iface!
16556
16557 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16558
16559         * expression.cs: fix the error from cs0121-2.cs
16560         (a parent interface has two child interfaces that
16561         have a function with the same name and 0 params
16562         and the function is called through the parent).
16563
16564 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16565
16566         * class.cs, rootcontext.cs, typmanager.cs: do not
16567         leak pointers.
16568
16569 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16570
16571         * codegen.cs: remove stack for the ec flow branching.
16572         It is already a linked list, so no need.
16573
16574 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
16575
16576         * Makefile: Allow custom profiler here.
16577
16578 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16579
16580         * typemanager.cs (LookupType):
16581           - Use a static char [], because split takes
16582             a param array for args, so it was allocating
16583             every time.
16584           - Do not store true in a hashtable, it boxes.
16585
16586 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16587
16588         * flowanalysis.cs: bytify common enums.
16589
16590 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16591
16592         * modifiers.cs: Add a new set of flags for the
16593         flags allowed on explicit interface impls.
16594         * cs-parser.jay: catch the use of modifiers in
16595         interfaces correctly.
16596         * class.cs: catch private void IFoo.Blah ().
16597
16598         All related to bug #50572.
16599
16600 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16601
16602         * decl.cs: Rewrite the consistant accessability checking.
16603         Accessability is not linear, it must be implemented in
16604         a tableish way. Fixes #49704.
16605
16606 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16607
16608         * expression.cs: Handle negation in a checked context.
16609         We must use subtraction from zero. Fixes #38674.
16610
16611 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16612
16613         * class.cs: Ignore static void main in DLLs.
16614         * rootcontext.cs: Handle the target type here,
16615         since we are have to access it from class.cs
16616         * driver.cs: account for the above.
16617
16618 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16619
16620         * report.cs: Give line numbers and files if available.
16621
16622 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
16623
16624         * driver.cs: Implement /addmodule.
16625
16626         * typemanager.cs:  Change 'modules' field so it now contains Modules not
16627         ModuleBuilders.
16628
16629 2003-12-20  Martin Baulig  <martin@ximian.com>
16630
16631         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16632         (FieldBase.IsAssigned): Removed this field.
16633         (FieldBase.SetAssigned): New public method.
16634         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16635
16636 2003-12-20  Martin Baulig  <martin@ximian.com>
16637
16638         * expression.cs (LocalVariableReference.DoResolve): Don't set
16639         `vi.Used' if we're called from DoResolveLValue().
16640
16641         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16642         returns the usage vector it just merged into the current one -
16643         pass this one to UsageWarning().
16644         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16645         of the `EmitContext', don't call this recursively on our children.
16646
16647 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
16648
16649         * driver.cs: Implement /target:module.
16650
16651 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
16652
16653         * support.cs (CharArrayHashtable): New helper class.
16654
16655         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
16656         char arrays, not strings, so we can avoid creating a string in
16657         consume_identifier if the identifier is a keyword.
16658
16659 2003-12-16  Martin Baulig  <martin@ximian.com>
16660
16661         * statement.cs (LocalInfo.Assigned): Removed this property.
16662         (LocalInfo.Flags): Removed `Assigned'.
16663         (LocalInfo.IsAssigned): New public method; takes the EmitContext
16664         and uses flow analysis.
16665         (Block.UsageWarning): Made this method private.
16666         (Block.Resolve): Call UsageWarning() if appropriate.
16667
16668         * expression.cs (LocalVariableReference.DoResolve): Always set
16669         LocalInfo.Used here.
16670
16671 2003-12-13  Martin Baulig  <martin@ximian.com>
16672
16673         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16674         any value here; we're now using flow analysis to figure out
16675         whether a statement/block returns a value.
16676
16677 2003-12-13  Martin Baulig  <martin@ximian.com>
16678
16679         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16680         working again.
16681         (FlowBranching.MergeFinally): Don't call
16682         `branching.CheckOutParameters()' here, this is called in
16683         MergeTopBlock().
16684         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16685         when adding the `finally' vector.       
16686
16687 2003-12-13  Martin Baulig  <martin@ximian.com>
16688
16689         * flowanalysis.cs
16690         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16691         actually work and also fix #48962.
16692
16693 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
16694
16695         * decl.cs: Do not check System.Object for nested types,
16696         since we know it does not have any. Big bang for buck:
16697
16698         BEFORE:
16699            Run 1:   8.35 seconds
16700            Run 2:   8.32 seconds
16701            corlib:  17.99 seconds
16702         AFTER:
16703            Run 1:   8.17 seconds
16704            Run 2:   8.17 seconds
16705            corlib:  17.39 seconds
16706
16707 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
16708
16709         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16710         time we are returning 0 members, so we save alot here.
16711
16712 2003-12-11  Martin Baulig  <martin@ximian.com>
16713
16714         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16715         `MergeChild()', also just take the `FlowBranching' as argument;
16716         call Merge() on it and return the result.
16717         (FlowBranching.Merge): We don't need to do anything if we just
16718         have one sibling.
16719
16720 2003-12-11  Martin Baulig  <martin@ximian.com>
16721
16722         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16723         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
16724         Maurer for this idea.
16725
16726 2003-12-11  Martin Baulig  <martin@ximian.com>
16727
16728         * flowanalysis.cs (MergeResult): This class is now gone; we now
16729         use the `UsageVector' for this.  The reason for this is that if a
16730         branching just has one sibling, we don't need to "merge" them at
16731         all - that's the next step to do.
16732         (FlowBranching.Merge): We now return a `UsageVector' instead of a
16733         `MergeResult'.
16734
16735 2003-12-11  Martin Baulig  <martin@ximian.com>
16736
16737         Reworked flow analyis and made it more precise and bug-free.  The
16738         most important change is that we're now using a special `Reachability'
16739         class instead of having "magic" meanings of `FlowReturns'.  I'll
16740         do some more cleanups and optimizations and also add some more
16741         documentation this week.
16742
16743         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16744         largely reworked this class.
16745         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16746         the new `Reachability' class instead of having "magic" values here.
16747         (FlowBranching): We're now using an instance of `Reachability'
16748         instead of having separate `Returns', `Breaks' etc. fields.
16749
16750         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16751         based on flow analysis; ignore the return value of block.Emit ().
16752
16753 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
16754
16755         * driver.cs typemanager.cs: Find the mono extensions to corlib even
16756         if they are private.
16757
16758 2003-12-09  Martin Baulig  <martin@ximian.com>
16759
16760         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16761         call them directly on the UsageVector.
16762
16763 2003-12-09  Martin Baulig  <martin@ximian.com>
16764
16765         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16766         Changed return type from `FlowReturns' to `Reachability'.
16767
16768 2003-12-09  Martin Baulig  <martin@ximian.com>
16769
16770         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16771         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16772         `Reachable' fields with a single `Reachability' one.
16773
16774 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16775
16776         * class.cs (FindMembers): Remove foreach's.
16777
16778         Bootstrap times:
16779
16780         BEFORE
16781                 Run 1:   8.74 seconds
16782                 Run 2:   8.71 seconds
16783
16784         AFTER
16785                 Run 1:   8.64 seconds
16786                 Run 2:   8.58 seconds
16787
16788
16789 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16790
16791         * cs-parser.jay:
16792         * gen-treedump.cs:
16793         * statement.cs:
16794         This patch does a few things:
16795                 1. EmptyStatement is now a singleton, so it is never reallocated.
16796                 2. All blah is EmptyStatement constructs have been changed to
16797                    blah == EmptyStatement.Value, which is much faster and valid
16798                    now that EmptyStatement is a singleton.
16799                 3. When resolving a block, rather than allocating a new array for
16800                    the non-empty statements, empty statements are replaced with
16801                    EmptyStatement.Value
16802                 4. Some recursive functions have been made non-recursive.
16803         Mainly the performance impact is from (3), however (1) and (2) are needed for
16804         this to work. (4) does not make a big difference in normal situations, however
16805         it makes the profile look saner.
16806
16807         Bootstrap times:
16808
16809         BEFORE
16810         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16811         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16812         Total memory allocated: 56397 KB
16813
16814         AFTER
16815         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16816         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16817         Total memory allocated: 55666 KB
16818
16819 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16820
16821         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16822         than the hashtable in a hashtable version
16823
16824         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16825         we always end up concating a string. This results in a huge perf
16826         loss, because many strings have to be tracked by the GC. In this
16827         patch, we first use a hashtable that works with two keys, so that
16828         the strings do not need to be concat'ed.
16829
16830         Bootstrap times:
16831         BEFORE
16832                 Run 1:   8.74 seconds
16833                 Run 2:   8.71 seconds
16834
16835         AFTER
16836                 Run 1:   8.65 seconds
16837                 Run 2:   8.56 seconds
16838
16839 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16840
16841         * Makefile: Add a new target `do-time' that does a quick and simple
16842         profile, leaving easy to parse output.
16843
16844 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
16845
16846         * codegen.cs (Init): Create the dynamic assembly with 
16847         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16848
16849 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16850
16851         * support.cs: Make the PtrHashtable use only one
16852         instance of its comparer.
16853
16854 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
16855
16856         * typemanager.cs: Fix lookup of GetNamespaces.
16857
16858 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
16859
16860         * expression.cs: Removed redundant line.
16861
16862         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16863         ArrayLists, use for loops with bounds.  
16864
16865         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16866         arraylist.
16867
16868         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16869         arraylists, use for loop with bounds.
16870
16871         The above three changes give us a 0.071 second performance
16872         improvement out of 3.294 seconds down to 3.223.  On my machine
16873         the above changes reduced the memory usage by 1,387 KB during
16874         compiler bootstrap.
16875
16876         * cs-parser.jay (QualifiedIdentifier): New class used to represent
16877         QualifiedIdentifiers.  Before we created a new string through
16878         concatenation, and mostly later on, the result would be
16879         manipulated by DecomposeQI through string manipulation.
16880
16881         This reduced the compiler memory usage for bootstrapping from
16882         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16883         compile times in 0.05 seconds.
16884
16885 2003-11-28  Dick Porter  <dick@ximian.com>
16886
16887         * support.cs: Do string compares with the Invariant culture.
16888
16889         * rootcontext.cs: 
16890         * gen-treedump.cs: 
16891         * expression.cs: 
16892         * driver.cs: 
16893         * decl.cs: 
16894         * codegen.cs: 
16895         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16896         the comparison is done with the Invariant culture.
16897
16898 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
16899
16900         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16901         GetEnumerator method.
16902
16903         (ProbeCollectionType): Iterate starting at the most specific type
16904         upwards looking for a GetEnumerator
16905
16906         * expression.cs: Shift count can be up to 31 for int/uint and 63
16907         for long/ulong.
16908
16909 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
16910
16911         * statement.cs (Block.LookupLabel): Also look for the label on the
16912         children blocks.  Use a hash table to keep track of visited
16913         nodes. 
16914
16915         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16916         we actually did transform the other operand, otherwise fall back
16917         to the common codepath that casts to long.
16918
16919         * cs-tokenizer.cs: Use the same code pattern as the int case.
16920         Maybe I should do the parsing myself, and avoid depending on the
16921         Parse routines to get this done.
16922
16923 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
16924
16925         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16926         which fixes bug 51347.  This time test it.
16927
16928         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16929         attributes for example can not tell the difference between these.
16930         The difference was only a syntax feature of the language. 
16931
16932         * attribute.cs: Apply attributes to delegates.
16933
16934         * delegate.cs: Call the apply attributes method.
16935
16936 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
16937
16938         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16939         comparing 0 vs Byte.MinValue, not the value
16940
16941         (ImplicitConversionRequired): When reporting a conversion error,
16942         use error 31 to print out the constant error instead of the
16943         simpler 29.
16944
16945         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16946         which fixes bug 51347.
16947
16948 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
16949
16950         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
16951         which fixes the -warnaserror command line option.
16952
16953 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
16954
16955         * cfold.cs (DoNumericPromotions): During constant folding of
16956         additions on UIntConstant, special case intconstants with
16957         IntConstants like we do on the expression binary operator. 
16958
16959 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
16960
16961         * convert.cs (ImplicitReferenceConversion): We were missing a case
16962         (System.Enum are not value types or class types, so we need to
16963         classify them separatedly).
16964
16965         * driver.cs: We do not support error 2007.
16966
16967 2003-11-12 Jackson Harper <jackson@ximian.com>
16968
16969         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16970         system directory. Also use the full file name so users can
16971         libraries names mscorlib-o-tron.dll in a non system dir.
16972
16973 2003-11-10  Martin Baulig  <martin@ximian.com>
16974
16975         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16976         (TypeManager.InitCoreTypes): Initialize them here, but instead of
16977         calling `ResolveType()' on them, directly assign their `Type'.
16978
16979 2003-11-08  Martin Baulig  <martin@ximian.com>
16980
16981         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16982         return value and the `out parent' parameter.
16983         (TypeContainer.DefineType): Moved the CS0644 check into
16984         GetClassBases().  Don't pass the interface types to the
16985         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16986         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16987
16988         * ecore.cs (TypeExpr.IsAttribute): New property.
16989         (TypeExpr.GetInterfaces): New method.
16990
16991         * interface.cs (Interface.GetInterfaceTypeByName): Return a
16992         TypeExpr instead of a Type.
16993         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16994         (Interface.DefineType): Don't pass the interface types to the
16995         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16996         them later and then call `TypeBulider.AddInterfaceImplementation()'.
16997
16998         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16999         instead of a `Type[]'.
17000         (TypeManager.RegisterBuilder): Likewise.
17001         (TypeManager.AddUserInterface): Likewise.
17002         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
17003         `Type[]' and also return a `TypeExpr[]'.
17004         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
17005
17006 2003-11-08  Martin Baulig  <martin@ximian.com>
17007
17008         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
17009         Expression.     
17010
17011 2003-11-08  Martin Baulig  <martin@ximian.com>
17012
17013         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
17014         TypeManager.ResolveExpressionTypes().
17015
17016         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
17017         instead of an Expression.
17018         (TypeExpr): This is now an abstract base class for `TypeExpression'.
17019         (TypeExpression): New public class; formerly known as `TypeExpr'.
17020
17021         * expression.cs (ComposedCast): Derive from TypeExpr.
17022
17023         * typemanager.cs (TypeManager.system_*_expr): These are now
17024         TypExpr's instead of Expression's.
17025         (TypeManager.ResolveExpressionTypes): New public static function;
17026         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
17027         of them.        
17028
17029 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
17030
17031         * expression.cs (New.DoResolve): Do not dereference value that
17032         might be a null return.
17033
17034         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
17035         sure that the constant value has the right type.  Fixes an
17036         unreported bug, similar to 50425.
17037
17038         * const.cs (Const.LookupConstantValue): Call
17039         ImplicitStandardConversionExists before doing a conversion to
17040         avoid havng the TypeManager.ChangeType do conversions.
17041
17042         Reduced the number of casts used
17043
17044         (Const.ChangeType): New routine to enable reuse of the constant
17045         type changing code from statement.
17046
17047         * typemanager.cs (ChangeType): Move common initialization to
17048         static global variables.
17049
17050         Fixes #50425.
17051
17052         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
17053         every value type to go through, even if it was void.  Fix that. 
17054
17055         * cs-tokenizer.cs: Use is_identifier_start_character on the start
17056         character of the define, and the is_identifier_part_character for
17057         the rest of the string.
17058
17059 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
17060
17061         * expression.cs (UnaryMutator.EmitCode): When I updated
17062         LocalVariableReference.DoResolve, I overdid it, and dropped an
17063         optimization done on local variable references.
17064
17065 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
17066
17067         * ecore.cs: Convert the return from Ldlen into an int.
17068
17069 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
17070
17071         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
17072         the accessibility, this is a special case for toplevel non-public
17073         classes (internal for instance).
17074
17075 2003-10-20  Nick Drochak <ndrochak@gol.com>
17076
17077         * ecore.cs: Fix typo and build.  Needed another right paren.
17078
17079 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
17080
17081         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
17082         `internal' case regular and protected, but not allowing protected
17083         to be evaluated later.  Bug 49840
17084
17085 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
17086
17087         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
17088         to kb.Nlast, and not the kb.nFirst to isolate the switch
17089         statement.
17090
17091         Extract the underlying type, so enumerations of long/ulong are
17092         treated like long/ulong.
17093
17094 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
17095
17096         * expression.cs (New): Overload the meaning of RequestedType to
17097         track the possible creation of the NewDelegate type, since
17098         DoResolve is invoked more than once for new constructors on field
17099         initialization.
17100
17101         See bugs: #48800 and #37014
17102
17103         * cs-parser.jay (declare_local_constants): Take an arraylist
17104         instead of a single constant.
17105
17106         (local_constant_declaration): It should take a
17107         constant_declarators, not a constant_declarator.  Fixes 49487
17108
17109         * convert.cs: Fix error report.
17110
17111 2003-10-13 Jackson Harper <jackson@ximian.com>
17112
17113         * typemanager.cs (TypeToCoreType): Add float and double this fixes
17114         bug #49611
17115
17116 2003-10-09  Martin Baulig  <martin@ximian.com>
17117
17118         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
17119         to the .ctor.
17120         (MethodCore.DoDefineParameters): Removed the TypeContainer
17121         argument; use the DeclSpace which was passed to the .ctor instead.
17122         (MethodCore.CheckParameter): Take a DeclSpace instead of a
17123         TypeContainer; we only need a DeclSpace here.
17124
17125 2003-10-09  Martin Baulig  <martin@ximian.com>
17126
17127         * class.cs (MethodData): Added additional `DeclSpace ds' argument
17128         to the .ctor.
17129         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
17130         EmitContext's .ctor.    
17131
17132 2003-10-09  Martin Baulig  <martin@ximian.com>
17133
17134         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
17135         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
17136         AsAccessible(), moved them as well.
17137
17138         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
17139
17140 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
17141
17142         * cs-parser.jay : Renamed yyName to yyNames related to jay.
17143
17144 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
17145
17146         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
17147         generation for >=, as spotted by Paolo, bug 48679.  
17148         Patch from David Waite.
17149
17150         * cs-tokenizer.cs: Add handling for #pragma.
17151
17152         * cs-parser.jay: Allow for both yield and yield return in the
17153         syntax.  The anti-cobolization of C# fight will go on!
17154
17155         * class.cs (TypeBuilder.DefineType): Catch error condition here
17156         (Parent.DefineType erroring out and returning null).
17157
17158         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17159         coping with enumerations variables, we were mistakenly processing
17160         them as a regular value type instead of built-in types.  Fixes the
17161         bug #48063
17162
17163         * typemanager.cs (IsBuiltinOrEnum): New method.
17164
17165 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
17166
17167         * cs-parser.jay: Upgrade: yield now needs the return clause.
17168
17169 2003-09-19  Martin Baulig  <martin@ximian.com>
17170
17171         * decl.cs (MemberCache.SetupCacheForInterface): Take a
17172         `MemberCache parent' argument.  Normally, an interface doesn't
17173         have a parent type except System.Object, but we use this in gmcs
17174         for generic type parameters.
17175
17176 2003-09-18  Martin Baulig  <martin@ximian.com>
17177
17178         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
17179         on `type.IsInterface'; don't check whether the type has a parent
17180         to determine whether it's an interface.
17181
17182 2003-09-15  Martin Baulig  <martin@ximian.com>
17183
17184         * class.cs (TypeContainer.DefineType): Added an error flag to
17185         avoid reporting duplicate CS0146's ("class definition is
17186         circular.").
17187
17188         * driver.cs (Driver.MainDriver): Abort if
17189         RootContext.ResolveTree() reported any errors.
17190
17191 2003-09-07  Martin Baulig  <martin@ximian.com>
17192
17193         * report.cs (Error, Warning): Added overloaded versions which take
17194         a `params object[] args' and call String.Format().
17195
17196 2003-09-07  Martin Baulig  <martin@ximian.com>
17197
17198         * decl.cs (DeclSpace..ctor): Don't call
17199         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
17200         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
17201         (DeclSpace.RecordDecl): New method.
17202
17203         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
17204
17205 2003-09-02  Ravi Pratap  <ravi@ximian.com>
17206
17207         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
17208         value attributes to be applied to ParameterBuilders.
17209
17210         * class.cs (MethodCore.LabelParameters): Make static and more
17211         generic so that it can be used from other places - like interface
17212         methods, for instance.
17213
17214         * interface.cs (Interface.Emit): Call LabelParameters before
17215         emitting attributes on the InterfaceMethod.
17216
17217 2003-08-26  Martin Baulig  <martin@ximian.com>
17218
17219         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
17220         resolving aliases; fixes #47927.
17221
17222 2003-08-26  Martin Baulig  <martin@ximian.com>
17223
17224         * statement.cs (Using.DoResolve): This is internally emitting a
17225         try/finally clause, so we need to set ec.NeedExplicitReturn if we
17226         do not always return.  Fixes #47681.
17227
17228 2003-08-26  Martin Baulig  <martin@ximian.com>
17229
17230         * decl.cs (MemberCore): Moved WarningNotHiding(),
17231         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
17232         into MemberBase.
17233         (AdditionResult): Make this nested in DeclSpace.
17234         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
17235         argument; call NamespaceEntry.Define() unless we're nested in a
17236         class or struct.
17237
17238         * namespace.cs (Namespace.DefineName): New public function.  This
17239         is called from DeclSpace's .ctor to add 
17240         (Namespace.Lookup): Include DeclSpaces in the lookup.
17241
17242         * class.cs (Operator): Derive from MemberBase, not MemberCore.
17243
17244         * const.cs (Const): Derive from MemberBase, not MemberCore.     
17245
17246 2003-08-25  Martin Baulig  <martin@ximian.com>
17247
17248         * convert.cs (Convert.ExplicitReferenceConversion): When
17249         converting from an interface type to a class, unbox if the target
17250         type is a struct type.  Fixes #47822.
17251
17252 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17253
17254         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
17255         #47854.
17256
17257 2003-08-22  Martin Baulig  <martin@ximian.com>
17258
17259         * class.cs (TypeManager.DefineType): When defining a nested type,
17260         call DefineType() on our parent; fixes #47801.
17261
17262 2003-08-22  Martin Baulig  <martin@ximian.com>
17263
17264         * class.cs (MethodData.Define): While checking if a method is an
17265         interface implementation, improve the test a bit more to fix #47654.
17266
17267 2003-08-22  Martin Baulig  <martin@ximian.com>
17268
17269         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
17270         correctly; fixes #47722.
17271
17272 2003-08-22  Martin Baulig  <martin@ximian.com>
17273
17274         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
17275         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
17276
17277         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
17278
17279 2003-08-22  Martin Baulig  <martin@ximian.com>
17280
17281         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
17282         can only be assigned in static constructors.  Fixes #47161.
17283
17284 2003-08-22  Martin Baulig  <martin@ximian.com>
17285
17286         Rewrote and improved the flow analysis code.
17287
17288         * flowbranching.cs (FlowBranching): Make this class abstract.
17289         (FlowBranching.CreateBranching): New static function to create a
17290         new flow branching.
17291         (FlowBranchingBlock, FlowBranchingException): New classes.
17292         (FlowBranching.UsageVector.Type): New public readonly field.
17293         (FlowBranching.UsageVector.Breaks): Removed the setter.
17294         (FlowBranching.UsageVector.Returns): Removed the setter.
17295         (FlowBranching.UsageVector): Added Break(), Return(),
17296         NeverReachable() and Throw() methods to modify the reachability.
17297         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
17298         done by FlowBranching.Merge().
17299         (FlowBranching.UsageVector.MergeChild): New method; merges the
17300         merge result into the current vector.
17301         (FlowBranching.Merge): New abstract method to merge a branching.
17302
17303 2003-08-12  Martin Baulig  <martin@ximian.com>
17304
17305         * expression.cs (Indirection.CacheTemporaries): Create the
17306         LocalTemporary with the pointer type, not its element type.
17307
17308 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
17309
17310         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
17311         token was a keyword or not.
17312
17313         Add `error' options where an IDENTIFIER was expected;  Provide
17314         CheckToken and CheckIdentifierToken convenience error reporting
17315         functions. 
17316
17317         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
17318
17319         * decl.cs: Rename `NamespaceEntry Namespace' public field into
17320         NameSpaceEntry NameSpaceEntry.
17321
17322         (LookupInterfaceOrClass): Avoid creating a full qualified name
17323         from namespace and name: avoid doing lookups when we know the
17324         namespace is non-existant.   Use new Tree.LookupByNamespace which
17325         looks up DeclSpaces based on their namespace, name pair.
17326
17327         * driver.cs: Provide a new `parser verbose' to display the
17328         exception thrown during parsing.  This is turned off by default
17329         now, so the output of a failure from mcs is more graceful.
17330
17331         * namespace.cs: Track all the namespaces defined in a hashtable
17332         for quick lookup.
17333
17334         (IsNamespace): New method
17335
17336 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
17337
17338         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
17339         we know that we need to concatenate (full typename can never be
17340         null). 
17341
17342         * class.cs: ditto.
17343
17344         * statement.cs: Use a bitfield;  Do not initialize to null things
17345         which are done by the constructor by default.
17346
17347         * cs-parser.jay: bug fix, parameter was 4, not 3.
17348
17349         * expression.cs: Just use the property;
17350
17351         * statement.cs: No need for GetVariableInfo method.
17352
17353 2003-08-08  Martin Baulig  <martin@ximian.com>
17354
17355         * flowanalysis.cs (FlowReturns): This is now nested in the
17356         `FlowBranching' class.
17357         (MyBitVector): Moved this here from statement.cs.
17358         (FlowBranching.SiblingType): New enum type.
17359         (FlowBranching.CreateSibling): Added `SiblingType' argument.
17360
17361 2003-08-07  Martin Baulig  <martin@ximian.com>
17362
17363         * flowanalysis.cs (FlowBranchingType): This is now nested in the
17364         `FlowBranching' class and called `BranchingType'.
17365
17366 2003-08-07  Martin Baulig  <martin@ximian.com>
17367
17368         * flowanalysis.cs: Moved all the control flow analysis code into
17369         its own file.
17370
17371 2003-08-07  Martin Baulig  <martin@ximian.com>
17372
17373         * assign.cs (Assign.DoResolve): `target' must either be an
17374         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
17375         #37319.
17376
17377 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
17378
17379         * expression.cs (BinaryMethod): This kind of expression is created by the
17380         Binary class if it determines that the operator has to be handled
17381         by a method.
17382
17383         (BinaryDelegate): This kind of expression is created if we are
17384         dealing with a + or - operator on delegates.
17385
17386         (Binary): remove method, argumetns, and DelegateOperator: when
17387         dealing with methods, 
17388
17389         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17390
17391         * statement.cs (Block): use bitfields for the three extra booleans
17392         we had in use.   Remove unused topblock parameter.
17393
17394         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17395
17396         * assign.cs: Drop extra unneeded tests.
17397
17398 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
17399
17400         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17401
17402         * statement.cs (Foreach): Use VariableStorage instead of
17403         LocalBuilders.   
17404
17405         * codegen.cs (VariableStorage): New class used by clients that
17406         require a variable stored: locals or fields for variables that
17407         need to live across yield.
17408
17409         Maybe provide a convenience api for EmitThis+EmitLoad?
17410
17411         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17412         these bad boys.
17413
17414 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
17415
17416         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17417         RemapParameterLValue): New methods that are used to turn a
17418         precomputed FieldInfo into an expression like this:
17419
17420                 instance.FieldInfo
17421
17422         The idea is to use this instead of making LocalVariableReference
17423         have more than one meaning.
17424
17425         * cs-parser.jay: Add error production to BASE.
17426
17427         * ecore.cs: Deal with TypeManager.GetField returning null, which
17428         is now a valid return value.
17429
17430         (FieldExprNoAddress): New expression for Fields whose address can
17431         not be taken.
17432
17433         * expression.cs (LocalVariableReference): During the resolve
17434         phases, create new expressions if we are in a remapping context.
17435         Remove code that dealt with remapping here.
17436
17437         (ParameterReference): same.
17438
17439         (ProxyInstance): New expression, like the `This' expression, but
17440         it is born fully resolved.  We know what we are doing, so remove
17441         the errors that are targeted to user-provided uses of `this'.
17442
17443         * statement.cs (Foreach): our variable is now stored as an
17444         Expression;  During resolution, follow the protocol, dont just
17445         assume it will return this.
17446
17447 2003-08-06  Martin Baulig  <martin@ximian.com>
17448
17449         * support.cs (SeekableStreamReader.cs): New public class.
17450
17451         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17452         SeekableStreamReader instead of the normal StreamReader.
17453
17454 2003-08-04  Martin Baulig  <martin@ximian.com>
17455
17456         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17457         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17458         deambiguate casts and delegate invocations.
17459         (parenthesized_expression): Use the new tokens to ensure this is
17460         not a cast of method invocation.
17461
17462         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17463         when reading a `)' and Deambiguate_CloseParens () was previously
17464         called.
17465
17466         * expression.cs (ParenthesizedExpression): New class.  This is
17467         just used for the CS0075 test.
17468         (Binary.DoResolve): Check for CS0075.   
17469
17470 2003-07-29  Ravi Pratap  <ravi@ximian.com>
17471
17472         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17473         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17474         reference comparison.
17475
17476         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17477         examine the ReturnType for equality - this is necessary in the
17478         cases of implicit and explicit operators whose signature also
17479         includes the return type.
17480
17481 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
17482
17483         * namespace.cs: Cache the result of the namespace computation,
17484         instead of computing it every time.
17485
17486 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
17487
17488         * decl.cs: Use a global arraylist that we reuse over invocations
17489         to avoid excesive memory consumption.  Reduces memory usage on an
17490         mcs compile by one meg (45 average).
17491
17492         * typemanager.cs (LookupTypeReflection): In .NET pointers are
17493         private, work around that.
17494
17495 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
17496
17497         * literal.cs (IntLiteral): Define Zero and One static literals. 
17498
17499         * cs-parser.jay (integer_literal): use static literals to reduce
17500         memory usage for the most used literals (0, 1 and -1).  211kb
17501         reduced in memory usage.
17502
17503         Replace all calls to `new ArrayList' with `new
17504         ArrayList(4)' which is a good average number for most allocations,
17505         and also requires only 16 bytes of memory for its buffer by
17506         default. 
17507
17508         This reduced MCS memory usage in seven megabytes for the RSS after
17509         bootstrapping.
17510
17511 2003-07-28  Ravi Pratap  <ravi@ximian.com>
17512
17513         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17514         handle params methods the correct way by forming only one
17515         applicable set with params and normal methods in them. Earlier we
17516         were looking at params methods only if we found no normal methods
17517         which was not the correct thing to do.
17518
17519         (Invocation.BetterFunction): Take separate arguments indicating
17520         when candidate and the best method are params methods in their
17521         expanded form.
17522
17523         This fixes bugs #43367 and #46199.
17524
17525         * attribute.cs: Documentation updates.
17526
17527         (CheckAttribute): Rename to CheckAttributeTarget.
17528         (GetValidPlaces): Rename to GetValidTargets.
17529
17530         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17531         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17532
17533         Fixes bug #44468.
17534
17535 2003-07-28  Martin Baulig  <martin@ximian.com>
17536
17537         * class.cs (TypeContainer.DefineMembers): Use the base type's full
17538         name when looking up the base class of a nested class.  Fixes #46977.
17539
17540 2003-07-26  Martin Baulig  <martin@ximian.com>
17541
17542         * expression.cs (Indexers.Indexer): New nested struct; contains
17543         getter, setter and the indexer's type.
17544         (Indexers.Properties): This is now an ArrayList of
17545         Indexers.Indexer's.
17546         (IndexerAccess.DoResolveLValue): Correctly set the type if the
17547         indexer doesn't have any getters.
17548
17549         * assign.cs (Assign.DoResolve): Also do the implicit conversions
17550         for embedded property and indexer assignments.
17551
17552 2003-07-26  Martin Baulig  <martin@ximian.com>
17553
17554         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17555         preprocessor directive is not the first non-whitespace character
17556         on a line.
17557
17558 2003-07-26  Martin Baulig  <martin@ximian.com>
17559
17560         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17561         namespace parsing, follow the spec more closely.
17562
17563         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17564         NamespaceEntry.Lookup().
17565
17566 2003-07-25  Martin Baulig  <martin@ximian.com>
17567
17568         * MethodCore.cs (OverridesSomething): New public field; it's set
17569         from TypeContainer.DefineMembers if this method overrides
17570         something (which doesn't need to be a method).  Fix #39462.
17571
17572 2003-07-25  Ravi Pratap  <ravi@ximian.com>
17573
17574         * typemanager.cs (GetMembers): Ensure that the list of members is
17575         reversed. This keeps things in sync.
17576
17577         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17578         find an AttributeUsage attribute.
17579
17580         * expression.cs (Invocation.OverloadResolve): Perform the check
17581         which disallows Invoke to be directly called on a Delegate.
17582
17583         (Error_InvokeOnDelegate): Report error cs1533.
17584
17585 2003-07-25  Martin Baulig  <martin@ximian.com>
17586
17587         * expression.cs (Indexers.GetIndexersForType): Only look in the
17588         interface hierarchy if the requested type is already an
17589         interface.  Fixes #46788 while keeping #46502 fixed.
17590
17591 2003-07-25  Martin Baulig  <martin@ximian.com>
17592
17593         * class.cs (TypeContainer.DefineMembers): Check whether all
17594         readonly fields have been assigned and report warning CS0649 if
17595         not.
17596
17597         * statement.cs (LocalInfo.IsFixed): Always return true if this is
17598         a valuetype.
17599
17600 2003-07-24  Ravi Pratap  <ravi@ximian.com>
17601
17602         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17603         returned from GetMethods to make things consistent with the
17604         assumptions MCS makes about ordering of methods.
17605
17606         This should comprehensively fix bug #45127 and it does :-)
17607
17608         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17609         ordering is actually reverse.
17610
17611         * Clean up some debug messages I left lying around.
17612
17613         * interface.cs (Populate*): Get rid of code which emits attributes
17614         since the stage in which we emit attributes is the 'Emit' stage,
17615         not the define stage.
17616
17617         (Emit): Move attribute emission for interface members here.
17618
17619 2003-07-22  Ravi Pratap  <ravi@ximian.com>
17620
17621         * expression.cs (Invocation.OverloadResolve): Follow the spec more
17622         closely: we eliminate methods in base types when we have an
17623         applicable method in a top-level type.
17624
17625         Please see section 14.5.5.1 for an exact description of what goes
17626         on. 
17627
17628         This fixes bug #45127 and a host of other related to corlib compilation.
17629
17630         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17631         array is the method corresponding to the top-level type (this is
17632         because of the changes made to icall.c) so we change this
17633         accordingly.
17634
17635         (MethodGroupExpr.Name): This too.
17636
17637         * typemanager.cs (GetElementType): New method which does the right
17638         thing when compiling corlib. 
17639
17640         * everywhere: Make use of the above in the relevant places.
17641
17642 2003-07-22  Martin Baulig  <martin@ximian.com>
17643
17644         * cs-parser.jay (invocation_expression): Moved
17645         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17646         `cast_expression', but create a InvocationOrCast which later
17647         resolves to either an Invocation or a Cast.
17648
17649         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17650         method; call this before EmitStatement() to make sure that this
17651         expression can be used as a statement.
17652
17653         * expression.cs (InvocationOrCast): New class; resolves to either
17654         an Invocation or a Cast.
17655
17656         * statement.cs (StatementExpression): Call ResolveStatement() on
17657         the ExpressionStatement before emitting it.
17658
17659 2003-07-21  Martin Baulig  <martin@ximian.com>
17660
17661         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17662         `ref' and `out' attributes match; fixes #46220.
17663         (MemberAccess.ResolveMemberAccess): You can't reference a type
17664         through an expression; fixes #33180.
17665         (Indexers.GetIndexersForType): Don't return the indexers from
17666         interfaces the class implements; fixes #46502.
17667
17668 2003-07-21  Martin Baulig  <martin@ximian.com>
17669
17670         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17671         CS0661 checks; fixes bug #30442.
17672
17673 2003-07-21  Martin Baulig  <martin@ximian.com>
17674
17675         * decl.cs (AdditionResult): Added `Error'.
17676
17677         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17678
17679         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17680         makes cs0031.cs actually work.
17681
17682 2003-07-20  Martin Baulig  <martin@ximian.com>
17683
17684         * namespace.cs: Fixed that bug which caused a crash when compiling
17685         the debugger's GUI.
17686
17687 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
17688
17689         * typemanager.cs (LookupTypeReflection): Never expose types which
17690         are NotPublic, NestedPrivate, NestedAssembly, or
17691         NestedFamANDAssem.  We used to return these, and later do a check
17692         that would report a meaningful error, but the problem is that we
17693         would not get the real match, if there was a name override.
17694
17695 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
17696
17697         * namespace.cs (Namespace, Name): Do not compute the namespace
17698         name dynamically, compute it in the constructor.  This reduced
17699         memory usage by 1697 KB.
17700
17701         * driver.cs: Use --pause to pause at the end.
17702
17703 2003-07-17  Peter Williams  <peter@newton.cx>
17704
17705         * Makefile: Change the name of the test target so that it doesn't
17706         conflict with the recursive test target.
17707
17708 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
17709
17710         * expression.cs (LocalVariableReference.Emit, EmitAssign,
17711         AddressOf): Do not use EmitThis, that was wrong, use the actual
17712         this pointer.
17713
17714 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
17715
17716         * class.cs (MethodData.Define): While checking if a method is an
17717         interface implementation, improve the test: If we are not public
17718         (use new test here: use the computed MethodAttributes directly,
17719         instead of the parsed modifier flags) check if the `implementing'
17720         method comes from an interface or not.
17721
17722         * pending.cs (VerifyPendingMethods): Slightly better error
17723         message.
17724
17725         * makefile: add test target that does the mcs bootstrap.
17726
17727 2003-07-16  Ravi Pratap  <ravi@ximian.com>
17728
17729         * interface.cs (Define): Do nothing here since there are no
17730         members to populate etc. Move the attribute emission out of here
17731         since this was just totally the wrong place to put it. Attribute
17732         application happens during the 'Emit' phase, not in the 'Define'
17733         phase.
17734
17735         (Emit): Add this method and move the attribute emission here
17736
17737         * rootcontext.cs (EmitCode): Call the Emit method on interface
17738         types too.
17739
17740 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17741
17742         * expression.cs (OverloadResolve): Report error only if Location
17743         is not 'Null' which means that there was a probe going on.
17744
17745 2003-07-14  Martin Baulig  <martin@ximian.com>
17746
17747         * expression.cs (ConditionalLogicalOperator): New public class to
17748         implement user defined conditional logical operators.
17749         This is section 14.11.2 in the spec and bug #40505.
17750
17751 2003-07-14  Martin Baulig  <martin@ximian.com>
17752
17753         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17754
17755 2003-07-14  Martin Baulig  <martin@ximian.com>
17756
17757         * codegen.cs (EmitContext.InFixedInitializer): New public field.
17758
17759         * ecore.cs (IVariable.VerifyFixed): New interface method.
17760
17761         * expression.cs (Unary.ResolveOperator): When resolving the `&'
17762         operator, check whether the variable is actually fixed.  Fixes bug
17763         #36055.  Set a variable definitely assigned when taking its
17764         address as required by the spec.
17765
17766         * statement.cs (LocalInfo.IsFixed): New field.
17767         (LocalInfo.MakePinned): Set `IsFixed' to true.
17768
17769 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17770
17771         * attribute.cs (Attribute.Resolve): While doing a Member lookup
17772         for .ctors, ensure that we only ask for members declared in the
17773         attribute type (BindingFlags.DeclaredOnly).
17774
17775         Fixes bug #43632.
17776
17777         * expression.cs (Error_WrongNumArguments): Report error 1501
17778         correctly the way CSC does.
17779
17780 2003-07-13  Martin Baulig  <martin@ximian.com>
17781
17782         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17783         lookup on the fully qualified name, to make things like "X.X" work
17784         where "X.X" is a fully qualified type name, but we also have a
17785         namespace "X" in the using list.  Fixes #41975.
17786
17787 2003-07-13  Martin Baulig  <martin@ximian.com>
17788
17789         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17790         function. If we're a CompoundAssign, we need to create an embedded
17791         CompoundAssign, not an embedded Assign.
17792         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17793         Fixes #45854.
17794
17795 2003-07-13  Martin Baulig  <martin@ximian.com>
17796
17797         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17798         work to fix bug #46088.
17799
17800 2003-07-13  Ravi Pratap <ravi@ximian.com>
17801
17802         * class.cs (Operator.Emit): Do not emit attributes here - it is
17803         taken care of by the Method class that we delegate too. This takes
17804         care of bug #45876.
17805
17806 2003-07-10  Martin Baulig  <martin@ximian.com>
17807
17808         * expression.cs (TypeOfVoid): New class.
17809         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
17810
17811 2003-07-10  Martin Baulig  <martin@ximian.com>
17812
17813         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17814         bug #35957.
17815
17816 2003-07-10  Martin Baulig  <martin@ximian.com>
17817
17818         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17819         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17820
17821         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17822
17823         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17824
17825 2003-07-10  Martin Baulig  <martin@ximian.com>
17826
17827         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17828         of decimal.  Fixes #42850.
17829
17830         NOTE: I also fixed the created byte blob, but this doesn't work on
17831         the MS runtime and csc never produces any byte blobs for decimal
17832         arrays.
17833
17834 2003-07-10  Martin Baulig  <martin@ximian.com>
17835
17836         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17837         structs; fixes #32068.
17838         (Block.AddChildVariableNames): Fixed #44302.
17839
17840 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17841
17842         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17843
17844 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17845
17846         * attribute.cs: And this test is onger needed.
17847
17848 2003-07-08  Martin Baulig  <martin@ximian.com>
17849
17850         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17851         inaccessible types.  Fixes #36313.
17852
17853         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17854
17855         * namespace.cs (NamespaceEntry): Create implicit entries for all
17856         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17857         implicit entries for N1.N2 and N1.
17858
17859 2003-07-08  Martin Baulig  <martin@ximian.com>
17860
17861         Rewrote the handling of namespaces to fix a lot of the issues
17862         wrt. `using' aliases etc.
17863
17864         * namespace.cs (Namespace): Splitted this class into a
17865         per-assembly `Namespace' and a per-file `NamespaceEntry'.
17866
17867         * typemanager.cs (TypeManager.IsNamespace): Removed.
17868         (TypeManager.ComputeNamespaces): Only compute namespaces from
17869         loaded assemblies here, not the namespaces from the assembly we're
17870         currently compiling.
17871
17872 2003-07-08  Martin Baulig  <martin@ximian.com>
17873
17874         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17875
17876 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17877
17878         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17879         already fixed it.  
17880
17881         I thought about the memory savings here, but LookupTypeReflection
17882         is used under already very constrained scenarios.  Compiling
17883         corlib or mcs only exposes one hit, so it would not really reduce
17884         any memory consumption.
17885
17886 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17887
17888         * typemanager.cs: fixes bug #45889 by only adding public types from
17889         other assemblies to the list of known types.
17890
17891 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17892
17893         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17894         on the type we resolved.
17895
17896 2003-07-05  Martin Baulig  <martin@ximian.com>
17897
17898         * pending.cs (PendingImplementation.ParentImplements): Don't
17899         create the proxy if the parent is abstract.
17900
17901         * class.cs (TypeContainer.DefineIndexers): Process explicit
17902         interface implementations first.  Fixes #37714.
17903
17904 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
17905
17906         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17907         defined recursively;  but since we modify the input parameters
17908         (left is set to `this' temporarily), we reset this value if the
17909         left_is_explicit is false, which gives the original semantics to
17910         the code.  
17911
17912         * literal.cs (NullPointer): new class used to represent a null
17913         literal in a pointer context.
17914
17915         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17916         type is a pointer, use a NullPointer object instead of a
17917         NullLiteral.   Closes 43687
17918
17919         (ExplicitConversion): Convert pointer values using
17920         the conv opcode to the proper type.
17921
17922         * ecore.cs (New): change ValueTypeVariable property into a method,
17923         that returns whether the valuetype is suitable for being used.
17924
17925         * expression.cs (Binary.DoNumericPromotions): Only return if we
17926         the int constant was a valid uint, and we can return both left and
17927         right as uints.  If not, we continue processing, to trigger the
17928         type conversion.  This fixes 39018.
17929
17930         * statement.cs (Block.EmitMeta): During constant resolution, set
17931         the CurrentBlock property on the emitcontext, so that we resolve
17932         constants propertly.
17933
17934 2003-07-02  Martin Baulig  <martin@ximian.com>
17935
17936         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17937         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17938
17939         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17940         than emitting it here.
17941
17942         * statement.cs: Fixed some more flow analysis bugs.
17943
17944 2003-07-02  Martin Baulig  <martin@ximian.com>
17945
17946         * class.cs (MethodData.Define): When implementing interface
17947         methods, set Final unless we're Virtual.
17948
17949         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17950         check work for interface methods.
17951
17952 2003-07-01  Martin Baulig  <martin@ximian.com>
17953
17954         * ecore.cs (EmitContext.This): Replaced this property with a
17955         GetThis() method which takes a Location argument.  This ensures
17956         that we get the correct error location for a CS0188.
17957
17958 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
17959
17960         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17961         ImplicitStandardConversion.
17962
17963         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17964
17965 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
17966
17967         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17968         optimization.
17969
17970 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
17971
17972         * class.cs (Constructor.Define): Turn off initlocals for unsafe
17973         constructors.
17974
17975         (MethodData.Define): Turn off initlocals for unsafe methods.
17976
17977 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
17978
17979         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17980         complete;  Fixes #37521.
17981
17982         * delegate.cs: Use Modifiers.TypeAttr to compute the
17983         TypeAttributes, instead of rolling our own.  This makes the flags
17984         correct for the delegates.
17985
17986 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
17987
17988         * class.cs (Constructor.Define): Set the private flag for static
17989         constructors as well.
17990
17991         * cs-parser.jay (statement_expression): Set the return value to
17992         null, to avoid a crash when we catch an error.
17993
17994 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
17995
17996         * cs-parser.jay: Applied patch from Jackson that adds support for
17997         extern and unsafe modifiers to destructor declarations.
17998
17999         * expression.cs: Report error 21 if the user is trying to index a
18000         System.Array.
18001
18002         * driver.cs: Add an error message, suggested by the bug report.
18003
18004         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
18005         if we do not have a ": this ()" constructor initializer.  Fixes 45149
18006
18007 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
18008
18009         * namespace.cs: Add some information to reduce FAQs.
18010
18011 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
18012
18013         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
18014         underlying enumeration types.  Fixes #43915.
18015
18016         * expression.cs: Treat ushort/short as legal values to be used in
18017         bitwise operations.
18018
18019 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
18020
18021         * delegate.cs: transfer custom attributes for paramenters from
18022         the delegate declaration to Invoke and BeginInvoke.
18023
18024 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
18025
18026         * attribute.cs: handle custom marshalers and emit marshal info
18027         for fields, too.
18028
18029 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
18030
18031         * makefile.gnu: Added anonymous.cs to the compiler sources.
18032
18033 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
18034
18035         * iterators.cs: Change the name of the proxy class to include two
18036         underscores.
18037
18038         * cs-parser.jay: Update grammar to include anonymous methods.
18039
18040         * anonymous.cs: new file.
18041
18042 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
18043
18044         * class.cs (Field.Define): Add missing test for pointers and
18045         safety. 
18046
18047 2003-05-27  Ravi Pratap  <ravi@ximian.com>
18048
18049         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
18050         we use the stobj opcode.
18051
18052         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
18053         since it wasn't the correct fix. 
18054
18055         It still is puzzling that we are required to use stobj for IntPtr
18056         which seems to be a ValueType.
18057
18058 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
18059
18060         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
18061         during regular simple name resolution.   Now, the trick is that
18062         instead of returning for processing the simplename, we do a
18063         TypeManager.LookupType (ie, a rooted lookup as opposed to a
18064         contextual lookup type).   If a match is found, return that, if
18065         not, return for further composition.
18066
18067         This fixes long-standing 30485.
18068
18069         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18070         using the address to initialize an object, do an Stobj instead of
18071         using the regular Stelem.
18072
18073         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
18074         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
18075         Because if we are a BaseIndexerAccess that value will be true.
18076         Fixes 43643.
18077
18078         * statement.cs (GotoCase.Resolve): Return after reporting an
18079         error, do not attempt to continue. 
18080
18081         * expression.cs (PointerArithmetic.Emit): If our operand is a
18082         long, convert our constants to match the operand before
18083         multiplying.  Convert to I type before adding.   Fixes 43670.
18084
18085 2003-05-14  Ravi Pratap  <ravi@ximian.com>
18086
18087         * enum.cs (ImplicitConversionExists) : Rename to
18088         ImplicitEnumConversionExists to remove ambiguity. 
18089
18090         * ecore.cs (NullCast): New type of cast expression class which
18091         basically is very similar to EmptyCast with the difference being
18092         it still is a constant since it is used only to cast a null to
18093         something else
18094         (eg. (string) null)
18095
18096         * convert.cs (ImplicitReferenceConversion): When casting a null
18097         literal, we return a NullCast.
18098
18099         * literal.cs (NullLiteralTyped): Remove - I don't see why this
18100         should be around anymore.
18101
18102         The renaming (reported was slightly wrong). Corrections:
18103
18104         ConvertImplicitStandard -> ImplicitConversionStandard
18105         ConvertExplicitStandard -> ExplicitConversionStandard
18106
18107         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
18108         before passing them in !
18109
18110         * convert.cs (ImplicitConversionStandard): When comparing for
18111         equal expr and target types, ensure that expr is not a
18112         NullLiteral.
18113
18114         In general, we must not be checking (expr_type ==
18115         target_type) in the top level conversion methods
18116         (ImplicitConversion, ExplicitConversion etc). This checking is
18117         done in the methods that they delegate to.
18118
18119 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
18120
18121         * convert.cs: Move Error_CannotConvertType,
18122         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
18123         ImplicitNumericConversion, ImplicitConversionExists,
18124         ImplicitUserConversionExists, StandardConversionExists,
18125         FindMostEncompassedType, FindMostSpecificSource,
18126         FindMostSpecificTarget, ImplicitUserConversion,
18127         ExplicitUserConversion, GetConversionOperators,
18128         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
18129         TryImplicitIntConversion, Error_CannotConvertImplicit,
18130         ConvertImplicitRequired, ConvertNumericExplicit,
18131         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
18132         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
18133         its own file.
18134
18135         Perform the following renames:
18136
18137         StandardConversionExists -> ImplicitStandardConversionExists
18138         ConvertImplicit -> ImplicitConversion
18139         ConvertImplicitStandard -> ImplicitStandardConversion
18140         TryImplicitIntConversion -> ImplicitIntConversion
18141         ConvertImplicitRequired -> ImplicitConversionRequired
18142         ConvertNumericExplicit -> ExplicitNumericConversion
18143         ConvertReferenceExplicit -> ExplicitReferenceConversion
18144         ConvertExplicit -> ExplicitConversion
18145         ConvertExplicitStandard -> ExplicitStandardConversion
18146
18147 2003-05-19  Martin Baulig  <martin@ximian.com>
18148
18149         * statement.cs (TypeInfo.StructInfo): Made this type protected.
18150         (TypeInfo): Added support for structs having structs as fields.
18151
18152         * ecore.cs (FieldExpr): Implement IVariable.
18153         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
18154         VariableInfo for the field.
18155
18156 2003-05-18  Martin Baulig  <martin@ximian.com>
18157
18158         * expression.cs (This.DoResolve): Report a CS0027 if we're
18159         emitting a field initializer.
18160
18161 2003-05-18  Martin Baulig  <martin@ximian.com>
18162
18163         * expression.cs (This.ResolveBase): New public function.
18164         (This.DoResolve): Check for CS0188.
18165
18166         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
18167         This.Resolve().
18168
18169         * ecore.cs (MethodGroupExpr.DoResolve): Set the
18170         `instance_expression' to null if we don't have any non-static
18171         methods.
18172
18173 2003-05-18  Martin Baulig  <martin@ximian.com>
18174
18175         Reworked the way how local variables and parameters are handled by
18176         the flow analysis code.
18177
18178         * statement.cs (TypeInfo, VariableMap): New public classes.
18179         (VariableInfo): New public class.  This is now responsible for
18180         checking whether a variable has been assigned.  It is used for
18181         parameters and local variables.
18182         (Block.EmitMeta): Take the InternalParameters as argument; compute
18183         the layout of the flow vectors here.
18184         (Block.LocalMap, Block.ParameterMap): New public properties.
18185         (FlowBranching): The .ctor doesn't get the InternalParameters
18186         anymore since Block.EmitMeta() now computes the layout of the flow
18187         vector.
18188         (MyStructInfo): This class is now known as `StructInfo' and nested
18189         in `TypeInfo'; we don't access this directly anymore.
18190
18191         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
18192         property and removed IsAssigned(), IsFieldAssigned(),
18193         SetAssigned() and SetFieldAssigned(); we now call them on the
18194         VariableInfo so we don't need to duplicate this code everywhere.
18195
18196         * expression.cs (ParameterReference): Added `Block block' argument
18197         to the .ctor.
18198         (LocalVariableReference, ParameterReference, This): The new
18199         VariableInfo class is now responsible for all the definite
18200         assignment stuff.
18201
18202         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
18203         IsParameterAssigned, SetParameterAssigned): Removed.
18204
18205 2003-05-18  Martin Baulig  <martin@ximian.com>
18206
18207         * typemanager.cs (InitCoreTypes): Try calling
18208         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
18209         the 3-args-version.  Corlib now also needs our `void_type'.
18210         (GetMethod): Added overloaded version which takes an optional
18211         `bool report_errors' to allow lookups of optional methods.
18212
18213 2003-05-12  Martin Baulig  <martin@ximian.com>
18214
18215         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
18216         only used for locals and not for parameters.
18217
18218 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
18219
18220         * support.cs (InternalParameters.ParameterType): Return the
18221         ExternalType of the parameter.
18222
18223         * parameter.cs (Parameter.ExternalType): drop the two arguments,
18224         they were unused.
18225
18226 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
18227
18228         * class.cs (MethodData.Define): Do not set the `newslot' on
18229         interface members, if they are also flagged as "override".
18230
18231         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
18232         better code for ++i and i++.  This only works for static fields
18233         and local variables.
18234
18235         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
18236         want to pull the DeclSpace out of the builder_to_declspace instead
18237         of the TypeBuilder (like in TypeContainer.FindMembers).
18238
18239         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
18240         instead of LookupTypeContainer.  Fixes the crash on .NET for
18241         looking up interface members.
18242
18243         * const.cs: Create our own emit context during the Definition
18244         stage, so that constants are evaluated in the proper context, when
18245         a recursive definition happens.
18246
18247 2003-05-11  Martin Baulig  <martin@ximian.com>
18248
18249         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
18250         new block for a switch section.
18251         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
18252         the adding/lookup in the switch block.  Fixes #39828.
18253
18254 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
18255
18256         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
18257         functionality: I needed to convert the data after I had performed
18258         the add/sub operation into the operands type size.
18259
18260         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
18261         pass the type for the box operation, otherwise the resulting
18262         object would have been of type object.
18263
18264         (BoxedCast): Add constructor to specify the type to box as.
18265
18266 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
18267
18268         * iterators.cs: I was reusing the `count' variable inadvertently,
18269         take steps to not allow this to happen.
18270
18271 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
18272
18273         * attribute.cs (Attribute.Resolve): Params attributes are encoded
18274         by creating an array at the point where the params starts and
18275         putting all those arguments there, then adjusting the size of the
18276         array.
18277
18278 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
18279
18280         * expression.cs (New.AddressOf): Implement interface
18281         IMemoryLocation.  This is used when the `new' operator is used in
18282         the context of an invocation to a method on a value type.
18283
18284         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
18285         example. 
18286
18287         * namespace.cs: Also check the using aliases here.
18288
18289         * driver.cs: Move the test for using validity after the types have
18290         been entered, so we do a single pass that also includes the using
18291         aliases. 
18292
18293         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
18294         in the regular case.   CreateSiblingForFinally is doing extra
18295         error checking.
18296
18297         * attribute.cs (GetAttributeArgumentExpression): Store the result
18298         on an out value, and use the return value to indicate failure
18299         instead of using null (which is a valid return for Constant.GetValue).
18300
18301         * statement.cs: Perform the analysis flow for the increment
18302         portion after the statement, because this will be the real flow of
18303         execution.  Fixes #42385
18304
18305         * codegen.cs (EmitContext.EmitArgument,
18306         EmitContext.EmitStoreArgument): New helper functions when the
18307         RemapToProxy flag is set.
18308
18309         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
18310         function.
18311
18312         Add support for remapping parameters. 
18313
18314         * iterators.cs: Propagate parameter values;  Store parameter
18315         values in the proxy classes.
18316
18317 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
18318
18319         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
18320         need a proxy reference;  I do not know what I was thinking
18321
18322         * cs-parser.jay (constructor_initializer): catch another error,
18323         and display nice message.
18324
18325         (field_declaration): catch void field declaration
18326         to flag a better error. 
18327
18328         * class.cs (MemberBase.CheckBase): Report an error instead of a
18329         warning if a new protected member is declared in a struct. 
18330         (Field.Define): catch the error of readonly/volatile.
18331
18332         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18333
18334         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
18335         volatile variable is taken
18336
18337 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
18338
18339         * statement.cs (Fixed.Resolve): Report an error if we are not in
18340         an unsafe context.
18341
18342 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
18343
18344         * typemanager.cs: reuse the code that handles type clashes for
18345         delegates and enumerations.
18346
18347         * class.cs (Report28): Always report.
18348
18349         * expression.cs (EncodeAsAttribute): Allow nulls here.
18350
18351 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
18352
18353         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18354         the functionality for testing whether an expression is valid for
18355         an attribute here.  Also handle the case of arrays of elements
18356         being stored. 
18357
18358         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18359         encoding a linear array into an array of objects that are suitable
18360         to be passed to an CustomAttributeBuilder.
18361
18362         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18363
18364         * ecore.cs: (FieldExpr): Handle field remapping here.
18365
18366         * iteratators.cs: Pass the instance variable (if the method is an
18367         instance method) to the constructors, so we can access the field
18368         variables on the class.
18369
18370         TODO: Test this with structs.  I think the THIS variable on
18371         structs might have to be a pointer, and not a refenrece
18372
18373 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
18374
18375         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18376         local variables to fields in a proxy class.
18377
18378         * iterators.cs (PopulateProxy): Rename our internal fields to
18379         <XXX>.  
18380         Create a <THIS> field if we are an instance method, so we can
18381         reference our parent container variables.
18382         (MapVariable): Called back from the EmitContext code to enter a
18383         new variable to field mapping into the proxy class (we just create
18384         a FieldBuilder).
18385
18386         * expression.cs
18387         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18388         for using the remapped locals to fields.
18389
18390         I placed the code here, because that gives the same semantics to
18391         local variables, and only changes the Emit code.
18392
18393         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18394         statements inside iterators.
18395         (VariableInfo): Add a FieldBuilder for the cases when we are
18396         remapping local variables to fields in a proxy class
18397
18398         * ecore.cs (SimpleNameResolve): Avoid testing two times for
18399         current_block != null.
18400
18401         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18402         not cope with strings, as it has been moved to the
18403         TableSwitchEmit.  Fixed bug in switch generation.
18404
18405         * expression.cs (New.DoResolve): Provide more context for the user
18406         when reporting an error.
18407
18408         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18409         pointers. 
18410
18411         * expression.cs (MemberAccess.DoResolve): When we get a type back,
18412         check the permissions for it.  Note than in a type-resolution
18413         context the check was already present in DeclSpace.ResolveType,
18414         but was missing from the MemberAccess.
18415
18416         (ArrayCreation.CheckIndices): warn if the user has
18417         more nested levels of expressions, but there are no more
18418         dimensions specified.  Avoids crash on bug 41906.
18419
18420 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
18421
18422         * statement.cs (Block): replace Implicit bool, for a generic
18423         flags.   
18424         New flag: `Unchecked'.  This is used during the EmitMeta phase
18425         (which is out-of-line with the regular Resolve/Emit process for a
18426         statement, as this is done ahead of time, but still gets a chance
18427         to call constant resolve).
18428
18429         (Block.Flags): new enum for adding a new flag.
18430
18431         (Block.EmitMeta): track the state of unchecked.
18432
18433         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18434         to enable constant resolution to work there as well.
18435
18436 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
18437
18438         * typemanager.cs (ienumerable_type): Also look up
18439         System.Collections.IEnumerable. 
18440
18441 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
18442
18443         TODO: Test more than one conditional per method.
18444
18445         * class.cs (Indexer.Define): Report the location where the user is
18446         referencing the unsupported feature.
18447
18448         (MethodData): Overload the use of `conditionals' to
18449         minimize the creation of needless ArrayLists.   This saves roughly
18450         212kb on my machine.
18451
18452         (Method): Implement the new IIteratorContainer interface.
18453         (Method.SetYields): Implement the method by setting the ModFlags
18454         to contain METHOD_YIELDS.
18455
18456         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18457         which just got set to null.
18458
18459         * iterators.cs: New file.
18460
18461         (Yield, YieldBreak): New statements.
18462
18463         * statement.cs (Return.Resolve): Flag an error if we are used in
18464         an iterator method.
18465
18466         * codegen.cs (InIterator): New flag set if the code is being
18467         compiled in an iterator method.
18468
18469         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
18470         internal modifier, and we just use it to avoid adding extra
18471         fields, as this is seldom used.  
18472
18473         * cs-parser.jay: Add yield_statement (yield and yield break).
18474
18475         * driver.cs: New flag -v2 to turn on version 2 features. 
18476
18477         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18478         hashtable when v2 is enabled.
18479
18480 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
18481
18482         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18483         there is already a namespace defined with this name.
18484
18485         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18486         people upgraded their corlibs.
18487
18488         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18489         always use fully qualified types, no need to use the compiler
18490         front end.
18491
18492         (TypeManager.IsNamespace): Use binarysearch.
18493
18494         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18495         AddDelegate): I did not quite use the new IsValid API properly: I
18496         have to pass the short-name and the fullname.  I was passing only
18497         the basename instead of the fullname sometimes. 
18498
18499         (TypeContainer.DefineType): call NamespaceClash.
18500
18501         * interface.cs (Interface.DefineType): use NamespaceClash before
18502         defining the type.
18503
18504         * delegate.cs (Delegate.DefineType): use NamespaceClash before
18505         defining the type.
18506
18507         * enum.cs: (Enum.DefineType): use NamespaceClash before
18508         defining the type.
18509
18510         * typemanager.cs (: 3-line patch that gives us some tasty 11%
18511         speed increase.  First, use the negative_hits cache when we get a
18512         negative.  Second, add the type with its full original name
18513         instead of the new . and + encoded name (reflection uses + to
18514         separate type from a nested type).  Use LookupTypeReflection
18515         directly which bypasses the type->name hashtable (that we already
18516         know does not contain the type.
18517
18518         * decl.cs (DeclSpace.ResolveTypeExpr): track the
18519         location/container type. 
18520
18521         * driver.cs: When passing utf8, use directly the UTF8Encoding.
18522
18523 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
18524
18525         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18526
18527         * delegate.cs (NewDelegate.Resolve): Test whether an instance
18528         method is being referenced in the method group from a static
18529         context, and report error 120 if so.
18530
18531         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18532         Error118. 
18533
18534         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18535         is created, we create the A namespace).
18536
18537         * cs-parser.jay: A namespace also introduces a DeclarationFound.
18538         Fixes #41591
18539
18540 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
18541
18542         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18543         invocation to ModuleBuilder.GetType with the same values will
18544         return a new type instance, so we need to cache its return
18545         values. 
18546
18547         * expression.cs (Binary.ResolveOperator): Only allow the compare
18548         operators on enums if they are of the same type.
18549
18550         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18551         types of ValueType on their own case.  Before we were giving them
18552         the same treatment as objects.
18553
18554         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18555         fullname.  Short name is used to compare against container name.
18556         Fullname is used to check against defined namespace names.
18557
18558         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18559         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18560
18561         (Method.CheckBase): Call parent.
18562         (MemberBase.CheckBase): Check for protected members on sealed
18563         classes.
18564         (PropertyBase.CheckBase): Call parent.
18565         (Field.Define): Call parent.
18566
18567         * report.cs: Negative error codes are now mapped to 8000 - code,
18568         so that the display is render more nicely.
18569
18570         * typemanager.cs: Do not use try/catch, instead report a regular
18571         error. 
18572
18573         (GetPointerType, GetReferenceType): These methods provide
18574         mechanisms to obtain the T* and T& from a T.  We had the code
18575         previously scattered around the code base, and it also used
18576         TypeManager.LookupType that would go through plenty of caches.
18577         This one goes directly to the type source.
18578
18579         In some places we did the Type.GetType followed by
18580         ModuleBuilder.GetType, but not in others, so this unifies the
18581         processing as well.
18582
18583         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18584         statements now that we have namespace information.
18585
18586         * typemanager.cs (IsNamespace): New method, returns whether the
18587         string presented is a namespace or not.
18588
18589         (ComputeNamespaces): New public entry point, computes the list of
18590         available namespaces, using the GetNamespaces API call in Mono, or
18591         the slower version in MS.NET.   
18592
18593         Now before we start the semantic analysis phase, we have a
18594         complete list of namespaces including everything that the user has
18595         provided.
18596
18597         Deleted old code to cache namespaces in .nsc files.
18598
18599 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
18600
18601         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18602         class/struct location definition Location for the implicit
18603         constructor location.
18604
18605         (Operator.Define): Use the location of the operator for the
18606         implicit Method definition.
18607
18608         (Constructor.Emit): use the constructor location for the implicit
18609         base initializer constructor.
18610
18611         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
18612         and the Expression class now contains two new methods:
18613
18614         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
18615         isolate type lookup from the rest of the resolution process.
18616
18617         Since we use Expressions to hold type definitions due to the way
18618         we parse the input we have historically overloaded Resolve to
18619         perform the Type lookups if a special flag is passed.  Now this is
18620         eliminated and two methods take their place. 
18621
18622         The differences in the two methods between xStep and xTerminal is
18623         that xStep is involved in our current lookup system that uses
18624         SimpleNames to compose a name, while xTerminal is used just to
18625         catch the case where the simplename lookup failed.
18626
18627 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
18628
18629         * expression.cs (ResolveMemberAccess): Remove redundant code.
18630         TypeExpr expressions are always born fully resolved.
18631
18632         * interface.cs (PopulateMethod): Do not lookup the types twice.
18633         We were doing it once during SemanticAnalysis and once during
18634         PopulateMethod.
18635
18636         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18637         in local variable type definitions, were being returned as a
18638         SimpleName (we decomposed everything into a string), that is
18639         because primary_expression was being used instead of a type in the
18640         grammar (reduce/reduce conflicts).
18641
18642         The part that was wrong is that we converted the expression into a
18643         string (an oversimplification in one hand, compounded with primary
18644         expressions doing string concatenation).
18645
18646         So things like:
18647
18648         A.B.C [] x;
18649
18650         Would return "A.B.C[]" as a SimpleName.  This stopped things like
18651         using clauses from working on this particular context.  And a type
18652         was being matched directly against "A.B.C[]".
18653
18654         We now use the correct approach, and allow for ComposedCast to be
18655         part of the unary expression.  So the "A.B.C []" become a composed
18656         cast of "A.B.C" (as a nested group of MemberAccess with a
18657         SimpleName at the end) plus the rank composition "[]". 
18658
18659         Also fixes 35567
18660
18661 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
18662
18663         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18664         for the access level checking.
18665
18666         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
18667         `TypeContainer container', because I kept getting confused when I
18668         was debugging this code.
18669
18670         * expression.cs (Indexers): Instead of tracking getters/setters,
18671         we now track them in parallel.  We create one arraylist less, but
18672         most importantly it is possible now for the LValue code to find a
18673         matching get for a set.
18674
18675         (IndexerAccess.DoResolveLValue): Update the code.
18676         GetIndexersForType has been modified already to extract all the
18677         indexers from a type.  The code assumed it did not.
18678
18679         Also make the code set the correct return type for the indexer.
18680         This was fixed a long time ago for properties, but was missing for
18681         indexers.  It used to be void_type.
18682
18683         (Binary.Emit): Test first for doubles instead of
18684         floats, as they are more common.
18685
18686         (Binary.EmitBranchable): Use the .un version of the branch opcodes
18687         when dealing with floats and the <=, >= operators.  This fixes bug
18688         #39314 
18689
18690         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18691         to load the array value by emitting a load on the foreach variable
18692         type.  This was incorrect.  
18693
18694         We now emit the code to load an element using the the array
18695         variable type, and then we emit the conversion operator.
18696
18697         Fixed #40176
18698
18699 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
18700
18701         * attribute.cs: Avoid allocation of ArrayLists in the common case.
18702
18703 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
18704
18705         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18706         test for protection before we test for signatures. 
18707
18708         (MethodSignature.ToString): implement.
18709
18710         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18711         to the case where we reduced into a LongConstant.
18712
18713         * decl.cs (CheckAccessLevel): If the type is an array, we can not
18714         depend on whether the information is acurrate, because the
18715         Microsoft runtime will always claim that the array type is public,
18716         regardless of the real state.
18717
18718         If the type is a pointer, another problem happens: the type is
18719         reported as non-public in Microsoft.  
18720
18721         In both cases we have to call CheckAccessLevel recursively with
18722         the underlying type as the argument to be tested.
18723
18724 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
18725
18726         * assign.cs (Assign.Emit): If we are dealing with a compound
18727         assignment expression, we should use the code path that stores the
18728         intermediate result in a temporary value.  This fixes #40903.
18729
18730         *expression.cs (Indirection.ToString): Provide ToString method for
18731         debugging. 
18732
18733 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
18734
18735         * class.cs: Null out fields holding references to Block objects so
18736         they can be garbage collected.
18737
18738         * expression.cs (OverloadResolve): Remove unused local.
18739
18740 2003-04-07  Martin Baulig  <martin@ximian.com>
18741
18742         * codegen.cs (EmitContext.CurrentFile): New public field.
18743         (EmitContext.Mark): Use the CurrentFile to check whether the
18744         location is in the correct file.
18745         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18746
18747 2003-04-07  Martin Baulig  <martin@ximian.com>
18748
18749         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18750
18751         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18752         location.  [FIXME: The location argument which gets passed to this
18753         method is sometimes wrong!]
18754
18755 2003-04-07  Nick Drochak <ndrochak@gol.com>
18756
18757         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18758
18759 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
18760
18761         * expression.cs (Indirection.EmitAssign): We were using the
18762         temporary, but returning immediately instead of continuing the
18763         EmitAssing flow.
18764
18765 2003-04-06  Martin Baulig  <martin@ximian.com>
18766
18767         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18768         if it's a nested child, but also deriving from the outer class.
18769         See test 190.cs.
18770
18771         * typemanager.cs (IsNestedChildOf): Make this work if it's a
18772         nested child, but also deriving from the outer class.  See
18773         test-190.cs.
18774         (FilterWithClosure): We may access private members of the outer
18775         class if we're a nested child and deriving from the outer class.
18776         (RealMemberLookup): Only set `closure_private_ok' if the
18777         `original_bf' contained BindingFlags.NonPublic.
18778
18779 2003-04-05  Martin Baulig  <martin@ximian.com>
18780
18781         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18782
18783 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
18784
18785         * class.cs (Event.Define): Do not allow abstract events to have
18786         initializers. 
18787
18788 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
18789
18790         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18791         block in event declarations.
18792
18793         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18794         value type, get its address.
18795
18796         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18797         leaving a class on the stack instead of a boolean value (int
18798         0/1).  Change the code so we compare against null, and then the
18799         result against zero.
18800
18801         * class.cs (TypeContainer.GetClassBases): We were checking for the
18802         parent class being sealed too late.
18803
18804         * expression.cs (Binary.Emit): For <= and >= when dealing with
18805         floating point values, use cgt.un and clt.un instead of cgt and
18806         clt alone.
18807
18808 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
18809
18810         * statement.cs: Apply the same optimization as MS: skip the 
18811         GetEnumerator returning an IEnumerator, and use the one returning a 
18812         CharEnumerator instead. This allows us to avoid the try-finally block 
18813         and the boxing.
18814
18815 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
18816
18817         * cs-parser.jay: Attributes cannot be applied to
18818                          namespaces. Fixes #40473
18819
18820 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18821
18822         * class.cs:
18823         (Add*): check if the name is valid using the full name for constants,
18824         fields, properties and events.
18825
18826 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
18827
18828         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18829         char constants to be part of the enumeration.
18830
18831         * expression.cs (Conditional.DoResolve): Add support for operator
18832         true. Implements the missing functionality from 14.12
18833
18834         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18835         operator true/false as required by the spec.
18836
18837         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18838         implicit conversion to boolean.
18839
18840         * statement.cs (Statement.ResolveBoolean): A boolean expression is
18841         also one where the type implements `operator true'. 
18842
18843         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18844         get an expression that will invoke operator true based on an
18845         expression.  
18846
18847         (GetConversionOperators): Removed the hack that called op_True
18848         here.  
18849
18850         (Expression.ResolveBoolean): Move this from Statement.
18851
18852 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
18853
18854         * ecore.cs (FieldExpr): do not allow initialization of initonly
18855         fields on derived classes
18856
18857 2003-03-13  Martin Baulig  <martin@ximian.com>
18858
18859         * statement.cs (Block.Emit): Call ig.BeginScope() and
18860         ig.EndScope() when compiling with debugging info; call
18861         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18862
18863 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
18864
18865         * expression.cs (Indexers): Do not construct immediately, allow
18866         for new members to be appended as we go.  Fixes 38143
18867
18868 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18869
18870         * expression.cs: save/restore context when resolving an unchecked
18871         expression.
18872
18873 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
18874
18875         * cfold.cs: Catch division by zero in modulus operator during
18876         constant folding.
18877
18878 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
18879
18880         * interface.cs (Interface.DefineMembers): Avoid defining members
18881         twice. 
18882
18883 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
18884
18885         * driver.cs: handle the +/- options for -noconfig
18886
18887         * statement.cs (Unckeched.Resolve): Also track the state of
18888         unchecked in the Resolve phase.
18889
18890 2003-02-27  Martin Baulig  <martin@ximian.com>
18891
18892         * ecore.cs (Expression.MemberLookup): Don't create a
18893         MethodGroupExpr for something which is not a method.  Fixes #38291.
18894
18895 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
18896
18897         * class.cs (MemberBase.CheckParameters): Also check that the type
18898         is unmanaged if it is a pointer.
18899
18900         * expression.cs (SizeOf.Resolve): Add location information.
18901
18902         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18903         a managed type is declared.
18904
18905         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18906         parameter modifiers as well.  Fixes bug 38606
18907
18908         * class.cs: Very sad.  Am backing out the speed up changes
18909         introduced by the ArrayList -> Array in the TypeContainer, as they
18910         were not actually that much faster, and introduced a bug (no error
18911         reports on duplicated methods).
18912
18913         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18914         source first, this will guarantee that we have a valid expression
18915         before calling in lower levels functions that will require a
18916         resolved object.  Then use this original_source in the
18917         target.ResolveLValue instead of the original source that was
18918         passed to us.
18919
18920         Another change.  Use target.Resolve instead of LValueResolve.
18921         Although we are resolving for LValues, we will let the Assign code
18922         take care of that (it will be called again from Resolve).  This
18923         basically allows code like this:
18924
18925         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18926         class Y { void A (X x) { x [0] += o; }
18927
18928         The problem was that the indexer was trying to resolve for
18929         set_Item (idx, object o) and never finding one.  The real set_Item
18930         was set_Item (idx, X).  By delaying the process we get the right
18931         semantics. 
18932
18933         Fixes bug 36505
18934
18935 2003-02-23  Martin Baulig  <martin@ximian.com>
18936
18937         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18938         while calling DoEmit ().
18939
18940         * codegen.cs (EmitContext.Mark): Don't mark locations in other
18941         source files; if you use the #line directive inside a method, the
18942         compiler stops emitting line numbers for the debugger until it
18943         reaches the end of the method or another #line directive which
18944         restores the original file.
18945
18946 2003-02-23  Martin Baulig  <martin@ximian.com>
18947
18948         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18949
18950 2003-02-23  Martin Baulig  <martin@ximian.com>
18951
18952         * statement.cs (Block.AddChildVariableNames): We need to call this
18953         recursively, not just for our immediate children.
18954
18955 2003-02-23  Martin Baulig  <martin@ximian.com>
18956
18957         * class.cs (Event.Define): Always make the field private, like csc does.
18958
18959         * typemanager.cs (TypeManager.RealMemberLookup): Make events
18960         actually work, fixes bug #37521.
18961
18962 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
18963
18964         * delegate.cs: When creating the various temporary "Parameters"
18965         classes, make sure that we call the ComputeAndDefineParameterTypes
18966         on those new parameters (just like we do with the formal ones), to
18967         allow them to be resolved in the context of the DeclSpace.
18968
18969         This fixes the bug that Dick observed in Bugzilla #38530.
18970
18971 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
18972
18973         * expression.cs (ResolveMemberAccess): When resolving a constant,
18974         do not attempt to pull a constant if the value was not able to
18975         generate a valid constant.
18976
18977         * const.cs (LookupConstantValue): Do not report more errors than required.
18978
18979 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18980
18981         * expression.cs: fixes bug #38328.
18982
18983 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
18984
18985         * class.cs: Changed all the various members that can be part of a
18986         class from being an ArrayList to be an Array of the right type.
18987         During the DefineType type_list, interface_list, delegate_list and
18988         enum_list are turned into types, interfaces, delegates and enums
18989         arrays.  
18990
18991         And during the member population, indexer_list, event_list,
18992         constant_list, field_list, instance_constructor_list, method_list,
18993         operator_list and property_list are turned into their real arrays.
18994
18995         Although we could probably perform this operation earlier, for
18996         good error reporting we need to keep the lists and remove the
18997         lists for longer than required.
18998
18999         This optimization was triggered by Paolo profiling the compiler
19000         speed on the output of `gen-sample-program.pl' perl script. 
19001
19002         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
19003         not crash in methods like MemberLookupFailed that use this field.  
19004
19005         This problem arises when the compiler fails to resolve a type
19006         during interface type definition for example.
19007
19008 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
19009
19010         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
19011         inherit from System.Object, so we have to stop at null, not only
19012         when reaching System.Object.
19013
19014 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
19015
19016         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
19017         DeclaredOnly because the parent indexer might have had a different
19018         name, but did not loop until the top of the hierarchy was reached.
19019
19020         The problem this one fixes is 35492: when a class implemented an
19021         indexer from an interface, we were getting the interface method
19022         (which was abstract) and we were flagging an error (can not invoke
19023         abstract method).
19024
19025         This also keeps bug 33089 functioning, and test-148 functioning.
19026
19027         * typemanager.cs (IsSpecialMethod): The correct way of figuring
19028         out if a method is special is to see if it is declared in a
19029         property or event, or whether it is one of the predefined operator
19030         names.   This should fix correctly #36804.
19031
19032 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
19033
19034         The goal here is to remove the dependency on EmptyCast.Peel ().
19035         Killing it completely.
19036
19037         The problem is that currently in a number of places where
19038         constants are expected, we have to "probe" for an EmptyCast, and
19039         Peel, which is not the correct thing to do, as this will be
19040         repetitive and will likely lead to errors. 
19041
19042         The idea is to remove any EmptyCasts that are used in casts that
19043         can be reduced to constants, so we only have to cope with
19044         constants. 
19045
19046         This bug hunt was triggered by Bug 37363 and the desire to remove
19047         the duplicate pattern where we were "peeling" emptycasts to check
19048         whether they were constants.  Now constants will always be
19049         constants.
19050
19051         * ecore.cs: Use an enumconstant here instead of wrapping with
19052         EmptyCast.  
19053
19054         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
19055         throwing me off.  By handling this we can get rid of a few hacks.
19056
19057         * statement.cs (Switch): Removed Peel() code.
19058
19059 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
19060
19061         * class.cs: Location information for error 508
19062
19063         * expression.cs (New.DoResolve): Add a guard against double
19064         resolution of an expression.  
19065
19066         The New DoResolve might be called twice when initializing field
19067         expressions (see EmitFieldInitializers, the call to
19068         GetInitializerExpression will perform a resolve on the expression,
19069         and later the assign will trigger another resolution
19070
19071         This leads to bugs (#37014)
19072
19073         * delegate.cs: The signature for EndInvoke should contain any ref
19074         or out parameters as well.  We were not doing this in the past. 
19075
19076         * class.cs (Field.Define): Do not overwrite the type definition
19077         inside the `volatile' group.  Turns out that volatile enumerations
19078         were changing the type here to perform a validity test, which
19079         broke conversions. 
19080
19081 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
19082
19083         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
19084         and structs, we do not want to load the instance variable
19085
19086         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
19087         enum_type has to be handled like an object reference (implicit
19088         conversions exists from this to object), but the regular IsClass
19089         and IsValueType tests will never return true for this one.
19090
19091         Also we use TypeManager.IsValueType instead of type.IsValueType,
19092         just for consistency with the rest of the code (this is only
19093         needed if we ever use the construct exposed by test-180.cs inside
19094         corlib, which we dont today).
19095
19096 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
19097
19098         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
19099         just InternalCall.
19100
19101 2003-02-09  Martin Baulig  <martin@ximian.com>
19102
19103         * namespace.cs (Namespace..ctor): Added SourceFile argument.
19104         (Namespace.DefineNamespaces): New static public method; this is
19105         called when we're compiling with debugging to add all namespaces
19106         to the symbol file.
19107
19108         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
19109         pass it to the Namespace's .ctor.
19110
19111         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
19112         and MethodBase arguments; pass the namespace ID to the symwriter;
19113         pass the MethodBase instead of the token to the symwriter.
19114         (SymbolWriter.DefineNamespace): New method to add a namespace to
19115         the symbol file.
19116
19117 2003-02-09  Martin Baulig  <martin@ximian.com>
19118
19119         * symbolwriter.cs: New file.  This is a wrapper around
19120         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
19121         methods here in near future.
19122
19123 2003-02-09  Martin Baulig  <martin@ximian.com>
19124
19125         * codegen.cs (EmitContext.Mark): Just pass the arguments to
19126         ILGenerator.MarkSequencePoint() which are actually used by the
19127         symbol writer.
19128
19129 2003-02-09  Martin Baulig  <martin@ximian.com>
19130
19131         * location.cs (SourceFile): New public sealed class.  This
19132         contains the name and an index which is used in the location's token.
19133         (Location): Reserve an appropriate number of bits in the token for
19134         the source file instead of walking over that list, this gives us a
19135         really huge performance improvement when compiling with debugging.
19136
19137         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
19138         `SourceFile' argument instead of a string.
19139         (Driver.ProcessFile): Add all the files via Location.AddFile(),
19140         but don't parse/tokenize here, we need to generate the list of all
19141         source files before we do that.
19142         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
19143         the files.
19144
19145         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
19146         instead of a string.
19147
19148         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
19149         of a string.
19150
19151 2003-02-09  Martin Baulig  <martin@ximian.com>
19152
19153         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
19154         filename on `#line default'.
19155
19156 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
19157
19158         * statement.cs: don't clear the pinned var when the fixed statement
19159         returns from the method (fixes bug#37752).
19160
19161 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
19162
19163         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
19164         to IsValueType.
19165
19166 2003-02-07  Martin Baulig  <martin@ximian.com>
19167
19168         * driver.cs: Removed the `--debug-args' command line argument.
19169
19170         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
19171         automatically by the AsssemblyBuilder.
19172         (CodeGen.InitializeSymbolWriter): We don't need to call any
19173         initialization function on the symbol writer anymore.  This method
19174         doesn't take any arguments.
19175
19176 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
19177
19178         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
19179         from referenced assemblies as well.
19180
19181 2003-02-02  Martin Baulig  <martin@ximian.com>
19182
19183         * class.cs (MethodData.Emit): Generate debugging info for external methods.
19184
19185 2003-02-02  Martin Baulig  <martin@ximian.com>
19186
19187         * class.cs (Constructor.Emit): Open the symbol writer before
19188         emitting the constructor initializer.
19189         (ConstructorInitializer.Emit): Call ec.Mark() to allow
19190         single-stepping through constructor initializers.
19191
19192 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
19193
19194         * class.cs: Handle error 549: do not allow virtual methods in
19195         sealed classes. 
19196
19197 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
19198
19199         * decl.cs: Check access levels when resolving types
19200
19201 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
19202
19203         * statement.cs: Add parameters and locals set in catch blocks that might 
19204         return to set vector
19205
19206 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
19207
19208         * class.cs (Operator): Set the SpecialName flags for operators.
19209
19210         * expression.cs (Invocation.DoResolve): Only block calls to
19211         accessors and operators on SpecialName methods.
19212
19213         (Cast.TryReduce): Handle conversions from char constants.
19214
19215
19216 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
19217
19218         * statement.cs: small memory and time optimization in FlowBranching.
19219
19220 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
19221
19222         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
19223         problem that the last fix but in the other sid (Set).
19224
19225         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
19226         access when there is no indexer in the hierarchy.
19227
19228 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
19229
19230         * class.cs: Combine some if statements.
19231
19232 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19233
19234         * driver.cs: fixed bug #37187.
19235
19236 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
19237
19238         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
19239         any indexer, it's needed to build a list with all the indexers in the
19240         hierarchy (AllGetters), else we have problems. Fixes #35653.
19241
19242 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
19243
19244         * class.cs (MethodData.Define): It is wrong for an interface
19245         implementation to be static in both cases: explicit and implicit.
19246         We were only handling this in one case.
19247
19248         Improve the if situation there to not have negations.
19249
19250         * class.cs (Field.Define): Turns out that we do not need to check
19251         the unsafe bit on field definition, only on usage.  Remove the test.
19252
19253 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19254
19255         * driver.cs: use assembly.Location instead of Codebase (the latest
19256         patch made mcs fail when using MS assemblies).
19257
19258 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
19259
19260         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
19261         get the path to *corlib.dll.
19262
19263 2003-01-21  Nick Drochak <ndrochak@gol.com>
19264
19265         * cs-tokenizer.cs:
19266         * pending.cs:
19267         * typemanager.cs: Remove compiler warnings
19268
19269 2003-01-20  Duncan Mak  <duncan@ximian.com>
19270
19271         * AssemblyInfo.cs: Bump the version number to 0.19.
19272
19273 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19274
19275         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
19276
19277 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
19278
19279         * class.cs (Constructor::Emit): Emit debugging info for constructors.
19280
19281 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
19282
19283         * cs-parser.jay: Small fix: we were not comparing the constructor
19284         name correctly.   Thanks to Zoltan for the initial pointer.
19285
19286 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
19287
19288         * cs-tokenizer.cs: Set file name when specified with #line
19289
19290 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
19291
19292         * cs-parser.jay: Only perform the constructor checks here if we
19293         are named like the class;  This will help provider a better
19294         error.  The constructor path is taken when a type definition is
19295         not found, but most likely the user forgot to add the type, so
19296         report that rather than the constructor error.
19297
19298 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
19299
19300         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
19301         allocations.
19302
19303 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19304
19305         * cs-parser.jay: Add cleanup call.
19306
19307 2003-01-13  Duncan Mak  <duncan@ximian.com>
19308
19309         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
19310         consistent with other methods.
19311
19312 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19313
19314         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
19315
19316 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
19317
19318         * attribute.cs: only set GuidAttr to true when we have a
19319         GuidAttribute.
19320
19321 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19322
19323         * ecore.cs:
19324         * expression.cs:
19325         * typemanager.cs: fixes to allow mcs compile corlib with the new
19326         Type.IsSubclassOf fix.
19327
19328 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
19329
19330         * expression.cs (LocalVariableReference.DoResolve): Classify a
19331         constant as a value, not as a variable.   Also, set the type for
19332         the variable.
19333
19334         * cs-parser.jay (fixed_statement): take a type instead of a
19335         pointer_type, so we can produce a better error message later.
19336
19337         * statement.cs (Fixed.Resolve): Flag types that are not pointers
19338         as an error.  
19339
19340         (For.DoEmit): Make inifinite loops have a
19341         non-conditional branch back.
19342
19343         (Fixed.DoEmit): First populate the pinned variables, then emit the
19344         statement, then clear the variables.  Before I was emitting the
19345         code once for each fixed piece.
19346
19347
19348 2003-01-08  Martin Baulig  <martin@ximian.com>
19349
19350         * statement.cs (FlowBranching.MergeChild): A break in a
19351         SWITCH_SECTION does not leave a loop.  Fixes #36155.
19352
19353 2003-01-08  Martin Baulig  <martin@ximian.com>
19354
19355         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19356         lives in the same number space than `param_map'.  Fixes #36154.
19357
19358 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
19359
19360         * cs-parser.jay (constructor_declaration): Set the
19361         Constructor.ModFlags before probing for it.  This makes the
19362         compiler report 514, 515 and 132 (the code was there, but got
19363         broken). 
19364
19365         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19366         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19367         (GotoCase.Resolve): Set `Returns' to ALWAYS.
19368
19369 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19370
19371         * enum.cs: create the enum static fields using the enum type.
19372
19373 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19374
19375         * class.cs: don't try to create the ParamBuilder for the return
19376         type if it's not needed (and handle it breaking for the ms runtime
19377         anyway).
19378
19379 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19380
19381         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19382
19383 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
19384
19385         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19386         the command.   This showed up while compiling the JANET source
19387         code, which used \r as its only newline separator.
19388
19389 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
19390
19391         * class.cs (Method.Define): If we are an operator (because it
19392         reuses our code), then set the SpecialName and HideBySig.  #36128
19393
19394 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
19395
19396         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19397         exception, report error 120 `object reference required'.
19398
19399         * driver.cs: Add --pause option, used during to measure the size
19400         of the process as it goes with --timestamp.
19401
19402         * expression.cs (Invocation.DoResolve): Do not allow methods with
19403         SpecialName to be invoked.
19404
19405 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
19406
19407         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19408         number before adding it.
19409
19410 2002-12-21  Ravi Pratap  <ravi@ximian.com>
19411
19412         * ecore.cs (StandardImplicitConversion): When in an unsafe
19413         context, we allow conversion between void * to any other pointer
19414         type. This fixes bug #35973.
19415
19416 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19417
19418         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19419         is not thrown when extensionless outputs are used 
19420
19421 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19422
19423         * rootcontext.cs: fixed compilation of corlib.
19424
19425 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
19426
19427         * attribute.cs (Attributes.Contains): Add new method.
19428
19429         * class.cs (MethodCore.LabelParameters): if the parameter is an
19430         `out' parameter, check that no attribute `[In]' has been passed.
19431
19432         * enum.cs: Handle the `value__' name in an enumeration.
19433
19434 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
19435
19436         * decl.cs: Added special case to allow overrides on "protected
19437         internal" methods
19438
19439 2002-12-18  Ravi Pratap  <ravi@ximian.com>
19440
19441         * attribute.cs (Attributes.AddAttributeSection): Rename to this
19442         since it makes much more sense.
19443
19444         (Attributes.ctor): Don't require a Location parameter.
19445
19446         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19447
19448         * attribute.cs (ApplyAttributes): Remove extra Location parameters
19449         since we already have that information per attribute.
19450
19451         * everywhere : make appropriate changes.
19452
19453         * class.cs (LabelParameters): Write the code which actually
19454         applies attributes to the return type. We can't do this on the MS
19455         .NET runtime so we flag a warning in the case an exception is
19456         thrown.
19457
19458 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
19459
19460         * const.cs: Handle implicit null conversions here too.
19461
19462 2002-12-17  Ravi Pratap  <ravi@ximian.com>
19463
19464         * class.cs (MethodCore.LabelParameters): Remove the extra
19465         Type [] parameter since it is completely unnecessary. Instead
19466         pass in the method's attributes so that we can extract
19467         the "return" attribute.
19468
19469 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
19470
19471         * cs-parser.jay (parse): Use Report.Error to flag errors instead
19472         of ignoring it and letting the compile continue.
19473
19474         * typemanager.cs (ChangeType): use an extra argument to return an
19475         error condition instead of throwing an exception.
19476
19477 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
19478
19479         * expression.cs (Unary.TryReduce): mimic the code for the regular
19480         code path.  Perform an implicit cast in the cases where we can
19481         implicitly convert to one of the integral types, and then reduce
19482         based on that constant.   This fixes bug #35483.
19483
19484 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19485
19486         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19487
19488 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19489
19490         * namespace.cs: fixed bug #35489.
19491
19492 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
19493
19494         * class.cs: Remove some dead code.
19495
19496         * cs-parser.jay: Estimate the number of methods needed
19497         (RootContext.MethodCount);
19498
19499         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19500         numbers instead of StringBuilders.
19501
19502         * support.cs (PtrHashtable): Add constructor with initial size;
19503         We can now reduce reallocations of the method table.
19504
19505 2002-12-10  Ravi Pratap  <ravi@ximian.com>
19506
19507         * attribute.cs (ApplyAttributes): Keep track of the emitted
19508         attributes on a per-target basis. This fixes bug #35413.
19509
19510 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
19511
19512         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19513         default to the Windows 1252 encoding.
19514
19515         (UnixParseOption): Support version, thanks to Alp for the missing
19516         pointer. 
19517
19518         * AssemblyInfo.cs: Add nice assembly information.
19519
19520         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19521         (bug 35169).
19522
19523         * cs-parser.jay: Allow a trailing comma before the close bracked
19524         in the attribute_section production.
19525
19526         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19527         address of the instance was being taken, I will take this out,
19528         because we take the address of the object immediately here.
19529
19530 2002-12-09  Ravi Pratap  <ravi@ximian.com>
19531
19532         * typemanager.cs (AreMultipleAllowed): Take care of the most
19533         obvious case where attribute type is not in the current assembly -
19534         stupid me ;-)
19535
19536 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
19537
19538         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19539         definitions, instead of doing that afterwards.  
19540
19541         Also we use a nice little hack, depending on the constructor, we
19542         know if we are a "composed" name or a simple name.  Hence, we
19543         avoid the IndexOf test, and we avoid 
19544
19545         * codegen.cs: Add code to assist in a bug reporter to track down
19546         the source of a compiler crash. 
19547
19548 2002-12-07  Ravi Pratap  <ravi@ximian.com>
19549
19550         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19551         types have been emitted for a given element and flag an error
19552         if something which does not have AllowMultiple set is used more
19553         than once.
19554
19555         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19556         attribute types and their corresponding AllowMultiple properties
19557
19558         (AreMultipleAllowed): Check the property for a given type.
19559
19560         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19561         property in the case we have a TypeContainer.
19562
19563         (Attributes.AddAttribute): Detect duplicates and just skip on
19564         adding them. This trivial fix catches a pretty gross error in our
19565         attribute emission - global attributes were being emitted twice!
19566
19567         Bugzilla bug #33187 is now fixed.
19568
19569 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
19570
19571         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19572         instead of pp_and).
19573
19574         * expression.cs (Binary.ResolveOperator): I can only use the
19575         Concat (string, string, string) and Concat (string, string,
19576         string, string) if the child is actually a concatenation of
19577         strings. 
19578
19579 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
19580
19581         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19582         context where we need a 2-character lookahead.
19583
19584         * pending.cs (PendingImplementation): Rework so we can keep track
19585         of interface types all the time, and flag those which were
19586         implemented by parents as optional.
19587
19588 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
19589
19590         * expression.cs (Binary.ResolveOperator): Use
19591         String.Concat(string,string,string) or
19592         String.Concat(string,string,string,string) when possible. 
19593
19594         * typemanager: More helper methods.
19595
19596
19597 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19598
19599         * pending.cs: remove the bogus return from GetMissingInterfaces()
19600         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19601
19602 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19603
19604         * namespace.cs: avoid duplicated 'using xxx' being added to
19605         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19606         when we get more than one 'using' statement for the same namespace.
19607         Report a CS0105 warning for it.
19608
19609 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
19610
19611         * cs-tokenizer.cs (consume_identifier): use read directly, instead
19612         of calling getChar/putback, uses internal knowledge of it.    
19613
19614         (xtoken): Reorder tokenizer so most common patterns are checked
19615         first.  This reduces the compilation time in another 5% (from 8.11s
19616         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19617
19618         The parsing time is 22% of the compilation in mcs, and from that
19619         64% is spent on the tokenization process.  
19620
19621         I tried using a binary search for keywords, but this is slower
19622         than the hashtable.  Another option would be to do a couple of
19623         things:
19624
19625                 * Not use a StringBuilder, instead use an array of chars,
19626                   with a set value.  Notice that this way we could catch
19627                   the 645 error without having to do it *afterwards*.
19628
19629                 * We could write a hand-parser to avoid the hashtable
19630                   compares altogether.
19631
19632         The identifier consumption process takes 37% of the tokenization
19633         time.  Another 15% is spent on is_number.  56% of the time spent
19634         on is_number is spent on Int64.Parse:
19635
19636                 * We could probably choose based on the string length to
19637                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
19638                   computations. 
19639
19640         Another 3% is spend on wrapping `xtoken' in the `token' function.
19641
19642         Handle 0xa0 as whitespace (#34752)
19643
19644 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
19645
19646         * typemanager.cs (IsCLRType): New routine to tell whether a type
19647         is one of the builtin types.  
19648
19649         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
19650         typecode in more places instead of doing pointer comparissions.
19651         We could leverage some knowledge about the way the typecodes are
19652         laid out.
19653
19654         New code to cache namespaces in assemblies, it is currently not
19655         invoked, to be used soon.
19656
19657         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19658
19659         * expression.cs (Binary.ResolveOperator): specially handle
19660         strings, and do not perform user-defined operator overloading for
19661         built-in types.
19662
19663 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
19664
19665         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19666         internalcall as it is a pretty simple operation;  Avoid whenever
19667         possible to call Char.IsLetter.
19668
19669         (consume_identifier): Cut by half the number of
19670         hashtable calls by merging the is_keyword and GetKeyword behavior.
19671
19672         Do not short-circuit, because if we do, we
19673         report errors (ie, #if false && true would produce an invalid
19674         directive error);
19675
19676
19677 2002-11-24  Martin Baulig  <martin@ximian.com>
19678
19679         * expression.cs (Cast.TryReduce): If we're in checked syntax,
19680         check constant ranges and report a CS0221.  Fixes #33186.
19681
19682 2002-11-24  Martin Baulig  <martin@ximian.com>
19683
19684         * cs-parser.jay: Make this work for uninitialized variable
19685         declarations in the `for' initializer.  Fixes #32416.
19686
19687 2002-11-24  Martin Baulig  <martin@ximian.com>
19688
19689         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19690         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
19691
19692 2002-11-24  Martin Baulig  <martin@ximian.com>
19693
19694         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19695         argument; if true, we also check for user-defined conversions.
19696         This is only needed if both arguments are of a user-defined type.
19697         Fixes #30443, added test-175.cs.
19698         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19699
19700         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19701
19702 2002-11-24  Martin Baulig  <martin@ximian.com>
19703
19704         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19705         function to get the store opcode.
19706         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19707         only emit the Ldelema if the store opcode is Stobj.  You must run
19708         both test-34 and test-167 to test this.  Fixes #34529.
19709
19710 2002-11-23  Martin Baulig  <martin@ximian.com>
19711
19712         * ecore.cs (Expression.MemberLookup): Added additional
19713         `qualifier_type' argument which is used when we're being called
19714         from MemberAccess.DoResolve() and null if we're called from a
19715         SimpleName lookup.
19716         (Expression.MemberLookupFailed): New method to report errors; this
19717         does the CS1540 check and reports the correct error message.
19718
19719         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19720         argument for the CS1540 check and redone the way how we're dealing
19721         with private members.  See the comment in the source code for details.
19722         (FilterWithClosure): Reverted this back to revision 1.197; renamed
19723         `closure_start_type' to `closure_qualifier_type' and check whether
19724         it's not null.  It was not this filter being broken, it was just
19725         being called with the wrong arguments.
19726
19727         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19728         and pass it the correct `qualifier_type'; this also does the error
19729         handling for us.
19730
19731 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
19732
19733         * expression.cs (Invocation.EmitParams): If the we are dealing
19734         with a non-built-in value type, load its address as well.
19735
19736         (ArrayCreation): Use a a pretty constant instead
19737         of the hardcoded value 2.   Use 6 instead of 2 for the number of
19738         static initializers.  
19739
19740         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19741         because they are not really value types, just glorified integers. 
19742
19743         * driver.cs: Do not append .exe, the CSC compiler does not do it.
19744
19745         * ecore.cs: Remove redundant code for enumerations, make them use
19746         the same code path as everything else, fixes the casting issue
19747         with enumerations in Windows.Forms.
19748
19749         * attribute.cs: Do only cast to string if it is a string, the
19750         validation happens later.
19751
19752         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19753         people upgrade their corlibs.
19754
19755         * ecore.cs: Oops, enumerations were not following the entire code path
19756
19757 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
19758
19759         * typemanager.cs (FilterWithClosure): Commented out the test for
19760         1540 in typemanager.cs, as it has problems when accessing
19761         protected methods from a parent class (see test-174.cs). 
19762
19763         * attribute.cs (Attribute.ValidateGuid): new method.
19764         (Attribute.Resolve): Use above.
19765
19766 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
19767
19768         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19769
19770         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19771         handling for enumerations, as we only needed the TypeContainer
19772         functionality to begin with (this is required for the fix below to
19773         work for enums that reference constants in a container class for
19774         example). 
19775
19776         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19777
19778         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19779         a valid TypeBuilder to perform lookups on.o
19780
19781         * class.cs (InheritableMemberSignatureCompare): Use true in the
19782         call to GetGetMethod and GetSetMethod, because we are comparing
19783         the signature, and we need to get the methods *even* if they are
19784         private. 
19785
19786         (PropertyBase.CheckBase): ditto.
19787
19788         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19789         GotoCase.Resolve): Use Peel on EmpytCasts.
19790
19791         * ecore.cs (EmptyCast): drop child, add Peel method.
19792
19793 2002-11-17  Martin Baulig  <martin@ximian.com>
19794
19795         * ecore.cs (EmptyCast.Child): New public property.
19796
19797         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19798         label resolved to an EmptyCast.  Fixes #34162.
19799         (GotoCase.Resolve): Likewise.
19800         (Block.EmitMeta): Likewise.
19801
19802 2002-11-17  Martin Baulig  <martin@ximian.com>
19803
19804         * expression.cs (Invocation.BetterConversion): Prefer int over
19805         uint; short over ushort; long over ulong for integer literals.
19806         Use ImplicitConversionExists instead of StandardConversionExists
19807         since we also need to check for user-defined implicit conversions.
19808         Fixes #34165.  Added test-173.cs.
19809
19810 2002-11-16  Martin Baulig  <martin@ximian.com>
19811
19812         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19813         with the `true' and `false' literals.  Fixes #33151.
19814
19815 2002-11-16  Martin Baulig  <martin@ximian.com>
19816
19817         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19818         October 22nd; don't do the cs1540 check for static members.
19819
19820         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19821         now using our own filter here and doing the cs1540 check again.
19822
19823 2002-11-16  Martin Baulig  <martin@ximian.com>
19824
19825         * support.cs (InternalParameters): Don't crash if we don't have
19826         any fixed parameters.  Fixes #33532.
19827
19828 2002-11-16  Martin Baulig  <martin@ximian.com>
19829
19830         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19831         when looking up static methods to make this work on Windows.
19832         Fixes #33773.
19833
19834 2002-11-16  Martin Baulig  <martin@ximian.com>
19835
19836         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19837         a setter rather than using PropertyInfo.CanWrite.
19838
19839 2002-11-15  Nick Drochak  <ndrochak@gol.com>
19840
19841         * class.cs: Allow acces to block member by subclasses. Fixes build
19842         breaker.
19843
19844 2002-11-14  Martin Baulig  <martin@ximian.com>
19845
19846         * class.cs (Constructor.Emit): Added the extern/block check.
19847         Fixes bug #33678.
19848
19849 2002-11-14  Martin Baulig  <martin@ximian.com>
19850
19851         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19852         iteration while looking for indexers, this is needed because the
19853         indexer may have a different name in our base classes.  Fixed the
19854         error reporting (no indexers at all, not get accessor, no
19855         overloaded match).  Fixes bug #33089.
19856         (IndexerAccess.DoResolveLValue): Likewise.
19857
19858 2002-11-14  Martin Baulig  <martin@ximian.com>
19859
19860         * class.cs (PropertyBase.CheckBase): Make this work for multiple
19861         indexers.  Fixes the first part of bug #33089.
19862         (MethodSignature.InheritableMemberSignatureCompare): Added support
19863         for properties.
19864
19865 2002-11-13  Ravi Pratap  <ravi@ximian.com>
19866
19867         * attribute.cs (Attribute.Resolve): Catch the
19868         NullReferenceException and report it since it isn't supposed to
19869         happen. 
19870
19871 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
19872
19873         * expression.cs (Binary.EmitBranchable): Also handle the cases for
19874         LogicalOr and LogicalAnd that can benefit from recursively
19875         handling EmitBranchable.  The code now should be nice for Paolo.
19876
19877 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
19878
19879         * typemanager.cs (LookupType): Added a negative-hit hashtable for
19880         the Type lookups, as we perform quite a number of lookups on
19881         non-Types.  This can be removed once we can deterministically tell
19882         whether we have a type or a namespace in advance.
19883
19884         But this might require special hacks from our corlib.
19885
19886         * TODO: updated.
19887
19888         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19889         and double which avoids a conversion from an integer to a double.
19890
19891         * expression.cs: tiny optimization, avoid calling IsConstant,
19892         because it effectively performs the lookup twice.
19893
19894 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
19895
19896         But a bogus return here to keep the semantics of the old code
19897         until the Mono runtime is fixed.
19898
19899         * pending.cs (GetMissingInterfaces): New method used to remove all
19900         the interfaces that are already implemented by our parent
19901         classes from the list of pending methods. 
19902
19903         * interface.cs: Add checks for calls after ResolveTypeExpr.
19904
19905 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
19906
19907         * class.cs (Class.Emit): Report warning 67: event not used if the
19908         warning level is beyond 3.
19909
19910         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19911         being a NullLiteral.
19912
19913         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19914         specifiers. 
19915
19916         * class.cs (TypeContainer.GetClassBases): Cover a missing code
19917         path that might fail if a type can not be resolved.
19918
19919         * expression.cs (Binary.Emit): Emit unsigned versions of the
19920         operators. 
19921
19922         * driver.cs: use error 5.
19923
19924 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19925
19926         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19927
19928 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
19929
19930         * cs-parser.jay (switch_section): A beautiful patch from Martin
19931         Baulig that fixed 33094.
19932
19933 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
19934
19935         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19936         Check whether the base is abstract and report an error if so.
19937
19938         * expression.cs (IndexerAccess.DoResolveLValue,
19939         IndexerAccess.DoResolve): ditto. 
19940
19941         (Invocation.DoResolve): ditto.
19942
19943         (Invocation.FullMethodDesc): Improve the report string.
19944
19945         * statement.cs (Block): Eliminate IsVariableDefined as it is
19946         basically just a wrapper for GetVariableInfo.
19947
19948         * ecore.cs (SimpleName): Use new 
19949
19950         * support.cs (ReflectionParamter.ParameterType): We unwrap the
19951         type, as we return the actual parameter ref/unref state on a
19952         different call.
19953
19954 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
19955
19956         * support.cs: Return proper flags REF/OUT fixing the previous
19957         commit.  
19958
19959         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
19960         not used to mean `ref' but `ref or out' in ParameterReference
19961
19962         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19963         full type signature instead of calling TypeManger.CSharpName
19964         ourselves. 
19965
19966         * support.cs (InternalParameters.ParameterDesc): Do not compare
19967         directly to the modflags, because REF/OUT will actually be bitsets
19968         if set. 
19969
19970         * delegate.cs (VerifyMethod): Check also the modifiers.
19971
19972         * cs-tokenizer.cs: Fix bug where floating point values with an
19973         exponent where a sign was missing was ignored.
19974
19975         * driver.cs: Allow multiple assemblies to be specified in a single
19976         /r: argument
19977
19978 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
19979
19980         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
19981         because identifiers after a parenthesis would end up in this kind
19982         of production, and we needed to desamiguate it for having casts
19983         like:
19984
19985                 (UserDefinedType *) xxx
19986
19987 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
19988
19989         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19990         we should set on the Bindingflags.NonPublic, but not turn on
19991         private_ok.  private_ok controls whether a Private member is
19992         returned (this is chekced on the filter routine), while the
19993         BindingFlags.NonPublic just controls whether private/protected
19994         will be allowed.   This fixes the problem part of the problem of
19995         private properties being allowed to be used in derived classes.
19996
19997         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19998         so we can call the children DoResolveLValue method (this will
19999         properly signal errors on lvalue assignments to base properties)
20000
20001         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
20002         getter are null, and we have a property info, we know that this
20003         happened because the lookup failed, so we report an error 122 for
20004         protection level violation.
20005
20006         We also silently return if setter and getter are null in the
20007         resolve functions, this condition only happens if we have flagged
20008         the error before.  This is the other half of the problem. 
20009
20010         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
20011         not have accessibility information, that is why we were returning
20012         true in the filter function in typemanager.cs.
20013
20014         To properly report 122 (property is inaccessible because of its
20015         protection level) correctly, we report this error in ResolveAccess
20016         by failing if both the setter and the getter are lacking (ie, the
20017         lookup failed). 
20018
20019         DoResolve and DoLResolve have been modified to check for both
20020         setter/getter being null and returning silently, the reason being
20021         that I did not want to put the knowledge about this error in upper
20022         layers, like:
20023
20024         int old = Report.Errors;
20025         x = new PropertyExpr (...);
20026         if (old != Report.Errors)
20027                 return null;
20028         else
20029                 return x;
20030
20031         So the property expr is returned, but it is invalid, so the error
20032         will be flagged during the resolve process. 
20033
20034         * class.cs: Remove InheritablePropertySignatureCompare from the
20035         class, as we no longer depend on the property signature to compute
20036         whether it is possible to implement a method or not.
20037
20038         The reason is that calling PropertyInfo.GetGetMethod will return
20039         null (in .NET, in Mono it works, and we should change this), in
20040         cases where the Get Method does not exist in that particular
20041         class.
20042
20043         So this code:
20044
20045         class X { public virtual int A { get { return 1; } } }
20046         class Y : X { }
20047         class Z : Y { public override int A { get { return 2; } } }
20048
20049         Would fail in Z because the parent (Y) would not have the property
20050         defined.  So we avoid this completely now (because the alternative
20051         fix was ugly and slow), and we now depend exclusively on the
20052         method names.
20053
20054         (PropertyBase.CheckBase): Use a method-base mechanism to find our
20055         reference method, instead of using the property.
20056
20057         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
20058         routines are gone now.
20059
20060         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
20061         names, they were incorrectly named.
20062
20063         * cs-tokenizer.cs: Return are more gentle token on failure. 
20064
20065         * pending.cs (PendingImplementation.InterfaceMethod): This routine
20066         had an out-of-sync index variable, which caused it to remove from
20067         the list of pending methods the wrong method sometimes.
20068
20069 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
20070
20071         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
20072         CanWrite, because those refer to this particular instance of the
20073         property, and do not take into account the fact that we can
20074         override single members of a property.
20075
20076         Constructor requires an EmitContext.  The resolution process does
20077         not happen here, but we need to compute the accessors before,
20078         because the resolution does not always happen for properties.
20079
20080         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
20081         subclass, before we did not update this flag, but we did update
20082         bindingflags. 
20083
20084         (GetAccessors): Drop this routine, as it did not work in the
20085         presence of partially overwritten set/get methods. 
20086
20087         Notice that this broke the cs1540 detection, but that will require
20088         more thinking. 
20089
20090 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20091
20092         * class.cs:
20093         * codegen.cs:
20094         * driver.cs: issue a warning instead of an error if we don't support
20095         debugging for the platform. Also ignore a couple of errors that may
20096         arise when trying to write the symbols. Undo my previous patch.
20097
20098 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20099
20100         * driver.cs: ignore /debug switch except for Unix platforms.
20101
20102 2002-10-23  Nick Drochak  <ndrochak@gol.com>
20103
20104         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
20105
20106 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
20107
20108         * driver.cs: Do not make mcs-debug conditional, so we do not break
20109         builds that use it.
20110
20111         * statement.cs (UsageVector.MergeChildren): I would like Martin to
20112         review this patch.  But basically after all the children variables
20113         have been merged, the value of "Breaks" was not being set to
20114         new_breaks for Switch blocks.  I think that it should be set after
20115         it has executed.  Currently I set this to the value of new_breaks,
20116         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
20117         conservative, but I do not understand this code very well.
20118
20119         I did not break anything in the build, so that is good ;-)
20120
20121         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
20122
20123 2002-10-20  Mark Crichton  <crichton@gimp.org>
20124
20125         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
20126
20127 2002-10-20  Nick Drochak  <ndrochak@gol.com>
20128
20129         * cfold.cs: Fixed compile blocker.
20130
20131 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
20132
20133         * driver.cs: I was chekcing the key, not the file.
20134
20135 2002-10-19  Ravi Pratap  <ravi@ximian.com>
20136
20137         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
20138         message that we were generating - we just need to silently return
20139         a null.
20140
20141 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
20142
20143         * class.cs (Event.Define): Change my previous commit, as this
20144         breaks the debugger.  This is a temporary hack, as it seems like
20145         the compiler is generating events incorrectly to begin with.
20146
20147         * expression.cs (Binary.ResolveOperator): Added support for 
20148         "U operator - (E x, E y)"
20149
20150         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
20151         y)".
20152
20153         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
20154         init-only variables, but this path did not take into account that
20155         there might be also instance readonly variables.  Correct this
20156         problem. 
20157
20158         This fixes bug 32253
20159
20160         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
20161         delegates as well.
20162
20163         * driver.cs: Change the extension for modules to `netmodule'
20164
20165         * cs-parser.jay: Improved slightly the location tracking for
20166         the debugger symbols.
20167
20168         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
20169         modifiers that were specified instead of the hardcoded value
20170         (FamAndAssem).  This was basically ignoring the static modifier,
20171         and others.  Fixes 32429.
20172
20173         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
20174         fixed a bug in the process (32476)
20175
20176         * expression.cs (ArrayAccess.EmitAssign): Patch from
20177         hwang_rob@yahoo.ca that fixes bug 31834.3
20178
20179 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
20180
20181         * driver.cs: Make the module extension .netmodule.
20182
20183 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
20184
20185         * driver.cs: Report an error if the resource file is not found
20186         instead of crashing.
20187
20188         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
20189         false, like Emit does.
20190
20191 2002-10-16  Nick Drochak  <ndrochak@gol.com>
20192
20193         * typemanager.cs: Remove unused private member.  Also reported mcs
20194         bug to report this as a warning like csc.
20195
20196 2002-10-15  Martin Baulig  <martin@gnome.org>
20197
20198         * statement.cs (Statement.Emit): Made this a virtual method; emits
20199         the line number info and calls DoEmit().
20200         (Statement.DoEmit): New protected abstract method, formerly knows
20201         as Statement.Emit().
20202
20203         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
20204
20205 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
20206
20207         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
20208         have fixed a remaining problem: not every AddXXXX was adding a
20209         fully qualified name.  
20210
20211         Now everyone registers a fully qualified name in the DeclSpace as
20212         being defined instead of the partial name.  
20213
20214         Downsides: we are slower than we need to be due to the excess
20215         copies and the names being registered this way.  
20216
20217         The reason for this is that we currently depend (on the corlib
20218         bootstrap for instance) that types are fully qualified, because
20219         we dump all the types in the namespace, and we should really have
20220         types inserted into the proper namespace, so we can only store the
20221         basenames in the defined_names array.
20222
20223 2002-10-10  Martin Baulig  <martin@gnome.org>
20224
20225         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
20226         from bug #31834, see the bug report for a testcase which is
20227         miscompiled.
20228
20229 2002-10-10  Martin Baulig  <martin@gnome.org>
20230
20231         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
20232         flow analysis code for this.
20233
20234         * statement.cs (Do, While, For): Tell the flow analysis code about
20235         infinite loops.
20236         (FlowBranching.UsageVector): Added support for infinite loops.
20237         (Block.Resolve): Moved the dead code elimination here and use flow
20238         analysis to do it.
20239
20240 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
20241
20242         * class.cs (Field.Define): Catch cycles on struct type
20243         definitions. 
20244
20245         * typemanager.cs (IsUnmanagedtype): Do not recursively check
20246         fields if the fields are static.  We only need to check instance
20247         fields. 
20248
20249         * expression.cs (As.DoResolve): Test for reference type.
20250
20251         * statement.cs (Using.ResolveExpression): Use
20252         ConvertImplicitRequired, not ConvertImplicit which reports an
20253         error on failture
20254         (Using.ResolveLocalVariableDecls): ditto.
20255
20256         * expression.cs (Binary.ResolveOperator): Report errors in a few
20257         places where we had to.
20258
20259         * typemanager.cs (IsUnmanagedtype): Finish implementation.
20260
20261 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
20262
20263         * expression.cs: Use StoreFromPtr instead of extracting the type
20264         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
20265
20266         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
20267         an enumeration value to a System.Enum, but System.Enum is not a
20268         value type, but an class type, so we need to box.
20269
20270         (Expression.ConvertExplicit): One codepath could return
20271         errors but not flag them.  Fix this.  Fixes #31853
20272
20273         * parameter.cs (Resolve): Do not allow void as a parameter type.
20274
20275 2002-10-06  Martin Baulig  <martin@gnome.org>
20276
20277         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
20278         if it's a class type and not a struct.  Fixes #31815.
20279
20280 2002-10-06  Martin Baulig  <martin@gnome.org>
20281
20282         * statement.cs: Reworked the flow analysis code a bit to make it
20283         usable for dead code elimination.
20284
20285 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20286
20287         * cs-parser.jay: allow empty source files. Fixes bug #31781.
20288
20289 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * expression.cs (ComposedCast.DoResolveType): A quick workaround
20292         to fix the test 165, will investigate deeper.
20293
20294 2002-10-04  Martin Baulig  <martin@gnome.org>
20295
20296         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
20297         finally blocks actually work.
20298         (Try.Resolve): We don't need to create a sibling for `finally' if
20299         there is no finally block.
20300
20301 2002-10-04  Martin Baulig  <martin@gnome.org>
20302
20303         * class.cs (Constructor.Define): The default accessibility for a
20304         non-default constructor is private, not public.
20305
20306 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
20307
20308         * class.cs (Constructor): Make AllowedModifiers public, add
20309         EXTERN.
20310
20311         * cs-parser.jay: Perform the modifiers test here, as the
20312         constructor for the Constructor class usually receives a zero
20313         because of the way we create it (first we create, later we
20314         customize, and we were never checking the modifiers).
20315
20316         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
20317         is a version of LookupTypeReflection that includes the type-name
20318         cache.  This can be used as a fast path for functions that know
20319         the fully qualified name and are only calling into *.GetType() to
20320         obtain a composed type.
20321
20322         This is also used by TypeManager.LookupType during its type
20323         composition.
20324
20325         (LookupType): We now also track the real type name, as sometimes
20326         we can get a quey for the real type name from things like
20327         ComposedCast.  This fixes bug 31422.
20328
20329         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20330         complete type fullname, it does not have to go through the type
20331         resolution system to obtain the composed version of the type (for
20332         obtaining arrays or pointers).
20333
20334         (Conditional.Emit): Use the EmitBoolExpression to
20335         generate nicer code, as requested by Paolo.
20336
20337         (ArrayCreation.CheckIndices): Use the patch from
20338         hwang_rob@yahoo.ca to validate the array initializers. 
20339
20340 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
20341
20342         * class.cs (ConstructorInitializer.Emit): simplify code by using
20343         Invocation.EmitCall, and at the same time, fix the bugs in calling
20344         parent constructors that took variable arguments. 
20345
20346         * ecore.cs (Expression.ConvertNumericExplicit,
20347         Expression.ImplicitNumericConversion): Remove the code that
20348         manually wrapped decimal (InternalTypeConstructor call is now gone
20349         as well).
20350
20351         * expression.cs (Cast.TryReduce): Also handle decimal types when
20352         trying to perform a constant fold on the type.
20353
20354         * typemanager.cs (IsUnmanagedtype): Partially implemented.
20355
20356         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20357         that only turned off an error report, and did nothing else. 
20358
20359 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
20360
20361         * driver.cs: Handle and ignore /fullpaths
20362
20363 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
20364
20365         * expression.cs (Binary.ResolveOperator): Catch the case where
20366         DoNumericPromotions returns true, 
20367
20368         (Binary.DoNumericPromotions): Simplify the code, and the tests.
20369
20370 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
20371
20372         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20373         report error 70.
20374
20375 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
20376
20377         * ecore.cs (ConvertNumericExplicit): It is not enough that the
20378         conversion exists, but it is also required that the conversion be
20379         performed.  This manifested in "(Type64Enum) 2".  
20380
20381         * class.cs (TypeManager.AddMethod): The fix is not to change
20382         AddEnum, because that one was using a fully qualified name (every
20383         DeclSpace derivative does), but to change the AddMethod routine
20384         that was using an un-namespaced name.  This now correctly reports
20385         the duplicated name.
20386
20387         Revert patch until I can properly fix it.  The issue
20388         is that we have a shared Type space across all namespaces
20389         currently, which is wrong.
20390
20391         Options include making the Namespace a DeclSpace, and merge
20392         current_namespace/current_container in the parser.
20393
20394 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
20395
20396         * cs-parser.jay: Improve error reporting when we get a different
20397         kind of expression in local_variable_type and
20398         local_variable_pointer_type. 
20399
20400         Propagate this to avoid missleading errors being reported.
20401
20402         * ecore.cs (ImplicitReferenceConversion): treat
20403         TypeManager.value_type as a target just like object_type.   As
20404         code like this:
20405
20406         ValueType v = 1;
20407
20408         Is valid, and needs to result in the int 1 being boxed before it
20409         is assigned to the value type v.
20410
20411         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20412         to validate the enumeration name.
20413
20414         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20415         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
20416         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20417
20418         * ecore.cs (TryImplicitIntConversion): When doing an
20419         implicit-enumeration-conversion, check if the type is 64-bits and
20420         perform a conversion before passing to EnumConstant.
20421
20422 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
20423
20424         * decl.cs (Error_AmbiguousTypeReference); New routine used to
20425         report ambiguous type references.  Unlike the MS version, we
20426         report what the ambiguity is.   Innovation at work ;-)
20427
20428         (DeclSpace.FindType): Require a location argument to
20429         display when we display an ambiguous error.
20430
20431         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20432
20433         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20434
20435         * expression.cs (EmitDynamicInitializers): Apply patch from
20436         hwang_rob@yahoo.ca that fixes the order in which we emit our
20437         initializers. 
20438
20439 2002-09-21  Martin Baulig  <martin@gnome.org>
20440
20441         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20442         delegate takes no arguments.
20443
20444 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
20445
20446         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20447         from integers.
20448
20449         * expression.cs: Extract the underlying type.
20450
20451         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20452
20453         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20454
20455 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
20456
20457         * class.cs (TypeContainer.DefineType): We can not use the nice
20458         PackingSize with the size set to 1 DefineType method, because it
20459         will not allow us to define the interfaces that the struct
20460         implements.
20461
20462         This completes the fixing of bug 27287
20463
20464         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20465         means also structs.  This fixes part of the problem. 
20466         (Expresion.ImplicitReferenceConversionExists): ditto.
20467
20468         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20469         error if there were no errors reported during the type lookup
20470         process, to avoid duplicates or redundant errors.  Without this
20471         you would get an ambiguous errors plus a type not found.  We have
20472         beaten the user enough with the first error.  
20473
20474         (DeclSparce.FindType): Emit a warning if we have an ambiguous
20475         reference. 
20476
20477         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20478         during the resolution process, stop the lookup, this avoids
20479         repeated error reports (same error twice).
20480
20481         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20482
20483         * typemanager.cs (LookupType): Redo the type lookup code to match
20484         the needs of System.Reflection.  
20485
20486         The issue is that System.Reflection requires references to nested
20487         types to begin with a "+" sign instead of a dot.  So toplevel
20488         types look like: "NameSpace.TopLevelClass", and nested ones look
20489         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20490         levels. 
20491
20492 2002-09-19  Martin Baulig  <martin@gnome.org>
20493
20494         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20495         says that a method always returns or always throws an exception,
20496         don't report the CS0161.
20497
20498         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20499         set `Returns = new_returns'.
20500
20501 2002-09-19  Martin Baulig  <martin@gnome.org>
20502
20503         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20504         to an enum constant, check for a CS0176.
20505
20506 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
20507
20508         * class.cs (TypeContainer.CheckPairedOperators): Now we check
20509         for operators that must be in pairs and report errors.
20510
20511         * ecore.cs (SimpleName.DoResolveType): During the initial type
20512         resolution process, when we define types recursively, we must
20513         check first for types in our current scope before we perform
20514         lookups in the enclosing scopes.
20515
20516         * expression.cs (MakeByteBlob): Handle Decimal blobs.
20517
20518         (Invocation.VerifyArgumentsCompat): Call
20519         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20520         I thought we were supposed to always call this, but there are a
20521         few places in the code where we dont do it.
20522
20523 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
20524
20525         * driver.cs: Add support in -linkres and -resource to specify the
20526         name of the identifier.
20527
20528 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20529
20530         * ecore.cs (StandardConversionExists): Sync with the conversion
20531         code: allow anything-* to void* conversions.
20532
20533         (FindMostSpecificSource): Use an Expression argument
20534         instead of a Type, because we might be handed over a Literal which
20535         gets a few more implicit conversions that plain types do not.  So
20536         this information was being lost.
20537
20538         Also, we drop the temporary type-holder expression when not
20539         required.
20540
20541 2002-09-17  Martin Baulig  <martin@gnome.org>
20542
20543         * class.cs (PropertyBase.CheckBase): Don't check the base class if
20544         this is an explicit interface implementation.
20545
20546 2002-09-17  Martin Baulig  <martin@gnome.org>
20547
20548         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20549         different `IndexerName' attributes.
20550
20551         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20552         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20553         virtual CommonResolve().
20554
20555 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20556
20557         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20558         and convert that to the UnderlyingType.
20559
20560         * statement.cs (Foreach.Resolve): Indexers are just like variables
20561         or PropertyAccesses.
20562
20563         * cs-tokenizer.cs (consume_string): Track line numbers and columns
20564         inside quoted strings, we were not doing this before.
20565
20566 2002-09-16  Martin Baulig  <martin@gnome.org>
20567
20568         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20569         resolve it.  This is needed for the definite assignment check of the
20570         instance expression, fixes bug #29846.
20571         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20572
20573 2002-09-16  Nick Drochak  <ndrochak@gol.com>
20574
20575         * parameter.cs: Fix compile error.  Cannot reference static member
20576         from an instance object.  Is this an mcs bug?
20577
20578 2002-09-14  Martin Baulig  <martin@gnome.org>
20579
20580         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20581         multiple times.  Fixes bug #30295, added test-166.cs.
20582
20583 2002-09-14  Martin Baulig  <martin@gnome.org>
20584
20585         * statement.cs (Block.Emit): Don't emit unreachable code.
20586         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20587         `break' statements.
20588         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20589
20590 2002-09-14  Martin Baulig  <martin@gnome.org>
20591
20592         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20593         is set.
20594
20595 2002-09-14  Martin Baulig  <martin@gnome.org>
20596
20597         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20598         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20599         be false on the ms runtime.
20600
20601 2002-09-13  Martin Baulig  <martin@gnome.org>
20602
20603         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20604         the CS0038 error message.
20605
20606 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
20607
20608         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20609         constant inside, return it.
20610
20611 2002-09-12  Martin Baulig  <martin@gnome.org>
20612
20613         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20614         implicit conversion can be done between enum types.
20615
20616         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20617         check whether an implicit conversion to the current enum's UnderlyingType
20618         exists and report an error if not.
20619
20620         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20621         without debugging support.
20622
20623         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20624         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
20625
20626 2002-09-12  Martin Baulig  <martin@gnome.org>
20627
20628         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20629
20630         * ecore.cs (IMemberExpr.DeclaringType): New property.
20631         (SimpleName.SimpleNameResolve): Check whether we're accessing a
20632         nonstatic member of an outer type (CS0038).
20633
20634 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
20635
20636         * driver.cs: Activate the using-error detector at warning level
20637         4 (at least for MS-compatible APIs).
20638
20639         * namespace.cs (VerifyUsing): Small buglett fix.
20640
20641         * pending.cs (PendingImplementation): pass the container pointer. 
20642
20643         * interface.cs (GetMethods): Allow for recursive definition.  Long
20644         term, I would like to move every type to support recursive
20645         definitions, not the current ordering mechanism that we have right
20646         now.
20647
20648         The situation is this: Attributes are handled before interfaces,
20649         so we can apply attributes to interfaces.  But some attributes
20650         implement interfaces, we will now handle the simple cases
20651         (recursive definitions will just get an error).  
20652
20653         * parameter.cs: Only invalidate types at the end if we fail to
20654         lookup all types.  
20655
20656 2002-09-09  Martin Baulig  <martin@gnome.org>
20657
20658         * ecore.cs (PropertyExpr.Emit): Also check for
20659         TypeManager.system_int_array_get_length so this'll also work when
20660         compiling corlib.  Fixes #30003.
20661
20662 2002-09-09  Martin Baulig  <martin@gnome.org>
20663
20664         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20665         and throw an exception if we can't get the type's size.  Fixed #30040,
20666         added test-165.cs.
20667
20668 2002-09-09  Martin Baulig  <martin@gnome.org>
20669
20670         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20671
20672         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20673         context.  Fixes bug #30027.
20674
20675         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20676         virtual functions.  Fixes bug #30043, added test-164.cs.
20677
20678 2002-09-08  Ravi Pratap  <ravi@ximian.com>
20679
20680         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20681
20682 2002-09-08  Nick Drochak  <ndrochak@gol.com>
20683
20684         * driver.cs: Use an object to get the windows codepage since it's not a
20685         static property.
20686
20687 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
20688
20689         * statement.cs (For.Emit): for infinite loops (test == null)
20690         return whether there is a break inside, not always "true".
20691
20692         * namespace.cs (UsingEntry): New struct to hold the name of the
20693         using definition, the location where it is defined, and whether it
20694         has been used in a successful type lookup.
20695
20696         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20697         strings.
20698
20699         * decl.cs: ditto.
20700
20701 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20702
20703         * attribute.cs : Fix incorrect code which relied on catching
20704         a NullReferenceException to detect a null being passed in
20705         where an object was expected.
20706
20707 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
20708
20709         * statement.cs (Try): flag the catch variable as assigned
20710
20711         * expression.cs (Cast): Simplified by using ResolveType instead of
20712         manually resolving.
20713
20714         * statement.cs (Catch): Fix bug by using ResolveType.
20715
20716 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20717
20718         * expression.cs (BetterConversion): Special case for when we have
20719         a NullLiteral as the argument and we have to choose between string
20720         and object types - we choose string the way csc does.
20721
20722         * attribute.cs (Attribute.Resolve): Catch the
20723         NullReferenceException and report error #182 since the Mono
20724         runtime no more has the bug and having this exception raised means
20725         we tried to select a constructor which takes an object and is
20726         passed a null.
20727
20728 2002-09-05  Ravi Pratap  <ravi@ximian.com>
20729
20730         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20731         message (1502, 1503) when we can't locate a method after overload
20732         resolution. This is much more informative and closes the bug
20733         Miguel reported.
20734
20735         * interface.cs (PopulateMethod): Return if there are no argument
20736         types. Fixes a NullReferenceException bug.
20737
20738         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20739         expressions too. Previously we were checking only in one place for
20740         positional arguments leaving out named arguments.
20741
20742         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20743         type to the enum type is not allowed. Remove code corresponding to
20744         that.
20745
20746         (ConvertNumericExplicit): Allow explicit conversions from
20747         the underlying type to enum type. This precisely follows the spec
20748         and closes a bug filed by Gonzalo.
20749
20750 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20751
20752         * compiler.csproj:
20753         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20754
20755 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
20756
20757         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20758         it was important that we stored the right value after the
20759         reduction in `converted'.
20760
20761 2002-09-04  Martin Baulig  <martin@gnome.org>
20762
20763         * location.cs (Location.SymbolDocument): Use full pathnames for the
20764         source files.
20765
20766 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
20767
20768         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20769         of the expression resolve mechanism, because that will catch the
20770         SimpleName error failures.
20771
20772         (Conditional): If we can not resolve the
20773         expression, return, do not crash.
20774
20775 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20776
20777         * cs-tokenizer.cs:
20778         (location): display token name instead of its number.
20779
20780 2002-08-28  Martin Baulig  <martin@gnome.org>
20781
20782         * expression.cs (Binary.ResolveOperator): Don't silently return
20783         but return an error if an operator cannot be applied between two
20784         enum types.
20785
20786 2002-08-28  Martin Baulig  <martin@gnome.org>
20787
20788         * class.cs (Constructor.Define): Set the permission attributes
20789         correctly instead of making all constructors public.
20790
20791 2002-08-28  Martin Baulig  <martin@gnome.org>
20792
20793         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20794         for private members before reporting a CS0103; if we find anything,
20795         it's a CS0122.
20796
20797 2002-08-28  Martin Baulig  <martin@gnome.org>
20798
20799         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20800         to check whether `closure_start_type == closure_invocation_type',
20801         we also need to check whether `m.DeclaringType == closure_invocation_type'
20802         before bypassing the permission checks.  We might be accessing
20803         protected/private members from the base class.
20804         (TypeManager.RealMemberLookup): Only set private_ok if private
20805         members were requested via BindingFlags.NonPublic.
20806
20807         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20808
20809         * expression.cs (MemberAccess.ResolveMemberAccess): Set
20810         MethodGroupExpr.IsExplicitImpl if appropriate.
20811         (Invocation.DoResolve): Don't report the CS0120 for explicit
20812         interface implementations.
20813
20814 2002-08-27  Martin Baulig  <martin@gnome.org>
20815
20816         * expression.cs (Invocation.DoResolve): If this is a static
20817         method and we don't have an InstanceExpression, we must report
20818         a CS0120.
20819
20820 2002-08-25  Martin Baulig  <martin@gnome.org>
20821
20822         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20823         `==' between a valuetype and an object.
20824
20825 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
20826
20827         * ecore.cs (TypeExpr): Provide a ToString method.
20828
20829 2002-08-24  Martin Baulig  <martin@gnome.org>
20830
20831         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20832         now called proggie.dbg and it's a binary file.
20833
20834 2002-08-23  Martin Baulig  <martin@gnome.org>
20835
20836         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20837
20838 2002-08-23  Martin Baulig  <martin@gnome.org>
20839
20840         * struct.cs (MyStructInfo.ctor): Make this work with empty
20841         structs; it's not allowed to use foreach() on null.
20842
20843 2002-08-23  Martin Baulig  <martin@gnome.org>
20844
20845         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20846         writer the full pathname of the generated assembly.
20847
20848 2002-08-23  Martin Baulig  <martin@gnome.org>
20849
20850         * statements.cs (FlowBranching.UsageVector.MergeChildren):
20851         A `finally' block never returns or breaks; improved handling of
20852         unreachable code.
20853
20854 2002-08-23  Martin Baulig  <martin@gnome.org>
20855
20856         * statement.cs (Throw.Resolve): Allow `throw null'.
20857
20858 2002-08-23  Martin Baulig  <martin@gnome.org>
20859
20860         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20861         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20862         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
20863         MemberLookup would return a wrong event if this is an explicit
20864         interface implementation and the class has an event with the same
20865         name.
20866
20867 2002-08-23  Martin Baulig  <martin@gnome.org>
20868
20869         * statement.cs (Block.AddChildVariableNames): New public method.
20870         (Block.AddChildVariableName): Likewise.
20871         (Block.IsVariableNameUsedInChildBlock): Likewise.
20872         (Block.AddVariable): Check whether a variable name has already
20873         been used in a child block.
20874
20875         * cs-parser.jay (declare_local_variables): Mark all variable names
20876         from the current block as being used in a child block in the
20877         implicit block.
20878
20879 2002-08-23  Martin Baulig  <martin@gnome.org>
20880
20881         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20882         find the symbol writer.
20883
20884         * driver.cs: csc also allows the arguments to /define being
20885         separated by commas, not only by semicolons.
20886
20887 2002-08-23  Martin Baulig  <martin@gnome.org>
20888
20889         * interface.cs (Interface.GetMembers): Added static check for events.
20890
20891 2002-08-15  Martin Baulig  <martin@gnome.org>
20892
20893         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20894         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20895
20896         * ecore.cs (Expression.MemberLookup): Added documentation and explained
20897         why the MethodData.EmitDestructor() change was necessary.
20898
20899 2002-08-20  Martin Baulig  <martin@gnome.org>
20900
20901         * class.cs (TypeContainer.FindMembers): Added static check for events.
20902
20903         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20904
20905         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20906         use Type.GetEvents(), not Type.FindMembers().
20907
20908 2002-08-20  Martin Baulig  <martin@gnome.org>
20909
20910         * decl.cs (MemberCache): Added a special method cache which will
20911         be used for method-only searched.  This ensures that a method
20912         search will return a MethodInfo with the correct ReflectedType for
20913         inherited methods.      
20914
20915 2002-08-20  Martin Baulig  <martin@gnome.org>
20916
20917         * decl.cs (DeclSpace.FindMembers): Made this public.
20918
20919 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20920
20921         * delegate.cs: fixed build on windows.
20922         [FIXME:  Filed as bug #29150: MCS must report these errors.]
20923
20924 2002-08-19  Ravi Pratap  <ravi@ximian.com>
20925
20926         * ecore.cs (StandardConversionExists): Return a false
20927         if we are trying to convert the void type to anything else
20928         since that is not allowed.
20929
20930         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20931         we flag error 70 in the event an event is trying to be accessed
20932         directly from outside the declaring type.
20933
20934 2002-08-20  Martin Baulig  <martin@gnome.org>
20935
20936         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20937         MemberCache from typemanager.cs to decl.cs.
20938
20939 2002-08-19  Martin Baulig  <martin@gnome.org>
20940
20941         * class.cs (TypeContainer): Implement IMemberContainer.
20942         (TypeContainer.DefineMembers): Create the MemberCache.
20943         (TypeContainer.FindMembers): Do better BindingFlags checking; only
20944         return public members if BindingFlags.Public was given, check
20945         whether members are static.
20946
20947 2002-08-16  Martin Baulig  <martin@gnome.org>
20948
20949         * decl.cs (DeclSpace.Define): Splitted this in Define and
20950         DefineMembers.  DefineMembers is called first and initializes the
20951         MemberCache.
20952
20953         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
20954         DefineMembers() on all our DeclSpaces.
20955
20956         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20957         but call DefineMembers() on all nested interfaces.  We call their
20958         Define() in our new Define() function.
20959
20960         * interface.cs (Interface): Implement IMemberContainer.
20961         (Interface.Define): Moved all code except the attribute stuf to
20962         DefineMembers().
20963         (Interface.DefineMembers): Initialize the member cache.
20964
20965         * typemanager.cs (IMemberFinder): Removed this interface, we don't
20966         need this anymore since we can use MemberCache.FindMembers directly.
20967
20968 2002-08-19  Martin Baulig  <martin@gnome.org>
20969
20970         * typemanager.cs (MemberCache): When creating the cache for an
20971         interface type, add all inherited members.
20972         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20973         to `out bool used_cache' and documented it.
20974         (TypeManager.MemberLookup): If we already used the cache in the first
20975         iteration, we don't need to do the interfaces check.
20976
20977 2002-08-19  Martin Baulig  <martin@gnome.org>
20978
20979         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
20980         here from IMemberFinder and don't implement this interface anymore.
20981         (DeclSpace.MemberCache): Moved here from IMemberFinder.
20982
20983         * typemanager.cs (IMemberFinder): This interface is now only used by
20984         classes which actually support the member cache.
20985         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20986         since we only put DeclSpaces into this Hashtable.
20987         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20988         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20989
20990 2002-08-16  Martin Baulig  <martin@gnome.org>
20991
20992         * typemanager.cs (ICachingMemberFinder): Removed.
20993         (IMemberFinder.MemberCache): New property.
20994         (TypeManager.FindMembers): Merged this with RealFindMembers().
20995         This function will never be called from TypeManager.MemberLookup()
20996         so we can't use the cache here, just the IMemberFinder.
20997         (TypeManager.MemberLookup_FindMembers): Check whether the
20998         IMemberFinder has a MemberCache and call the cache's FindMembers
20999         function.
21000         (MemberCache): Rewrote larger parts of this yet another time and
21001         cleaned it up a bit.
21002
21003 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
21004
21005         * driver.cs (LoadArgs): Support quoting.
21006
21007         (Usage): Show the CSC-like command line arguments.
21008
21009         Improved a few error messages.
21010
21011 2002-08-15  Martin Baulig  <martin@gnome.org>
21012
21013         * typemanager.cs (IMemberContainer.Type): New property.
21014         (IMemberContainer.IsInterface): New property.
21015
21016         The following changes are conditional to BROKEN_RUNTIME, which is
21017         defined at the top of the file.
21018
21019         * typemanager.cs (MemberCache.MemberCache): Don't add the base
21020         class'es members, but add all members from TypeHandle.ObjectType
21021         if we're an interface.
21022         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
21023         is the current type.
21024         (MemberCache.CacheEntry.Container): Removed this field.
21025         (TypeHandle.GetMembers): Include inherited members.
21026
21027 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21028
21029         * typemanager.cs: fixed compilation and added a comment on a field that
21030         is never used.
21031
21032 2002-08-15  Martin Baulig  <martin@gnome.org>
21033
21034         * class.cs (ConstructorInitializer.Resolve): In the
21035         Expression.MemberLookup call, use the queried_type as
21036         invocation_type.
21037
21038         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
21039         declared' attribute, it's always true.
21040         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
21041         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
21042         temporary wrapper for FindMembers which tells MemberLookup whether
21043         members from the base classes are included in the return value.
21044         This will go away soon.
21045         (TypeManager.MemberLookup): Use this temporary hack here; once the
21046         new MemberCache is completed, we don't need to do the DeclaredOnly
21047         looping here anymore since the MemberCache will take care of this.
21048         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
21049         (MemberCache): When creating the MemberCache for a class, get
21050         members from the current class and all its base classes.
21051         (MemberCache.CacheEntry.Container): New field.  This is a
21052         temporary hack until the Mono runtime is fixed to distinguish
21053         between ReflectedType and DeclaringType.  It allows us to use MCS
21054         with both the MS runtime and the unfixed Mono runtime without
21055         problems and without accecting performance.
21056         (MemberCache.SearchMembers): The DeclaredOnly looping from
21057         TypeManager.MemberLookup is now done here.      
21058
21059 2002-08-14  Martin Baulig  <martin@gnome.org>
21060
21061         * statement.cs (MyStructInfo.MyStructInfo): Don't call
21062         Type.GetFields on dynamic types but get the fields from the
21063         corresponding TypeContainer.
21064         (MyStructInfo.GetStructInfo): Added check for enum types.
21065
21066         * typemanager.cs (MemberList.IsSynchronized): Implemented.
21067         (MemberList.SyncRoot): Implemented.
21068         (TypeManager.FilterWithClosure): No need to check permissions if
21069         closure_start_type == closure_invocation_type, don't crash if
21070         closure_invocation_type is null.
21071
21072 2002-08-13  Martin Baulig  <martin@gnome.org>
21073
21074         Rewrote TypeContainer.FindMembers to use a member cache.  This
21075         gives us a speed increase of about 35% for the self-hosting MCS
21076         build and of about 15-20% for the class libs (both on GNU/Linux).
21077
21078         * report.cs (Timer): New class to get enhanced profiling.  This
21079         whole class is "TIMER" conditional since it remarkably slows down
21080         compilation speed.
21081
21082         * class.cs (MemberList): New class.  This is an IList wrapper
21083         which we're now using instead of passing MemberInfo[]'s around to
21084         avoid copying this array unnecessarily.
21085         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
21086         (ICachingMemberFinder, IMemberContainer): New interface.
21087         (TypeManager.FilterWithClosure): If `criteria' is null, the name
21088         has already been checked, otherwise use it for the name comparision.
21089         (TypeManager.FindMembers): Renamed to RealMemberFinder and
21090         provided wrapper which tries to use ICachingMemberFinder.FindMembers
21091         if possible.  Returns a MemberList, not a MemberInfo [].
21092         (TypeHandle): New class, implements IMemberContainer.  We create
21093         one instance of this class per type, it contains a MemberCache
21094         which is used to do the member lookups.
21095         (MemberCache): New class.  Each instance of this class contains
21096         all members of a type and a name-based hash table.
21097         (MemberCache.FindMembers): This is our new member lookup
21098         function.  First, it looks up all members of the requested name in
21099         the hash table.  Then, it walks this list and sorts out all
21100         applicable members and returns them.
21101
21102 2002-08-13  Martin Baulig  <martin@gnome.org>
21103
21104         In addition to a nice code cleanup, this gives us a performance
21105         increase of about 1.4% on GNU/Linux - not much, but it's already
21106         half a second for the self-hosting MCS compilation.
21107
21108         * typemanager.cs (IMemberFinder): New interface.  It is used by
21109         TypeManager.FindMembers to call FindMembers on a TypeContainer,
21110         Enum, Delegate or Interface.
21111         (TypeManager.finder_to_member_finder): New PtrHashtable.
21112         (TypeManager.finder_to_container): Removed.
21113         (TypeManager.finder_to_delegate): Removed.
21114         (TypeManager.finder_to_interface): Removed.
21115         (TypeManager.finder_to_enum): Removed.
21116
21117         * interface.cs (Interface): Implement IMemberFinder.
21118
21119         * delegate.cs (Delegate): Implement IMemberFinder.
21120
21121         * enum.cs (Enum): Implement IMemberFinder.
21122
21123         * class.cs (TypeContainer): Implement IMemberFinder.
21124
21125 2002-08-12  Martin Baulig  <martin@gnome.org>
21126
21127         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
21128
21129 2002-08-12  Martin Baulig  <martin@gnome.org>
21130
21131         * ecore.cs (ITypeExpression): New interface for expressions which
21132         resolve to a type.
21133         (TypeExpression): Renamed to TypeLookupExpression.
21134         (Expression.DoResolve): If we're doing a types-only lookup, the
21135         expression must implement the ITypeExpression interface and we
21136         call DoResolveType() on it.
21137         (SimpleName): Implement the new ITypeExpression interface.
21138         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
21139         hack, the situation that we're only looking up types can't happen
21140         anymore when this method is called.  Moved the type lookup code to
21141         DoResolveType() and call it.
21142         (SimpleName.DoResolveType): This ITypeExpression interface method
21143         is now doing the types-only lookup.
21144         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
21145         (ResolveFlags): Added MaskExprClass.
21146
21147         * expression.cs (MemberAccess): Implement the ITypeExpression
21148         interface.
21149         (MemberAccess.DoResolve): Added support for a types-only lookup
21150         when we're called via ITypeExpression.DoResolveType().
21151         (ComposedCast): Implement the ITypeExpression interface.
21152
21153         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
21154         Expression.Resolve() with ResolveFlags.Type instead.
21155
21156 2002-08-12  Martin Baulig  <martin@gnome.org>
21157
21158         * interface.cs (Interface.Define): Apply attributes.
21159
21160         * attribute.cs (Attribute.ApplyAttributes): Added support for
21161         interface attributes.
21162
21163 2002-08-11  Martin Baulig  <martin@gnome.org>
21164
21165         * statement.cs (Block.Emit): Only check the "this" variable if we
21166         do not always throw an exception.
21167
21168         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
21169         whether the property has a set accessor.
21170
21171 2002-08-11  Martin Baulig  <martin@gnome.org>
21172
21173         Added control flow analysis support for structs.
21174
21175         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
21176         with control flow analysis turned off.
21177         (IVariable): New interface.
21178         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
21179         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
21180         (FieldExpr.DoResolve): Resolve the instance expression with flow
21181         analysis turned off and do the definite assignment check after the
21182         resolving when we know what the expression will resolve to.
21183
21184         * expression.cs (LocalVariableReference, ParameterReference):
21185         Implement the new IVariable interface, only call the flow analysis
21186         code if ec.DoFlowAnalysis is true.
21187         (This): Added constructor which takes a Block argument.  Implement
21188         the new IVariable interface.
21189         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
21190         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
21191         This does the definite assignment checks for struct members.
21192
21193         * class.cs (Constructor.Emit): If this is a non-static `struct'
21194         constructor which doesn't have any initializer, call
21195         Block.AddThisVariable() to tell the flow analysis code that all
21196         struct elements must be initialized before control returns from
21197         the constructor.
21198
21199         * statement.cs (MyStructInfo): New public class.
21200         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
21201         argument to this indexer.  If non-zero, check an individual struct
21202         member, not the whole struct.
21203         (FlowBranching.CheckOutParameters): Check struct members.
21204         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
21205         overloaded versions of these methods which take an additional
21206         `int field_idx' argument to check struct members.
21207         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
21208         overloaded versions of these methods which take an additional
21209         `string field_name' argument to check struct member.s
21210         (VariableInfo): Implement the IVariable interface.
21211         (VariableInfo.StructInfo): New public property.  Returns the
21212         MyStructInfo instance of the variable if it's a struct or null.
21213         (Block.AddThisVariable): New public method.  This is called from
21214         Constructor.Emit() for non-static `struct' constructor which do
21215         not have any initializer.  It creates a special variable for the
21216         "this" instance variable which will be checked by the flow
21217         analysis code to ensure that all of the struct's fields are
21218         initialized before control returns from the constructor.
21219         (UsageVector): Added support for struct members.  If a
21220         variable/parameter is a struct with N members, we reserve a slot
21221         in the usage vector for each member.  A struct is considered fully
21222         initialized if either the struct itself (slot 0) or all its
21223         members are initialized.
21224
21225 2002-08-08  Martin Baulig  <martin@gnome.org>
21226
21227         * driver.cs (Driver.MainDriver): Only report an error CS5001
21228         if there were no compilation errors.
21229
21230         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
21231         `UnsafeContext' property to determine whether the parent is in
21232         unsafe context rather than checking the parent's ModFlags:
21233         classes nested in an unsafe class are unsafe as well.
21234
21235 2002-08-08  Martin Baulig  <martin@gnome.org>
21236
21237         * statement.cs (UsageVector.MergeChildren): Distinguish between
21238         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
21239         we return.  Added test17() and test18() to test-154.cs.
21240
21241 2002-08-08  Martin Baulig  <martin@gnome.org>
21242
21243         * typemanager.cs (TypeManager.FilterWithClosure): If we have
21244         Family access, make sure the invoking type isn't a subclass of the
21245         queried type (that'd be a CS1540).
21246
21247         * ecore.cs (Expression.MemberLookup): Added overloaded version of
21248         this method which takes an additional `Type invocation_type'.
21249
21250         * expression.cs (BaseAccess.DoResolve): Use the base type as
21251         invocation and query type.
21252         (MemberAccess.DoResolve): If the lookup failed and we're about to
21253         report a CS0122, try a lookup with the ec.ContainerType - if this
21254         succeeds, we must report a CS1540.
21255
21256 2002-08-08  Martin Baulig  <martin@gnome.org>
21257
21258         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
21259         (MethodGroupExpr): Implement the IMemberExpr interface.
21260
21261         * expression (MemberAccess.ResolveMemberAccess): No need to have
21262         any special code for MethodGroupExprs anymore, they're now
21263         IMemberExprs.   
21264
21265 2002-08-08  Martin Baulig  <martin@gnome.org>
21266
21267         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
21268         Family, FamANDAssem and FamORAssem permissions.
21269         (TypeManager.IsSubclassOrNestedChildOf): New public method.
21270
21271 2002-08-08  Martin Baulig  <martin@gnome.org>
21272
21273         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
21274         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
21275         or loop block.
21276
21277 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
21278
21279         * driver.cs: implemented /resource option to embed managed resources.
21280
21281 2002-08-07  Martin Baulig  <martin@gnome.org>
21282
21283         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
21284         (FieldBase.HasFieldInitializer): New public property.
21285         (FieldBase.GetInitializerExpression): New public method.  Resolves and
21286         returns the field initializer and makes sure it is only resolved once.
21287         (TypeContainer.EmitFieldInitializers): Call
21288         FieldBase.GetInitializerExpression to get the initializer, this ensures
21289         that it isn't resolved multiple times.
21290
21291         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
21292         the resolving process (SimpleName/MemberLookup) that we're currently
21293         emitting a field initializer (which must not access any instance members,
21294         this is an error CS0236).
21295
21296         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
21297         argument, if the `IsFieldInitializer' flag is set, we must report and
21298         error CS0236 and not an error CS0120.   
21299
21300 2002-08-07  Martin Baulig  <martin@gnome.org>
21301
21302         * ecore.cs (IMemberExpr): New public interface.
21303         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
21304         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
21305         if the expression is an IMemberExpr.
21306
21307         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
21308         to be null, implicitly default to `this' if we're non-static in
21309         this case.  Simplified the code a lot by using the new IMemberExpr
21310         interface.  Also fixed bug #28176 here.
21311
21312 2002-08-06  Martin Baulig  <martin@gnome.org>
21313
21314         * cs-parser.jay (SimpleLookup): Removed.  We need to create
21315         ParameterReferences during semantic analysis so that we can do a
21316         type-only search when resolving Cast, TypeOf and SizeOf.
21317         (block): Pass the `current_local_parameters' to the Block's
21318         constructor.
21319
21320         * class.cs (ConstructorInitializer): Added `Parameters parameters'
21321         argument to the constructor.
21322         (ConstructorInitializer.Resolve): Create a temporary implicit
21323         block with the parameters.
21324
21325         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
21326         references here if we aren't doing a type-only search.
21327
21328         * statement.cs (Block): Added constructor which takes a
21329         `Parameters parameters' argument.
21330         (Block.Parameters): New public property.
21331
21332         * support.cs (InternalParameters.Parameters): Renamed `parameters'
21333         to `Parameters' and made it public readonly.
21334
21335 2002-08-06  Martin Baulig  <martin@gnome.org>
21336
21337         * ecore.cs (Expression.Warning): Made this public as well.
21338
21339         * report.cs (Report.Debug): Print the contents of collections.
21340
21341 2002-08-06  Martin Baulig  <martin@gnome.org>
21342
21343         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
21344         used to tell Resolve() which kinds of expressions it may return.
21345         (Expression.Resolve): Added overloaded version of this method which
21346         takes a `ResolveFlags flags' argument.  This can be used to tell
21347         Resolve() which kinds of expressions it may return.  Reports a
21348         CS0118 on error.
21349         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21350         ResolveFlags.SimpleName.
21351         (Expression.Error118): Added overloaded version of this method which
21352         takes a `ResolveFlags flags' argument.  It uses the flags to determine
21353         which kinds of expressions are allowed.
21354
21355         * expression.cs (Argument.ResolveMethodGroup): New public method.
21356         Resolves an argument, but allows a MethodGroup to be returned.
21357         This is used when invoking a delegate.
21358
21359         * TODO: Updated a bit.
21360
21361 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21362
21363         Fixed compilation with csc.
21364
21365         * ecore.cs: Expression.Error made public. Is this correct? Should
21366         Warning be made public too?
21367
21368         * expression.cs: use ea.Location instead of ea.loc.
21369         [FIXME:  Filed as bug #28607: MCS must report these errors.]
21370
21371 2002-08-06  Martin Baulig  <martin@gnome.org>
21372
21373         * ecore.cs (Expression.loc): Moved the location here instead of
21374         duplicating it in all derived classes.
21375         (Expression.Location): New public property.
21376         (Expression.Error, Expression.Warning): Made them non-static and
21377         removed the location argument.
21378         (Expression.Warning): Added overloaded version which takes an
21379         `int level' argument.
21380         (Expression.Error118): Make this non-static and removed the
21381         expression and location arguments.
21382         (TypeExpr): Added location argument to the constructor.
21383
21384         * expression.cs (StaticCallExpr): Added location argument to
21385         the constructor.
21386         (Indirection, PointerArithmetic): Likewise.
21387         (CheckedExpr, UnCheckedExpr): Likewise.
21388         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21389         (StringPtr): Likewise.
21390
21391
21392 2002-08-05  Martin Baulig  <martin@gnome.org>
21393
21394         * expression.cs (BaseAccess.DoResolve): Actually report errors.
21395
21396         * assign.cs (Assign.DoResolve): Check whether the source
21397         expression is a value or variable.
21398
21399         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21400         while resolving the corresponding blocks.
21401
21402         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21403         an error, don't silently return null.
21404
21405         * statement.cs (Block.AddVariable): Do the error reporting here
21406         and distinguish between CS0128 and CS0136.
21407         (Block.DoResolve): Report all unused labels (warning CS0164).
21408         (LabeledStatement): Pass the location to the constructor.
21409         (LabeledStatement.HasBeenReferenced): New property.
21410         (LabeledStatement.Resolve): Set it to true here.
21411
21412         * statement.cs (Return.Emit): Return success even after reporting
21413         a type mismatch error (CS0126 or CS0127), this is what csc does and
21414         it avoids confusing the users with any consecutive errors.
21415
21416 2002-08-05  Martin Baulig  <martin@gnome.org>
21417
21418         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21419
21420         * const.cs (Const.LookupConstantValue): Catch circular definitions.
21421
21422         * expression.cs (MemberAccess.DoResolve): Silently return if an
21423         error has already been reported.
21424
21425         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21426         error has already been reported.
21427
21428 2002-08-05  Martin Baulig  <martin@gnome.org>
21429
21430         * statement.cs (UsageVector): Only initialize the `parameters'
21431         vector if we actually have any "out" parameters.
21432
21433 2002-08-05  Martin Baulig  <martin@gnome.org>
21434
21435         * expression.cs (Binary.ResolveOperator): When combining delegates,
21436         they must have the same type.
21437
21438 2002-08-05  Martin Baulig  <martin@gnome.org>
21439
21440         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21441         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21442         work with the ms runtime and we also don't need it: if we're a
21443         PropertyBuilder and not in the `indexer_arguments' hash, then we
21444         are a property and not an indexer.
21445
21446         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21447         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21448         since the latter one doesn't work with the ms runtime.
21449
21450 2002-08-03  Martin Baulig  <martin@gnome.org>
21451
21452         Fixed bugs #27998 and #22735.
21453
21454         * class.cs (Method.IsOperator): New public field.
21455         (Method.CheckBase): Report CS0111 if there's already a method
21456         with the same parameters in the current class.  Report CS0508 when
21457         attempting to change the return type of an inherited method.
21458         (MethodData.Emit): Report CS0179 if a method doesn't have a body
21459         and it's not marked abstract or extern.
21460         (PropertyBase): New abstract base class for Property and Indexer.
21461         (PropertyBase.CheckBase): Moved here from Property and made it work
21462         for indexers.
21463         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21464         the same so we can reuse it there.
21465         (Property, Indexer): Derive from PropertyBase.
21466         (MethodSignature.inheritable_property_signature_filter): New delegate
21467         to find properties and indexers.
21468
21469         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21470         argument and improved error reporting.
21471
21472         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21473         EmptyReadOnlyParameters and made it a property.
21474
21475         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21476         version of this method which takes a `PropertyInfo indexer'.
21477         (TypeManager.RegisterIndexer): New method.
21478
21479         * class.cs: Added myself as author of this file :-)
21480
21481 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21482
21483         * class.cs: fixed compilation on windoze.
21484
21485 2002-08-03  Martin Baulig  <martin@gnome.org>
21486
21487         * interface.cs (Interface.GetInterfaceBases): Check whether all
21488         base interfaces are at least as accessible than the current one.
21489
21490         * class.cs (TypeContainer.GetClassBases): Check whether base types
21491         are at least as accessible than the current type.
21492         (TypeContainer.AsAccessible): Implemented and made non-static.
21493         (MemberBase.CheckParameters): Report errors if the accessibility
21494         checks fail.
21495
21496         * delegate.cs (Delegate.Delegate): The default visibility is
21497         internal for top-level types and private for nested types.
21498         (Delegate.Define): Report errors if the accessibility checks fail.
21499
21500         * enum.cs (Enum.Enum): The default visibility is internal for
21501         top-level types and private for nested types.
21502         (Enum.DefineType): Compute the correct visibility.
21503
21504         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21505         function which takes a `bool is_toplevel' instead of a TypeContainer.
21506
21507         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21508         builtin type.
21509
21510 2002-08-02  Martin Baulig  <martin@gnome.org>
21511
21512         * expression.cs (LocalVariableReferenc): Added constructor which
21513         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21514         (LocalVariableReference.IsReadOnly): New property.
21515         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21516         variable is readonly, use our own readonly flag to do this; you can
21517         use the new constructor to get a writable reference to a read-only
21518         variable.
21519
21520         * cs-parser.jay (foreach_statement, using_statement): Get a writable
21521         reference to the local variable.
21522
21523 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
21524
21525         * rootcontext.cs (ResolveCore): Also include System.Exception
21526
21527         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21528         we reach an EmptyStatement.
21529
21530         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21531         is also fine.
21532
21533         * expression.cs (Binary.ResolveOperator): Check error result in
21534         two places.
21535
21536         use brtrue/brfalse directly and avoid compares to null.
21537
21538 2002-08-02  Martin Baulig  <martin@gnome.org>
21539
21540         * class.cs (TypeContainer.Define): Define all nested interfaces here.
21541         Fixes bug #28407, added test-155.cs.
21542
21543 2002-08-01  Martin Baulig  <martin@gnome.org>
21544
21545         * class.cs (Event.EmitDefaultMethod): Make this work with static
21546         events.  Fixes #28311, added verify-3.cs.
21547
21548 2002-08-01  Martin Baulig  <martin@gnome.org>
21549
21550         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21551         `is_disposable' fields.
21552         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21553         `hm.is_disposable' if we're using the collection pattern.
21554         (Foreach.EmitCollectionForeach): Use the correct type for the
21555         enumerator's local variable, only emit the try/finally block if
21556         necessary (fixes #27713).
21557
21558 2002-08-01  Martin Baulig  <martin@gnome.org>
21559
21560         * ecore.cs (Expression.report118): Renamed to Error118 and made
21561         it public static.
21562
21563         * statement.cs (Throw.Resolve): Check whether the expression is of
21564         the correct type (CS0118) and whether the type derives from
21565         System.Exception (CS0155).
21566         (Catch.Resolve): New method.  Do the type lookup here and check
21567         whether it derives from System.Exception (CS0155).
21568         (Catch.CatchType, Catch.IsGeneral): New public properties.
21569
21570         * typemanager.cs (TypeManager.exception_type): Added.
21571
21572 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
21573
21574         * driver.cs: Updated About function.
21575
21576 2002-07-31  Martin Baulig  <martin@gnome.org>
21577
21578         Implemented Control Flow Analysis.
21579
21580         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21581         (EmitContext.CurrentBranching): Added.
21582         (EmitContext.StartFlowBranching): Added.
21583         (EmitContext.EndFlowBranching): Added.
21584         (EmitContext.KillFlowBranching): Added.
21585         (EmitContext.IsVariableAssigned): Added.
21586         (EmitContext.SetVariableAssigned): Added.
21587         (EmitContext.IsParameterAssigned): Added.
21588         (EmitContext.SetParameterAssigned): Added.
21589         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21590         Added control flow analysis stuff here.
21591
21592         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21593         resolve the expression as lvalue.
21594         (LocalVariableReference.DoResolve): Check whether the variable has
21595         already been assigned.
21596         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21597         the parameter as assigned here.
21598         (ParameterReference.DoResolve): Check whether the parameter has already
21599         been assigned.
21600         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21601         expression as lvalue.
21602
21603         * statement.cs (FlowBranching): New class for the flow analysis code.
21604         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21605         (LabeledStatement.IsDefined): New public property.
21606         (LabeledStatement.AddUsageVector): New public method to tell flow
21607         analyis that the label may be reached via a forward jump.
21608         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21609         flow analysis.
21610         (VariableInfo.Number): New public field.  This is used by flow analysis
21611         to number all locals of a block.
21612         (Block.CountVariables): New public property.  This is the number of
21613         local variables in this block (including the locals from all parent
21614         blocks).
21615         (Block.EmitMeta): Number all the variables.
21616
21617         * statement.cs: Added flow analysis support to all classes.
21618
21619 2002-07-31  Martin Baulig  <martin@gnome.org>
21620
21621         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21622         To get debugging messages, compile mcs with /define:MCS_DEBUG and
21623         then use this argument.
21624
21625         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21626
21627         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21628         use this to specify /define options.
21629
21630 2002-07-29  Martin Baulig  <martin@gnome.org>
21631
21632         * statement.cs (Fixed): Moved all code that does variable lookups
21633         and resolvings from Emit to Resolve.
21634
21635         * statement.cs (For): Moved all code that does variable lookups
21636         and resolvings from Emit to Resolve.
21637
21638         * statement.cs (Using): Moved all code that does variable lookups
21639         and resolvings from Emit to Resolve.
21640
21641 2002-07-29  Martin Baulig  <martin@gnome.org>
21642
21643         * attribute.cs (Attribute.Resolve): Explicitly catch a
21644         System.NullReferenceException when creating the
21645         CustromAttributeBuilder and report a different warning message.
21646
21647 2002-07-29  Martin Baulig  <martin@gnome.org>
21648
21649         * support.cs (ParameterData.ParameterName): Added method to
21650         get the name of a parameter.
21651
21652         * typemanager.cs (TypeManager.IsValueType): New public method.
21653
21654 2002-07-29  Martin Baulig  <martin@gnome.org>
21655
21656         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
21657         is a flag which specifies that it's either ref or out.
21658         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21659         the out parameter to `out Parameter.Modifier mod', also set the
21660         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21661
21662         * support.cs (InternalParameters.ParameterModifier): Distinguish
21663         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21664         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21665
21666         * expression.cs (Argument.GetParameterModifier): Distinguish
21667         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21668         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21669
21670 2002-07-29  Martin Baulig  <martin@gnome.org>
21671
21672         * expression.cs (ParameterReference.ParameterReference): Added
21673         `Location loc' argument to the constructor.
21674
21675         * cs-parser.jay: Pass location to ParameterReference.
21676
21677 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
21678
21679         * statement.cs (Try): Initialize the location.
21680
21681         * cs-parser.jay: pass location to Try.
21682
21683         * expression.cs (Unary.Reduce): Change the prototype to return
21684         whether a constant fold could be performed or not.  The result is
21685         returned in an out parameters.  In the case of Indirection and
21686         AddressOf, we want to perform the full tests.
21687
21688 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
21689
21690         * statement.cs (Statement.Emit): Flag dead code.
21691
21692 2002-07-27  Andrew Birkett  <andy@nobugs.org>
21693
21694         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21695
21696 2002-07-27  Martin Baulig  <martin@gnome.org>
21697
21698         * class.cs (MethodData.Define): Put back call to
21699         TypeManager.AddMethod(), accidentally commented this out.
21700
21701         * report.cs (Debug): New public method to print debugging information,
21702         this is `[Conditional ("DEBUG")]'.
21703
21704 2002-07-26  Martin Baulig  <martin@gnome.org>
21705
21706         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21707         (switch_statement): Push the current_block to the switch_stack and
21708         pop it again when we're done with the switch.
21709         (switch_section): The new block is a child of the current_block.
21710         Fixes bug #24007, added test-152.cs.
21711
21712 2002-07-27  Martin Baulig  <martin@gnome.org>
21713
21714         * expression.cs (Invocation.EmitArguments): When calling a varargs
21715         function with only its fixed arguments, we need to pass an empty
21716         array.
21717
21718 2002-07-27  Martin Baulig  <martin@gnome.org>
21719
21720         Mono 0.13 has been released.
21721
21722 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
21723
21724         * driver.cs: Rename --resource to --linkres, because that is what
21725         we do currently, we dont support --resource yet.
21726
21727         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21728
21729 2002-07-25  Martin Baulig  <martin@gnome.org>
21730
21731         * class.cs (MethodData): New public class.  This is a `method builder'
21732         class for a method or one accessor of a Property/Indexer/Event.
21733         (MethodData.GetMethodFlags): Moved here from MemberBase.
21734         (MethodData.ApplyAttributes): Likewise.
21735         (MethodData.ApplyObsoleteAttribute): Likewise.
21736         (MethodData.ApplyConditionalAttribute): Likewise.
21737         (MethodData.ApplyDllImportAttribute): Likewise.
21738         (MethodData.CheckAbstractAndExternal): Likewise.
21739         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21740         (MethodData.Emit): Formerly known as Method.Emit().
21741         (MemberBase): Moved everything which was specific to a single
21742         accessor/method to MethodData.
21743         (Method): Create a new MethodData and call Define() and Emit() on it.
21744         (Property, Indexer, Event): Create a new MethodData objects for each
21745         accessor and call Define() and Emit() on them.
21746
21747 2002-07-25  Martin Baulig  <martin@gnome.org>
21748
21749         Made MethodCore derive from MemberBase to reuse the code from there.
21750         MemberBase now also checks for attributes.
21751
21752         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21753         (MemberBase.GetMethodFlags): Moved here from class Method and marked
21754         as virtual.
21755         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21756         `CallingConventions cc' and `Attributes opt_attrs' arguments.
21757         (MemberBase.ApplyAttributes): New virtual method; applies the
21758         attributes to a method or accessor.
21759         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21760         (MemberBase.ApplyConditionalAttribute): Likewise.
21761         (MemberBase.ApplyDllImportAttribute): Likewise.
21762         (MemberBase.CheckAbstractAndExternal): Likewise.
21763         (MethodCore.ParameterTypes): This is now a property instead of a
21764         method, it's initialized from DoDefineParameters().
21765         (MethodCore.ParameterInfo): Removed the set accessor.
21766         (MethodCore.DoDefineParameters): New protected virtual method to
21767         initialize ParameterTypes and ParameterInfo.
21768         (Method.GetReturnType): We can now simply return the MemberType.
21769         (Method.GetMethodFlags): Override the MemberBase version and add
21770         the conditional flags.
21771         (Method.CheckBase): Moved some code from Define() here, call
21772         DoDefineParameters() here.
21773         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21774         here to avoid some larger code duplication.
21775         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21776         ensure that abstract and external accessors don't declare a body.
21777
21778         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21779         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21780         lookup in the attribute's parent classes, so we need to abort as soon
21781         as we found the first match.
21782         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21783         the attribute has no arguments.
21784
21785         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21786         of a Method.
21787
21788 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21789
21790         * cs-parser.jay: reverted previous patch.
21791
21792 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21793
21794         * cs-parser.jay: fixed bug #22119.
21795
21796 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21797
21798         * attribute.cs: fixed compilation. The error was:
21799         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
21800         be assigned to before control leaves the current method."
21801         [FIXME:  Filed as bug #28186: MCS must report this error.]
21802
21803 2002-07-25  Martin Baulig  <martin@gnome.org>
21804
21805         * attribute.cs (Attribute.Conditional_GetConditionName): New static
21806         method to pull the condition name ouf of a Conditional attribute.
21807         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21808         the obsolete message and error flag out of an Obsolete attribute.
21809
21810         * class.cs (Method.GetMethodFlags): New public method to get the
21811         TypeManager.MethodFlags for this method.
21812         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21813         private methods.
21814         (Method.Define): Get and apply the Obsolete and Conditional attributes;
21815         if we're overriding a virtual function, set the new private variable
21816         `parent_method'; call the new TypeManager.AddMethod().
21817
21818         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
21819         the MethodBuilder and the Method in a PtrHashtable.
21820         (TypeManager.builder_to_method): Added for this purpose.
21821         (TypeManager.MethodFlags): Added IsObsoleteError.
21822         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
21823         Obsolete and Conditional arguments in MethodBuilders.  If we discover
21824         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21825         the message from the attribute.
21826
21827 2002-07-24  Martin Baulig  <martin@gnome.org>
21828
21829         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21830         preprocessor directives, ensure that the argument to #define/#undef is
21831         exactly one identifier and that it's actually an identifier.
21832
21833         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21834         did not work ....
21835
21836 2002-07-24  Martin Baulig  <martin@gnome.org>
21837
21838         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21839         initialize it to TypeManager.object_type in the constructor.
21840         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21841         of the `hm.get_current' method if we're using the collection pattern.
21842         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21843         for the explicit conversion to make it work when we're using the collection
21844         pattern and the `Current' property has a different return type than `object'.
21845         Fixes #27713.
21846
21847 2002-07-24  Martin Baulig  <martin@gnome.org>
21848
21849         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21850         does not match, but don't report any errors.  This method is called in
21851         order for all methods in a MethodGroupExpr until a matching method is
21852         found, so we don't want to bail out if the first method doesn't match.
21853         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21854         matches, report the 123.  Fixes #28070.
21855
21856 2002-07-24  Martin Baulig  <martin@gnome.org>
21857
21858         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21859         TypeManager.TypeToCoreType() to the top of the method so the
21860         following equality checks will work.  Fixes #28107.
21861
21862 2002-07-24  Martin Baulig  <martin@gnome.org>
21863
21864         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21865         operand is of type uint, and the other operand is of type sbyte,
21866         short or int, the operands are converted to type long." -
21867         Actually do what this comment already told us.  Fixes bug #28106,
21868         added test-150.cs.
21869
21870 2002-07-24  Martin Baulig  <martin@gnome.org>
21871
21872         * class.cs (MethodBase): New abstract class.  This is now a base
21873         class for Property, Indexer and Event to avoid some code duplication
21874         in their Define() and DefineMethods() methods.
21875         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21876         generic methods for Define() and DefineMethods().
21877         (FieldBase): Derive from MemberBase, not MemberCore.
21878         (Property): Derive from MemberBase, not MemberCore.
21879         (Property.DefineMethod): Moved all the code from this method to the
21880         new MethodBase.DefineAccessor(), just call it with appropriate
21881         argumetnts.
21882         (Property.Define): Call the new Property.DoDefine(), this does some
21883         sanity checks and we don't need to duplicate the code everywhere.
21884         (Event): Derive from MemberBase, not MemberCore.
21885         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21886         accessors, this will also make them work with interface events.
21887         (Indexer): Derive from MemberBase, not MemberCore.
21888         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21889         (Indexer.Define): Use the new MethodBase functions.
21890
21891         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21892         argument to the constructor.
21893         (Interface.FindMembers): Added support for interface events.
21894         (Interface.PopluateEvent): Implemented.
21895
21896         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
21897
21898 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
21899
21900         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21901         but this is required to check for a method name being the same as
21902         the containing class.  
21903
21904         Handle this now.
21905
21906 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21907
21908         * interface.cs: initialize variable.
21909
21910 2002-07-23  Martin Baulig  <martin@gnome.org>
21911
21912         Implemented the IndexerName attribute in interfaces.
21913
21914         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21915         name if this is an explicit interface implementation.
21916         (Indexer.InterfaceIndexerName): New public variable.  If we're
21917         implementing an interface indexer, this is the IndexerName in that
21918         interface.  Otherwise, it's the IndexerName.
21919         (Indexer.DefineMethod): If we're implementing interface indexer,
21920         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
21921         and Pending.ImplementIndexer methods.
21922         (Indexer.Define): Also define the PropertyBuilder if we're
21923         implementing an interface indexer and this is neither an explicit
21924         interface implementation nor do the IndexerName match the one in
21925         the interface.
21926
21927         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21928         If a method is defined here, then we always need to create a proxy
21929         for it.  This is used when implementing interface indexers.
21930         (Pending.IsInterfaceIndexer): New public method.
21931         (Pending.ImplementIndexer): New public method.
21932         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21933         This is used when implementing interface indexers to define a proxy
21934         if necessary.
21935         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21936         define a proxy if necessary.
21937
21938         * interface.cs (Interface.IndexerName): New public variable.
21939         (Interface.PopulateIndexer): Set the IndexerName.
21940         (Interface.DefineIndexers): New private method.  Populate all the
21941         indexers and make sure their IndexerNames match.
21942
21943         * typemanager.cs (IndexerPropertyName): Added support for interface
21944         indexers.
21945
21946 2002-07-22  Martin Baulig  <martin@gnome.org>
21947
21948         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21949         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21950         ret if HasReturnLabel.
21951         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21952         variables.
21953
21954         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21955         and set the ec.LoopBeginTryCatchLevel.
21956         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21957         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21958         the current ec.TryCatchLevel, the branch goes out of an exception
21959         block.  In this case, we need to use Leave and not Br.
21960
21961 2002-07-22  Martin Baulig  <martin@gnome.org>
21962
21963         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21964         block unless the block does not always return or it is contained in
21965         another try { ... } catch { ... } block.  Fixes bug #26506.
21966         Added verify-1.cs to the test suite.
21967
21968 2002-07-22  Martin Baulig  <martin@gnome.org>
21969
21970         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21971         then we do not always return.  Fixes bug #24985.
21972
21973 2002-07-22  Martin Baulig  <martin@gnome.org>
21974
21975         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21976         lookup on a per-class level; ie. walk up the class hierarchy until we
21977         found at least one applicable method, then choose the best among them.
21978         Fixes bug #24463 and test-29.cs.
21979
21980 2002-07-22  Martin Baulig  <martin@gnome.org>
21981
21982         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21983         return types of the methods.  The return type is not part of the
21984         signature and we must not check it to make the `new' modifier work.
21985         Fixes bug #27999, also added test-147.cs.
21986         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21987
21988         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21989         on the method's return type.
21990
21991 2002-07-21  Martin Baulig  <martin@gnome.org>
21992
21993         * assign.cs: Make this work if the rightmost source is a constant and
21994         we need to do an implicit type conversion.  Also adding a few more tests
21995         to test-38.cs which should have caught this.
21996
21997         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21998         target in the makefile for this.  The makefile.gnu is primarily intended
21999         for end-users who don't want to debug the compiler.
22000
22001 2002-07-21  Martin Baulig  <martin@gnome.org>
22002
22003         * assign.cs: Improved the Assign class so it can now handle embedded
22004         assignments (X = Y = Z = something).  As a side-effect this'll now also
22005         consume less local variables.  test-38.cs now passes with MCS, added
22006         a few new test cases to that test.
22007
22008 2002-07-20  Martin Baulig  <martin@gnome.org>
22009
22010         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
22011         instructions.  Fixes bug #27977, also added test-146.cs.
22012
22013 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22014
22015         * cs-tokenizer.cs: fixed getHex ().
22016
22017 2002-07-19  Martin Baulig  <martin@gnome.org>
22018
22019         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
22020         not Type.GetType() to lookup the array type.  This is needed when
22021         we're constructing an array of a user-defined type.
22022         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
22023         single-dimensional arrays, but also for single-dimensial arrays of
22024         type decimal.
22025
22026 2002-07-19  Martin Baulig  <martin@gnome.org>
22027
22028         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
22029         this function is called, it's not allowed to share LocalBuilders
22030         among ILGenerators.
22031
22032 2002-07-19  Martin Baulig  <martin@gnome.org>
22033
22034         * expression.cs (Argument.Resolve): Report an error 118 when trying
22035         to pass a type as argument.
22036
22037 2002-07-18  Martin Baulig  <martin@gnome.org>
22038
22039         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
22040         Conv_R_Un for the signed `long' type.
22041
22042 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
22043
22044         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
22045         `expr' for the temporary result, as that will fail if we do
22046         multiple resolves on the same expression.
22047
22048 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
22049
22050         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
22051         ec.TypeContainer for looking up aliases. 
22052
22053         * class.cs (TypeContainer): Remove LookupAlias from here.
22054
22055         * decl.cs (DeclSpace); Move here.
22056
22057 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
22058
22059         * class.cs (FindMembers): Only call filter if the constructor
22060         bulider is not null.
22061
22062         Also handle delegates in `NestedTypes' now.  Now we will perform
22063         type lookups using the standard resolution process.  This also
22064         fixes a bug.
22065
22066         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
22067         This uses Expressions (the limited kind that can be parsed by the
22068         tree) instead of strings.
22069
22070         * expression.cs (ComposedCast.ToString): Implement, used to flag
22071         errors since now we have to render expressions.
22072
22073         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
22074         FormArrayType. 
22075
22076         * ecore.cs (SimpleName.ToString): ditto.
22077
22078         * cs-parser.jay: Instead of using strings to assemble types, use
22079         Expressions to assemble the type (using SimpleName, ComposedCast,
22080         MemberAccess).  This should fix the type lookups in declarations,
22081         because we were using a different code path for this.
22082
22083         * statement.cs (Block.Resolve): Continue processing statements
22084         even when there is an error.
22085
22086 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
22087
22088         * class.cs (Event.Define): Also remove the `remove' method from
22089         the list of pending items.
22090
22091         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
22092         generate more compact code. 
22093
22094 2002-07-17  Martin Baulig  <martin@gnome.org>
22095
22096         * const.cs (Const.LookupConstantValue): Add support for constant
22097         `unchecked' and `checked' expressions.
22098         Also adding test case test-140.cs for this.
22099
22100 2002-07-17  Martin Baulig  <martin@gnome.org>
22101
22102         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
22103         check whether mi.ReturnType implements the IEnumerator interface; the
22104         `==' and the IsAssignableFrom() will fail in this situation.
22105
22106 2002-07-16  Ravi Pratap  <ravi@ximian.com>
22107
22108         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
22109         here too.
22110
22111 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22112
22113         * expression.cs: fixed bug #27811.
22114
22115 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
22116
22117         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
22118         Molaro: when we are a ref, the value already contains a pointer
22119         value, do not take the address of it.
22120
22121 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22122         * removed mb-parser.jay and mb-tokenizer.cs
22123
22124 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22125
22126         * expression.cs: check against the building corlib void type.
22127
22128 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
22129
22130         * ecore.cs: fix for valuetype static readonly fields: when 
22131         initializing them, we need their address, not the address of a copy.
22132
22133 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
22134
22135         * typemanager.cs: register also enum_type in corlib.
22136
22137 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22138
22139         * class.cs: allow calling this (but not base) initializers in structs.
22140
22141 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
22142
22143         * ecore.cs: make sure we compare against the building base types
22144         in GetTypeSize ().
22145
22146 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
22147
22148         * typemanager.cs: fix TypeToCoreType() to handle void and object
22149         (corlib gets no more typerefs after this change).
22150
22151 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
22152
22153         * expression.cs (ArrayCreation.EmitArrayArguments): use
22154         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
22155
22156         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
22157         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
22158         array indexes, the runtime actually forbids them.
22159
22160         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
22161         for array arguments here.
22162
22163         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
22164         instead of the default for ValueTypes.
22165
22166         (New.DoEmit): Use IsValueType instead of
22167         IsSubclassOf (value_type)
22168         (New.DoResolve): ditto.
22169         (Invocation.EmitCall): ditto.
22170
22171         * assign.cs (Assign): ditto.
22172
22173         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
22174         Statements *are* currently doing part of their resolution during
22175         Emit.  
22176
22177         Expressions do always resolve during resolve, but statements are
22178         only required to propagate resolution to their children.
22179
22180 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
22181
22182         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
22183
22184         (LoadAssembly): Do not add the dll if it is already specified
22185
22186         (MainDriver): Add the System directory to the link path at the end,
22187         after all the other -L arguments. 
22188
22189         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
22190         wrong opcode for loading bytes and bools (ldelem.i1 instead of
22191         ldelem.u1) and using the opposite for sbytes.
22192
22193         This fixes Digger, and we can finally run it.
22194
22195         * driver.cs (UnixParseOption): Move the option parsing here.  
22196         (CSCParseOption): Implement CSC-like parsing of options.
22197
22198         We now support both modes of operation, the old Unix way, and the
22199         new CSC-like way.  This should help those who wanted to make cross
22200         platform makefiles.
22201
22202         The only thing broken is that /r:, /reference: and /lib: are not
22203         implemented, because I want to make those have the same semantics
22204         as the CSC compiler has, and kill once and for all the confussion
22205         around this.   Will be doing this tomorrow.
22206
22207         * statement.cs (Unsafe.Resolve): The state is checked during
22208         resolve, not emit, so we have to set the flags for IsUnsfe here.
22209
22210 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
22211
22212         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
22213         not catch the Error_ObjectRefRequired in SimpleName (as it is
22214         possible to have a class/instance variable name that later gets
22215         deambiguated), we have to check this here.      
22216
22217 2002-07-10  Ravi Pratap  <ravi@ximian.com>
22218
22219         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
22220         make static and put into Expression.
22221
22222         (Event.Define): Register the private field of the event with the 
22223         TypeManager so that GetFieldFromEvent can get at it.
22224
22225         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
22226         keep track of the private field associated with an event which
22227         has no accessors.
22228
22229         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
22230         private field.
22231
22232         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
22233
22234 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
22235
22236         * expression.cs (Binary.EmitBranchable): this routine emits the
22237         Binary expression in a branchable context.  This basically means:
22238         we need to branch somewhere, not just get the value on the stack.
22239
22240         This works together with Statement.EmitBoolExpression.
22241
22242         * statement.cs (Statement.EmitBoolExpression): Use
22243         EmitBranchable. 
22244
22245 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
22246
22247         * statement.cs (For): Reduce the number of jumps in loops.
22248
22249         (For): Implement loop inversion for the For statement.
22250
22251         (Break): We can be breaking out of a Try/Catch controlled section
22252         (foreach might have an implicit try/catch clause), so we need to
22253         use Leave instead of Br.
22254
22255         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
22256         now).  If the instace expression supports IMemoryLocation, we use
22257         the AddressOf method from the IMemoryLocation to extract the
22258         address instead of emitting the instance.
22259
22260         This showed up with `This', as we were emitting the instance
22261         always (Emit) instead of the Address of This.  Particularly
22262         interesting when This is a value type, as we dont want the Emit
22263         effect (which was to load the object).
22264
22265 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
22266
22267         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
22268
22269         * statement.cs (Checked): Set the CheckedState during the resolve
22270         process too, as the ConvCast operations track the checked state on
22271         the resolve process, and not emit.
22272
22273         * cs-parser.jay (namespace_member_declaration): Flag that we have
22274         found a declaration when we do.  This is used to flag error 1529
22275
22276         * driver.cs: Report ok when we display the help only.
22277
22278 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
22279
22280         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
22281
22282 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
22283
22284         * cs-tokenizer.cs (define): We also have to track locally the
22285         defines.  AllDefines is just used for the Conditional Attribute,
22286         but we also need the local defines for the current source code. 
22287
22288 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
22289
22290         * statement.cs (While, For, Do): These loops can exit through a
22291         Break statement, use this information to tell whether the
22292         statement is the last piece of code.
22293
22294         (Break): Flag that we break.
22295
22296         * codegen.cs (EmitContexts): New `Breaks' state variable.
22297
22298 2002-07-03  Martin Baulig  <martin@gnome.org>
22299
22300         * class.cs (TypeContainer.MethodModifiersValid): Allow override
22301         modifiers in method declarations in structs.  Otherwise, you won't
22302         be able to override things like Object.Equals().
22303
22304 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
22305
22306         * class.cs (Method, Property, Indexer): Do not allow the public
22307         modifier to be used in explicit interface implementations.
22308
22309         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
22310         override modifiers in method declarations in structs
22311
22312 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
22313
22314         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
22315         integer or real overflow, report an error
22316
22317 2002-07-02  Martin Baulig  <martin@gnome.org>
22318
22319         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
22320         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
22321         to tell the runtime about our newly created System.Object and
22322         System.ValueType types.
22323
22324 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
22325
22326         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
22327         struct instead of Ldarg/Starg.
22328
22329 2002-07-02  Martin Baulig  <martin@gnome.org>
22330
22331         * expression.cs (Indirection.Indirection): Call
22332         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22333
22334 2002-07-02  Martin Baulig  <martin@gnome.org>
22335
22336         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22337         ValueType, call TypeManager.TypeToCoreType() on it.
22338         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22339         the OpCodes.Newarr argument.
22340
22341 2002-07-02  Martin Baulig  <martin@gnome.org>
22342
22343         * expression.cs (Invocation.EmitCall): When compiling corlib,
22344         replace all calls to the system's System.Array type to calls to
22345         the newly created one.
22346
22347         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22348         System.Array methods.
22349         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22350         from the system's System.Array type which must be replaced.
22351
22352 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22353
22354         * typemanager.cs: load unverifiable_code_ctor so we can build
22355         corlib using the correct type. Avoid using GetTypeCode() with
22356         TypeBuilders.
22357         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22358         TypeManager.object_type to allow building corlib.
22359
22360 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22361
22362         * ecore.cs: handle System.Enum separately in LoadFromPtr().
22363
22364 2002-07-01  Martin Baulig  <martin@gnome.org>
22365
22366         * class.cs: Make the last change actually work, we need to check
22367         whether `ifaces != null' to avoid a crash.
22368
22369 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22370
22371         * class.cs: when we build structs without fields that implement
22372         interfaces, we need to add the interfaces separately, since there is
22373         no API to both set the size and add the interfaces at type creation
22374         time.
22375
22376 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22377
22378         * expression.cs: the dimension arguments to the array constructors
22379         need to be converted if they are a long.
22380
22381 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22382
22383         * class.cs: don't emit ldarg.0 if there is no parent constructor
22384         (fixes showstopper for corlib).
22385
22386 2002-06-29  Martin Baulig  <martin@gnome.org>
22387
22388         MCS now compiles corlib on GNU/Linux :-)
22389
22390         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22391         ie. check for MethodImplOptions.InternalCall.
22392
22393         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22394         and TypeManager.attribute_type are null, so we must explicitly check
22395         whether parent is not null to find out whether it's an attribute type.
22396         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22397         and SetBuilder, not only if the property is neither abstract nor external.
22398         This is necessary to set the MethodImplOptions on the accessor methods.
22399         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22400         SetBuilder, see Property.Emit().
22401
22402         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22403         populate "System.Object", "System.ValueType" and "System.Attribute" since
22404         they've already been populated from BootCorlib_PopulateCoreTypes().
22405
22406 2002-06-29  Martin Baulig  <martin@gnome.org>
22407
22408         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22409         is the NullLiteral, we also need to make sure that target_type is not
22410         an enum type.   
22411
22412 2002-06-29  Martin Baulig  <martin@gnome.org>
22413
22414         * rootcontext.cs (RootContext.ResolveCore): We must initialize
22415         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22416         before calling BootstrapCorlib_ResolveDelegate ().
22417
22418 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22419
22420         * statement.cs: fixed build-breaker. All tests passed ok.
22421
22422 2002-06-27  Martin Baulig  <martin@gnome.org>
22423
22424         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22425         for System.Decimal when compiling corlib.
22426
22427 2002-06-27  Martin Baulig  <martin@gnome.org>
22428
22429         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22430         switch blocks which contain nothing but a default clause.
22431
22432 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
22433
22434        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22435
22436 2002-06-27  Martin Baulig  <martin@gnome.org>
22437
22438         * ecore.cs (PropertyExpr.PropertyExpr): Call
22439         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22440
22441         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22442         is already a TypeBuilder.
22443
22444 2002-06-27  Martin Baulig  <martin@gnome.org>
22445
22446         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22447         `target_type == TypeManager.array_type', not IsAssignableFrom() in
22448         the "from an array-type to System.Array" case.  This makes it work
22449         when compiling corlib.
22450
22451 2002-06-27  Martin Baulig  <martin@gnome.org>
22452
22453         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22454         non-static PropertyExpr, set its InstanceExpression.  This makes
22455         the `ICollection.Count' property work in System/Array.cs.
22456
22457 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
22458
22459         * driver.cs: Made error handling more consistent.  Errors now
22460         tracked by Report class, so many methods which used to return int
22461         now return void.  Main() now prints success/failure and 
22462         errors/warnings message.
22463
22464         Renamed '--probe' compiler argument to '--expect-error'.  Removed
22465         the magic number return values (123 and 124).  Now, if the
22466         expected error occurs, the compiler exits with success (exit value
22467         0).  If the compilation completes without seeing that particular
22468         error, the compiler exits with failure (exit value 1).  The
22469         makefile in mcs/errors has been changed to handle the new behaviour.
22470
22471         * report.cs: Made 'expected error' number a property and renamed
22472         it from 'Probe' to 'ExpectedError'.
22473
22474         * genericparser.cs: Removed error handling support, since it is
22475         now all done by Report class.
22476
22477         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22478         class, so parse() no longer returns an int.
22479
22480         * namespace.cs: Use Report.Error instead of GenericParser.error
22481
22482 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
22483
22484         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22485         TypeContainer.AddOperator): At the front of the list put the
22486         explicit implementations, so they get resolved/defined first. 
22487
22488 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
22489
22490         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22491         interface type is implemented by this TypeContainer.  Used during
22492         explicit interface implementation.
22493
22494         (Property.Define, Indexer.Define, Method.Define): Validate that
22495         the given interface in the explicit implementation is one of the
22496         base classes for the containing type.
22497
22498         Also if we are explicitly implementing an interface, but there is
22499         no match in the pending implementation table, report an error.
22500
22501         (Property.Define): Only define the property if we are
22502         not explicitly implementing a property from an interface.  Use the
22503         correct name also for those properties (the same CSC uses,
22504         although that is really not needed).
22505
22506         (Property.Emit): Do not emit attributes for explicitly implemented
22507         properties, as there is no TypeBuilder.
22508
22509         (Indexer.Emit): ditto.
22510
22511         Hiding then means that we do not really *implement* a pending
22512         implementation, which makes code fail.
22513
22514 2002-06-22  Martin Baulig  <martin@gnome.org>
22515
22516         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22517         the return value of Object.GetType().  [FIXME: we need to do this whenever
22518         we get a type back from the reflection library].
22519
22520 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22521
22522         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22523
22524 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
22525
22526         * attribute.cs: Return null if we can not look up the type.
22527
22528         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22529         the interface types found.
22530
22531         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22532         interface types found.
22533
22534         * typemanager.cs (GetInterfaces): Make this routine returns alll
22535         the interfaces and work around the lame differences between
22536         System.Type and System.Reflection.Emit.TypeBuilder in the results
22537         result for GetInterfaces.
22538
22539         (ExpandInterfaces): Given an array of interface types, expand and
22540         eliminate repeated ocurrences of an interface.  This expands in
22541         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22542         be IA, IB, IC.
22543
22544 2002-06-21  Martin Baulig  <martin@gnome.org>
22545
22546         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22547         on System.Enum.
22548
22549 2002-06-21  Martin Baulig  <martin@gnome.org>
22550
22551         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
22552         and called with one of the core types, return the corresponding typebuilder for
22553         that type.
22554
22555         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22556         element type.
22557
22558 2002-06-21  Martin Baulig  <martin@gnome.org>
22559
22560         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22561         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22562         (Expression.ConvertReferenceExplicit): Likewise.
22563
22564         * expression.cs (ElementAccess.DoResolve): Likewise.
22565         (ElementAccess.DoResolveLValue): Likewise.
22566
22567 2002-06-10  Martin Baulig  <martin@gnome.org>
22568
22569         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22570         add the "value" parameter to the parameter list.
22571
22572         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22573         to our caller.
22574
22575 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
22576
22577         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22578         the argument to an int, uint, long or ulong, per the spec.  Also
22579         catch negative constants in array creation.
22580
22581 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22582
22583         * class.cs: do not allow the same interface to appear twice in
22584         the definition list.
22585
22586 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22587
22588         * ecore.cs: don't use ldlen with System.Array.
22589
22590 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22591
22592         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22593
22594 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22595
22596         * modifiers.cs: produce correct field attributes for protected
22597         internal. Easy fix so miguel can work on ther harder stuff:-)
22598
22599 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
22600
22601         * pending.cs: New file.  Move the code from class.cs here.
22602         Support clearning the pending flag for all methods (when not doing
22603         explicit interface implementation).
22604
22605 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22606
22607         * rootcontext.cs: added a couple more types needed to bootstrap.
22608
22609 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
22610
22611         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22612         constructor in the type, instead of any constructor in the type
22613         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
22614         a bug in the Mono runtime when applying the params attribute). 
22615
22616 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
22617         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22618
22619 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
22620
22621         * expression.cs (Unary.ResolveOperator): Use TypeManager
22622         to resolve the type.
22623
22624 2002-06-13  Ravi Pratap  <ravi@ximian.com>
22625
22626         * cs-parser.jay (enum_member_declaration): Pass in the attributes
22627         attached.
22628
22629         * enum.cs (AddEnumMember): Add support to store the attributes associated 
22630         with each member too.
22631
22632         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22633         field builders too - this takes care of the enum member case.
22634
22635 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
22636
22637         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22638         address-of operator on both value types and pointers.
22639
22640 2002-06-10  Martin Baulig  <martin@gnome.org>
22641
22642         * interface.cs (Interface.PopulateIndexer): Add the indexer's
22643         PropertyBuilder to the `property_builders' list.
22644
22645         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22646         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22647         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
22648         find any indexers which are inherited from an interface.
22649
22650 2002-06-09  Martin Baulig  <martin@gnome.org>
22651
22652         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22653         the same type as the constant if necessary.  There's also a test-130.cs
22654         for this.
22655
22656         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22657
22658         * typemanager.cs (TypeManager.ChangeType): Previously known as
22659         Enum.ChangeEnumType().
22660
22661 2002-06-09  Martin Baulig  <martin@gnome.org>
22662
22663         * expression.cs (Cast.TryReduce): Added support for consts.
22664
22665 2002-06-08  Ravi Pratap  <ravi@ximian.com>
22666
22667         * class.cs (Accessor): Hold attributes information so we can pass
22668         it along.
22669
22670         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22671         Modify to pass in attributes attached to the methods.
22672
22673         (add_accessor_declaration, remove_accessor_declaration): Ditto.
22674
22675         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22676         to handle the Accessor kind :-)
22677
22678         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22679
22680 2002-06-08  Martin Baulig  <martin@gnome.org>
22681
22682         * expression.cs (Unary.TryReduceNegative): Added support for
22683         ULongConstants.
22684
22685 2002-06-08  Martin Baulig  <martin@gnome.org>
22686
22687         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22688         name can't be found in the `defined_names' - the caller will do a
22689         MemberLookup in this case and thus find methods in System.Enum
22690         such as Enum.IsDefined().
22691
22692 2002-06-08  Martin Baulig  <martin@gnome.org>
22693
22694         * enum.cs (Enum.ChangeEnumType): This is a custom version of
22695         Convert.ChangeType() which works with TypeBuilder created types.
22696         (Enum.LookupEnumValue, Enum.Define): Use it here.
22697
22698         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22699         `TypeBuilder.BaseType != null' check.
22700         (TypeContainer.FindMembers): Only lookup parent members if we
22701         actually have a parent.
22702         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22703         (ConstructorInitializer.Resolve): Likewise.
22704
22705         * interface.cs (Interface.FindMembers): Added
22706         `TypeBuilder.BaseType != null' check.
22707
22708         * rootcontext.cs (RootContext.ResolveCore): Added
22709         "System.Runtime.CompilerServices.IndexerNameAttribute" to
22710         classes_second_stage.
22711
22712         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22713         debug_type and trace_type when compiling with --nostdlib.       
22714
22715 2002-06-07  Martin Baulig  <martin@gnome.org>
22716
22717         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22718         (AddField): Set it to true when adding a non-static field.
22719         (DefineType): Use `have_nonstatic_fields' to find out whether we
22720         have non-static fields, not `Fields != null'.
22721
22722 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
22723
22724         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22725         dereferencing a null on the static-field code path)
22726
22727 2002-05-30  Martin Baulig  <martin@gnome.org>
22728
22729         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22730         to take command line arguments.  Use reflection to call the new
22731         custom `Initialize' function on the symbol writer and pass it the
22732         command line arguments.
22733
22734         * driver.cs (--debug-args): New command line argument to pass command
22735         line arguments to the symbol writer.
22736
22737 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
22738
22739         * assign.cs (DoResolve): Forgot to do the implicit conversion to
22740         the target type for indexers and properties.  Thanks to Joe for
22741         catching this.
22742
22743 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
22744
22745         * typemanager.cs (MethodFlags): returns the method flags
22746         (Obsolete/ShouldIgnore) that control warning emission and whether
22747         the invocation should be made, or ignored. 
22748
22749         * expression.cs (Invocation.Emit): Remove previous hack, we should
22750         not do this on matching a base type, we should do this based on an attribute
22751
22752         Only emit calls to System.Diagnostics.Debug and
22753         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22754         on the command line.
22755
22756         * rootcontext.cs: Global settings for tracing and debugging.
22757
22758         * cs-tokenizer.cs (define): New utility function to track
22759         defines.   Set the global settings for TRACE and DEBUG if found.
22760
22761 2002-05-25  Ravi Pratap  <ravi@ximian.com>
22762
22763         * interface.cs (Populate*): Pass in the TypeContainer as well as
22764         the DeclSpace as parameters so that we can create EmitContexts and
22765         then use that to apply attributes etc.
22766
22767         (PopulateMethod, PopulateEvent, PopulateProperty)
22768         (PopulateIndexer): Apply attributes everywhere.
22769
22770         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22771         etc.
22772
22773         (ApplyAttributes): Update accordingly.
22774
22775         We now apply interface attributes for all members too.
22776
22777 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
22778
22779         * class.cs (Indexer.Define); Correctly check if we are explicit
22780         implementation (instead of checking the Name for a ".", we
22781         directly look up if the InterfaceType was specified).
22782
22783         Delay the creation of the PropertyBuilder.
22784
22785         Only create the PropertyBuilder if we are not an explicit
22786         interface implementation.   This means that explicit interface
22787         implementation members do not participate in regular function
22788         lookups, and hence fixes another major ambiguity problem in
22789         overload resolution (that was the visible effect).
22790
22791         (DefineMethod): Return whether we are doing an interface
22792         implementation. 
22793
22794         * typemanager.cs: Temporary hack until we get attributes in
22795         interfaces (Ravi is working on that) and we get IndexerName
22796         support in interfaces.
22797
22798         * interface.cs: Register the indexers as properties.
22799
22800         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22801         warning, I have verified that this is a bug in the .NET runtime
22802         (JavaScript suffers of the same problem).
22803
22804         * typemanager.cs (MemberLookup): When looking up members for
22805         interfaces, the parent of an interface is the implicit
22806         System.Object (so we succeed in searches of Object methods in an
22807         interface method invocation.  Example:  IEnumerable x;  x.ToString
22808         ()) 
22809
22810 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
22811
22812         * class.cs (Event): Events should also register if they do
22813         implement the methods that an interface requires.
22814
22815         * typemanager.cs (MemberLookup); use the new GetInterfaces
22816         method. 
22817
22818         (GetInterfaces): The code used to lookup interfaces for a type is
22819         used in more than one place, factor it here. 
22820
22821         * driver.cs: Track the errors at the bottom of the file, we kept
22822         on going.
22823
22824         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22825         instance if the method we are calling is static!
22826
22827 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
22828
22829         * attribute.cs (ApplyAttributes): Make this function filter out
22830         the IndexerName attribute (as that attribute in reality is never
22831         applied) and return the string constant for the IndexerName
22832         attribute. 
22833
22834         * class.cs (TypeContainer.Emit): Validate that all the indexers
22835         have the same IndexerName attribute, and if so, set the
22836         DefaultName attribute on the class. 
22837
22838         * typemanager.cs: The return value might contain other stuff (not
22839         only methods).  For instance, consider a method with an "Item"
22840         property and an Item method.
22841
22842         * class.cs: If there is a problem with the parameter types,
22843         return. 
22844
22845 2002-05-24  Ravi Pratap  <ravi@ximian.com>
22846
22847         * ecore.cs (ImplicitConversionExists): Wrapper function which also
22848         looks at user defined conversion after making a call to 
22849         StandardConversionExists - we need this for overload resolution.
22850
22851         * expression.cs : Update accordingly the various method calls.
22852
22853         This fixes 2 bugs filed against implicit user defined conversions 
22854
22855 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
22856
22857         * statement.cs: Track the result of the assignment.
22858
22859 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
22860
22861         * expression.cs (MemberAccess): Improved error reporting for
22862         inaccessible members.
22863
22864 2002-05-22  Martin Baulig  <martin@gnome.org>
22865
22866         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
22867         itself with debugging support.
22868
22869 2002-05-22  Martin Baulig  <martin@gnome.org>
22870
22871         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22872         Removed, this isn't needed anymore.
22873
22874 2002-05-20  Martin Baulig  <martin@gnome.org>
22875
22876         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22877         be underlying type for an enum.
22878
22879 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
22880
22881         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22882         that splits out the loading of just the core types.
22883
22884         * rootcontext.cs (ResolveCore): Split the struct resolution in
22885         two, so we can load the enumeration underlying types before any
22886         enums are used.
22887
22888         * expression.cs (Is): Bandaid until we fix properly Switch (see
22889         bug #24985 for details).
22890
22891         * typemanager.cs (ImplementsInterface): The hashtable will contain
22892         a null if there are no interfaces implemented.
22893
22894 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
22895
22896         * cs-parser.jay (indexer_declarator): It is fine to have array
22897         parameters
22898
22899 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22900
22901         * typemanager.cs: (RegisterBuilder): New function used to register
22902         TypeBuilders that implement interfaces.  Since
22903         TypeBuilder.GetInterfaces (as usual) does not work with lame
22904         Reflection.Emit. 
22905         (AddUserType): register interfaces.
22906
22907         (ImplementsInterface): Use the builder_to_ifaces hash if we are
22908         dealing with TypeBuilder.  Also, arrays are showing up as
22909         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22910         methods can not be invoked on them!
22911
22912         * ecore.cs (ExplicitReferenceConversionExists): Made public.
22913         (ImplicitReferenceConversionExists): Split out from
22914         StandardConversionExists. 
22915
22916         * expression.cs (As): We were only implementing one of the three
22917         cases for the as operator.  We now implement them all.
22918         (Is): Implement the various other cases for Is as well.
22919
22920         * typemanager.cs (CACHE): New define used to control if we want or
22921         not the FindMembers cache.  Seems to have a negative impact on
22922         performance currently
22923
22924         (MemberLookup): Nested types have full acess to
22925         enclosing type members
22926
22927         Remove code that coped with instance/static returns for events, we
22928         now catch this in RealFindMembers.
22929
22930         (RealFindMembers): only perform static lookup if the instance
22931         lookup did not return a type or an event.  
22932
22933 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22934
22935         * assign.cs (CompoundAssign): We pass more semantic information
22936         now to Compound Assignments than we did before: now we have all
22937         the information at hand, and now we resolve the target *before* we
22938         do the expression expansion, which allows the "CacheValue" method
22939         to have the effect we intended (before, a [x] += 1 would generate
22940         two differen ArrayAccess expressions from the ElementAccess,
22941         during the resolution process).
22942
22943         (CompoundAssign.DoResolve): Resolve target and original_source here.
22944
22945 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
22946
22947         * expression.cs (ArrayAccess): dropped debugging information. 
22948
22949         * typemanager.cs: Small bug fix: I was always returning i_members,
22950         instead of one of i_members or s_members (depending on which had
22951         the content).
22952
22953         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
22954         method is invoked before any code generation takes place, and it
22955         is a mechanism to inform that the expression will be invoked more
22956         than once, and that the method should use temporary values to
22957         avoid having side effects
22958
22959         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22960
22961         * ecore.cs (Expression.CacheTemporaries): Provide empty default
22962         implementation.
22963
22964         * expression.cs (Indirection, ArrayAccess): Add support for
22965         CacheTemporaries in these two bad boys. 
22966
22967         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22968         ldobj or ldind_ref.  
22969         (StoreFromPtr): Handle stobj as well.
22970
22971         * expression.cs (UnaryMutator): Share more code.
22972
22973         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22974         down: I was not tracking the Filter function as well, which
22975         was affecting the results of the cache.
22976
22977 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
22978
22979         * attribute.cs: Remove the hack to handle the CharSet property on
22980         StructLayouts. 
22981
22982 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
22983
22984         * attribute.cs (DoResolve): More uglyness, we now only try to
22985         resolve the attribute partially, to extract the CharSet
22986         information (only if we are a StructLayout attribute).  Otherwise 
22987
22988         (GetExtraTypeInfo): Add some code to conditionally kill in the
22989         future this.   I am more and more convinced that the .NET
22990         framework has special code to handle the attribute setting on
22991         certain elements.
22992
22993         * expression.cs (IsParamsMethodApplicable): Revert my previous
22994         foreach change here, it was wrong.
22995
22996 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
22997
22998         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22999         (pp_expr): do not abort on unknown input, just return.
23000         (eval): abort if there are pending chars.
23001
23002         * attribute.cs (Attribute.Resolve): Positional parameters are
23003         optional.  Deal with that case.
23004
23005         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
23006         the Ansi/Unicode/Auto information for the type.
23007
23008         (TypeContainer.DefineType): instantiate the EmitContext here, as
23009         we will be using it during the type definition (to resolve
23010         attributes) and during the emit phase.
23011
23012         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
23013         to pull type information out of the attributes
23014
23015         (Attribute.Resolve): track the constructor builder, and allow for
23016         multiple invocations (structs and classes will use this).
23017
23018         * ecore.cs (MemberLookupFinal): new version with all the
23019         parameters customizable.
23020
23021         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
23022         constructors.  Return if the result value is null (as the error
23023         would have been flagged already by MemberLookupFinal)
23024
23025         Do not allow instances of abstract classes or interfaces to be
23026         created.
23027
23028         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
23029         We have to compare the assembly property here when dealing with
23030         FamANDAssem and Assembly access modifiers, because we might be
23031         creating an assembly from *modules* (that means that we are not
23032         getting TypeBuilders for types defined in other modules that are
23033         part of this assembly).
23034
23035         (Method.Emit): If the method is marked abstract and has a body,
23036         emit an error. 
23037
23038         (TypeContainer.DefineMembers): If both the defined member and the
23039         parent name match are methods, then do not emit any warnings: let
23040         the Method.Define routine take care of flagging warnings.  But if
23041         there is a mismatch (method overrides something else, or method is
23042         overriwritten by something, then emit warning).
23043
23044         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
23045         set to null, this means `do not check for the return type on the
23046         signature'. 
23047
23048         (Method.Define): set the return type for the method signature to
23049         null, so that we get methods with the same name and parameters and
23050         different return types.  This is used to flag warning 114 (you are
23051         hiding a method, and you probably want to use the new/override
23052         keywords instead).
23053
23054         * typemanager.cs (MemberLookup): Implemented proper access
23055         control, closing a long standing set of bug reports.  The problem
23056         was that the Framework only has two bits: Public and NonPublic,
23057         and NonPublic includes private and protected methods, but we need
23058         to enforce the FamANDAssem, FamOrAssem and Family. 
23059
23060 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
23061
23062         * statement.cs (GotoCase): Return true: Ammounts to giving up
23063         knowledge on whether we return or not, and letting the other case
23064         be responsible for it.
23065
23066 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
23067
23068         * driver.cs: Do not load directories for each file processed, only
23069         do it if there is a pattern.
23070
23071         * ecore.cs: Report readonly assigns here as well, as we might have
23072         been resolved only by MemberAccess.
23073
23074         (SimpleName.SimpleNameResolve): Also be useful for LValue
23075         resolution.   We need this to propagate assign to local readonly variables
23076
23077         * typemanager.cs: Use a ptrhashtable for the criteria, because we
23078         do not want to reuse potential criteria memory.
23079
23080         * class.cs (MyEventBuilder): Set reflected_type;
23081
23082         * ecore.cs (Constantify): Added support for constifying bools.
23083
23084         (RootContext.LookupType): Added a cache for values looked up in
23085         the declaration space.
23086
23087         * typemanager.cs (FindMembers): Now is a front-end to
23088         RealFindMembers, and provides a two-level hashtable-based cache to
23089         the request.  
23090
23091         15% performance improvement: from 22.5 to 19.2 seconds.
23092
23093         * expression.cs (IsParamsMethodApplicable): use foreach.
23094         (Invocation.DoResolve): ditto.
23095         (New.DoResolve): ditto.
23096         (ArrayCreation.DoResolve): ditto.
23097
23098         * ecore.cs (FindMostEncompassingType): use foreach.
23099
23100         * delegate.cs (NewDelegate.DoResolve): Use foreach
23101
23102         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
23103         (RemoveMethods): use foreach.
23104
23105         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
23106         nested foreach statements instead of for, and also break out of
23107         the inner loop once a match is found.
23108
23109         (Invocation.OverloadResolve): Use foreach, simplify the code. 
23110
23111 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
23112
23113         * cfold.cs (BinaryFold): During an enumeration evaluation context,
23114         we actually unwrap the expression to allow for extra information
23115         to be extracted. 
23116
23117         * expression.cs: Use Shr_Un on unsigned operations. 
23118
23119 2002-05-08  Ravi Pratap  <ravi@ximian.com>
23120
23121         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
23122         applicable operators was not being considered correctly. This closes
23123         the bug Miguel reported.
23124
23125 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
23126
23127         * attribute.cs: check that the type derives from System.Attribute
23128         and report the correct error in that case (moved the duplicate code to
23129         its own method, too).
23130
23131 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
23132
23133         * attribute.cs: lookup attribute type name as the spec says: first the
23134         bare attribute name and then name + "Attribute" (nant compiles with
23135         mcs after this fix).
23136
23137 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
23138
23139         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
23140         Because of the way we parse things, we should try to see if a
23141         UIntConstant can fit in an integer.
23142
23143 2002-05-07  Ravi Pratap  <ravi@ximian.com>
23144
23145         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
23146         when we are in an explicit context.
23147
23148         (ConvertReferenceExplicit): When converting from Iface type S to Class
23149         T make sure the rules are implemented as an OR.
23150
23151         * parameter.cs (ParameterType): Make it a property for now although the
23152         purpose really isn't anything immediate.
23153
23154         * expression.cs (Is*Applicable): Do better checking on the parameter type
23155         of a ref/out parameter. The ones from the system assemblies are already 
23156         marked with the correct type so we don't need to do any correction.
23157
23158         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
23159         the object type is standard too so include that.
23160
23161 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
23162
23163         * ecore.cs (StandardConversionExists): Augment with missing code:
23164         deal with IntConstant, LongConstants and Enumerations.
23165
23166         * assign.cs: Report the error, instead of failing silently
23167
23168         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
23169         typecontainer that they are declared, because the
23170         typecontainer/namespace will have the list of using clauses that
23171         need to be applied.
23172
23173         Assembly Attributes were escaping the normal registration
23174         mechanism. 
23175
23176         (EmitCode): Apply attributes within an EmitContext that represents
23177         the container they were declared on.
23178
23179         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
23180
23181 2002-05-06  Ravi Pratap  <ravi@ximian.com>
23182
23183         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
23184         Revamp completely - make much cleaner as we now operate only
23185         on a set of Types.
23186
23187         (FindMostSpecificSource, FindMostSpecificTarget): New methods
23188         to implement the logic detailed in the spec more correctly.
23189
23190         (UserDefinedConversion): Update accordingly.
23191
23192 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
23193
23194         * statement.cs: Return flow analysis information up.
23195
23196         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
23197         and the default.
23198
23199         (token): Do not consume an extra character before calling
23200         decimal_digits.
23201
23202 2002-05-06  Piers Haken <piersh@friskit.com>
23203
23204         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
23205
23206 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
23207
23208         * class.cs (Constructor.Emit): Set the IsStatic flag in the
23209         EmitContext during the instance constructor initializer
23210         resolution, to stop access to instance variables.
23211
23212         This is mandated by the spec, last paragraph of the `constructor
23213         initializers' section. 
23214
23215 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
23216
23217         * cs-parser.jay, class.cs (Accessor): new class used to represent
23218         an accessor (get or set).  In the past we used `null' to represent
23219         a missing accessor.  But this is ambiguous because there was no
23220         way to tell in abstract indexers/properties if one of them was
23221         specified.
23222
23223         Now there is a way of addressing that.
23224
23225         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
23226         instead of FindMembers.
23227
23228         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
23229         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
23230
23231         * attribute.cs: Treat indexers and properties as the same in terms
23232         of applying attributes
23233
23234         * ecore.cs (FindMostEncompassedType): Use statically initialized
23235         EmptyExpressions()s like we do elsewhere to avoid creating useless
23236         objects (and we take this out of the tight loop).
23237
23238         (GetConversionOperators): Move the code to extract the actual
23239         operators to a separate routine to clean things up.
23240
23241 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
23242
23243         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
23244         events are always registered FieldBuilders.
23245
23246         * class.cs (FieldBase): New class shared by Fields 
23247
23248         * delegate.cs: If we are a toplevel delegate, use our full name.
23249         If we are a nested delegate, then only use our tail name.
23250
23251 2002-05-02  Ravi Pratap  <ravi@ximian.com>
23252
23253         * expression.cs (IsApplicable): Ensure that we add the "&" to
23254         ref/out types before comparing it with the type of the argument.
23255
23256         (IsParamsMethodApplicable): Ditto.
23257
23258         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
23259         silly me ;-)
23260
23261         * delegate.cs : Handle the case when we have more than one applicable
23262         method. Flag an error only when we finish checking all.
23263
23264 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
23265
23266         * expression.cs: Add support for boolean static initializers.
23267
23268 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
23269
23270         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
23271
23272         * parameter.cs (ComputeParameterTypes,
23273         ComputeAndDefineParameterTypes): Better error handling: now we
23274         clear the `types' cache if we fail during any of the type lookups.
23275         We also return the status code correctly to our caller
23276
23277         * delegate.cs: If we fail to define a delegate, abort the extra
23278         steps. 
23279
23280         * expression.cs (Binary.ResolveOperator): for
23281         operator==(object,object) and operator !=(object, object) we also
23282         have to verify that there is an implicit conversion from one to
23283         the other.
23284
23285         (ArrayAccess.DoResolve): Array Access can operate on
23286         non-variables. 
23287
23288 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
23289
23290         * assign.cs (CompoundAssign): A new class used as a "flag" that
23291         the assignment actually is happening as part of a compound
23292         assignment operator.
23293
23294         During compound assignment, a few new rules exist to enable things
23295         like:
23296
23297         byte b |= 1 + 2
23298
23299         From the spec:
23300
23301         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
23302         to the type of x) if y is implicitly convertible to the type of x,
23303         and the operator is a builtin operator and the return type of the
23304         operator is explicitly convertible to the type of x. 
23305
23306         * rootcontext.cs: Reset warning level to 2.  4 catches various
23307         "interesting" features in mcs, we must clean this up at some
23308         point, but currently am trying to kill other bugs ;-)
23309
23310         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
23311         in container classes as well.  
23312
23313         * expression.cs (Binary.ResolveOperator): Handle string case
23314         before anything else (as operator overloading does emit an error
23315         before doing anything else).
23316
23317         This code could go away when we move to a table driven model, but
23318         i could not come up with a good plan last night.
23319
23320 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
23321
23322         * typemanager.cs (CSharpName): reimplementation using regex.
23323         * class.cs: added null check for fields in Emit
23324         * rootcontext.cs: set warninglevel to 4
23325
23326 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
23327
23328         * typemanager.cs (CSharpName): reimplemented with Lupus
23329         suggestion.
23330
23331 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
23332
23333         * statement.cs (If): correclty implement Resolve, because we were
23334         not catching sem errors in there.  The same process is needed
23335         everywhere else. 
23336         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23337
23338
23339         (Statement.Warning_DeadCodeFound): Factorize code.
23340         (While): Report dead code here too.
23341
23342         (Statement): Added Resolve virtual method to allow
23343         for resolution split from the emit code.
23344
23345 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23346
23347         * statement.cs (EmitBoolExpression): No longer try to resolve the
23348         expression here.    
23349         (MakeBoolean): New utility function that resolve, implicitly
23350         converts to boolean and tags the expression. 
23351
23352
23353         (If, Do): Implement dead code elimination.
23354         (While): Implement loop inversion
23355
23356         (Do, While, For, If): Resolve the expression prior to calling our
23357         code generation.
23358
23359 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
23360
23361         * class.cs:
23362           - added method Report28 (warning: program has more than one entry point)
23363           - added method IsEntryPoint, implements paragraph 10.1 of the spec
23364           - modified method Method.Define, the part at the end of the method
23365
23366         * rootcontext.cs: added static public Location EntryPointLocation;
23367           
23368         * ../errors/cs0028.cs : Add test case for the above warning.              
23369
23370         * typemanager.cs:
23371           - modified method CSharpName to allow arrays of primitive type to
23372             be printed nicely (e.g. instead of System.Int32[][] it now prints
23373             int[][])
23374           - added method CSharpSignature: returns the signature of a method
23375             in string format to be used in reporting errors, warnings, etc.
23376
23377         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23378         with String.Empty.
23379
23380 2002-04-26  Ravi Pratap  <ravi@ximian.com>
23381
23382         * delegate.cs (Define): Fix extremely silly bug where I was
23383         setting the type of the 'object' parameter of the BeginInvoke
23384         method to System.IAsyncResult instead of System.Object ;-)
23385
23386 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23387
23388         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23389         here. 
23390
23391         (Constructor.Emit): return if we fail to initialize the
23392         constructor.  Another door closed!  
23393
23394         * expression.cs (New.DoResolve): Improve error message (from -6 to
23395         1501).  Use DeclaredOnly lookup to find the exact constructor.
23396
23397         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23398         loop.  This is useful.
23399
23400         * cs-parser.jay: Adjust the default parameters so that destructors
23401         have the proper signature.
23402
23403 2002-04-26  Martin Baulig  <martin@gnome.org>
23404
23405         * driver.cs (LoadAssembly): If `assembly' contains any characters
23406         which are only valid in path names and not in assembly names
23407         (currently slash, backslash and point), use Assembly.LoadFrom ()
23408         instead of Assembly.Load () on the `assembly' (before iteration
23409         over the link_paths).
23410
23411 2002-04-26  Martin Baulig  <martin@gnome.org>
23412
23413         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23414
23415 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
23416
23417         * class.cs (Property): use the new typemanager.MemberLookup
23418
23419         (TypeContainer.MemberLookup): Implement using the
23420         TypeManager.MemberLookup now. 
23421
23422         * typemanager.cs: Make MemberLookup a function of the TypeManager,
23423         and return MemberInfos, so that these can be used without an
23424         EmitContext (what we had before).
23425
23426 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
23427
23428         * expression.cs: Fix the case where the argument to params if the
23429         type of the params.  I omitted handling this before.   Fixed
23430
23431 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23432
23433         * driver.cs: Call BootCorlib_PopulateCoreType
23434
23435         * class.cs (Property.CheckBase): Check for properties only, not
23436         for all members. 
23437
23438         * interface.cs: Temporary hack: try/catch around the
23439         CustomAttributeBuilder, because I am getting an exception that I
23440         do not understand.
23441
23442         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23443         types whose definitions are required to be there (attributes are
23444         defined before standard types).
23445
23446         Compute definitions as we boot the various types, as they are used
23447         immediately (value_type class will need object_type, but if we do
23448         not initialize object_type, we will pass a null, which will let
23449         the runtime pick the System.Object from the existing corlib, which
23450         is not what we want).
23451
23452 2002-04-22  Patrik Torstensson <totte@labs2.com>
23453
23454         * cs-tokenizer.cs: fixed a number of trim() issues.
23455
23456 2002-04-22  Ravi Pratap  <ravi@ximian.com>
23457
23458         * expression.cs (Argument.Type): Ensure that we return the correct
23459         type when we have out or ref parameters [in which case we 
23460         append a "&"].
23461
23462 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23463
23464         * class.cs (Property, Indexer): Allow extern modifier in there. 
23465
23466         * typemanager.cs (InitBaseTypes): Initializes object_type and
23467         value_type, since those will be used early on during the bootstrap
23468         process to compile corlib.
23469
23470         (InitCoreTypes): Move code from here to InitBaseTypes.
23471
23472 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
23473
23474         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23475         single-dimension arrays as using the ldlen opcode.  
23476
23477         Daniel Lewis discovered this optimization.  
23478
23479         * typemanager.cs: Add signature for System.Array::get_Length
23480
23481 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23482
23483         * statement.cs: report the error when the foreach does not apply to an
23484         array nor a collection.
23485
23486 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
23487
23488         * expression.cs: Add implicit conversions to the operator ~.
23489
23490         * constant.cs (DecimalConstant.Emit): Emit decimal value.
23491
23492         * typemanager.cs: Locate the decimal constructor.
23493
23494 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23495
23496         * attribute.cs: use the new property of TypeOf.
23497         * expression.cs: added 'get' property around typearg.
23498
23499         These changes fix a build breaker reported by NickD. Is this the
23500         correct way to fix?  If not, please, revert my changes and make it
23501         work :-).
23502
23503 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
23504
23505         * attribute.cs: Add support for typeof in attribute invocations.
23506         I am not sure that this is right though.
23507
23508 2002-04-14  Duncan Mak  <duncan@ximian.com>
23509
23510         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23511         Binary.Operator.Division case.
23512
23513 2002-04-13  Ravi Pratap  <ravi@ximian.com>
23514
23515         * class.cs (DefineType): Ensure that we do a proper check on
23516         attribute types and also register it with the TypeManager.
23517
23518         (TypeContainer.Targets): The default for attribute types is
23519         AttributeTargets.All.
23520
23521         * attribute.cs (ApplyAttributes): Registering the attribute type
23522         is done elsewhere, not when we discover we have a Usage attribute.
23523
23524 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23525
23526         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23527         and get rid of is_delegate parameter.
23528
23529         * everywhere : update.
23530
23531 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23532
23533         * cs-parser.jay (compilation_unit): Revamp completely to use
23534         some new ideas that I got from Rhys' grammar to solve the problems
23535         with assembly level attributes.
23536
23537         (outer_declaration): New grammar production.
23538
23539         (attribute_sections): Add.
23540
23541         (opt_attributes): Base on attribute_sections
23542
23543         (namespace_declaration): Allow opt_attributes to tackle the case
23544         when we have assembly level attributes - we are clever in this
23545         regard now ;-)
23546
23547         * attribute.cs (ApplyAttributes): Do not worry about assembly 
23548         attributes in the non-global context.
23549
23550         * rootcontext.cs (AddGlobalAttributes): Go back to using this
23551         instead of SetGlobalAttributes.
23552
23553         * class.cs, rootcontext.cs : Ensure we define and generate 
23554         attribute types before anything else.
23555
23556         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23557         and flag the new error -20 for the case when the attribute type
23558         does not have valid targets specified. csc does not catch this.
23559
23560         * ../errors/errors.txt : update for error # -20
23561
23562 2002-04-11  Ravi Pratap  <ravi@ximian.com>
23563
23564         * support.cs (InternalParameters.ParameterModifier): Do some null
23565         checking and return sane values.
23566
23567         * class.cs (Method.Define): If we are a PInvoke method, ensure
23568         that we are static and extern. Report error # 601
23569
23570         * ../errors/cs0601.cs : Add test case for the above error.
23571
23572 2002-04-07  Ravi Pratap  <ravi@ximian.com>
23573
23574         * rootcontext.cs (attribute_types): We need to keep type of
23575         all attribute types separately and emit code for them first.
23576
23577         (RegisterAttribute) : Implement.
23578
23579         * class.cs (DefineType): Check if the current Type is a custom
23580         attribute type and register it accordingly.
23581
23582         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23583         adding the first attribute twice and rename to
23584
23585         (SetGlobalAttributes): this.
23586
23587         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23588         lookups.
23589
23590         * attribute.cs (ApplyAttributes): Take an additional argument telling us
23591         if we are processing global arguments. Hmm, I am unsure of this.
23592
23593 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23594
23595         * expression.cs: added static array of strings to avoid calling
23596         Enum.ToString () for Operator in Binary. Significant recover of
23597         performance.
23598
23599 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
23600
23601         * class.cs (FindMembers): Allow the Builders of the various
23602         members to be null.  If they are skip them.  This only happens
23603         during the PInvoke declaration.
23604
23605 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
23606
23607         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23608         failure, so we do not keep going afterwards.
23609
23610         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23611         wanted to pass `false' as the `is_delegate' argument.  If this is
23612         the case, why not use delegate_type == null to mean `is_delegate =
23613         false' and anything else as is_delegate = true.
23614
23615 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
23616
23617         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23618         code for the section, not the beginning of the tests.
23619
23620 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
23621
23622         * cfold.cs: Handle operator + (Enum x, Underlying x) 
23623
23624         * expression.cs (Binary): same.  Warn about errors where we have
23625         Enum/Enum in operator + as well.
23626
23627 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
23628
23629         * statement.cs:
23630                 - added support for switch(bool)
23631                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23632                 - add TableSwitchEmit() to handle table-based switch statements
23633
23634 2002-04-05  Ravi Pratap  <ravi@ximian.com>
23635
23636         * expression.cs (Invocation.OverloadResolve): Factor out code which
23637         does parameter compatibility checking with arguments so that we can 
23638         re-use the code even from Delegate.VerifyApplicability
23639
23640         (VerifyArgumentsCompat): Move above code here.
23641
23642         * delegate.cs (VerifyApplicability): Get rid of duplicate code
23643         and instead make a call to the above method.
23644
23645 2002-03-31  Ravi Pratap  <ravi@ximian.com>
23646
23647         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23648         We use it to keep track of classes which are attribute types.
23649
23650 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
23651
23652         * delegate.cs (Delegate.Define): Correctly define the types in the
23653         presence of fixed and array parameters.
23654
23655         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23656         doing FindMembers.
23657
23658         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23659         include NonPublic after the first iteration.
23660
23661         * class.cs (Indexer.CheckBase): Only check if both parents are
23662         non-null. 
23663
23664         * cs-parser.jay (accessor_body): If empty, set to null.
23665
23666         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23667         same code path here to resolve constants names that we did have in
23668         MemberAccess.DoResolve.  There is too much code duplicated here.
23669
23670 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
23671
23672         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23673
23674         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23675         to MakeUnionSet.
23676
23677         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23678         tokens, numbers and strings.
23679
23680         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23681         parenthesis.
23682
23683         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23684         asyncronous parameters and the regular parameters.  
23685
23686         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23687         specify the target directory.
23688
23689         * expression.cs: (This.DoResolve): Simplify
23690         (As.Emit): Optimize, do not generate IsInst if the expression is
23691         always of the given type.
23692
23693         (Is.DoResolve): Bug fix, we were reporting both always/never for
23694         the is expression.
23695
23696         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23697         creating too many unnecessary arrays.
23698
23699 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
23700
23701         * class.cs (EmitFieldInitializer): Use Assign expression to assign
23702         fields instead of rolling our own initializer.   Takes care of all
23703         implicit conversions, and drops unnecessary static checks/argument.
23704
23705 2002-03-31  Dick Porter  <dick@ximian.com>
23706
23707         * driver.cs: use the GetDirectories() return values properly, and
23708         use "/" as path separator.
23709
23710 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
23711
23712         * expression.cs (Unary): Optimize - - expr into expr.
23713         (Binary): Optimize a + (-b) into a -b.
23714
23715         * codegen.cs (CodeGen): Made all methods static.
23716
23717 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
23718
23719         * rootcontext.cs: 
23720
23721         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23722         TypeBuilder property.
23723
23724         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23725         instead. 
23726
23727         * tree.cs: Removed the various RecordXXXX, and replaced with a
23728         single RecordDecl.  Removed all the accessor methods, and just
23729         left a single access point Type 
23730
23731         * enum.cs: Rename DefineEnum to DefineType.
23732
23733         * decl.cs: New abstract method `DefineType' used to unify the
23734         Defines for Enumerations, Interfaces, TypeContainers and
23735         Delegates.
23736
23737         (FindType): Moved LookupInterfaceOrClass here.  Moved the
23738         LookupBaseClasses method that used to live in class.cs and
23739         interface.cs here, and renamed to FindType.
23740
23741         * delegate.cs: Implement DefineType.  Take advantage of the
23742         refactored pattern for locating the parent builder without taking
23743         the parent_builder argument (which we know does not work if we are
23744         nested, and triggering a toplevel definition).
23745
23746 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23747
23748         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23749         accessibility of a member has changed during override and report
23750         an error if so.
23751
23752         * class.cs (Method.Define, Property.Define): Only complain on
23753         overrides if the method is private, any other accessibility is
23754         fine (and since we just checked the permission is the same, we are
23755         good to go).
23756
23757         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23758         and elif are processed always.  The other pre-processing
23759         directives are only processed if we are "taking" the path
23760
23761 2002-03-29  Martin Baulig  <martin@gnome.org>
23762
23763         * class.cs (Method.Emit): Only emit symbolic debugging info if the
23764         current location is not Null.
23765
23766         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23767         a separate method so we can profile it.
23768
23769         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23770         `span.Seconds' are just seconds, but no minutes or hours.
23771         (MainDriver): Profile the CodeGen.SaveSymbols calls.
23772
23773 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23774
23775         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23776         Remove the gratuitous set of Final:
23777
23778                                 // If an interface implementation, then we can set Final.
23779                                 if (((flags & MethodAttributes.Abstract) == 0) &&
23780                                     implementing.DeclaringType.IsInterface)
23781                                         flags |= MethodAttributes.Final;
23782
23783         I do not know what I was smoking when I used that.
23784
23785
23786         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23787         step into fixing the name resolution issues for delegates and
23788         unifying the toplevel name resolution.
23789
23790 2002-03-28  Martin Baulig  <martin@gnome.org>
23791
23792         * class.cs (Method.Emit): If we have a symbol writer, call its
23793         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23794         tell it about the current method.
23795
23796         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23797         writer that we're going to emit the first byte of IL code for a new
23798         statement (a new source line).
23799         (EmitContext.EmitTopBlock): If we have a symbol writer, call
23800         EmitContext.Mark() before emitting any code.
23801
23802         * location.cs (SymbolDocument): Return null when we're Null.
23803
23804         * statement.cs (Statement): Moved the `Location loc' variable here.
23805         (Statement.EmitBoolExpression): If we have a symbol writer, call
23806         ec.Mark() before emitting any code to tell it that we're at the
23807         beginning of a new statement.
23808         (StatementExpression): Added `Location' argument to the constructor.
23809         (Block): Added public readonly variable `StartLocation' and public
23810         variable `EndLocation'.  The latter is to be set using SetEndLocation().
23811         (Block): Added constructor which takes a start and end location.
23812         (Block.SetEndLocation): New method. This sets the end location.
23813         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23814         local variables we create.
23815         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23816         each statement and do also mark the begin and end of the block.
23817
23818         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23819         tell it the current lexer.Location, use Location.Null for the end of the
23820         block.
23821         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23822         current block, set its end location using SetEndLocation().
23823         (statement_expression): StatementExpression constructor now takes the
23824         lexer.Location as additional argument.
23825         (for_statement, declare_local_variables): Likewise.
23826         (declare_local_variables): When creating a new implicit block, use the
23827         new Block constructor and pass it the lexer.Location.
23828
23829 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23830
23831         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23832         members also on the parent interfaces recursively.
23833
23834 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
23835
23836         * report.cs: Use new formats, since Gonzalo finished the missing
23837         bits. 
23838
23839         * expression.cs (Binary.ResolveOperator): added missing operator|
23840         operator& and operator^ for bool/bool.
23841
23842         * cs-parser.jay: CheckDef now takes a Location argument that is
23843         used to report errors more precisly (instead of reporting the end
23844         of a definition, we try to track something which is a lot closer
23845         to the source of the problem).
23846
23847         * cs-tokenizer.cs: Track global token use, so we can properly flag
23848         the use of #define/#undef after the first token has been seen.
23849
23850         Also, rename the reportXXXX to Error_DescriptiveName
23851
23852         * decl.cs (DeclSpace.IsTopLevel): Move property here from
23853         TypeContainer, so that Enum and Interface can use this too.
23854
23855         * class.cs (TypeContainer.LookupInterfaceOrClass,
23856         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23857         `builder' argument.  Typically this was used to pass the parent
23858         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23859         the definition).  
23860
23861         The problem is that a nested class could trigger the definition of
23862         a toplevel class, and the builder would be obviously wrong in that
23863         case. 
23864
23865         So we drop this argument, and we compute dynamically the
23866         TypeBuilder/ModuleBuilder (the correct information was available
23867         to us anyways from DeclSpace.Parent)
23868
23869         * interface.cs (Interface.DefineInterface): Drop builder
23870         parameter cleanup like class.cs
23871
23872         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
23873         like class.cs
23874
23875         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23876         values. 
23877
23878         (Try.Emit): Propagate the returns value from the statement.
23879
23880         (Return.Emit): Even if we are leavning 
23881
23882         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23883
23884         * modifiers.cs: Fix the computation of MethodAttributes flags.
23885
23886 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23887
23888         * driver.cs: allow compilation of files that start with '/'.
23889         Add a default case when checking the argument of --target.
23890
23891 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
23892
23893         * interface.cs: Implement the same search algorithm for types in
23894         the interface code.
23895
23896         * delegate.cs: Do not allow multiple definition.
23897
23898         * Recovered ChangeLog that got accidentally amputated
23899
23900         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23901
23902         * rootcontext.cs: Load manually enum to allow core classes to
23903         contain enumerations.
23904
23905         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23906         Update to new static methods in TypeManager.
23907
23908         * typemanager.cs (GetMethod, GetConstructor): Use our
23909         implementation of FindMembers to find the members, since during
23910         corlib compilation, the types are TypeBuilders and GetMethod and
23911         GetConstructor do not work.
23912
23913         Make all methods in TypeManager static.
23914
23915         (InitCodeHelpers): Split the functionality from
23916         the InitCodeTypes function.
23917
23918         * driver.cs: Call InitCodeHelpers after we have populated the
23919         types. 
23920
23921         * cs-parser.jay (delegate_declaration): we did not used to compute
23922         the delegate name correctly for void delegates.
23923
23924 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
23925
23926         * rootcontext.cs (RootContext): Init the interface_resolve_order
23927         and type_container_resolve_order always.
23928
23929         (ResolveCore, BootstrapCorlib_ResolveClass,
23930         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23931         compiler when compiling with --nostdlib
23932
23933         * class.cs (TypeContainer.DefineType): Check that our parent is
23934         not null.  This test is most important when we are bootstraping
23935         the core types.
23936
23937         * codegen.cs: Split out the symbol writing code.
23938
23939 2002-03-25  Martin Baulig  <martin@gnome.org>
23940
23941         * driver.cs (-g): Made -g an alias for --debug.
23942
23943 2002-03-24  Martin Baulig  <martin@gnome.org>
23944
23945         * codegen.cs (SymbolWriter): New public variable. Returns the
23946         current symbol writer.
23947         (CodeGen): Added `bool want_debugging_support' argument to the
23948          constructor. If true, tell the ModuleBuild that we want debugging
23949         support and ask it for the ISymbolWriter.
23950         (Save): If we have a symbol writer, call it's Close() method after
23951         saving the assembly.
23952
23953         * driver.c (--debug): New command line argument to create a
23954         debugger information file.
23955
23956         * location.cs (SymbolDocument): New public property. Returns an
23957         ISymbolDocumentWriter object for the current source file or null
23958         if we don't have a symbol writer.
23959
23960 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
23961
23962         * driver.cs (LoadAssembly): Correctly return when all the paths
23963         have been tried and not before.
23964
23965         * statement.cs (Switch.Emit): return the actual coverage for this
23966         statement (returns/not-returns)
23967
23968         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23969         switch of the statement if we are the last switch section.  That
23970         kills two problems: try/catch problems (we used to emit an empty
23971         nop at the end) and switch statements where all branches would
23972         return. 
23973
23974 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
23975
23976         * driver.cs: Add default assemblies (the equivalent to the
23977         Microsoft CSC.RSP file)
23978
23979         * cs-tokenizer.cs: When updating `cols and setting it to zero,
23980         also update tokens_seen and set it to false.
23981
23982         * driver.cs: Implement --recurse for Mike.
23983
23984         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23985         correctly splitting out the paths.
23986
23987 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
23988
23989         * interface.cs (Interface.PopulateProperty): Instead of using
23990         `parent' as the declaration space for the set parameters, use
23991         `this' 
23992
23993         * support.cs (InternalParameters): InternalParameters constructor
23994         takes a DeclSpace instead of a TypeContainer.
23995
23996         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23997         types are being initialized, load the address of it before calling
23998         the function.  
23999
24000         (New): Provide a mechanism to disable the generation of local
24001         value type temporaries when the caller will be providing us with
24002         an address to store it.
24003
24004         (ArrayCreation.EmitDynamicInitializers): Use it.
24005
24006 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
24007
24008         * expression.cs (Invocation.EmitArguments): Only probe for array
24009         property if there is more than one argument.  Sorry about that.
24010
24011         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
24012         empty param arrays.
24013
24014         * class.cs (Method.LabelParameters): Fix incorrect code path that
24015         prevented the `ParamArrayAttribute' from being applied to the
24016         params attribute.
24017
24018 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
24019
24020         * support.cs (ReflectionParameters): Correctly compute whether the
24021         last argument is a params array.  Fixes the problem with
24022         string.Split ('a')
24023
24024         * typemanager.cs: Make the assemblies array always be non-null
24025         (empty, but non-null)
24026
24027         * tree.cs (RecordDecl): New function that abstracts the recording
24028         of names.  This reports error 101, and provides a pointer to the
24029         previous declaration.  Fixes a crash in the compiler.
24030
24031         * cs-parser.jay (constructor_declaration): Update to new grammar,
24032         and provide a constructor_body that can be empty.
24033
24034 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
24035
24036         * driver.cs: Add support for --resources.
24037
24038         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
24039         Make all types for the various array helper methods be integer.
24040
24041         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
24042         CheckState to ConvCast.
24043
24044         (ConvCast): Now it takes a `checked' state argument, to avoid
24045         depending on the emit context for the conversion, and just using
24046         the resolve time setting.
24047
24048         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
24049         instead of Invocation.EmitArguments.  We do not emit the original
24050         arguments, instead we emit those which have been converted to
24051         unsigned int expressions.
24052
24053         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
24054
24055         * codegen.cs: ditto.
24056
24057         * expression.cs (LocalVariableReference): Drop the use of the
24058         Store function that depended on the variable index.
24059
24060         * statement.cs (VariableInfo): Drop the `Idx' property from this
24061         class, as this is not taking into account the indexes for
24062         temporaries tat we generate during the execution, getting the
24063         indexes wrong.
24064
24065         * class.cs: First emit class initializers, then call the parent
24066         constructor. 
24067
24068         * expression.cs (Binary): Fix opcode emision.
24069         (UnaryMutator.EmitCode): Support checked code generation
24070
24071         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
24072         matches for events for both the Static and Instance scans,
24073         pointing to the same element.   Fix that.
24074
24075 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
24076
24077         * rootcontext.cs (ResolveTree): Always set the
24078         interface_resolve_order, because nested interfaces will be calling
24079         into us.
24080
24081         * class.cs (GetInterfaceOrClass): Track the same resolution
24082         process used by TypeManager.LookupType.  This fixes the nested
24083         type lookups in class declarations (separate path from
24084         LookupType). 
24085
24086         (TypeContainer.DefineType): Also define nested interfaces.
24087         (TypeContainer.RegisterOrder): New public function used to
24088         register the order in which child interfaces need to be closed.
24089
24090         Nested interfaces need to be closed after their parents have been
24091         created. 
24092
24093         * interface.cs (InterfaceAttr): Put all the logic for computing
24094         the interface attribute here. 
24095
24096         (DefineInterface): Register our interface order with the
24097         RootContext or with the TypeContainer depending on the case.
24098
24099 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
24100
24101         * cs-parser.jay: rework foreach statement to work with the new
24102         changes to the policy on SimpleNames.
24103
24104         * report.cs: support Stacktrace on warnings as well.
24105
24106         * makefile: drop --unsafe and /unsafe from the compile.
24107
24108 2002-03-13  Ravi Pratap  <ravi@ximian.com>
24109
24110         * ecore.cs (StandardConversionExists): Modify to take an Expression
24111         as the first parameter. Ensure we do null -> reference type conversion
24112         checking.
24113
24114         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
24115         temporary Expression objects.
24116
24117 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
24118
24119         * interface.cs: workaround bug in method overloading resolution
24120         (there is already a bugzilla bug for it).
24121
24122 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
24123
24124         We could also solve this problem by having a separate path for
24125         performing type lookups, instead of DoResolve, we could have a
24126         ResolveType entry point, and only participating pieces of the
24127         production (simplename, deref, array) would implement this. 
24128
24129         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
24130         signal SimpleName to only resolve type names and not attempt to
24131         resolve anything else.
24132
24133         * expression.cs (Cast): Set the flag.
24134
24135         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
24136
24137         * class.cs: Only report 108 if there is no `new' modifier.
24138
24139         * cs-parser.jay: rework foreach statement to work with the new
24140         changes to the policy on SimpleNames.
24141
24142         * report.cs: support Stacktrace on warnings as well.
24143
24144         * makefile: drop --unsafe and /unsafe from the compile.
24145
24146 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
24147
24148         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24149         lookups here, instead of doing that at parse time.  This means
24150         that our grammar will not introduce `LocalVariableReferences' as
24151         expressions at this point.  That solves the problem of code like
24152         this:
24153
24154         class X {
24155            static void Main ()
24156            { int X = 1;
24157             { X x = null }}}
24158
24159         This is only half the fix.  The full fix requires parameters to
24160         also be handled in this way.
24161
24162         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
24163         makes the use more obvious of the DeclSpace.  The
24164         ec.TypeContainer.TypeBuilder is now only used to pull the
24165         TypeBuilder for it.
24166
24167         My theory is that I can get rid of the TypeBuilder completely from
24168         the EmitContext, and have typecasts where it is used (from
24169         DeclSpace to where it matters).  
24170
24171         The only pending problem is that the code that implements Aliases
24172         is on TypeContainer, and probably should go in DeclSpace.
24173
24174         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24175         lookups here, instead of doing that at parse time.  This means
24176         that our grammar will not introduce `LocalVariableReferences' as
24177         expressions at this point.  That solves the problem of code like
24178         this:
24179
24180         class X {
24181            static void Main ()
24182            { int X = 1;
24183             { X x = null }}}
24184
24185         This is only half the fix.  The full fix requires parameters to
24186         also be handled in this way.
24187
24188         * class.cs (Property.DefineMethod): When implementing an interface
24189         method, set newslot, when implementing an abstract method, do not
24190         set the flag (before we tried never setting it, or always setting
24191         it, which is the difference).
24192         (Indexer.DefineMethod): same.
24193         (Method.DefineMethod): same.
24194
24195         * ecore.cs: Only set the status used flag if we get back a Field.
24196
24197         * attribute.cs: Temporary hack, so Paolo can keep working.
24198
24199 2002-03-08  Ravi Pratap  <ravi@ximian.com>
24200
24201         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
24202         the unmanaged type in the case we have a MarshalAs attribute.
24203
24204         (Resolve): Handle the case when we are parsing the special MarshalAs
24205         attribute [we need to store the unmanaged type to use later]
24206
24207         * typemanager.cs (marshal_as_attr_type): Built in type for the 
24208         MarshalAs Attribute.
24209
24210         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
24211         on parameters and accordingly set the marshalling info.
24212
24213 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
24214
24215         * class.cs: Optimizing slightly by removing redundant code after
24216         we switched to the `NoTypes' return value.
24217         (Property.DefineMethod): use NoTypes here too.
24218
24219         This fixes the bug I introduced in my last batch of changes.
24220
24221 2002-03-05  Ravi Pratap  <ravi@ximian.com>
24222
24223         * tree.cs (RecordEnum): Add. We now keep track of enums too.
24224
24225         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
24226         Enums since those are types too. 
24227
24228         * cs-parser.jay (enum_declaration): Record enums as we parse them.
24229
24230         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
24231         thanks to a call during the lookup process.
24232
24233 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
24234
24235         * statement.cs (Foreach): Lots of work to accomodate a particular
24236         kind of foreach statement that I had not kept in mind.  It is
24237         possible to have foreachs on classes that provide a GetEnumerator
24238         method that return objects that implement the "pattern" for using
24239         a foreach, there is no need to support GetEnumerator
24240         specifically. 
24241
24242         This is needed to compile nant.
24243
24244         * decl.cs: Only report 114 if the member is not `Finalize' and if
24245         the warning level is at least 2.
24246
24247         * class.cs: Moved the compare function from Method to
24248         MethodSignature. 
24249
24250         (MethodSignature.InheritableMemberSignatureCompare): Add new
24251         filter function that is used to extract inheritable methods from a
24252         class. 
24253
24254         (Method.Define): Use the new `inheritable_method_signature_filter'
24255         delegate
24256
24257         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
24258         command. 
24259
24260 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
24261
24262         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
24263
24264         * cs-parser.jay: Add opt_semicolon to the interface declaration.
24265
24266         * expression.cs: Pass location information to
24267         ConvertImplicitStandard. 
24268
24269         * class.cs: Added debugging code to track return values from
24270         interfaces. 
24271
24272 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
24273
24274         * expression.cs (Is.DoResolve): If either side of the `is' is an
24275         interface, do not flag the warning.
24276
24277         * ecore.cs (ImplicitReferenceConversion): We need a separate test
24278         for interfaces
24279
24280         * report.cs: Allow for --fatal to be used with --probe.
24281
24282         * typemanager.cs (NoTypes): Move the definition for the empty Type
24283         array here. 
24284
24285         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
24286         properties. 
24287         (TypeContainer.DefineProxy): New function used to proxy to parent
24288         implementations when implementing interfaces.
24289         (TypeContainer.ParentImplements): used to lookup if our parent
24290         implements a public function that is required by an interface.
24291         (TypeContainer.VerifyPendingMethods): Hook this up.
24292
24293         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
24294         `modules' and `assemblies' arraylists into arrays.  We only grow
24295         these are the very early start up of the program, so this improves
24296         the speedof LookupType (nicely measured).
24297
24298         * expression.cs (MakeByteBlob): Replaced unsafe code with
24299         BitConverter, as suggested by Paolo.
24300
24301         * cfold.cs (ConstantFold.Binary): Special case: perform constant
24302         folding of string concatenation, but if either side is a string,
24303         and the other is not, then return null, and let the runtime use
24304         the concatenation on the string plus the object (using
24305         `Object.ToString'). 
24306
24307 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
24308
24309         Constant Folding has been implemented now.
24310
24311         * expression.cs (Unary.Reduce): Do not throw an exception, catch
24312         the error instead on types that are not supported in one's
24313         complement. 
24314
24315         * constant.cs (Constant and all children): New set of functions to
24316         perform implict and explicit conversions.
24317
24318         * ecore.cs (EnumConstant): Implement the new functions to perform
24319         conversion by proxying to the child expression.
24320
24321         * codegen.cs: (ConstantCheckState): Constant evaluation has its
24322         own separate setting that can not be turned off from the command
24323         line using --unchecked or --checked and is only controlled using
24324         the checked/unchecked statements and expressions.  This setting is
24325         used by the constant folder to flag errors.
24326
24327         * expression.cs (CheckedExpr, UncheckedExpr): Set the
24328         ConstantCheckState as well.   
24329
24330         During Resolve, they also have to flag the state, because the
24331         constant folder runs completely in the Resolve phase.
24332
24333         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24334         well.
24335
24336 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24337
24338         * cfold.cs: New file, this file contains the constant folder.
24339
24340         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24341         argument to track whether we are using the resulting address to
24342         load or store a value and provide better error messages. 
24343
24344         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24345         new AddressOf arguments.
24346
24347         * statement.cs (Foreach.EmitCollectionForeach): Update
24348
24349         * expression.cs (Argument.Emit): Call AddressOf with proper
24350         arguments to track usage.
24351
24352         (New.DoEmit): Call AddressOf with new arguments.
24353
24354         (Unary.Emit): Adjust AddressOf call.
24355
24356 2002-03-01  Ravi Pratap  <ravi@ximian.com>
24357
24358         * cs-parser.jay (member_access): Change the case for pre-defined types
24359         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
24360         this suggestion.
24361
24362         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24363         a method body.
24364
24365         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24366         essentially like methods and apply attributes like MethodImplOptions to them too.
24367
24368         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24369         not being null.
24370
24371         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24372         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24373         is the DeclSpace.
24374
24375         * Update code everywhere accordingly.
24376
24377         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24378
24379         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24380
24381 2002-02-28  Ravi Pratap  <ravi@ximian.com>
24382
24383         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24384         try performing lookups against those instead of jumping straight into using
24385         the 'using' clauses.
24386
24387         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24388
24389         (LookupType): Perform lookups in implicit parents too.
24390
24391         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24392         sequence as RootContext.LookupType. 
24393
24394         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
24395         the various cases of namespace lookups into this method.
24396
24397 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24398
24399         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24400         in positional arguments)
24401
24402         * class.cs (Operator): Update the AllowedModifiers to contain
24403         extern. 
24404
24405         * cs-parser.jay: Update operator declaration to allow for the
24406         operator body to be empty.
24407
24408         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24409         values. 
24410
24411 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
24412
24413         * class.cs (Method.Emit): Label parameters.
24414
24415         * driver.cs: Return 1 or 0 as the program exit code.
24416
24417 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
24418
24419         * expression.cs: Special case the `null' object when trying to
24420         auto-compute the type, as anything can be explicitly converted to
24421         that. 
24422
24423         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24424         spotting this Paolo.
24425
24426         (Expression.ImplicitNumericConversion): Perform comparissions of
24427         the type using the underlying type in the case of an enumeration
24428         rather than using the enumeration type for the compare.
24429
24430         Cope with the underlying == type case, which is not possible to
24431         catch before. 
24432
24433         (Expression.ConvertNumericExplicit): Perform comparissions of
24434         the type using the underlying type in the case of an enumeration
24435         rather than using the enumeration type for the compare.
24436
24437         * driver.cs: If the user does not supply an extension, assume .exe
24438
24439         * cs-parser.jay (if_statement): Rewrote so that we can track the
24440         location for the if statement.
24441
24442         * expression.cs (Binary.ConstantFold): Only concat strings when
24443         the operation is "+", not everything ;-)
24444
24445         * statement.cs (Statement.EmitBoolExpression): Take a location
24446         argument. 
24447         (If, While, Do): Track location.
24448
24449         * expression.cs (Binary.ResolveOperator): In the object + string
24450         case, I was missing a call to ConvertImplicit
24451
24452 2002-02-25  Ravi Pratap  <ravi@ximian.com>
24453
24454         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24455         Location arguments. Ensure we use RootContext.LookupType to do our work
24456         and not try to do a direct Type.GetType and ModuleBuilder.GetType
24457
24458         * interface.cs (PopulateMethod): Handle the type of the parameter being
24459         null gracefully.
24460
24461         * expression.cs (Invocation.BetterFunction): Handle the case when we 
24462         have a params method with no fixed arguments and a call is made with no
24463         arguments.
24464
24465 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
24466
24467         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24468         the verbatim-string-literal
24469
24470         * support.cs (InternalParameters.ParameterModifier): handle null
24471         fixed parameters.
24472         (InternalParameters.ParameterType): ditto.
24473
24474         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24475         duplicating the name of the variable parameter.
24476         (GetParameterByName): Fix bug where we were not looking up array
24477         paramters if they were the only present (thanks Paolo!).
24478         (GetParameterInfo): We only have an empty set of types if both
24479         fixed and array are set to null.
24480         (GetParameterInfo-idx): Handle FixedParameter == null
24481
24482         * cs-parser.jay: Handle the case where there is no catch
24483         statements (missing null test).
24484
24485 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
24486
24487         * driver.cs (MainDriver): Be conservative on our command line
24488         handling.
24489
24490         Catch DirectoryNotFoundException when calling GetFiles.
24491
24492         (SplitPathAndPattern): Used to split the input specification into
24493         a path and a pattern that we can feed to Directory.GetFiles.
24494
24495 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
24496
24497         * statement.cs (Fixed): Implement the last case of the Fixed
24498         statement (string handling).
24499
24500         * expression.cs (StringPtr): New class used to return a char * to
24501         a string;  Used by the Fixed statement.
24502
24503         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
24504
24505         * expression.cs (Binary.ResolveOperator): Remove redundant
24506         MemberLookup pn parent type.
24507         Optimize union call, we do not need a union if the types are the same.
24508         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24509         type.
24510
24511         Specialize the use of MemberLookup everywhere, instead of using
24512         the default settings. 
24513
24514         (StackAlloc): Implement stackalloc keyword.
24515
24516         * cs-parser.jay: Add rule to parse stackalloc.
24517
24518         * driver.cs: Handle /h, /help, /?
24519
24520         * expression.cs (MakeByteBlob): Removed the hacks we had in place
24521         before we supported unsafe code.
24522
24523         * makefile: add --unsafe to the self compilation of mcs.
24524
24525 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
24526
24527         * expression.cs (PointerArithmetic): New class that is used to
24528         perform pointer arithmetic.
24529         (Binary.Resolve): Handle pointer arithmetic
24530         Handle pointer comparission.
24531         (ArrayPtr): Utility expression class that is used to take the
24532         address of an array.
24533
24534         (ElementAccess): Implement array access for pointers
24535
24536         * statement.cs (Fixed): Implement fixed statement for arrays, we
24537         are missing one more case before we are done.
24538
24539         * expression.cs (Indirection): Implement EmitAssign and set the
24540         ExprClass to Variable.  This allows pointer dereferences to be
24541         treated as variables, and to have values assigned to them.
24542
24543         * ecore.cs (Expression.StoreFromPtr): New utility function to
24544         store values dereferencing.
24545
24546 2002-02-20  Ravi Pratap  <ravi@ximian.com>
24547
24548         * expression.cs (Binary.ResolveOperator): Ensure that we are
24549         not trying to operate on a void type - this fixes the reported
24550         bug.
24551
24552         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24553         the parent implementation is sealed.
24554
24555         * ../errors/cs0239.cs : Add.
24556
24557         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24558
24559         * typemanager.cs (unverifiable_code_type): Corresponds to 
24560         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24561         which have unsafe code in them.
24562
24563         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
24564         unsafe context.
24565
24566 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
24567
24568         * cs-tokenizer.cs: Add support for @"litreal strings"
24569
24570         Make tokenizer accept pre-processor directives
24571         on any column (remove the old C-like limitation). 
24572
24573         * rootcontext.cs (EmitCode): Emit any global attributes.
24574         (AddGlobalAttributes): Used to keep track of assembly attributes. 
24575
24576         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24577
24578         * cs-parser.jay: Add support for global attributes.  
24579
24580 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
24581
24582         * expression.cs (Indirection): New helper class.  Unary will
24583         create Indirection classes to be able to implement the
24584         IMemoryLocation interface on it.
24585
24586 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
24587
24588         * cs-parser.jay (fixed_statement): reference the right statement.
24589
24590         * statement.cs (Fixed.Emit): Finish implementing the fixed
24591         statement for the &x case.
24592
24593 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
24594
24595         * class.cs (Property.Define, Method.Define): Remove newslot when
24596         `implementing'.  
24597
24598         * modifiers.cs: My use of NewSlot when `Abstract' was set was
24599         wrong.  NewSlot should only be used if the `new' keyword is present.
24600
24601         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24602         locating our system dir.  Sorry about this.
24603
24604 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24605
24606         * driver.cs (GetSystemDir): Compute correctly the location of our
24607         system assemblies.  I was using the compiler directory instead of
24608         the library directory.
24609
24610 2002-02-13  Ravi Pratap  <ravi@ximian.com>
24611
24612         * expression.cs (BetterFunction): Put back in what Miguel commented out
24613         since it is the correct fix. The problem is elsewhere ;-)
24614
24615         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24616         parameters of the parms method are themselves compatible or not !
24617
24618         (StandardConversionExists): Fix very dangerous bug where we were forgetting
24619         to check that a class implements an interface before saying that an implicit
24620         conversion was allowed. Use ImplementsInterface to do the checking.
24621
24622 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24623
24624         * class.cs (Method.Define): Track whether we are an explicit
24625         implementation or not.  And only call DefineMethodOverride if we
24626         are an explicit implementation.
24627
24628         (Property.DefineMethod): Ditto.
24629
24630 2002-02-11  Ravi Pratap  <ravi@ximian.com>
24631
24632         * expression.cs (BetterFunction): Catch hideous bug which was
24633          preventing us from detecting ambiguous calls due to implicit casts i.e
24634         cs0121.
24635
24636 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
24637
24638         * support.cs (Pair): Remove un-needed method.  I figured why I was
24639         getting the error in cs-parser.jay, the variable in a foreach loop
24640         is readonly, and the compiler does not really treat this as a variable.
24641
24642         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
24643         instead of EQUALS in grammar.  
24644
24645         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24646
24647         * expression.cs (Unary.DoResolve): Check whether the argument is
24648         managed or not.
24649
24650 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
24651
24652         * support.cs: Api for Pair to set a value.  Despite the fact that
24653         the variables are public the MS C# compiler refuses to compile
24654         code that accesses the field if the variable is part of a foreach
24655         statement. 
24656
24657         * statement.cs (Fixed): Begin implementation of the fixed
24658         statement.
24659
24660         (Block.AddVariable): Return the VariableInfo on success and null
24661         on failure instead of true/false. 
24662
24663         * cs-parser.jay (foreach): Catch errors on variables already
24664         defined (we were ignoring this value before) and properly unwind
24665         the block hierarchy
24666
24667         (fixed_statement): grammar for the fixed statement.
24668
24669 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
24670
24671         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24672         pointer types to be incretemented.
24673
24674         (SizeOf): Implement.
24675
24676         * cs-parser.jay (pointer_member_access): Implement
24677         expr->IDENTIFIER production.
24678
24679         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24680         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24681         on safe contexts.
24682
24683         (Unary): Implement indirection.
24684
24685         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24686         use in non-unsafe context).
24687
24688         (SimpleName.DoResolve): Check for pointers in field access on safe
24689         contexts. 
24690
24691         (Expression.LoadFromPtr): Factor the load-indirect code in this
24692         function.  This was duplicated in UnboxCast and ParameterReference
24693
24694 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
24695
24696         * expression.cs (ComposedCast): report an error if a pointer cast
24697         is used in a safe region.
24698
24699         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24700         pointer type casts in unsafe context.
24701
24702         * codegen.cs (EmitContext): Set up IsUnsafe.
24703
24704         * cs-parser.jay (non_expression_type): Add productions for pointer
24705         casts. 
24706
24707         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24708         code.  We should not use force into static mode if the method is
24709         not virtual.  Fixes bug in MIS
24710
24711         * statement.cs (Do.Emit, While.Emit, For.Emit,
24712         Statement.EmitBoolExpression): Add support to Do and While to
24713         propagate infinite loop as `I do return' semantics.
24714
24715         Improve the For case to also test for boolean constants.
24716
24717         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24718         to the list of attributes we can add.
24719
24720         Remove `EmitContext' argument.
24721
24722         * class.cs (Method.Define): Apply parameter attributes.
24723         (Constructor.Define): Apply parameter attributes.
24724         (MethodCore.LabelParameters): Move here the core of labeling
24725         parameters. 
24726
24727         * support.cs (ReflectionParameters.ParameterModifier,
24728         InternalParameters.ParameterModifier): Use IsByRef on the type and
24729         only return the OUT bit for these parameters instead of in/out/ref
24730         flags.
24731
24732         This is because I miss-understood things.  The ParameterInfo.IsIn
24733         and IsOut represent whether the parameter has the [In] and [Out]
24734         attributes set.  
24735
24736 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
24737
24738         * ecore.cs (FieldExpr.Emit): Release temporaries.
24739
24740         * assign.cs (LocalTemporary.Release): new function.
24741
24742         * codegen.cs (EmitContext.GetTemporaryStorage,
24743         EmitContext.FreeTemporaryStorage): Rework the way we deal with
24744         temporary storage.  Now we can "put back" localbuilders when we
24745         are done with them
24746
24747 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
24748
24749         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24750         need to make a copy of the variable to generate verifiable code.
24751
24752 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
24753
24754         * driver.cs: Compute dynamically the system directory.
24755
24756         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24757         Slower, but more generally useful.  Used by the abstract
24758         registering implementation. 
24759
24760         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24761         the rules for the special rule on Type/instances.  First check if
24762         we have the same name, and if so, try that special static path
24763         rather than the instance path.
24764
24765 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
24766
24767         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24768         for, while and if.
24769
24770         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24771         Enum, ValueType, Delegate or Array for non-corlib compiles.
24772
24773         * cs-tokenizer.cs: Catch long identifiers (645)
24774
24775         * typemanager.cs (IndexerPropetyName): Ravi never tested this
24776         piece of code.
24777
24778         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24779         fix, we were returning too early, so we were not registering
24780         pending methods from abstract classes.
24781
24782         Do not register pending methods if the class is abstract.
24783
24784         * expression.cs (Conditional.DoResolve): Report circular implicit
24785         conversions when we neecd to compute it for conditional
24786         expressions. 
24787
24788         (Is.DoResolve): If the expression is always of the provided type,
24789         flag warning 183.  If the expression can not ever be of the
24790         provided type flag warning 184.
24791
24792         * class.cs: Catch 169 as well.
24793
24794         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24795         read. 
24796
24797 2002-01-18  Nick Drochak  <ndrochak@gol.com>
24798
24799         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
24800
24801 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
24802
24803         * interface.cs: (PopulateMethod): Check for pointers being defined
24804         only if the unsafe context is active.
24805         (PopulateProperty): ditto.
24806         (PopulateIndexer): ditto.
24807
24808         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24809         specified.  If pointers are present, make sure that they are
24810         present in an unsafe context.
24811         (Constructor, Constructor.Define): ditto.
24812         (Field, Field.Define): ditto.
24813         (Property, Property.Define): ditto.
24814         (Event, Event.Define): ditto.
24815
24816         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24817         hashtable if there are classes or structs defined.
24818
24819         * expression.cs (LocalVariableReference.DoResolve): Simplify this
24820         code, as the constant resolution moved.
24821
24822         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24823         the metadata, so we can flag error 133. 
24824
24825         * decl.cs (MemberCore.UnsafeOK): New function to test that a
24826         pointer is being declared in an unsafe context.
24827
24828 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
24829
24830         * modifiers.cs (Modifiers.Check): Require a Location argument.
24831         Report error 227 for Unsafe use.
24832
24833         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24834
24835         * statement.cs (For.Emit): If the test is null, then report that
24836         we do `return', as we wont reach anything afterwards.
24837
24838         (Switch.SwitchGoverningType): Track the expression that matched
24839         the conversion.
24840
24841         * driver.cs: Allow negative numbers as an error code to flag.
24842
24843         * cs-parser.jay: Handle 1551.
24844
24845         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24846
24847 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24848
24849         * cs-parser.jay: Report 1518 (type declaration can only contain
24850         class, struct, interface, enum or delegate)
24851
24852         (switch_label): Report 1523 (keywords `case' or `default' must
24853         preced code)
24854
24855         (opt_switch_sections): Report 1522 (empty switch)
24856
24857         * driver.cs: Report 1515 (response file specified multiple times)
24858         Report 1516 (Source file specified multiple times).
24859
24860         * expression.cs (Argument.Resolve): Signal 1510
24861
24862         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24863         access not allowed in static code)
24864
24865 2002-01-11  Ravi Pratap  <ravi@ximian.com>
24866
24867         * typemanager.cs (IsPointerType): Utility method which we are going
24868         to need a lot.
24869
24870         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24871         the object type, so we take care of that.
24872
24873         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24874
24875         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24876         added to non-params parameters :-)
24877
24878         * typemanager.cs (CSharpName): Include 'void' type too. 
24879
24880         (void_ptr_type): Include in the set of core types.
24881
24882         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
24883         duplicating code.
24884
24885         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
24886         an unsafe context.
24887
24888         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
24889         completely forgotten about it.
24890
24891 2002-01-10  Ravi Pratap  <ravi@ximian.com>
24892
24893         * cs-parser.jay (pointer_type): Add. This begins our implementation
24894         of parsing rules for unsafe code.
24895
24896         (unsafe_statement): Implement.
24897
24898         (embedded_statement): Modify to include the above.
24899
24900         * statement.cs (Unsafe): Implement new class for unsafe blocks.
24901
24902         * codegen.cs (EmitContext.InUnsafe): Add. This determines
24903         if the current context is an unsafe one.
24904
24905         * cs-parser.jay (local_variable_pointer_type): Since local variable types
24906         are handled differently, we need separate rules for them.
24907
24908         (local_variable_declaration): Update to use local_variable_pointer_type
24909         to allow variable declarations of unmanaged pointer types.
24910
24911         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24912         in unsafe contexts.
24913
24914         * ../errors/cs0214.cs : Add.
24915
24916 2002-01-16  Nick Drochak  <ndrochak@gol.com>
24917
24918         * makefile: remove 'response' file when cleaning.
24919
24920 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24921
24922         * cs-parser.jay: Report 1524.
24923
24924 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
24925
24926         * typemanager.cs (RegisterMethod): drop checking if we have
24927         registered this from here
24928
24929 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
24930
24931         * class.cs (Method.EmitDestructor): Implement calling our base
24932         destructor. 
24933
24934         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24935         value of InFinally.
24936
24937         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24938         this routine and will wrap the call in a try/catch block.  Deal
24939         with the case.
24940
24941 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
24942
24943         * ecore.cs (Expression.MemberLookup): instead of taking a
24944         parameter `same_type' that was used to tell whether we could
24945         access private members we compute our containing type from the
24946         EmitContext.
24947
24948         (FieldExpr): Added partial support for volatile fields.  This does
24949         not work for volatile fields exposed from assemblies, as I can not
24950         figure out how to extract the modreq from it.
24951
24952         Updated all the source files to use this.
24953
24954         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24955         because it is referenced by MemberLookup very often. 
24956
24957 2002-01-09  Ravi Pratap  <ravi@ximian.com>
24958
24959         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24960         TypeBuilder.GetCustomAttributes to retrieve what we need.
24961
24962         Get rid of redundant default_member_attr_type as this is the same as
24963         default_member_type which already exists.
24964
24965         * interface.cs, attribute.cs : Update accordingly.
24966
24967 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
24968
24969         * typemanager.cs: Enable IndexerPropertyName again.  It does not
24970         work for TYpeBuilders though.  Ravi, can you please fix this?
24971
24972         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24973
24974         * expression.cs (Argument.Emit): Handle the case of ref objects
24975         being passed to ref functions;  
24976
24977         (ParameterReference.EmitLoad): Loads the content of the pointer
24978         without dereferencing.
24979
24980 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24981
24982         * cs-tokenizer.cs: Implemented the pre-processing expressions.
24983
24984 2002-01-08  Ravi Pratap  <ravi@ximian.com>
24985
24986         * class.cs (Indexer.DefineMethod): Incorporate the interface
24987         type in the name of the method if we are doing explicit interface
24988         implementation.
24989
24990         * expression.cs (ConversionExists): Remove as it is completely obsolete.
24991
24992         (BetterConversion): Fix extremely trivial bug where we were referring to
24993         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24994         again !
24995
24996         * ../errors/bug16.cs : Add although we have fixed it.
24997
24998 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24999
25000         * expression.cs (BaseIndexer): Begin implementation.
25001
25002         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
25003
25004         * cs-parser.jay (indexer_declarator): Use qualified_identifier
25005         production directly to remove a shift/reduce, and implement
25006         explicit interface implementation.
25007
25008         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
25009         after a floating point suffix.
25010
25011         * expression.cs (DoNumericPromotions): Improved the conversion for
25012         uint/uint.  If we have a constant, we avoid doing a typecast to a
25013         larger type.
25014
25015         * class.cs (Indexer): Implement explicit interface implementation
25016         for indexers.
25017
25018 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
25019
25020         * class.cs: make the default instance constructor public and hidebysig.
25021
25022 2001-01-03  Ravi Pratap  <ravi@ximian.com>
25023
25024         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
25025         so we can call it from elsewhere.
25026
25027         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
25028         we emit it internally if the class has a defined indexer; otherwise the user
25029         emits it by decorating the class definition with the DefaultMemberAttribute.
25030
25031         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
25032         attribute is not used on a type which defines an indexer.
25033
25034         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
25035         character when we skip whitespace.
25036
25037         * ../errors/cs0646.cs : Add.
25038
25039 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
25040
25041         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
25042         again. 
25043
25044         * makefile: Add practical target `mcs3.exe' which builds the third
25045         generation compiler. 
25046
25047         * expression.cs (New): Fix structures constructor calling.
25048
25049         * class.cs (Property, Method, Indexer): Emit Final flag on the
25050         method if we are an interface implementation and we are not
25051         abstract. 
25052
25053         * ecore.cs (PropertyExpr): New public field `IsBase', tells
25054         whether this property is referencing a `base' method.
25055
25056         * expression.cs (Invocation.EmitCall): take an extra argument:
25057         is_base, this is used to determine whether the `call' or
25058         `callvirt' opcode should be used.
25059
25060
25061         * delegate.cs: update EmitCall.
25062
25063         * class.cs (Method.Define): Set NewSlot for the cases where we are
25064         not implementing an interface method.
25065
25066         (Property.Define): ditto.
25067
25068 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
25069
25070         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
25071         'r'.  Allows mcs to parse itself fully.
25072
25073 2002-01-02  Ravi Pratap  <ravi@ximian.com>
25074
25075         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
25076         of the number of initializers that require the InitializeArray method.
25077
25078         (CheckIndices): Store the Expression in all cases - not the plain value. Also
25079         update the above field where necessary.
25080
25081         (MakeByteBlob): Update accordingly.
25082
25083         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
25084         greater than 2.
25085
25086         (EmitDynamicInitializers): Update in accordance with the new optimization.
25087
25088         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
25089         same OpCode applies.
25090
25091         * cs-parser.jay : Fix some glaring errors I introduced.
25092
25093 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
25094
25095         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
25096         so that we can check for name clashes there too.
25097
25098         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
25099         for interface indexers.
25100
25101         * interfaces.cs (Define): Emit the default member attribute.
25102
25103         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
25104         variable was being referred to while setting the value ;-)
25105
25106 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
25107
25108         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
25109         byte-by-byte information when we know the data is zero.
25110
25111         Make the block always a multiple of 4, because
25112         DefineInitializedData has a bug.
25113
25114         * assign.cs: Fix, we should assign from the temporary, not from
25115         the source. 
25116
25117         * expression.cs (MakeByteBlob): Fix my incorrect code.
25118
25119 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
25120
25121         * typemanager.cs (EnumToUnderlying): This function is used to get
25122         the underlying type from an enumeration, because it does not
25123         always work. 
25124
25125         * constant.cs: Use the I4_S form for values between -128 and 127.
25126
25127         * statement.cs (Block.LookupLabel): Looks up a label.
25128         (Block): Drop support for labeled blocks.
25129
25130         (LabeledStatement): New kind of statement that represents a label
25131         only.
25132
25133         (Goto): Finally implement this bad boy.
25134
25135         * cs-parser.jay: Update to reflect new mechanism to implement
25136         labels.
25137
25138 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
25139
25140         * codegen.cs (EmitContext.This): a codegen property that keeps the
25141         a single instance of this instead of creating many different this
25142         instances. 
25143
25144         * delegate.cs (Delegate.DoResolve): Update to use the property;
25145
25146         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
25147
25148         * expression.cs (BaseAccess.DoResolve): Ditto.
25149
25150 2001-12-29  Ravi Pratap  <ravi@ximian.com>
25151
25152         * typemanager.cs (methodimpl_attr_type): Add to hold the type
25153         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
25154
25155         (InitCoreTypes): Update accordingly.
25156
25157         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
25158         so we can quickly store the state.
25159
25160         (ApplyAttributes): Set the correct implementation flags
25161         for InternalCall methods.
25162
25163 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
25164
25165         * expression.cs (EmitCall): if a method is not virtual, then do
25166         not use callvirt on it.
25167
25168         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
25169         user defined stuff) requires the use of stobj, which takes an
25170         address on the stack instead of an array and an index.  So emit
25171         the Ldelema operation for it.
25172
25173         (EmitStoreOpcode): Use stobj for valuetypes.
25174
25175         (UnaryMutator.EmitCode): Use the right 1 value depending on
25176         whether we are dealing with int64/uint64, float or doubles.
25177
25178         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
25179         constructors that I implemented last night.
25180
25181         (Constructor.IsDefault): Fix to work properly for static
25182         constructors.
25183
25184         * cs-parser.jay (CheckDef): report method signature errors.
25185         Update error number 103 to be 132.
25186
25187         * decl.cs: New AdditionResult enumeration value: MethodExists.
25188         Although we do this check for methods later on in the semantic
25189         analysis, catching repeated default constructors is so easy that
25190         we catch these here. 
25191
25192         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
25193         promotions code.
25194
25195         (ParameterReference.EmitAssign, Emit): handle
25196         bools as bytes.
25197
25198         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
25199         (ArrayAccess.EmitStoreOpcode): ditto.
25200
25201         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
25202
25203         * expression.cs (MakeByteBlob): Complete all the missing types
25204         (uint, short, ushort, byte, sbyte)
25205
25206         * class.cs: Only init instance field initializers on instance
25207         constructors. 
25208
25209         Rename `constructors' to instance_constructors. 
25210
25211         (TypeContainer.AddConstructor): Only add constructors to the list
25212         if it is not static.
25213
25214         Make sure that we handle default_static_constructor independently
25215         everywhere where we handle instance_constructors
25216
25217 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
25218
25219         * class.cs: Do not lookup or create a base initializer for a
25220         static constructor.
25221
25222         (ConstructorInitializer.Resolve): use the proper type to lookup
25223         for constructors.
25224
25225         * cs-parser.jay: Report error 1585 (modifiers between type and name).
25226
25227         * enum.cs, interface.cs: Remove CloseType, this is taken care by
25228         in DeclSpace. 
25229
25230         * decl.cs: CloseType is now an virtual method, the default
25231         implementation just closes this type.
25232
25233 2001-12-28  Ravi Pratap  <ravi@ximian.com>
25234
25235         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
25236         to PreserveSig by default. Also emit HideBySig on such methods.
25237
25238         Basically, set the defaults to standard values.
25239
25240         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
25241         argument, if candidate is better, it can't be worse than the best !
25242
25243         (Invocation): Re-write bits to differentiate between methods being
25244         applicable in their expanded form and their normal form - for params
25245         methods of course.
25246
25247         Get rid of use_standard everywhere as only standard conversions are allowed
25248         in overload resolution. 
25249
25250         More spec conformance.
25251
25252 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
25253
25254         * driver.cs: Add --timestamp, to see where the compiler spends
25255         most of its time.
25256
25257         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
25258         `this' in static code.
25259
25260         (SimpleName.DoResolve): Implement in terms of a helper function
25261         that allows static-references to be passed upstream to
25262         MemberAccess.
25263
25264         (Expression.ResolveWithSimpleName): Resolve specially simple
25265         names when called by MemberAccess to implement the special
25266         semantics. 
25267
25268         (Expression.ImplicitReferenceConversion): Handle conversions from
25269         Null to reference types before others, as Null's type is
25270         System.Object. 
25271
25272         * expression.cs (Invocation.EmitCall): Handle the special case of
25273         calling methods declared on a reference type from a ValueType
25274         (Base classes System.Object and System.Enum)
25275
25276         (MemberAccess.Resolve): Only perform lookups on Enumerations if
25277         the left hand side is a TypeExpr, not on every enumeration. 
25278
25279         (Binary.Resolve): If types are reference types, then do a cast to
25280         object on operators != and == of both arguments.
25281
25282         * typemanager.cs (FindMembers): Extract instance and static
25283         members if requested.
25284
25285         * interface.cs (PopulateProperty): Use void_type instead of null
25286         as the return type for the setter method.
25287
25288         (PopulateIndexer): ditto.
25289
25290 2001-12-27  Ravi Pratap  <ravi@ximian.com>
25291
25292         * support.cs (ReflectionParameters): Fix minor bug where we
25293         were examining the wrong parameter for the ParamArray attribute.
25294
25295         Cope with requests for the type of the parameter at position
25296         greater than the params parameter's. We now return the element
25297         type of the params array as that makes more sense.
25298
25299         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
25300         accordingly as we no longer have to extract the element type
25301         ourselves.
25302
25303         (Invocation.OverloadResolve): Update.
25304
25305 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
25306
25307         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
25308         against IEnumerator, test whether the return value is a descendant
25309         of the IEnumerator interface.
25310
25311         * class.cs (Indexer.Define): Use an auxiliary method to implement
25312         the other bits of the method definition.  Begin support for
25313         explicit interface implementation.
25314
25315         (Property.DefineMethod): Use TypeManager.void_type instead of null
25316         for an empty return value.
25317
25318 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
25319
25320         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
25321         dealing with a FieldExpr which is composed of a FieldBuilder, in
25322         the code path we did extract the constant, but we should have
25323         obtained the underlying value to be able to cast it (otherwise we
25324         end up in an infinite loop, this is what Ravi was running into).
25325
25326         (ArrayCreation.UpdateIndices): Arrays might be empty.
25327
25328         (MemberAccess.ResolveMemberAccess): Add support for section
25329         14.5.4.1 that deals with the special case of E.I when E is a type
25330         and something else, that I can be a reference to a static member.
25331
25332         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25333         handle a particular array type to create byte blobs, it is just
25334         something we dont generate byteblobs for.
25335
25336         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25337         arguments. 
25338
25339         * location.cs (Push): remove the key from the hashtable that we
25340         are about to add.   This happens for empty files.
25341
25342         * driver.cs: Dispose files after we have parsed them.
25343
25344         (tokenize): new function that only runs the tokenizer on its
25345         input, for speed testing.
25346
25347 2001-12-26  Ravi Pratap  <ravi@ximian.com>
25348
25349         * class.cs (Event.Define): Define the private field only if there
25350         are no accessors defined.
25351
25352         * expression.cs (ResolveMemberAccess): If there is no associated
25353         field with the event, that means we have an event defined with its
25354         own accessors and we should flag error cs0070 since transforming
25355         ourselves into a field is not valid in that case.
25356
25357         * ecore.cs (SimpleName.DoResolve): Same as above.
25358
25359         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25360         and charset to sane values.
25361
25362 2001-12-25  Ravi Pratap  <ravi@ximian.com>
25363
25364         * assign.cs (DoResolve): Perform check on events only if they 
25365         are being accessed outside the declaring type.
25366
25367         * cs-parser.jay (event_declarations): Update rules to correctly
25368         set the type of the implicit parameter etc.
25369
25370         (add_accessor, remove_accessor): Set current local parameters.
25371
25372         * expression.cs (Binary): For delegate addition and subtraction,
25373         cast the return value from the method into the appropriate delegate
25374         type.
25375
25376 2001-12-24  Ravi Pratap  <ravi@ximian.com>
25377
25378         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25379         of these as the workaround is unnecessary.
25380
25381         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25382         delegate data - none of that is needed at all.
25383
25384         Re-write bits to extract the instance expression and the delegate method
25385         correctly.
25386
25387         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
25388         on delegates too.
25389
25390         * attribute.cs (ApplyAttributes): New method to take care of common tasks
25391         of attaching attributes instead of duplicating code everywhere.
25392
25393         * everywhere : Update code to do attribute emission using the above method.
25394
25395 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25396
25397         * expression.cs (IsParamsMethodApplicable): if there are not
25398         parameters, return immediately.
25399
25400         * ecore.cs: The 0 literal can be implicity converted to an enum
25401         type. 
25402
25403         (SimpleName.DoResolve): First lookup the type, then lookup the
25404         members. 
25405
25406         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25407         want to get its address.  If the InstanceExpression is not
25408         addressable, store the result in a temporary variable, then get
25409         the address of it.
25410
25411         * codegen.cs: Only display 219 errors on warning level or above. 
25412
25413         * expression.cs (ArrayAccess): Make it implement the
25414         IMemoryLocation interface.
25415
25416         (Binary.DoResolve): handle the operator == (object a, object b)
25417         and operator != (object a, object b) without incurring into a
25418         BoxedCast (because 5 != o should never be performed).
25419
25420         Handle binary enumerator operators.
25421
25422         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25423         value type, otherwise use Ldelem_ref.
25424
25425         Use precomputed names;
25426
25427         (AddressOf): Implement address of
25428
25429         * cs-parser.jay (labeled_statement): Fix recursive block
25430         addition by reworking the production.
25431
25432         * expression.cs (New.DoEmit): New has a special case:
25433                 
25434                  If we are dealing with a ValueType, we have a few
25435                  situations to deal with:
25436                 
25437                     * The target of New is a ValueType variable, that is
25438                       easy, we just pass this as the variable reference
25439                 
25440                     * The target of New is being passed as an argument,
25441                       to a boxing operation or a function that takes a
25442                       ValueType.
25443                 
25444                       In this case, we need to create a temporary variable
25445                       that is the argument of New.
25446
25447
25448 2001-12-23  Ravi Pratap  <ravi@ximian.com>
25449
25450         * rootcontext.cs (LookupType): Check that current_type is not null before
25451         going about looking at nested types.
25452
25453         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25454         not implement the IAssignMethod interface any more.
25455
25456         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25457         where we tranform them into FieldExprs if they are being resolved from within
25458         the declaring type.
25459
25460         * ecore.cs (SimpleName.DoResolve): Do the same here.
25461
25462         * assign.cs (DoResolve, Emit): Clean up code considerably. 
25463
25464         * ../errors/bug10.cs : Add.
25465
25466         * ../errors/cs0070.cs : Add.
25467
25468         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25469
25470         * assign.cs : Get rid of EventIsLocal everywhere.
25471
25472 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25473
25474         * ecore.cs (ConvertIntLiteral): finished the implementation.
25475
25476         * statement.cs (SwitchLabel): Convert the value we are using as a
25477         key before looking up the table.
25478
25479 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25480
25481         * codegen.cs (EmitTopBlock): Require a Location argument now.
25482
25483         * cs-parser.jay (constructor_declarator): We need to setup
25484         current_local_parameters before we parse the
25485         opt_constructor_initializer, to allow the variables to be bound
25486         to the constructor arguments.
25487
25488         * rootcontext.cs (LookupType): First lookup nested classes in our
25489         class and our parents before we go looking outside our class.
25490
25491         * expression.cs (ConstantFold): Extract/debox the values at the
25492         beginnning. 
25493
25494         * rootcontext.cs (EmitCode): Resolve the constants first before we
25495         resolve the types.  This is not really needed, but it helps debugging.
25496
25497         * statement.cs: report location.
25498
25499         * cs-parser.jay: pass location to throw statement.
25500
25501         * driver.cs: Small bug fix.
25502
25503         * report.cs: Updated format to be 4-zero filled digits.
25504
25505 2001-12-22  Ravi Pratap  <ravi@ximian.com>
25506
25507         * expression.cs (CheckIndices): Fix minor bug where the wrong
25508         variable was being referred to ;-)
25509
25510         (DoEmit): Do not call EmitStaticInitializers when the 
25511         underlying type is System.Object.
25512
25513 2001-12-21  Ravi Pratap  <ravi@ximian.com>
25514
25515         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25516         and do the usual workaround for SRE.
25517
25518         * class.cs (MyEventBuilder.EventType): New member to get at the type
25519         of the event, quickly.
25520
25521         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25522
25523         * assign.cs (Assign.DoResolve): Handle the case when the target
25524         is an EventExpr and perform the necessary checks.
25525
25526         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25527         interface.
25528
25529         (SimpleName.MemberStaticCheck): Include check for EventExpr.
25530
25531         (EventExpr): Set the type in the constructor itself since we 
25532         are meant to be born fully resolved.
25533
25534         (EventExpr.Define): Revert code I wrote earlier.
25535                 
25536         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25537         instance expression is null. The instance expression is a This in that case
25538         or a null, depending on whether it is a static method or not.
25539
25540         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25541         refers to more than one method.
25542
25543         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25544         and accordingly flag errors.
25545
25546 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25547
25548         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25549
25550 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25551
25552         * location.cs (ToString): Provide useful rutine.
25553
25554 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25555
25556         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25557         objects, return the actual integral boxed.
25558
25559         * statement.cs (SwitchLabel): define an ILLabel for each
25560         SwitchLabel. 
25561
25562         (Switch.CheckSwitch): If the value is a Literal, extract
25563         the underlying literal.
25564
25565         Also in the unused hashtable we had, add the SwitchLabel so we can
25566         quickly look this value up.
25567
25568         * constant.cs: Implement a bunch of new constants.  Rewrite
25569         Literal based on this.  Made changes everywhere to adapt to this.
25570
25571         * expression.cs (Expression.MakeByteBlob): Optimize routine by
25572         dereferencing array only once, and also copes with enumrations.
25573
25574         bytes are two bytes wide, not one.
25575
25576         (Cast): Perform constant conversions.
25577
25578         * ecore.cs (TryImplicitIntConversion): Return literals instead of
25579         wrappers to the literals here.
25580
25581         * expression.cs (DoNumericPromotions): long literals can converted
25582         to ulong implicity (this is taken care of elsewhere, but I was
25583         missing this spot).
25584
25585         * ecore.cs (Expression.Literalize): Make the return type Literal,
25586         to improve type checking.
25587
25588         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25589
25590 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25591
25592         * literal.cs: Revert code from ravi that checked the bounds.  The
25593         bounds are sane by the definition of the type itself. 
25594
25595         * typemanager.cs: Fix implementation of ImplementsInterface.  We
25596         need to actually look up in our parent hierarchy for interfaces
25597         implemented. 
25598
25599         * const.cs: Use the underlying type for enumerations
25600
25601         * delegate.cs: Compute the basename for the delegate creation,
25602         that should fix the delegate test case, and restore the correct
25603         Type Lookup semantics in rootcontext
25604
25605         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
25606         referencing a nested type with the Reflection API is using the "+"
25607         sign. 
25608
25609         * cs-parser.jay: Do not require EOF token at the end.
25610
25611 2001-12-20  Ravi Pratap  <ravi@ximian.com>
25612
25613         * rootcontext.cs (LookupType): Concatenate type names with
25614         a '.' instead of a '+' The test suite passes again.
25615
25616         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25617         field of the enumeration.
25618
25619         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25620         the case when the member is an EventExpr.
25621
25622         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25623         static has an associated instance expression.
25624
25625         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25626
25627         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25628
25629         * class.cs (Event.Define): Register event and perform appropriate checks
25630         for error #111.
25631
25632         We define the Add and Remove methods even if the use provides none because
25633         in that case, we provide default implementations ourselves.
25634
25635         Define a private field of the type of the event. This is done by the CSC compiler
25636         and we should be doing it too ;-)
25637
25638         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25639         More methods we use in code we generate.
25640
25641         (multicast_delegate_type, delegate_type): Two separate types since the distinction
25642         is important.
25643
25644         (InitCoreTypes): Update accordingly for the above.
25645
25646         * class.cs (Event.Emit): Generate code for default accessors that we provide
25647
25648         (EmitDefaultMethod): Do the job in the above.
25649
25650         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
25651         appropriate place.
25652
25653 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25654
25655         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25656         builders even if we were missing one.
25657
25658         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25659         pass the Basename as our class name instead of the Name.  The
25660         basename will be correctly composed for us.
25661
25662         * parameter.cs (Paramters): Now takes a Location argument.
25663
25664         * decl.cs (DeclSpace.LookupType): Removed convenience function and
25665         make all the code call directly LookupType in RootContext and take
25666         this chance to pass the Location information everywhere.
25667
25668         * Everywhere: pass Location information.
25669
25670 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
25671
25672         * class.cs (Constructor.Define): Updated way of detecting the
25673         length of the parameters.
25674
25675         (TypeContainer.DefineType): Use basename as the type name for
25676         nested types.
25677
25678         (TypeContainer.Define): Do not recursively define types here, as
25679         definition is taken care in order by the RootContext.
25680
25681         * tree.cs: Keep track of namespaces in a per-file basis.
25682
25683         * parameter.cs (Parameter.ComputeSignature): Update to use
25684         DeclSpace. 
25685
25686         (Parameters.GetSignature): ditto.
25687
25688         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25689         instead of a TypeContainer.
25690
25691         (Interface.SemanticAnalysis): Use `this' instead of our parent to
25692         resolve names.  Because we need to be resolve in our context, not
25693         our parents.
25694
25695         * driver.cs: Implement response files.
25696
25697         * class.cs (TypeContainer.DefineType): If we are defined, do not
25698         redefine ourselves.
25699
25700         (Event.Emit): Emit the code for add/remove handlers.
25701         (Event.Define): Save the MethodBuilders for add/remove.
25702
25703         * typemanager.cs: Use pair here too.
25704
25705         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25706         DictionaryEntry requires the first argument to be non-null.  
25707
25708         (enum_declaration): Compute full name for registering the
25709         enumeration.
25710
25711         (delegate_declaration): Instead of using
25712         formal_parameter_list, use opt_formal_parameter_list as the list
25713         can be empty.
25714
25715         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25716         (EventParsing): New property that controls whether `add' and
25717         `remove' are returned as tokens or identifiers (for events);
25718
25719 2001-12-19  Ravi Pratap  <ravi@ximian.com>
25720
25721         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25722         use MyEventBuilder only and let it wrap the real builder for us.
25723
25724         (MyEventBuilder): Revamp constructor etc.
25725
25726         Implement all operations that we perform on EventBuilder in precisely the same
25727         way here too.
25728
25729         (FindMembers): Update to use the EventBuilder member.
25730
25731         (Event.Emit): Update accordingly.
25732
25733 2001-12-18  Ravi Pratap  <ravi@ximian.com>
25734
25735         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25736         by calling the appropriate methods.
25737
25738         (GetCustomAttributes): Make stubs as they cannot possibly do anything
25739         useful.
25740
25741         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25742
25743 2001-12-17  Ravi Pratap  <ravi@ximian.com>
25744
25745         * delegate.cs (Delegate.Populate): Check that the return type
25746         and various parameters types are indeed accessible.
25747
25748         * class.cs (Constructor.Define): Same here.
25749
25750         (Field.Define): Ditto.
25751
25752         (Event.Define): Ditto.
25753
25754         (Operator.Define): Check that the underlying Method defined itself
25755         correctly - so it's MethodBuilder should not be null.
25756
25757         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25758         expression happens to be null.
25759
25760         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25761         members but as of now we don't seem to be able to do anything really useful with it.
25762
25763         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25764         not the EventBuilder.
25765
25766 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
25767
25768         * cs-tokenizer.cs: Add support for defines.
25769         Add support for #if, #elif, #else, #endif
25770
25771         (eval_var): evaluates a variable.
25772         (eval): stubbed for evaluating functions.
25773
25774         * cs-parser.jay: Pass the defines information
25775
25776         * driver.cs: Add --define command line option.
25777
25778         * decl.cs: Move MemberCore here.
25779
25780         Make it the base class for DeclSpace.  This allows us to catch and
25781         report 108 and 109 for everything now.
25782
25783         * class.cs (TypeContainer.Define): Extract all the members
25784         before populating and emit the warning 108 (new keyword required
25785         to override) instead of having each member implement this.
25786
25787         (MemberCore.Define): New abstract method, we will be using this in
25788         the warning reporting engine in Populate.
25789
25790         (Operator.Define): Adjust to new MemberCore protocol. 
25791
25792         * const.cs (Const): This does not derive from Expression, it is a
25793         temporary object we use to create fields, it is a MemberCore. 
25794
25795         * class.cs (Method.Define): Allow the entry point to be in a
25796         specific class.
25797
25798         * driver.cs: Rewrite the argument handler to clean it up a bit.
25799
25800         * rootcontext.cs: Made it just an auxiliary namespace feature by
25801         making everything static.
25802
25803         * driver.cs: Adapt code to use RootContext type name instead of
25804         instance variable.
25805
25806         * delegate.cs: Remove RootContext argument.
25807
25808         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25809         argument. 
25810
25811         * class.cs (Event.Define): The lookup can fail.
25812
25813         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
25814
25815         * expression.cs: Resolve the this instance before invoking the code.
25816
25817 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
25818
25819         * cs-parser.jay: Add a production in element_access that allows
25820         the thing to become a "type" reference.  This way we can parse
25821         things like "(string [])" as a type.
25822
25823         Note that this still does not handle the more complex rules of
25824         casts. 
25825
25826
25827         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
25828
25829         * ecore.cs: (CopyNewMethods): new utility function used to
25830         assemble the list of methods from running FindMembers.
25831
25832         (MemberLookup): Rework FindMembers so that 
25833
25834 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
25835
25836         * class.cs (TypeContainer): Remove Delegates who fail to be
25837         defined.
25838
25839         * delegate.cs (Populate): Verify that we dont get null return
25840         values.   TODO: Check for AsAccessible.
25841
25842         * cs-parser.jay: Use basename to emit error 574 (destructor should
25843         have the same name as container class), not the full name.
25844
25845         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25846         possible representation.  
25847
25848         Also implements integer type suffixes U and L.
25849
25850 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
25851
25852         * expression.cs (ArrayCreation.DoResolve): We need to do the
25853         argument resolution *always*.
25854
25855         * decl.cs: Make this hold the namespace.  Hold the root context as
25856         well.
25857         (LookupType): Move here.
25858
25859         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25860
25861         * location.cs (Row, Name): Fixed the code, it was always returning
25862         references to the first file.
25863
25864         * interface.cs: Register properties defined through interfaces.
25865
25866         * driver.cs: Add support for globbing on the command line
25867
25868         * class.cs (Field): Make it derive from MemberCore as well.
25869         (Event): ditto.
25870
25871 2001-12-15  Ravi Pratap  <ravi@ximian.com>
25872
25873         * class.cs (Event::Define): Check that the type of the event is a delegate
25874         type else flag error #66.
25875
25876         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25877         same.
25878
25879         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25880         values of EntryPoint, CharSet etc etc.
25881
25882         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25883
25884         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25885         be null and we should ignore this. I am not sure if this is really clean. Apparently,
25886         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25887         which needs this to do its work.
25888
25889         * ../errors/cs0066.cs : Add.
25890
25891 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
25892
25893         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25894         helper functions.
25895
25896         * class.cs: (MethodSignature.MethodSignature): Removed hack that
25897         clears out the parameters field.
25898         (MemberSignatureCompare): Cleanup
25899
25900         (MemberCore): New base class used to share code between MethodCore
25901         and Property.
25902
25903         (RegisterRequiredImplementations) BindingFlags.Public requires
25904         either BindingFlags.Instace or Static.  Use instance here.
25905
25906         (Property): Refactored code to cope better with the full spec.
25907
25908         * parameter.cs (GetParameterInfo): Return an empty array instead
25909         of null on error.
25910
25911         * class.cs (Property): Abstract or extern properties have no bodies.
25912
25913         * parameter.cs (GetParameterInfo): return a zero-sized array.
25914
25915         * class.cs (TypeContainer.MethodModifiersValid): Move all the
25916         method modifier validation to the typecontainer so we can reuse
25917         this on properties.
25918
25919         (MethodCore.ParameterTypes): return an empty sized array of types.
25920
25921         (Property.Define): Test property modifier validity.
25922
25923         Add tests for sealed/override too.
25924
25925         (Method.Emit): abstract or extern methods have no bodies.
25926
25927 2001-12-14  Ravi Pratap  <ravi@ximian.com>
25928
25929         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25930         thing.
25931
25932         (Method::Define, ::Emit): Modify accordingly.
25933
25934         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25935
25936         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25937
25938         * makefile: Pass in /unsafe.
25939
25940 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
25941
25942         * class.cs (MakeKey): Kill routine.
25943
25944         * class.cs (TypeContainer.Define): Correctly define explicit
25945         method implementations (they require the full interface name plus
25946         the method name).
25947
25948         * typemanager.cs: Deply the PtrHashtable here and stop using the
25949         lame keys.  Things work so much better.
25950
25951         This of course broke everyone who depended on `RegisterMethod' to
25952         do the `test for existance' test.  This has to be done elsewhere.
25953
25954         * support.cs (PtrHashtable): A hashtable that avoid comparing with
25955         the object stupid Equals method (because, that like fails all over
25956         the place).  We still do not use it.
25957
25958         * class.cs (TypeContainer.SetRequiredInterface,
25959         TypeContainer.RequireMethods): Killed these two routines and moved
25960         all the functionality to RegisterRequiredImplementations.
25961
25962         (TypeContainer.RegisterRequiredImplementations): This routine now
25963         registers all the implementations required in an array for the
25964         interfaces and abstract methods.  We use an array of structures
25965         which can be computed ahead of time to reduce memory usage and we
25966         also assume that lookups are cheap as most classes will not
25967         implement too many interfaces.
25968
25969         We also avoid creating too many MethodSignatures.
25970
25971         (TypeContainer.IsInterfaceMethod): Update and optionally does not
25972         clear the "pending" bit if we find that there are problems with
25973         the declaration.
25974
25975         (TypeContainer.VerifyPendingMethods): Update to report errors of
25976         methods that look like implementations but are not.
25977
25978         (TypeContainer.Define): Add support for explicit interface method
25979         implementation. 
25980
25981 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
25982
25983         * typemanager.cs: Keep track of the parameters here instead of
25984         being a feature of the TypeContainer.
25985
25986         * class.cs: Drop the registration of parameters here, as
25987         InterfaceMethods are also interface declarations.
25988
25989         * delegate.cs: Register methods with the TypeManager not only with
25990         the TypeContainer.  This code was buggy.
25991
25992         * interface.cs: Full registation here.
25993
25994 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
25995
25996         * expression.cs: Remove reducer for binary expressions, it can not
25997         be done this way.
25998
25999         * const.cs: Put here the code that used to go into constant.cs
26000
26001         * constant.cs: Put here the code for constants, this is a new base
26002         class for Literals.
26003
26004         * literal.cs: Make Literal derive from Constant.
26005
26006 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
26007
26008         * statement.cs (Return.Emit): Report error 157 if the user
26009         attempts to return from a finally block.
26010
26011         (Return.Emit): Instead of emitting a return, jump to the end of
26012         the function.
26013
26014         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
26015         LocalBuilder to store the result of the function.  ReturnLabel is
26016         the target where we jump.
26017
26018
26019 2001-12-09  Radek Doulik  <rodo@ximian.com>
26020
26021         * cs-parser.jay: remember alias in current namespace
26022
26023         * ecore.cs (SimpleName::DoResolve): use aliases for types or
26024         namespaces
26025
26026         * class.cs (LookupAlias): lookup alias in my_namespace
26027
26028         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
26029         aliases hashtable
26030         (LookupAlias): lookup alias in this and if needed in parent
26031         namespaces
26032
26033 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
26034
26035         * support.cs: 
26036
26037         * rootcontext.cs: (ModuleBuilder) Made static, first step into
26038         making things static.  I need this to avoid passing the
26039         TypeContainer when calling ParameterType.
26040
26041         * support.cs (InternalParameters.ParameterType): Remove ugly hack
26042         that did string manipulation to compute the type and then call
26043         GetType.  Use Parameter.ParameterType instead.
26044
26045         * cs-tokenizer.cs: Consume the suffix for floating values.
26046
26047         * expression.cs (ParameterReference): figure out whether this is a
26048         reference parameter or not.  Kill an extra variable by computing
26049         the arg_idx during emission.
26050
26051         * parameter.cs (Parameters.GetParameterInfo): New overloaded
26052         function that returns whether a parameter is an out/ref value or not.
26053
26054         (Parameter.ParameterType): The type of the parameter (base,
26055         without ref/out applied).
26056
26057         (Parameter.Resolve): Perform resolution here.
26058         (Parameter.ExternalType): The full type (with ref/out applied).
26059
26060         * statement.cs (Using.Emit, Using.EmitExpression): Implement
26061         support for expressions on the using statement.
26062
26063 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
26064
26065         * statement.cs (Using.EmitLocalVariableDecls): Split the
26066         localvariable handling of the using statement.
26067
26068         (Block.EmitMeta): Keep track of variable count across blocks.  We
26069         were reusing slots on separate branches of blocks.
26070
26071         (Try.Emit): Emit the general code block, we were not emitting it. 
26072
26073         Check the type of the declaration to be an IDisposable or
26074         something that can be implicity converted to it. 
26075
26076         Emit conversions if required.
26077
26078         * ecore.cs (EmptyExpression): New utility class.
26079         (Expression.ImplicitConversionExists): New utility function.
26080
26081 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
26082
26083         * statement.cs (Using): Implement.
26084
26085         * expression.cs (LocalVariableReference): Support read only variables.
26086
26087         * statement.cs: Remove the explicit emit for the Leave opcode.
26088         (VariableInfo): Add a readonly field.
26089
26090 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
26091
26092         * ecore.cs (ConvCast): new class used to encapsulate the various
26093         explicit integer conversions that works in both checked and
26094         unchecked contexts.
26095
26096         (Expression.ConvertNumericExplicit): Use new ConvCast class to
26097         properly generate the overflow opcodes.
26098
26099 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
26100
26101         * statement.cs: The correct type for the EmptyExpression is the
26102         element_type, not the variable type.  Ravi pointed this out.
26103
26104 2001-12-04  Ravi Pratap  <ravi@ximian.com>
26105
26106         * class.cs (Method::Define): Handle PInvoke methods specially
26107         by using DefinePInvokeMethod instead of the usual one.
26108
26109         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
26110         above to do the task of extracting information and defining the method.
26111
26112 2001-12-04  Ravi Pratap  <ravi@ximian.com>
26113
26114         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
26115         of the condition for string type.
26116
26117         (Emit): Move that here. 
26118
26119         (ArrayCreation::CheckIndices): Keep string literals in their expression
26120         form.
26121
26122         (EmitDynamicInitializers): Handle strings appropriately.
26123
26124 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
26125
26126         * codegen.cs (EmitContext): Replace multiple variables with a
26127         single pointer to the current Switch statement.
26128
26129         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
26130         EmitContext.
26131
26132 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
26133
26134         * statement.cs 
26135
26136         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
26137         default'.
26138
26139         (Foreach.Emit): Foreach on arrays was not setting
26140         up the loop variables (for break/continue).
26141
26142         (GotoCase): Semi-implented.
26143
26144 2001-12-03  Ravi Pratap  <ravi@ximian.com>
26145
26146         * attribute.cs (CheckAttribute): Handle system attributes by using
26147         Attribute.GetAttributes to examine information we need.
26148
26149         (GetValidPlaces): Same here.
26150
26151         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
26152
26153         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
26154
26155         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
26156
26157         (Method::Define): Set appropriate flags if we have a DllImport attribute.
26158
26159         (Method::Emit): Handle the case when we are a PInvoke method.
26160
26161 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
26162
26163         * expression.cs: Use ResolveWithSimpleName on compound names.
26164
26165 2001-12-02  Ravi Pratap  <ravi@ximian.com>
26166
26167         * constant.cs (EmitConstant): Make sure we resolve the associated expression
26168         before trying to reduce it.
26169
26170         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
26171
26172         * constant.cs (LookupConstantValue): Implement.
26173
26174         (EmitConstant): Use the above in emitting the constant.
26175
26176         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
26177         that are user-defined by doing a LookupConstantValue on them.
26178
26179         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
26180         too, like above.
26181
26182 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
26183
26184         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
26185
26186         (BaseAccess.DoResolve): Implement.
26187
26188         (MemberAccess.DoResolve): Split this routine into a
26189         ResolveMemberAccess routine that can be used independently
26190
26191 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
26192
26193         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
26194         As that share bits of the implementation.  Is returns a boolean,
26195         while As returns the Type that is being probed.
26196
26197 2001-12-01  Ravi Pratap  <ravi@ximian.com>
26198
26199         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
26200         instead of a Literal - much easier.
26201
26202         (EnumInTransit): Remove - utterly useless :-)
26203
26204         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
26205
26206         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
26207
26208         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
26209         chain when we have no associated expression.
26210
26211 2001-11-30  Ravi Pratap  <ravi@ximian.com>
26212
26213         * constant.cs (Define): Use Location while reporting the errror.
26214
26215         Also emit a warning when 'new' is used and there is no inherited
26216         member to hide.
26217
26218         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
26219         populated.
26220
26221         (LookupEnumValue): Implement to lookup an enum member's value and define it
26222         if necessary.
26223
26224         (Populate): Re-write accordingly to use the above routine.
26225
26226 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
26227
26228         * expression.cs (This): Fix prototype for DoResolveLValue to
26229         override the base class DoResolveLValue.
26230
26231         * cs-parser.cs: Report errors cs574 and cs575 (destructor
26232         declarations) 
26233
26234         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
26235         (we need to load the address of the field here).  This fixes
26236         test-22. 
26237
26238         (FieldExpr.DoResolveLValue): Call the DoResolve
26239         function to initialize the Instance expression.
26240
26241         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
26242         correctly the GetEnumerator operation on a value type.
26243
26244         * cs-parser.jay: Add more simple parsing error catches.
26245
26246         * statement.cs (Switch): Add support for string switches.
26247         Handle null specially.
26248
26249         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
26250
26251 2001-11-28  Ravi Pratap  <ravi@ximian.com>
26252
26253         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
26254
26255         (declare_local_constant): New helper function.
26256
26257         * statement.cs (AddConstant): Keep a separate record of constants
26258
26259         (IsConstant): Implement to determine if a variable is a constant.
26260
26261         (GetConstantExpression): Implement.
26262
26263         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
26264
26265         * statement.cs (IsVariableDefined): Re-write.
26266
26267 2001-11-27  Ravi Pratap  <ravi@ximian.com>
26268
26269         * class.cs (TypeContainer::FindMembers): Look for constants
26270         in the case when we are looking for MemberTypes.Field
26271
26272         * expression.cs (MemberAccess::DoResolve): Check that in the
26273         case we are a FieldExpr and a Literal, we are not being accessed
26274         by an instance reference.
26275
26276         * cs-parser.jay (local_constant_declaration): Implement.
26277
26278         (declaration_statement): Implement for constant declarations.
26279
26280 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
26281
26282         * statement.cs (Switch): Catch double defaults.
26283
26284         (Switch): More work on the switch() statement
26285         implementation.  It works for integral values now, need to finish
26286         string support.
26287
26288
26289 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
26290
26291         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
26292         integer literals into other integer literals.  To be used by
26293         switch. 
26294
26295 2001-11-24  Ravi Pratap  <ravi@ximian.com>
26296
26297         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
26298         some memory.
26299
26300         (EmitDynamicInitializers): Cope with the above since we extract data
26301         directly from ArrayData now.
26302
26303         (ExpectInitializers): Keep track of whether initializers are mandatory
26304         or not.
26305
26306         (Bounds): Make it a hashtable to prevent the same dimension being 
26307         recorded for every element in that dimension.
26308
26309         (EmitDynamicInitializers): Fix bug which prevented the Set array method
26310         from being found.
26311
26312         Also fix bug which was causing the indices to be emitted in the reverse
26313         order.
26314
26315 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
26316
26317         * expression.cs (ArrayCreation): Implement the bits that Ravi left
26318         unfinished.  They do not work, because the underlying code is
26319         sloppy.
26320
26321 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26322
26323         * cs-parser.jay: Remove bogus fixme.
26324
26325         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
26326         on Switch statement.
26327
26328 2001-11-23  Ravi Pratap  <ravi@ximian.com>
26329
26330         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26331         the same. 
26332
26333         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26334         parameter. Apparently, any expression is allowed. 
26335
26336         (ValidateInitializers): Update accordingly.
26337
26338         (CheckIndices): Fix some tricky bugs thanks to recursion.
26339
26340         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
26341         I was being completely brain-dead.
26342
26343         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26344         and re-write acordingly.
26345
26346         (DelegateInvocation): Re-write accordingly.
26347
26348         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26349
26350         (MakeByteBlob): Handle types more correctly.
26351
26352         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26353         initialization from expressions but it is incomplete because I am a complete
26354         Dodo :-|
26355
26356 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26357
26358         * statement.cs (If.Emit): Fix a bug that generated incorrect code
26359         on If.  Basically, we have to return `true' (ie, we do return to
26360         our caller) only if both branches of the if return.
26361
26362         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26363         short-circuit operators, handle them as short circuit operators. 
26364
26365         (Cast.DoResolve): Resolve type.
26366         (Cast.Cast): Take an expression as the target type.
26367
26368         * cs-parser.jay (cast_expression): Remove old hack that only
26369         allowed a limited set of types to be handled.  Now we take a
26370         unary_expression and we resolve to a type during semantic
26371         analysis.
26372
26373         Use the grammar productions from Rhys to handle casts (this is
26374         not complete like Rhys syntax yet, we fail to handle that corner
26375         case that C# has regarding (-x), but we will get there.
26376
26377 2001-11-22  Ravi Pratap  <ravi@ximian.com>
26378
26379         * class.cs (EmitFieldInitializer): Take care of the case when we have a
26380         field which is an array type.
26381
26382         * cs-parser.jay (declare_local_variables): Support array initialization too.
26383
26384         * typemanager.cs (MakeKey): Implement.
26385
26386         (everywhere): Use the above appropriately.
26387
26388         * cs-parser.jay (for_statement): Update for array initialization while
26389         declaring variables.
26390
26391         * ecore.cs : The error message was correct, it's the variable's names that
26392         were misleading ;-) Make the code more readable.
26393
26394         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26395         the correct type etc.
26396
26397         (ConvertExplicit): Handle Enum types by examining the underlying type.
26398
26399 2001-11-21  Ravi Pratap  <ravi@ximian.com>
26400
26401         * parameter.cs (GetCallingConvention): Always return
26402         CallingConventions.Standard for now.
26403
26404 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26405
26406         * expression.cs (Binary.ResolveOperator): Update the values of `l'
26407         and `r' after calling DoNumericPromotions.
26408
26409         * ecore.cs: Fix error message (the types were in the wrong order).
26410
26411         * statement.cs (Foreach.ProbeCollectionType): Need to pass
26412         BindingFlags.Instance as well 
26413
26414         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26415         implicit int literal conversion in an empty cast so that we
26416         propagate the right type upstream.
26417
26418         (UnboxCast): new class used to unbox value types.
26419         (Expression.ConvertExplicit): Add explicit type conversions done
26420         by unboxing.
26421
26422         (Expression.ImplicitNumericConversion): Oops, forgot to test for
26423         the target type before applying the implicit LongLiterals to ULong
26424         literal cast.
26425
26426 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
26427
26428         * cs-parser.jay (for_statement): Reworked the way For works: now
26429         we declare manually any variables that are introduced in
26430         for_initializer to solve the problem of having out-of-band code
26431         emition (that is what got for broken).
26432
26433         (declaration_statement): Perform the actual variable declaration
26434         that used to be done in local_variable_declaration here.
26435
26436         (local_variable_declaration): Do not declare anything, just pass
26437         the information on a DictionaryEntry
26438
26439 2001-11-20  Ravi Pratap  <ravi@ximian.com>
26440
26441         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26442         re-write of the logic to now make it recursive.
26443
26444         (UpdateIndices): Re-write accordingly.
26445
26446         Store element data in a separate ArrayData list in the above methods.
26447
26448         (MakeByteBlob): Implement to dump the array data into a byte array.
26449
26450 2001-11-19  Ravi Pratap  <ravi@ximian.com>
26451
26452         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26453         into CheckIndices.
26454
26455         * constant.cs (Define): Implement.
26456
26457         (EmitConstant): Re-write fully.
26458
26459         Pass in location info.
26460
26461         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26462         respectively.
26463
26464         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26465         DictionaryEntry since we need location info too.
26466
26467         (constant_declaration): Update accordingly.
26468
26469         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26470         code into another method : UpdateIndices.
26471
26472 2001-11-18  Ravi Pratap  <ravi@ximian.com>
26473
26474         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26475         some type checking etc.
26476
26477 2001-11-17  Ravi Pratap  <ravi@ximian.com>
26478
26479         * expression.cs (ArrayCreation::ValidateInitializers): Implement
26480         bits to provide dimension info if the user skips doing that.
26481
26482         Update second constructor to store the rank correctly.
26483
26484 2001-11-16  Ravi Pratap  <ravi@ximian.com>
26485
26486         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26487         and try to implement.
26488
26489         * ../errors/cs0150.cs : Add.
26490
26491         * ../errors/cs0178.cs : Add.
26492
26493 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
26494
26495         * statement.cs: Implement foreach on multi-dimensional arrays. 
26496
26497         * parameter.cs (Parameters.GetParameterByName): Also lookup the
26498         name of the params argument.
26499
26500         * expression.cs: Use EmitStoreOpcode to get the right opcode while
26501         initializing the array.
26502
26503         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26504         we can use this elsewhere.
26505
26506         * statement.cs: Finish implementation of foreach for single
26507         dimension arrays.
26508
26509         * cs-parser.jay: Use an out-of-band stack to pass information
26510         around, I wonder why I need this.
26511
26512         foreach_block: Make the new foreach_block the current_block.
26513
26514         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26515         function used to return a static Parameters structure.  Used for
26516         empty parameters, as those are created very frequently.
26517
26518         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26519
26520 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26521
26522         * interface.cs : Default modifier is private, not public. The
26523         make verify test passes again.
26524
26525 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26526
26527         * support.cs (ReflectionParameters): Fix logic to determine
26528         whether the last parameter is a params one. Test 9 passes again.
26529
26530         * delegate.cs (Populate): Register the builders we define with
26531         RegisterParameterForBuilder. Test 19 passes again.
26532
26533         * cs-parser.jay (property_declaration): Reference $6 instead
26534         of $$ to get at the location.
26535
26536         (indexer_declaration): Similar stuff.
26537
26538         (attribute): Ditto.
26539
26540         * class.cs (Property): Register parameters for the Get and Set methods
26541         if they exist. Test 23 passes again.
26542
26543         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26544         call to EmitArguments as we are sure there aren't any params arguments. 
26545         Test 32 passes again.
26546
26547         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26548         IndexOutOfRangeException. 
26549
26550         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26551         Test 33 now passes again.
26552
26553 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
26554
26555         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26556         broke a bunch of things.  Will have to come up with a better way
26557         of tracking locations.
26558
26559         * statement.cs: Implemented foreach for single dimension arrays.
26560
26561 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26562
26563         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26564         an error.  This removes the lookup from the critical path.
26565
26566         * cs-parser.jay: Removed use of temporary_loc, which is completely
26567         broken. 
26568
26569 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
26570
26571         * support.cs (ReflectionParameters.ParameterModifier): Report
26572         whether the argument is a PARAMS argument or not.
26573
26574         * class.cs: Set the attribute `ParamArrayAttribute' on the
26575         parameter argument.
26576
26577         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26578         and cons_param_array_attribute (ConstructorInfo for
26579         ParamArrayAttribute)., 
26580
26581         * codegen.cs: Emit the return using the `Return' statement, that
26582         way we can report the error correctly for missing return values. 
26583
26584         * class.cs (Method.Emit): Clean up.
26585
26586         * expression.cs (Argument.Resolve): Take another argument: the
26587         location where this argument is used.  Notice that this is not
26588         part of the "Argument" class as to reduce the size of the
26589         structure (we know the approximate location anyways).
26590
26591         Test if the argument is a variable-reference, if not, then
26592         complain with a 206.
26593
26594         (Argument.Emit): Emit addresses of variables.
26595
26596         (Argument.FullDesc): Simplify.
26597
26598         (Invocation.DoResolve): Update for Argument.Resolve.
26599
26600         (ElementAccess.DoResolve): ditto.
26601
26602         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26603         method should be virtual, as this method is always virtual.
26604
26605         (NewDelegate.DoResolve): Update for Argument.Resolve.
26606
26607         * class.cs (ConstructorInitializer.DoResolve): ditto.
26608
26609         * attribute.cs (Attribute.Resolve): ditto.
26610
26611 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
26612
26613         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26614
26615         * expression.cs (ParameterReference): Drop IStackStorage and implement
26616         IAssignMethod instead. 
26617
26618         (LocalVariableReference): ditto.
26619
26620         * ecore.cs (FieldExpr): Drop IStackStorage and implement
26621         IAssignMethod instead. 
26622
26623 2001-11-13  Miguel de Icaza <miguel@ximian.com>
26624
26625         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26626         enumerations that are used in heavily used structures derive from
26627         byte in a laughable and pathetic attempt to reduce memory usage.
26628         This is the kind of pre-optimzations that you should not do at
26629         home without adult supervision.
26630
26631         * expression.cs (UnaryMutator): New class, used to handle ++ and
26632         -- separatedly from the other unary operators.  Cleans up the
26633         code, and kills the ExpressionStatement dependency in Unary.
26634
26635         (Unary): Removed `method' and `Arguments' from this class, making
26636         it smaller, and moving it all to SimpleCall, so I can reuse this
26637         code in other locations and avoid creating a lot of transient data
26638         strucutres when not required.
26639
26640         * cs-parser.jay: Adjust for new changes.
26641
26642 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
26643
26644         * enum.cs (Enum.Populate): If there is a failure during
26645         definition, return
26646
26647         * cs-parser.jay (opt_enum_base): we used to catch type errors
26648         here, but this is really incorrect.  The type error should be
26649         catched during semantic analysis.
26650
26651 2001-12-11  Ravi Pratap  <ravi@ximian.com>
26652
26653         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26654         current_local_parameters as expected since I, in my stupidity, had forgotten
26655         to do this :-)
26656
26657         * attribute.cs (GetValidPlaces): Fix stupid bug.
26658
26659         * class.cs (Method::Emit): Perform check on applicability of attributes.
26660
26661         (Constructor::Emit): Ditto.
26662
26663         (Field::Emit): Ditto.
26664
26665         (Field.Location): Store location information.
26666
26667         (Property, Event, Indexer, Operator): Ditto.
26668
26669         * cs-parser.jay (field_declaration): Pass in location for each field.
26670
26671         * ../errors/cs0592.cs : Add.
26672
26673 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26674
26675         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26676
26677         (InitCoreTypes): Update accordingly.
26678
26679         (RegisterAttrType, LookupAttr): Implement.
26680
26681         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26682         info about the same.
26683
26684         (Resolve): Update to populate the above as necessary.
26685
26686         (Error592): Helper.
26687
26688         (GetValidPlaces): Helper to the above.
26689
26690         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26691
26692         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26693
26694 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26695
26696         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26697
26698         * ../errors/cs0617.cs : Add.
26699
26700 2001-11-11  Ravi Pratap  <ravi@ximian.com>
26701
26702         * enum.cs (Emit): Rename to Populate to be more consistent with what
26703         we expect it to do and when exactly it is called.
26704
26705         * class.cs, rootcontext.cs : Update accordingly.
26706
26707         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26708         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26709
26710         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26711
26712         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26713         of a fieldinfo using the above, when dealing with a FieldBuilder.
26714
26715 2001-11-10  Ravi Pratap  <ravi@ximian.com>
26716
26717         * ../errors/cs0031.cs : Add.
26718
26719         * ../errors/cs1008.cs : Add.
26720
26721         * ../errrors/cs0543.cs : Add.
26722
26723         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26724         enum type.
26725
26726         (FindMembers): Implement.
26727
26728         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26729         enums and delegates too.
26730
26731         (enum_types): Rename to builder_to_enum.
26732
26733         (delegate_types): Rename to builder_to_delegate.
26734
26735         * delegate.cs (FindMembers): Implement.
26736
26737 2001-11-09  Ravi Pratap  <ravi@ximian.com>
26738
26739         * typemanager.cs (IsEnumType): Implement.
26740
26741         * enum.cs (Emit): Re-write parts to account for the underlying type
26742         better and perform checking etc.
26743
26744         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26745         of the underlying type.
26746
26747         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26748         value
26749
26750         * enum.cs (error31): Helper to report error #31.
26751
26752         * cs-parser.jay (enum_declaration): Store location of each member too.
26753
26754         * enum.cs (member_to_location): New hashtable. 
26755
26756         (AddEnumMember): Update location hashtable.
26757
26758         (Emit): Use the location of each member while reporting errors.
26759
26760 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26761
26762         * cs-parser.jay: A for_initializer if is a
26763         local_variable_declaration really ammount to have an implicit
26764         block with the variable declaration and no initializer for for.
26765
26766         * statement.cs (For.Emit): Cope with null initializers.
26767
26768         This fixes the infinite loop on for initializers.
26769
26770 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
26771
26772         * enum.cs: More cleanup.
26773
26774         * ecore.cs: Remove dead code.
26775
26776         * class.cs (Property.Emit): More simplification.
26777         (Event.Emit): ditto.
26778
26779         Reworked to have less levels of indentation.
26780
26781 2001-11-08  Ravi Pratap  <ravi@ximian.com>
26782
26783         * class.cs (Property): Emit attributes.
26784
26785         (Field): Ditto.
26786
26787         (Event): Ditto.
26788
26789         (Indexer): Ditto.
26790
26791         (Operator): Ditto.
26792
26793         * enum.cs (Emit): Ditto.
26794
26795         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26796         Enums too.
26797
26798         * class.cs (Field, Event, etc.): Move attribute generation into the
26799         Emit method everywhere.
26800
26801         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26802         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26803         as we had no way of defining nested enums !
26804
26805         * rootcontext.cs : Adjust code accordingly.
26806
26807         * typemanager.cs (AddEnumType): To keep track of enum types separately.
26808
26809 2001-11-07  Ravi Pratap  <ravi@ximian.com>
26810
26811         * expression.cs (EvalConstantExpression): Move into ecore.cs
26812
26813         * enum.cs (Enum): Rename some members and make them public and readonly
26814         according to our convention.
26815
26816         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26817         nothing else.
26818
26819         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26820
26821         (Enum::Emit): Write a simple version for now which doesn't try to compute
26822         expressions. I shall modify this to be more robust in just a while.
26823
26824         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26825
26826         (TypeContainer::CloseType): Create the Enum types too.
26827
26828         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26829
26830         * expression.cs (EvalConstantExpression): Get rid of completely.
26831
26832         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26833         user-defined values and other cases.
26834
26835         (IsValidEnumLiteral): Helper function.
26836
26837         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
26838         out there in the case we had a literal FieldExpr.
26839
26840         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26841
26842         (Literalize): Revamp a bit to take two arguments.
26843
26844         (EnumLiteral): New class which derives from Literal to wrap enum literals.
26845
26846 2001-11-06  Ravi Pratap  <ravi@ximian.com>
26847
26848         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26849
26850         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26851
26852         (Resolve): Use the above to ensure we have proper initializers.
26853
26854 2001-11-05  Ravi Pratap  <ravi@ximian.com>
26855
26856         * expression.cs (Expression::EvalConstantExpression): New method to 
26857         evaluate constant expressions.
26858
26859         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26860
26861 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
26862
26863         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26864         in an array.
26865
26866         (Binary.ResolveOperator): Handle operator != (object a, object b)
26867         and operator == (object a, object b);
26868
26869         (Binary.DoNumericPromotions): Indicate whether the numeric
26870         promotion was possible.
26871
26872         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26873         Implement.  
26874
26875         Made the ArrayAccess implement interface IAssignMethod instead of
26876         IStackStore as the order in which arguments are passed reflects
26877         this.
26878
26879         * assign.cs: Instead of using expr.ExprClass to select the way of
26880         assinging, probe for the IStackStore/IAssignMethod interfaces.
26881
26882         * typemanager.cs: Load InitializeArray definition.
26883
26884         * rootcontext.cs (RootContext.MakeStaticData): Used to define
26885         static data that can be used to initialize arrays. 
26886
26887 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
26888
26889         * expression.cs: Handle operator== and operator!= for booleans.
26890
26891         (Conditioal.Reduce): Implement reducer for the ?: operator.
26892
26893         (Conditional.Resolve): Implement dead code elimination.
26894
26895         (Binary.Resolve): Catch string literals and return a new
26896         concatenated string.
26897
26898         (Unary.Reduce): Implement reduction of unary expressions.
26899
26900         * ecore.cs: Split out the expression core handling here.
26901
26902         (Expression.Reduce): New method used to perform constant folding
26903         and CSE.  This is needed to support constant-expressions. 
26904
26905         * statement.cs (Statement.EmitBoolExpression): Pass true and false
26906         targets, and optimize for !x.
26907
26908 2001-11-04  Ravi Pratap  <ravi@ximian.com>
26909
26910         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26911         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26912         set custom atttributes.
26913
26914         * literal.cs (Literal::GetValue): New abstract method to return the actual
26915         value of the literal, cast as an object.
26916
26917         (*Literal): Implement GetValue method.
26918
26919         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26920         expressions to the arraylist but objects of type Argument.
26921
26922         * class.cs (TypeContainer::Emit): Emit our attributes too.
26923
26924         (Method::Emit, Constructor::Emit): Ditto.
26925
26926         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26927         to be ignoring earlier.
26928
26929 2001-11-03  Ravi Pratap  <ravi@ximian.com>
26930
26931         * attribute.cs (AttributeSection::Define): Implement to do the business
26932         of constructing a CustomAttributeBuilder.
26933
26934         (Attribute): New trivial class. Increases readability of code.  
26935
26936         * cs-parser.jay : Update accordingly.
26937
26938         (positional_argument_list, named_argument_list, named_argument): New rules
26939
26940         (attribute_arguments): Use the above so that we are more correct.
26941
26942 2001-11-02  Ravi Pratap  <ravi@ximian.com>
26943
26944         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26945         to perform all checks for a method with a params parameter.
26946
26947         (Invocation::OverloadResolve): Update to use the above method and therefore
26948         cope correctly with params method invocations.
26949
26950         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
26951         params too.
26952
26953         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26954         constructors in our parent too because we can't afford to miss out on 
26955         protected ones ;-)
26956
26957         * attribute.cs (AttributeSection): New name for the class Attribute
26958
26959         Other trivial changes to improve readability.
26960
26961         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26962         use the new class names.
26963
26964 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26965
26966         * class.cs (Method::Define): Complete definition for params types too
26967
26968         (Indexer::Define): Ditto.
26969
26970         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26971         Cope everywhere with a request for info about the array parameter.
26972
26973 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26974
26975         * tree.cs (RecordNamespace): Fix up to check for the correct key.
26976
26977         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
26978         local_variable_type to extract the string corresponding to the type.
26979
26980         (local_variable_type): Fixup the action to use the new helper method.
26981
26982         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
26983         go.
26984
26985         * expression.cs : Clean out code which uses the above.
26986
26987 2001-10-31  Ravi Pratap  <ravi@ximian.com>
26988
26989         * typemanager.cs (RegisterMethod): Check if we already have an existing key
26990         and bale out if necessary by returning a false.
26991
26992         (RegisterProperty): Ditto.
26993
26994         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26995         and print out appropriate error messages.
26996
26997         * interface.cs (everywhere): Ditto.
26998
26999         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
27000         location to constructor.
27001
27002         * class.cs (Property, Event, Indexer): Update accordingly.
27003
27004         * ../errors/cs111.cs : Added.
27005
27006         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
27007         of a method, as laid down by the spec.
27008
27009         (Invocation::OverloadResolve): Use the above method.
27010
27011 2001-10-31  Ravi Pratap  <ravi@ximian.com>
27012
27013         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
27014         now take a TypeContainer and a Parameters object.
27015
27016         (ParameterData): Modify return type of ParameterModifier method to be 
27017         Parameter.Modifier and not a string.
27018
27019         (ReflectionParameters, InternalParameters): Update accordingly.
27020
27021         * expression.cs (Argument::GetParameterModifier): Same here.
27022
27023         * support.cs (InternalParameters::ParameterType): Find a better way of determining
27024         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
27025         symbol in it at all so maybe this is only for now.
27026
27027 2001-10-30  Ravi Pratap  <ravi@ximian.com>
27028
27029         * support.cs (InternalParameters): Constructor now takes an extra argument 
27030         which is the actual Parameters class.
27031
27032         (ParameterDesc): Update to provide info on ref/out modifiers.
27033
27034         * class.cs (everywhere): Update call to InternalParameters to pass in
27035         the second argument too.
27036
27037         * support.cs (ParameterData): Add ParameterModifier, which is a method 
27038         to return the modifier info [ref/out etc]
27039
27040         (InternalParameters, ReflectionParameters): Implement the above.
27041
27042         * expression.cs (Argument::ParameterModifier): Similar function to return
27043         info about the argument's modifiers.
27044
27045         (Invocation::OverloadResolve): Update to take into account matching modifiers 
27046         too.
27047
27048         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
27049         a new SetFormalParameters object which we pass to InternalParameters.
27050
27051 2001-10-30  Ravi Pratap  <ravi@ximian.com>
27052
27053         * expression.cs (NewArray): Merge into the ArrayCreation class.
27054
27055 2001-10-29  Ravi Pratap  <ravi@ximian.com>
27056
27057         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
27058         NewUserdefinedArray into one as there wasn't much of a use in having
27059         two separate ones.
27060
27061         * expression.cs (Argument): Change field's name to ArgType from Type.
27062
27063         (Type): New readonly property which returns the proper type, taking into 
27064         account ref/out modifiers.
27065
27066         (everywhere): Adjust code accordingly for the above.
27067
27068         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
27069         whether we are emitting for a ref or out parameter.
27070
27071         * expression.cs (Argument::Emit): Use the above field to set the state.
27072
27073         (LocalVariableReference::Emit): Update to honour the flag and emit the
27074         right stuff.
27075
27076         * parameter.cs (Attributes): Set the correct flags for ref parameters.
27077
27078         * expression.cs (Argument::FullDesc): New function to provide a full desc.
27079
27080         * support.cs (ParameterData): Add method ParameterDesc to the interface.
27081
27082         (ReflectionParameters, InternalParameters): Implement the above method.
27083
27084         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
27085         reporting errors.
27086
27087         (Invocation::FullMethodDesc): Ditto. 
27088
27089 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
27090
27091         * cs-parser.jay: Add extra production for the second form of array
27092         creation. 
27093
27094         * expression.cs (ArrayCreation): Update to reflect the above
27095         change. 
27096
27097         * Small changes to prepare for Array initialization.
27098
27099 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
27100
27101         * typemanager.cs (ImplementsInterface): interface might be null;
27102         Deal with this problem;
27103
27104         Also, we do store negative hits on the cache (null values), so use
27105         this instead of calling t.GetInterfaces on the type everytime.
27106
27107 2001-10-28  Ravi Pratap  <ravi@ximian.com>
27108
27109         * typemanager.cs (IsBuiltinType): New method to help determine the same.
27110
27111         * expression.cs (New::DoResolve): Get rid of array creation code and instead
27112         split functionality out into different classes.
27113
27114         (New::FormArrayType): Move into NewBuiltinArray.
27115
27116         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
27117         quite useless.
27118
27119         (NewBuiltinArray): New class to handle creation of built-in arrays.
27120
27121         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
27122         account creation of one-dimensional arrays.
27123
27124         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
27125
27126         (NewUserdefinedArray::DoResolve): Implement.
27127
27128         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
27129
27130         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
27131         we maintain inside the TypeManager. This is necessary to perform lookups on the
27132         module builder.
27133
27134         (LookupType): Update to perform GetType on the module builders too.     
27135
27136         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
27137
27138         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
27139
27140 2001-10-23  Ravi Pratap  <ravi@ximian.com>
27141
27142         * expression.cs (New::DoResolve): Implement guts of array creation.
27143
27144         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
27145
27146 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
27147
27148         * expression.cs: Fix bug I introduced lsat night that broke
27149         Delegates. 
27150
27151         (Expression.Resolve): Report a 246 error (can not resolve name)
27152         if we find a SimpleName in the stream.
27153
27154         (Expression.ResolveLValue): Ditto.
27155
27156         (Expression.ResolveWithSimpleName): This function is a variant of
27157         ResolveName, this one allows SimpleNames to be returned without a
27158         warning.  The only consumer of SimpleNames is MemberAccess
27159
27160 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
27161
27162         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
27163         might arrive here.  I have my doubts that this is correct.
27164
27165         * statement.cs (Lock): Implement lock statement.
27166
27167         * cs-parser.jay: Small fixes to support `lock' and `using'
27168
27169         * cs-tokenizer.cs: Remove extra space
27170
27171         * driver.cs: New flag --checked, allows to turn on integer math
27172         checking. 
27173
27174         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
27175         Threading.Monitor.Exit 
27176
27177 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
27178
27179         * expression.cs (IndexerAccess::DoResolveLValue): Set the
27180         Expression Class to be IndexerAccess.
27181
27182         Notice that Indexer::DoResolve sets the eclass to Value.
27183
27184 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
27185
27186         * class.cs (TypeContainer::Emit): Emit code for indexers.
27187
27188         * assign.cs (IAssignMethod): New interface implemented by Indexers
27189         and Properties for handling assignment.
27190
27191         (Assign::Emit): Simplify and reuse code. 
27192
27193         * expression.cs (IndexerAccess, PropertyExpr): Implement
27194         IAssignMethod, clean up old code. 
27195
27196 2001-10-22  Ravi Pratap  <ravi@ximian.com>
27197
27198         * typemanager.cs (ImplementsInterface): New method to determine if a type
27199         implements a given interface. Provides a nice cache too.
27200
27201         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
27202         method.
27203
27204         (ConvertReferenceExplicit): Ditto.
27205
27206         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
27207         various methods, with correct names etc.
27208
27209         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
27210         Operator.UnaryNegation.
27211
27212         * cs-parser.jay (operator_declarator): Be a little clever in the case where
27213         we have a unary plus or minus operator.
27214
27215         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
27216         UnaryMinus.
27217
27218         * everywhere : update accordingly.
27219
27220         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
27221         respectively.
27222
27223         * class.cs (Method::Define): For the case where we are implementing a method
27224         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
27225         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
27226
27227 2001-10-21  Ravi Pratap  <ravi@ximian.com>
27228
27229         * interface.cs (FindMembers): Implement to work around S.R.E
27230         lameness.
27231
27232         * typemanager.cs (IsInterfaceType): Implement.
27233
27234         (FindMembers): Update to handle interface types too.
27235
27236         * expression.cs (ImplicitReferenceConversion): Re-write bits which
27237         use IsAssignableFrom as that is not correct - it doesn't work.
27238
27239         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
27240         and accordingly override EmitStatement.
27241
27242         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
27243         using the correct logic :-)
27244
27245 2001-10-19  Ravi Pratap  <ravi@ximian.com>
27246
27247         * ../errors/cs-11.cs : Add to demonstrate error -11 
27248
27249 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
27250
27251         * assign.cs (Assign::Resolve): Resolve right hand side first, and
27252         then pass this as a hint to ResolveLValue.
27253
27254         * expression.cs (FieldExpr): Add Location information
27255
27256         (FieldExpr::LValueResolve): Report assignment to readonly
27257         variable. 
27258
27259         (Expression::ExprClassFromMemberInfo): Pass location information.
27260
27261         (Expression::ResolveLValue): Add new method that resolves an
27262         LValue. 
27263
27264         (Expression::DoResolveLValue): Default invocation calls
27265         DoResolve. 
27266
27267         (Indexers): New class used to keep track of indexers in a given
27268         Type. 
27269
27270         (IStackStore): Renamed from LValue, as it did not really describe
27271         what this did.  Also ResolveLValue is gone from this interface and
27272         now is part of Expression.
27273
27274         (ElementAccess): Depending on the element access type
27275
27276         * typemanager.cs: Add `indexer_name_type' as a Core type
27277         (System.Runtime.CompilerServices.IndexerNameAttribute)
27278
27279         * statement.cs (Goto): Take a location.
27280
27281 2001-10-18  Ravi Pratap  <ravi@ximian.com>
27282
27283         * delegate.cs (Delegate::VerifyDelegate): New method to verify
27284         if two delegates are compatible.
27285
27286         (NewDelegate::DoResolve): Update to take care of the case when
27287         we instantiate a delegate from another delegate.
27288
27289         * typemanager.cs (FindMembers): Don't even try to look up members
27290         of Delegate types for now.
27291
27292 2001-10-18  Ravi Pratap  <ravi@ximian.com>
27293
27294         * delegate.cs (NewDelegate): New class to take care of delegate
27295         instantiation.
27296
27297         * expression.cs (New): Split the delegate related code out into 
27298         the NewDelegate class.
27299
27300         * delegate.cs (DelegateInvocation): New class to handle delegate 
27301         invocation.
27302
27303         * expression.cs (Invocation): Split out delegate related code into
27304         the DelegateInvocation class.
27305
27306 2001-10-17  Ravi Pratap  <ravi@ximian.com>
27307
27308         * expression.cs (New::DoResolve): Implement delegate creation fully
27309         and according to the spec.
27310
27311         (New::DoEmit): Update to handle delegates differently.
27312
27313         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
27314         because of which we were printing out arguments in reverse order !
27315
27316         * delegate.cs (VerifyMethod): Implement to check if the given method
27317         matches the delegate.
27318
27319         (FullDelegateDesc): Implement.
27320
27321         (VerifyApplicability): Implement.
27322
27323         * expression.cs (Invocation::DoResolve): Update to accordingly handle
27324         delegate invocations too.
27325
27326         (Invocation::Emit): Ditto.
27327
27328         * ../errors/cs1593.cs : Added.
27329
27330         * ../errors/cs1594.cs : Added.
27331
27332         * delegate.cs (InstanceExpression, TargetMethod): New properties.
27333
27334 2001-10-16  Ravi Pratap  <ravi@ximian.com>
27335
27336         * typemanager.cs (intptr_type): Core type for System.IntPtr
27337
27338         (InitCoreTypes): Update for the same.
27339
27340         (iasyncresult_type, asynccallback_type): Ditto.
27341
27342         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27343         correct.
27344
27345         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27346         too.
27347
27348         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27349         the builders for the 4 members of a delegate type :-)
27350
27351         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27352         type.
27353
27354         * expression.cs (New::DoResolve): Implement guts for delegate creation.
27355
27356         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27357
27358 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
27359
27360         * statement.cs (Break::Emit): Implement.   
27361         (Continue::Emit): Implement.
27362
27363         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27364         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27365         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27366         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
27367         end loop
27368
27369         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27370         properties that track the label for the current loop (begin of the
27371         loop and end of the loop).
27372
27373 2001-10-15  Ravi Pratap  <ravi@ximian.com>
27374
27375         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27376         use of emitting anything at all.
27377
27378         * class.cs, rootcontext.cs : Get rid of calls to the same.
27379
27380         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27381
27382         (Populate): Define the constructor correctly and set the implementation
27383         attributes.
27384
27385         * typemanager.cs (delegate_types): New hashtable to hold delegates that
27386         have been defined.
27387
27388         (AddDelegateType): Implement.
27389
27390         (IsDelegateType): Implement helper method.
27391
27392         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27393
27394         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27395         and accordingly handle it.
27396
27397         * delegate.cs (Populate): Take TypeContainer argument.
27398         Implement bits to define the Invoke method. However, I still haven't figured out
27399         how to take care of the native int bit :-(
27400
27401         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
27402         Qualify the name of the delegate, not its return type !
27403
27404         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27405         conversion.
27406
27407         (StandardConversionExists): Checking for array types turns out to be recursive.
27408
27409         (ConvertReferenceExplicit): Implement array conversion.
27410
27411         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27412
27413 2001-10-12  Ravi Pratap  <ravi@ximian.com>
27414
27415         * cs-parser.jay (delegate_declaration): Store the fully qualified
27416         name as it is a type declaration.
27417
27418         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
27419         readonly.
27420
27421         (DefineDelegate): Renamed from Define. Does the same thing essentially,
27422         as TypeContainer::DefineType.
27423
27424         (Populate): Method in which all the definition of the various methods (Invoke)
27425         etc is done.
27426
27427         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27428         see.
27429
27430         (CloseDelegate): Finally creates the delegate.
27431
27432         * class.cs (TypeContainer::DefineType): Update to define delegates.
27433         (Populate, Emit and CloseType): Do the same thing here too.
27434
27435         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27436         delegates in all these operations.
27437
27438 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
27439
27440         * expression.cs: LocalTemporary: a new expression used to
27441         reference a temporary that has been created.
27442
27443         * assign.cs: Handle PropertyAccess back here, so that we can
27444         provide the proper semantic access to properties.
27445
27446         * expression.cs (Expression::ConvertReferenceExplicit): Implement
27447         a few more explicit conversions. 
27448
27449         * modifiers.cs: `NEW' modifier maps to HideBySig.
27450
27451         * expression.cs (PropertyExpr): Make this into an
27452         ExpressionStatement, and support the EmitStatement code path. 
27453
27454         Perform get/set error checking, clean up the interface.
27455
27456         * assign.cs: recognize PropertyExprs as targets, and if so, turn
27457         them into toplevel access objects.
27458
27459 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
27460
27461         * expression.cs: PropertyExpr::PropertyExpr: use work around the
27462         SRE.
27463
27464         * typemanager.cs: Keep track here of our PropertyBuilders again to
27465         work around lameness in SRE.
27466
27467 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
27468
27469         * expression.cs (LValue::LValueResolve): New method in the
27470         interface, used to perform a second resolution pass for LValues. 
27471
27472         (This::DoResolve): Catch the use of this in static methods.
27473
27474         (This::LValueResolve): Implement.
27475
27476         (This::Store): Remove warning, assigning to `this' in structures
27477         is 
27478
27479         (Invocation::Emit): Deal with invocation of
27480         methods on value types.  We need to pass the address to structure
27481         methods rather than the object itself.  (The equivalent code to
27482         emit "this" for structures leaves the entire structure on the
27483         stack instead of a pointer to it). 
27484
27485         (ParameterReference::DoResolve): Compute the real index for the
27486         argument based on whether the method takes or not a `this' pointer
27487         (ie, the method is static).
27488
27489         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27490         value types returned from functions when we need to invoke a
27491         method on the sturcture.
27492
27493
27494 2001-10-11  Ravi Pratap  <ravi@ximian.com>
27495
27496         * class.cs (TypeContainer::DefineType): Method to actually do the business of
27497         defining the type in the Modulebuilder or Typebuilder. This is to take
27498         care of nested types which need to be defined on the TypeBuilder using
27499         DefineNestedMethod.
27500
27501         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
27502         methods in RootContext, only ported to be part of TypeContainer.
27503
27504         (TypeContainer::GetInterfaceOrClass): Ditto.
27505
27506         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27507
27508         * interface.cs (Interface::DefineInterface): New method. Does exactly
27509         what RootContext.CreateInterface did earlier, only it takes care of nested types 
27510         too.
27511
27512         (Interface::GetInterfaces): Move from RootContext here and port.
27513
27514         (Interface::GetInterfaceByName): Same here.
27515
27516         * rootcontext.cs (ResolveTree): Re-write.
27517
27518         (PopulateTypes): Re-write.
27519
27520         * class.cs (TypeContainer::Populate): Populate nested types too.
27521         (TypeContainer::Emit): Emit nested members too.
27522
27523         * typemanager.cs (AddUserType): Do not make use of the FullName property,
27524         instead just use the name argument passed in as it is already fully
27525         qualified.
27526
27527         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27528         to TypeContainer mapping to see if a type is user-defined.
27529
27530         * class.cs (TypeContainer::CloseType): Implement. 
27531
27532         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27533         the default constructor.
27534
27535         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27536         twice.
27537
27538         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27539
27540         * interface.cs (CloseType): Create the type here.
27541
27542         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27543         the hierarchy.
27544
27545         Remove all the methods which are now in TypeContainer.
27546
27547 2001-10-10  Ravi Pratap  <ravi@ximian.com>
27548
27549         * delegate.cs (Define): Re-write bits to define the delegate
27550         correctly.
27551
27552 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
27553
27554         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27555
27556         * expression.cs (ImplicitReferenceConversion): handle null as well
27557         as a source to convert to any reference type.
27558
27559         * statement.cs (Return): Perform any implicit conversions to
27560         expected return type.  
27561
27562         Validate use of return statement.  
27563
27564         * codegen.cs (EmitContext): Pass the expected return type here.
27565
27566         * class.cs (Method, Constructor, Property): Pass expected return
27567         type to EmitContext.
27568
27569 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
27570
27571         * expression.cs: Make DoResolve take an EmitContext instead of a
27572         TypeContainer.
27573
27574         Replaced `l' and `location' for `loc', for consistency.
27575
27576         (Error, Warning): Remove unneeded Tc argument.
27577
27578         * assign.cs, literal.cs, constant.cs: Update to new calling
27579         convention. 
27580
27581         * codegen.cs: EmitContext now contains a flag indicating whether
27582         code is being generated in a static method or not.
27583
27584         * cs-parser.jay: DecomposeQI, new function that replaces the old
27585         QualifiedIdentifier.  Now we always decompose the assembled
27586         strings from qualified_identifier productions into a group of
27587         memberaccesses.
27588
27589 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
27590
27591         * rootcontext.cs: Deal with field-less struct types correctly now
27592         by passing the size option to Define Type.
27593
27594         * class.cs: Removed hack that created one static field. 
27595
27596 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27597
27598         * statement.cs: Moved most of the code generation here. 
27599
27600 2001-10-09  Ravi Pratap  <ravi@ximian.com>
27601
27602         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27603         seem very right.
27604
27605         (ElementAccess): Remove useless bits for now - keep checks as the spec
27606         says.
27607
27608 2001-10-08  Ravi Pratap  <ravi@ximian.com>
27609
27610         * expression.cs (ElementAccess::DoResolve): Remove my crap code
27611         and start performing checks according to the spec.
27612
27613 2001-10-07  Ravi Pratap  <ravi@ximian.com>
27614
27615         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27616         rank_specifiers instead.
27617
27618         (rank_specifiers): Change the order in which the rank specifiers are stored
27619
27620         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27621
27622         * expression.cs (ElementAccess): Implement the LValue interface too.
27623
27624 2001-10-06  Ravi Pratap  <ravi@ximian.com>
27625
27626         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27627         except that user defined conversions are not included.
27628
27629         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
27630         perform the conversion of the return type, if necessary.
27631
27632         (New::DoResolve): Check whether we are creating an array or an object
27633         and accordingly do the needful.
27634
27635         (New::Emit): Same here.
27636
27637         (New::DoResolve): Implement guts of array creation.
27638
27639         (New::FormLookupType): Helper function.
27640
27641 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27642
27643         * codegen.cs: Removed most of the code generation here, and move the
27644         corresponding code generation bits to the statement classes. 
27645
27646         Added support for try/catch/finalize and throw.
27647
27648         * cs-parser.jay: Added support for try/catch/finalize.
27649
27650         * class.cs: Catch static methods having the flags override,
27651         virtual or abstract.
27652
27653         * expression.cs (UserCast): This user cast was not really doing
27654         what it was supposed to do.  Which is to be born in fully resolved
27655         state.  Parts of the resolution were being performed at Emit time! 
27656
27657         Fixed this code.
27658
27659 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27660
27661         * expression.cs: Implicity convert the result from UserCast.
27662
27663 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27664
27665         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27666         prevented it from working correctly. 
27667
27668         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27669         merely ConvertImplicit.
27670
27671 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27672
27673         * typemanager.cs: Make the LookupTypeContainer function static,
27674         and not per-instance.  
27675
27676         * class.cs: Make static FindMembers (the one that takes a Type
27677         argument). 
27678
27679         * codegen.cs: Add EmitForeach here.
27680
27681         * cs-parser.jay: Make foreach a toplevel object instead of the
27682         inline expansion, as we need to perform semantic analysis on it. 
27683
27684 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27685
27686         * expression.cs (Expression::ImplicitUserConversion): Rename to
27687         UserDefinedConversion.
27688
27689         (Expression::UserDefinedConversion): Take an extra argument specifying 
27690         whether we look for explicit user conversions too.
27691
27692         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27693
27694         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27695
27696         (ExplicitUserConversion): Make it a call to UserDefinedConversion
27697         with the appropriate arguments.
27698
27699         * cs-parser.jay (cast_expression): Record location too.
27700
27701         * expression.cs (Cast): Record location info.
27702
27703         (Expression::ConvertExplicit): Take location argument.
27704
27705         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27706         to determine if we are doing explicit conversions.
27707
27708         (UserCast::Emit): Update accordingly.
27709
27710         (Expression::ConvertExplicit): Report an error if everything fails.
27711
27712         * ../errors/cs0030.cs : Add.
27713
27714 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
27715
27716         * modifiers.cs: If the ABSTRACT keyword is present, also set the
27717         virtual and newslot bits. 
27718
27719         * class.cs (TypeContainer::RegisterRequiredImplementations):
27720         Record methods we need.
27721
27722         (TypeContainer::MakeKey): Helper function to make keys for
27723         MethodBases, since the Methodbase key is useless.
27724
27725         (TypeContainer::Populate): Call RegisterRequiredImplementations
27726         before defining the methods.   
27727
27728         Create a mapping for method_builders_to_methods ahead of time
27729         instead of inside a tight loop.
27730
27731         (::RequireMethods):  Accept an object as the data to set into the
27732         hashtable so we can report interface vs abstract method mismatch.
27733
27734 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27735
27736         * report.cs: Make all of it static.
27737
27738         * rootcontext.cs: Drop object_type and value_type computations, as
27739         we have those in the TypeManager anyways.
27740
27741         Drop report instance variable too, now it is a global.
27742
27743         * driver.cs: Use try/catch on command line handling.
27744
27745         Add --probe option to debug the error reporting system with a test
27746         suite. 
27747
27748         * report.cs: Add support for exiting program when a probe
27749         condition is reached.
27750
27751 2001-10-03  Ravi Pratap  <ravi@ximian.com>
27752
27753         * expression.cs (Binary::DoNumericPromotions): Fix the case when
27754         we do a forcible conversion regardless of type, to check if 
27755         ForceConversion returns a null.
27756
27757         (Binary::error19): Use location to report error.
27758
27759         (Unary::error23): Use location here too.
27760
27761         * ../errors/cs0019.cs : Check in.
27762
27763         * ../errors/cs0023.cs : Check in.
27764
27765         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27766         case of a non-null MethodInfo object with a length of 0 !
27767
27768         (Binary::ResolveOperator): Flag error if overload resolution fails to find
27769         an applicable member - according to the spec :-)
27770         Also fix logic to find members in base types.
27771
27772         (Unary::ResolveOperator): Same here.
27773
27774         (Unary::report23): Change name to error23 and make first argument a TypeContainer
27775         as I was getting thoroughly confused between this and error19 :-)
27776
27777         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27778         (::FindMostEncompassedType): Implement.
27779         (::FindMostEncompassingType): Implement.
27780         (::StandardConversionExists): Implement.
27781
27782         (UserImplicitCast): Re-vamp. We now need info about most specific
27783         source and target types so that we can do the necessary conversions.
27784
27785         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27786         mathematical union with no duplicates.
27787
27788 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27789
27790         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27791         in order from base classes to child classes, so that we can in
27792         child classes look up in our parent for method names and
27793         attributes (required for handling abstract, virtual, new, override
27794         constructs: we need to instrospect our base class, and if we dont
27795         populate the classes in order, the introspection might be
27796         incorrect.  For example, a method could query its parent before
27797         the parent has any methods and would determine that the parent has
27798         no abstract methods (while it could have had them)).
27799
27800         (RootContext::CreateType): Record the order in which we define the
27801         classes.
27802
27803 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
27804
27805         * class.cs (TypeContainer::Populate): Also method definitions can
27806         fail now, keep track of this.
27807
27808         (TypeContainer::FindMembers): Implement support for
27809         DeclaredOnly/noDeclaredOnly flag.
27810
27811         (Constructor::Emit) Return the ConstructorBuilder.
27812
27813         (Method::Emit) Return the MethodBuilder. 
27814         Check for abstract or virtual methods to be public.
27815
27816         * rootcontext.cs (RootContext::CreateType): Register all the
27817         abstract methods required for the class to be complete and the
27818         interface methods that must be implemented. 
27819
27820         * cs-parser.jay: Report error 501 (method requires body if it is
27821         not marked abstract or extern).
27822
27823         * expression.cs (TypeOf::Emit): Implement.
27824
27825         * typemanager.cs: runtime_handle_type, new global type.
27826
27827         * class.cs (Property::Emit): Generate code for properties.
27828
27829 2001-10-02  Ravi Pratap  <ravi@ximian.com>
27830
27831         * expression.cs (Unary::ResolveOperator): Find operators on base type
27832         too - we now conform exactly to the spec.
27833
27834         (Binary::ResolveOperator): Same here.
27835
27836         * class.cs (Operator::Define): Fix minor quirk in the tests.
27837
27838         * ../errors/cs0215.cs : Added.
27839
27840         * ../errors/cs0556.cs : Added.
27841
27842         * ../errors/cs0555.cs : Added.
27843
27844 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27845
27846         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27847         single integer which is really efficient
27848
27849 2001-10-01  Ravi Pratap  <ravi@ximian.com>
27850
27851         *  expression.cs (Expression::ImplicitUserConversion): Use location
27852         even in the case when we are examining True operators.
27853  
27854         * class.cs (Operator::Define): Perform extensive checks to conform
27855         with the rules for operator overloading in the spec.
27856
27857         * expression.cs (Expression::ImplicitReferenceConversion): Implement
27858         some of the other conversions mentioned in the spec.
27859
27860         * typemanager.cs (array_type): New static member for the System.Array built-in
27861         type.
27862
27863         (cloneable_interface): For System.ICloneable interface.
27864
27865         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27866         we start resolving the tree and populating types.
27867
27868         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27869  
27870 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27871
27872         * expression.cs (Expression::ExprClassFromMemberInfo,
27873         Expression::Literalize): Create literal expressions from
27874         FieldInfos which are literals.
27875
27876         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27877         type casts, because they were wrong.  The test suite in tests
27878         caught these ones.
27879
27880         (ImplicitNumericConversion): ushort to ulong requires a widening
27881         cast. 
27882
27883         Int32 constant to long requires widening cast as well.
27884
27885         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27886         for integers because the type on the stack is not i4.
27887
27888 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
27889
27890         * expression.cs (report118): require location argument. 
27891
27892         * parameter.cs: Do not dereference potential null value.
27893
27894         * class.cs: Catch methods that lack the `new' keyword when
27895         overriding a name.  Report warnings when `new' is used without
27896         anything being there to override.
27897
27898         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27899
27900         * class.cs: Only add constructor to hashtable if it is non-null
27901         (as now constructors can fail on define).
27902
27903         (TypeManager, Class, Struct): Take location arguments.
27904
27905         Catch field instance initialization in structs as errors.
27906
27907         accepting_filter: a new filter for FindMembers that is static so
27908         that we dont create an instance per invocation.
27909
27910         (Constructor::Define): Catch errors where a struct constructor is
27911         parameterless 
27912
27913         * cs-parser.jay: Pass location information for various new
27914         constructs. 
27915
27916         * delegate.cs (Delegate): take a location argument.
27917
27918         * driver.cs: Do not call EmitCode if there were problesm in the
27919         Definition of the types, as many Builders wont be there. 
27920
27921         * decl.cs (Decl::Decl): Require a location argument.
27922
27923         * cs-tokenizer.cs: Handle properly hex constants that can not fit
27924         into integers, and find the most appropiate integer for it.
27925
27926         * literal.cs: Implement ULongLiteral.
27927
27928         * rootcontext.cs: Provide better information about the location of
27929         failure when CreateType fails.
27930
27931 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
27932
27933         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27934         as well.
27935
27936         * expression.cs (Binary::CheckShiftArguments): Add missing type
27937         computation.
27938         (Binary::ResolveOperator): Add type to the logical and and logical
27939         or, Bitwise And/Or and Exclusive Or code paths, it was missing
27940         before.
27941
27942         (Binary::DoNumericPromotions): In the case where either argument
27943         is ulong (and most signed types combined with ulong cause an
27944         error) perform implicit integer constant conversions as well.
27945
27946 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
27947
27948         * expression.cs (UserImplicitCast): Method should always be
27949         non-null. 
27950         (Invocation::BetterConversion): Simplified test for IntLiteral.
27951
27952         (Expression::ImplicitNumericConversion): Split this routine out.
27953         Put the code that performs implicit constant integer conversions
27954         here. 
27955
27956         (Expression::Resolve): Become a wrapper around DoResolve so we can
27957         check eclass and type being set after resolve.
27958
27959         (Invocation::Badness): Remove this dead function
27960
27961         (Binary::ResolveOperator): Do not compute the expensive argumnets
27962         unless we have a union for it.
27963
27964         (Probe::Emit): Is needs to do an isinst and then
27965         compare against null.
27966
27967         (::CanConvert): Added Location argument.  If the Location argument
27968         is null (Location.Null), then we do not report errors.  This is
27969         used by the `probe' mechanism of the Explicit conversion.  We do
27970         not want to generate an error for something that the user
27971         explicitly requested to be casted.  But the pipeline for an
27972         explicit cast first tests for potential implicit casts.
27973
27974         So for now, if the Location is null, it means `Probe only' to
27975         avoid adding another argument.   Might have to revise this
27976         strategy later.
27977
27978         (ClassCast): New class used to type cast objects into arbitrary
27979         classes (used in Explicit Reference Conversions).
27980
27981         Implement `as' as well.
27982
27983         Reverted all the patches from Ravi below: they were broken:
27984
27985                 * The use of `level' as a mechanism to stop recursive
27986                   invocations is wrong.  That was there just to catch the
27987                   bug with a strack trace but not as a way of addressing
27988                   the problem.
27989
27990                   To fix the problem we have to *understand* what is going
27991                   on and the interactions and come up with a plan, not
27992                   just get things going.
27993
27994                 * The use of the type conversion cache that I proposed
27995                   last night had an open topic: How does this work across
27996                   protection domains.  A user defined conversion might not
27997                   be public in the location where we are applying the
27998                   conversion, a different conversion might be selected
27999                   (ie, private A->B (better) but public B->A (worse),
28000                   inside A, A->B applies, but outside it, B->A will
28001                   apply).
28002
28003                 * On top of that (ie, even if the above is solved),
28004                   conversions in a cache need to be abstract.  Ie, `To
28005                   convert from an Int to a Short use an OpcodeCast', not
28006                   `To convert from an Int to a Short use the OpcodeCast on
28007                   the variable 5' (which is what this patch was doing).
28008
28009 2001-09-28  Ravi Pratap  <ravi@ximian.com>
28010
28011         * expression.cs (Invocation::ConversionExists): Re-write to use
28012         the conversion cache
28013
28014         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
28015         cache all conversions done, not just user-defined ones.
28016
28017         (Invocation::BetterConversion): The real culprit. Use ConversionExists
28018         to determine if a conversion exists instead of acutually trying to 
28019         perform the conversion. It's faster too.
28020
28021         (Expression::ConvertExplicit): Modify to use ConversionExists to check
28022         and only then attempt the implicit conversion.
28023
28024 2001-09-28  Ravi Pratap  <ravi@ximian.com>
28025
28026         * expression.cs (ConvertImplicit): Use a cache for conversions
28027         already found. Check level of recursion and bail out if necessary.
28028
28029 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
28030
28031         * typemanager.cs (string_concat_string_string, string_concat_object_object):
28032         Export standard methods that we expect for string operations.
28033
28034         * statement.cs (Block::UsageWarning): Track usage of variables and
28035         report the errors for not used variables.
28036
28037         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
28038         operator. 
28039
28040 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
28041
28042         * codegen.cs: remove unnneded code 
28043
28044         * expression.cs: Removed BuiltinTypeAccess class
28045
28046         Fix the order in which implicit conversions are
28047         done.  
28048
28049         The previous fixed dropped support for boxed conversions (adding a
28050         test to the test suite now)
28051
28052         (UserImplicitCast::CanConvert): Remove test for source being null,
28053         that code is broken.  We should not feed a null to begin with, if
28054         we do, then we should track the bug where the problem originates
28055         and not try to cover it up here.
28056
28057         Return a resolved expression of type UserImplicitCast on success
28058         rather than true/false.  Ravi: this is what I was talking about,
28059         the pattern is to use a static method as a "constructor" for
28060         objects. 
28061
28062         Also, do not create arguments until the very last minute,
28063         otherwise we always create the arguments even for lookups that
28064         will never be performed. 
28065
28066         (UserImplicitCast::Resolve): Eliminate, objects of type
28067         UserImplicitCast are born in a fully resolved state. 
28068
28069         * typemanager.cs (InitCoreTypes): Init also value_type
28070         (System.ValueType). 
28071
28072         * expression.cs (Cast::Resolve): First resolve the child expression.
28073
28074         (LValue): Add new method AddressOf to be used by
28075         the `&' operator.  
28076
28077         Change the argument of Store to take an EmitContext instead of an
28078         ILGenerator, because things like FieldExpr need to be able to call
28079         their children expression to generate the instance code. 
28080
28081         (Expression::Error, Expression::Warning): Sugar functions for
28082         reporting errors.
28083
28084         (Expression::MemberLookup): Accept a TypeContainer instead of a
28085         Report as the first argument.
28086
28087         (Expression::ResolvePrimary): Killed.  I still want to improve
28088         this as currently the code is just not right.
28089
28090         (Expression::ResolveMemberAccess): Simplify, but it is still
28091         wrong. 
28092
28093         (Unary::Resolve): Catch errors in AddressOf operators.
28094
28095         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
28096         index to a byte for the short-version, or the compiler will choose
28097         the wrong Emit call, which generates the wrong data.
28098
28099         (ParameterReference::Emit, ::Store): same.
28100
28101         (FieldExpr::AddressOf): Implement.
28102
28103         * typemanager.cs: TypeManager: made public variable instead of
28104         property.
28105
28106         * driver.cs: document --fatal.
28107
28108         * report.cs (ErrorMessage, WarningMessage): new names for the old
28109         Error and Warning classes.
28110
28111         * cs-parser.jay (member_access): Turn built-in access to types
28112         into a normal simplename
28113
28114 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28115
28116         * expression.cs (Invocation::BetterConversion): Fix to cope
28117         with q being null, since this was introducing a bug.
28118
28119         * expression.cs (ConvertImplicit): Do built-in conversions first.
28120
28121 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28122
28123         * expression.cs (UserImplicitCast::Resolve): Fix bug.
28124
28125 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28126
28127         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
28128         I had introduced long ago (what's new ?).
28129
28130         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
28131         the work of all the checking. 
28132         (ConvertImplicit): Call CanConvert and only then create object if necessary.
28133         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
28134
28135         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
28136         that is the right way. 
28137
28138         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
28139         overloading resolution. Use everywhere instead of cutting and pasting code.
28140
28141         (Binary::ResolveOperator): Use MakeUnionSet.
28142
28143         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
28144         we have to convert to bool types. Not complete yet.
28145
28146 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
28147
28148         * typemanager.cs (TypeManager::CSharpName): support ushort.
28149
28150         * expression.cs (Expression::TryImplicitIntConversion): Attempts
28151         to provide an expression that performsn an implicit constant int
28152         conversion (section 6.1.6).
28153         (Expression::ConvertImplicitRequired): Reworked to include
28154         implicit constant expression conversions.
28155
28156         (Expression::ConvertNumericExplicit): Finished.
28157
28158         (Invocation::Emit): If InstanceExpression is null, then it means
28159         that we perform a call on this.
28160
28161 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
28162
28163         * expression.cs (Unary::Emit): Remove some dead code.
28164         (Probe): Implement Resolve and Emit for `is'.
28165         (Expression::ConvertImplicitRequired): Attempt to do constant
28166         expression conversions here.  Maybe should be moved to
28167         ConvertImplicit, but I am not sure.
28168         (Expression::ImplicitLongConstantConversionPossible,
28169         Expression::ImplicitIntConstantConversionPossible): New functions
28170         that tell whether is it possible to apply an implicit constant
28171         expression conversion.
28172
28173         (ConvertNumericExplicit): Started work on explicit numeric
28174         conversions.
28175
28176         * cs-parser.jay: Update operator constants.
28177
28178         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
28179         (Parameters::GetSignature): Hook up VerifyArgs here.
28180         (Parameters::VerifyArgs): Verifies that no two arguments have the
28181         same name. 
28182
28183         * class.cs (Operator): Update the operator names to reflect the
28184         ones that the spec expects (as we are just stringizing the
28185         operator names).
28186
28187         * expression.cs (Unary::ResolveOperator): Fix bug: Use
28188         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
28189         previous usage did only work for our methods.
28190         (Expression::ConvertImplicit): Handle decimal implicit numeric
28191         conversions as well.
28192         (Expression::InternalTypeConstructor): Used to invoke constructors
28193         on internal types for default promotions.
28194
28195         (Unary::Emit): Implement special handling for the pre/post
28196         increment/decrement for overloaded operators, as they need to have
28197         the same semantics as the other operators.
28198
28199         (Binary::ResolveOperator): ditto.
28200         (Invocation::ConversionExists): ditto.
28201         (UserImplicitCast::Resolve): ditto.
28202
28203 2001-09-26  Ravi Pratap  <ravi@ximian.com>
28204
28205         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
28206         operator, return after emitting body. Regression tests pass again !
28207
28208         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
28209         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
28210         (Invocation::OverloadResolve): Ditto.
28211         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
28212
28213         * everywhere : update calls to the above methods accordingly.
28214
28215 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
28216
28217         * assign.cs (Assign): Make it inherit from ExpressionStatement.
28218
28219         * expression.cs (ExpressionStatement): New base class used for
28220         expressions that can appear in statements, so that we can provide
28221         an alternate path to generate expression that do not leave a value
28222         on the stack.
28223
28224         (Expression::Emit, and all the derivatives): We no longer return
28225         whether a value is left on the stack or not.  Every expression
28226         after being emitted leaves a single value on the stack.
28227
28228         * codegen.cs (EmitContext::EmitStatementExpression): Use the
28229         facilties of ExpressionStatement if possible.
28230
28231         * cs-parser.jay: Update statement_expression.
28232
28233 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
28234
28235         * driver.cs: Change the wording of message
28236
28237 2001-09-25  Ravi Pratap  <ravi@ximian.com>
28238
28239         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
28240         the type of the expression to the return type of the method if
28241         we have an overloaded operator match ! The regression tests pass again !
28242         (Unary::ResolveOperator): Ditto.
28243
28244         * expression.cs (Invocation::ConversionExists): Correct the member lookup
28245         to find "op_Implicit", not "implicit" ;-)
28246         (UserImplicitCast): New class to take care of user-defined implicit conversions.
28247         (ConvertImplicit, ForceConversion): Take TypeContainer argument
28248
28249         * everywhere : Correct calls to the above accordingly.
28250
28251         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
28252         (ConvertImplicit): Do user-defined conversion if it exists.
28253
28254 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
28255
28256         * assign.cs: track location.
28257         (Resolve): Use implicit conversions on assignment.
28258
28259         * literal.cs: Oops.  Not good, Emit of short access values should
28260         pass (Bytes) or the wrong argument will be selected.
28261
28262         * expression.cs (Unary::Emit): Emit code for -expr.
28263
28264         (Unary::ResolveOperator): Handle `Substract' for non-constants
28265         (substract from zero from the non-constants).
28266         Deal with Doubles as well. 
28267
28268         (Expression::ConvertImplicitRequired): New routine that reports an
28269         error if no implicit conversion exists. 
28270
28271         (Invocation::OverloadResolve): Store the converted implicit
28272         expressions if we make them
28273
28274 2001-09-24  Ravi Pratap  <ravi@ximian.com>
28275
28276         * class.cs (ConstructorInitializer): Take a Location argument.
28277         (ConstructorBaseInitializer): Same here.
28278         (ConstructorThisInitializer): Same here.
28279
28280         * cs-parser.jay : Update all calls accordingly.
28281
28282         * expression.cs (Unary, Binary, New): Take location argument.
28283         Update accordingly everywhere.
28284
28285         * cs-parser.jay : Update all calls to the above to take a location
28286         argument.
28287
28288         * class.cs : Ditto.
28289
28290 2001-09-24  Ravi Pratap  <ravi@ximian.com>
28291
28292         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
28293         (Invocation::BetterConversion): Same here
28294         (Invocation::ConversionExists): Ditto.
28295
28296         (Invocation::ConversionExists): Implement.
28297
28298 2001-09-22  Ravi Pratap  <ravi@ximian.com>
28299
28300         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
28301         Also take an additional TypeContainer argument.
28302
28303         * All over : Pass in TypeContainer as argument to OverloadResolve.
28304
28305         * typemanager.cs (CSharpName): Update to check for the string type and return
28306         that too.
28307
28308         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
28309         a given method.
28310
28311 2001-09-21  Ravi Pratap  <ravi@ximian.com>
28312
28313         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
28314         (Invocation::BetterFunction): Implement.
28315         (Invocation::BetterConversion): Implement.
28316         (Invocation::ConversionExists): Skeleton, no implementation yet.
28317
28318         Okay, things work fine !
28319
28320 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
28321
28322         * typemanager.cs: declare and load enum_type, delegate_type and
28323         void_type. 
28324
28325         * expression.cs (Expression::Emit): Now emit returns a value that
28326         tells whether a value is left on the stack or not.  This strategy
28327         might be reveted tomorrow with a mechanism that would address
28328         multiple assignments.
28329         (Expression::report118): Utility routine to report mismatches on
28330         the ExprClass.
28331
28332         (Unary::Report23): Report impossible type/operator combination
28333         utility function.
28334
28335         (Unary::IsIncrementableNumber): Whether the type can be
28336         incremented or decremented with add.
28337         (Unary::ResolveOperator): Also allow enumerations to be bitwise
28338         complemented. 
28339         (Unary::ResolveOperator): Implement ++, !, ~,
28340
28341         (Invocation::Emit): Deal with new Emit convetion.
28342
28343         * All Expression derivatives: Updated their Emit method to return
28344         whether they leave values on the stack or not.
28345
28346         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28347         stack for expressions that are statements. 
28348
28349 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28350
28351         * expression.cs (LValue): New interface.  Must be implemented by
28352         LValue objects.
28353         (LocalVariableReference, ParameterReference, FieldExpr): Implement
28354         LValue interface.
28355
28356         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28357         interface for generating code, simplifies the code.
28358
28359 2001-09-20  Ravi Pratap  <ravi@ximian.com>
28360
28361         * expression.cs (everywhere): Comment out return statements in ::Resolve
28362         methods to avoid the warnings.
28363
28364 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28365
28366         * driver.cs (parse): Report error 2001 if we can not open the
28367         source file.
28368
28369         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28370         not resolve it.
28371
28372         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28373         object. 
28374
28375         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28376         otherwise nested blocks end up with the same index.
28377
28378         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28379
28380         * expression.cs:  Instead of having FIXMEs in the Resolve
28381         functions, throw exceptions so it is obvious that we are facing a
28382         bug. 
28383
28384         * cs-parser.jay (invocation_expression): Pass Location information.
28385
28386         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28387         Use a basename for those routines because .NET does not like paths
28388         on them. 
28389
28390         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28391         already defined.
28392
28393 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
28394
28395         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28396         are loading the correct data types (throws an exception if not).
28397         (TypeManager::InitCoreTypes): Use CoreLookupType
28398
28399         * expression.cs (Unary::ResolveOperator): return the child
28400         expression for expressions which are just +expr.
28401         (Unary::ResolveOperator): Return negative literals for -LITERAL
28402         expressions (otherwise they are Unary {Literal}).
28403         (Invocation::Badness): Take into account `Implicit constant
28404         expression conversions'.
28405
28406         * literal.cs (LongLiteral): Implement long literal class.
28407         (IntLiteral): export the `Value' of the intliteral. 
28408
28409 2001-09-19  Ravi Pratap  <ravi@ximian.com>
28410
28411         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28412
28413         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
28414         instead of 'Operator'
28415
28416         * expression.cs (Binary::ResolveOperator): Update accordingly.
28417         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28418         and 'Minus'
28419
28420         * cs-parser.jay (unary_expression): Update to use the new names.
28421
28422         * gen-treedump.cs (GetUnary): Same here.
28423
28424         * expression.cs (Unary::Resolve): Implement.
28425         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
28426         operators are found instead of making noise ;-)
28427         (Unary::ResolveOperator): New method to do precisely the same thing which
28428         Binary::ResolveOperator does for Binary expressions.
28429         (Unary.method, .Arguments): Add.
28430         (Unary::OperName): Implement.   
28431         (Unary::ForceConversion): Copy and Paste !
28432
28433         * class.cs (Operator::Define): Fix a small bug for the case when we have 
28434         a unary operator.
28435
28436         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28437         for the inbuilt operators. Only overloading works for now ;-)
28438
28439 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
28440
28441         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28442         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28443
28444         * expression.cs (This::Emit): Implement. 
28445         (This::Resolve): Implement.
28446         (TypeOf:Resolve): Implement.
28447         (Expression::ResolveSimpleName): Add an implicit this to instance
28448         field references. 
28449         (MemberAccess::Resolve): Deal with Parameters and Fields. 
28450         Bind instance variable to Field expressions.
28451         (FieldExpr::Instance): New field used to track the expression that
28452         represents the object instance.
28453         (FieldExpr::Resolve): Track potential errors from MemberLookup not
28454         binding 
28455         (FieldExpr::Emit): Implement.
28456
28457         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28458         the last instruction contains a return opcode to avoid generating
28459         the last `ret' instruction (this generates correct code, and it is
28460         nice to pass the peverify output).
28461
28462         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28463         initializer for static and instance variables.
28464         (Constructor::Emit): Allow initializer to be null in the case of
28465         static constructors.  Only emit initializer for instance
28466         constructors. 
28467
28468         (TypeContainer::FindMembers): Return a null array if there are no
28469         matches.
28470
28471         Also fix the code for the MemberTypes.Method branch, as it was not
28472         scanning that for operators (or tried to access null variables before).
28473
28474         * assign.cs (Assign::Emit): Handle instance and static fields. 
28475
28476         * TODO: Updated.
28477
28478         * driver.cs: Stop compilation if there are parse errors.
28479
28480         * cs-parser.jay (constructor_declaration): Provide default base
28481         initializer for non-static constructors.
28482         (constructor_declarator): Do not provide a default base
28483         initializers if none was specified.
28484         Catch the fact that constructors should not have parameters.
28485
28486         * class.cs: Do not emit parent class initializers for static
28487         constructors, that should be flagged as an error.
28488
28489 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28490
28491         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28492         Move back code into TypeContainer::Populate.
28493
28494 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28495
28496         * class.cs (TypeContainer::AddConstructor): Fix the check to
28497         compare against Name, not Basename. 
28498         (Operator::OpType): Change Plus and Minus to Add and Subtract.
28499
28500         * cs-parser.jay : Update accordingly.
28501
28502         * class.cs (TypeContainer::FindMembers): For the case where we are searching
28503         for methods, don't forget to look into the operators too.
28504         (RegisterMethodBuilder): Helper method to take care of this for
28505         methods, constructors and operators.
28506         (Operator::Define): Completely revamp.
28507         (Operator.OperatorMethod, MethodName): New fields.
28508         (TypeContainer::Populate): Move the registering of builders into
28509         RegisterMethodBuilder.
28510         (Operator::Emit): Re-write.
28511
28512         * expression.cs (Binary::Emit): Comment out code path to emit method
28513         invocation stuff for the case when we have a user defined operator. I am
28514         just not able to get it right !
28515
28516 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28517
28518         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28519         argument. 
28520
28521         (Expression::MemberLookup): Provide a version that allows to
28522         specify the MemberTypes and BindingFlags. 
28523
28524         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28525         so it was not fetching variable information from outer blocks.
28526
28527         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28528         Beforefieldinit as it was buggy.
28529
28530         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28531         that Ravi put here.  
28532
28533         * class.cs (Constructor::Emit): Only emit if block is not null.
28534         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28535         deal with this by semantically definining it as if the user had
28536         done it.
28537
28538         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28539         constructors as we now "emit" them at a higher level.
28540
28541         (TypeContainer::DefineDefaultConstructor): Used to define the
28542         default constructors if none was provided.
28543
28544         (ConstructorInitializer): Add methods Resolve and Emit. 
28545
28546         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28547
28548 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28549
28550         * class.cs (TypeContainer::EmitDefaultConstructor): Register
28551         the default constructor builder with our hashtable for methodbuilders
28552         to methodcores.
28553
28554         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28555         and argument_count is 0 in which case we have a match.
28556         (Binary::ResolveOperator): More null checking and miscellaneous coding
28557         style cleanup.
28558
28559 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28560
28561         * rootcontext.cs (IsNameSpace): Compare against null.
28562
28563         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28564
28565         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28566         and Unary::Operator.
28567
28568         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28569         accordingly.
28570
28571         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28572         we have overloaded operators.
28573         (Binary::ResolveOperator): Implement the part which does the operator overload
28574         resolution.
28575
28576         * class.cs (Operator::Emit): Implement.
28577         (TypeContainer::Emit): Emit the operators we have too.
28578
28579         * expression.cs (Binary::Emit): Update to emit the appropriate code for
28580         the case when we have a user-defined operator.
28581
28582 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28583
28584         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28585
28586 2001-09-16  Ravi Pratap  <ravi@ximian.com>
28587
28588         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28589         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28590         (Constructor::Emit): Implement.
28591         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28592         if we have no work to do. 
28593         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
28594         Emit method.
28595
28596         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28597         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28598
28599         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28600         of parent.parent.
28601
28602 2001-09-15  Ravi Pratap  <ravi@ximian.com>
28603
28604         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28605         in the source.
28606         (Tree::RecordNamespace): Method to do what the name says ;-)
28607         (Tree::Namespaces): Property to get at the namespaces hashtable.
28608
28609         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
28610         keep track.
28611
28612         * rootcontext.cs (IsNamespace): Fixed it :-)
28613
28614 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28615
28616         * class.cs (TypeContainer::FindMembers): Add support for
28617         constructors. 
28618         (MethodCore): New class that encapsulates both the shared aspects
28619         of a Constructor and a Method.  
28620         (Method, Constructor): Factored pieces into MethodCore.
28621
28622         * driver.cs: Added --fatal which makes errors throw exceptions.
28623         Load System assembly as well as part of the standard library.
28624
28625         * report.cs: Allow throwing exceptions on errors for debugging.
28626
28627         * modifiers.cs: Do not use `parent', instead use the real type
28628         container to evaluate permission settings.
28629
28630         * class.cs: Put Ravi's patch back in.  He is right, and we will
28631         have to cope with the
28632
28633 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28634
28635         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28636         FamORAssem, not FamANDAssem.
28637
28638 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28639
28640         * driver.cs: Added --parse option that only parses its input files
28641         and terminates.
28642
28643         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
28644         incorrect.  IsTopLevel is not used to tell whether an object is
28645         root_types or not (that can be achieved by testing this ==
28646         root_types).  But to see if this is a top-level *class* (not
28647         necessarly our "toplevel" container). 
28648
28649 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28650
28651         * enum.cs (Enum::Define): Modify to call the Lookup method on the
28652         parent instead of a direct call to GetType.
28653
28654 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28655
28656         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28657         Modifiers.TypeAttr. This should just be a call to that method.
28658
28659         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28660         object so that we can determine if we are top-level or not.
28661
28662         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
28663         TypeContainer too.
28664
28665         * enum.cs (Enum::Define): Ditto.
28666
28667         * modifiers.cs (FieldAttr): Re-write.
28668
28669         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28670         (TypeContainer::HaveStaticConstructor): New property to provide access
28671         to precisely that info.
28672
28673         * modifiers.cs (MethodAttr): Re-write.
28674         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28675
28676         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28677         of top-level types as claimed.
28678
28679 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28680
28681         * expression.cs (MemberLookup): Fruitless attempt to lookup
28682         constructors.  Maybe I need to emit default constructors?  That
28683         might be it (currently .NET emits this for me automatically).
28684         (Invocation::OverloadResolve): Cope with Arguments == null.
28685         (Invocation::EmitArguments): new function, shared by the new
28686         constructor and us.
28687         (Invocation::Emit): Handle static and instance methods.  Emit
28688         proper call instruction for virtual or non-virtual invocations.
28689         (New::Emit): Implement.
28690         (New::Resolve): Implement.
28691         (MemberAccess:Resolve): Implement.
28692         (MethodGroupExpr::InstanceExpression): used conforming to the spec
28693         to track instances.
28694         (FieldExpr::Resolve): Set type.
28695
28696         * support.cs: Handle empty arguments.
28697                 
28698         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28699         SimpleLookup): Auxiliary routines to help parse a qualifier
28700         identifier.  
28701
28702         Update qualifier_identifier rule.
28703
28704         * codegen.cs: Removed debugging messages.
28705
28706         * class.cs: Make this a global thing, this acts just as a "key" to
28707         objects that we might have around.
28708
28709         (Populate): Only initialize method_builders_to_methods once.
28710
28711         * expression.cs (PropertyExpr): Initialize type from the
28712         PropertyType. 
28713
28714         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28715         Resolve pattern.  Attempt to implicitly convert value to boolean.
28716         Emit code.
28717
28718         * expression.cs: Set the type for the int32/int32 argument case.
28719         (Binary::ResolveOperator): Set the return type to boolean for
28720         comparission operators
28721
28722         * typemanager.cs: Remove debugging print code.
28723
28724         (Invocation::Resolve): resolve type.
28725
28726         * class.cs: Allocate a MemberInfo of the correct size, as the code
28727         elsewhere depends on the test to reflect the correct contents.
28728
28729         (Method::) Keep track of parameters, due to System.Reflection holes
28730
28731         (TypeContainer::Populate): Keep track of MethodBuilders to Method
28732         mapping here.
28733
28734         (TypeContainer::FindMembers): Use ArrayList and then copy an array
28735         of the exact size and return that.
28736
28737         (Class::LookupMethodByBuilder): New function that maps
28738         MethodBuilders to its methods.  Required to locate the information
28739         on methods because System.Reflection bit us again.
28740
28741         * support.cs: New file, contains an interface ParameterData and
28742         two implementations: ReflectionParameters and InternalParameters
28743         used to access Parameter information.  We will need to grow this
28744         as required.
28745
28746         * expression.cs (Invocation::GetParameterData): implement a cache
28747         and a wrapper around the ParameterData creation for methods. 
28748         (Invocation::OverloadResolve): Use new code.
28749
28750 2001-09-13  Ravi Pratap  <ravi@ximian.com>
28751
28752         * class.cs (TypeContainer::EmitField): Remove and move into 
28753         (Field::Define): here and modify accordingly.
28754         (Field.FieldBuilder): New member.
28755         (TypeContainer::Populate): Update accordingly.
28756         (TypeContainer::FindMembers): Implement.
28757
28758 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28759
28760         * statement.cs: (VariableInfo::VariableType): New field to be
28761         initialized with the full type once it is resolved. 
28762
28763 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
28764
28765         * parameter.cs (GetParameterInfo): Use a type cache to compute
28766         things only once, and to reuse this information
28767
28768         * expression.cs (LocalVariableReference::Emit): Implement.
28769         (OpcodeCast::Emit): fix.
28770
28771         (ParameterReference::Resolve): Implement.
28772         (ParameterReference::Emit): Implement.
28773
28774         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28775         that are expressions need to stay as Expressions.
28776
28777         * typemanager.cs (CSharpName): Returns the C# name of a type if
28778         possible. 
28779
28780         * expression.cs (Expression::ConvertImplicit): New function that
28781         implements implicit type conversions.
28782
28783         (Expression::ImplicitReferenceConversion): Implements implicit
28784         reference conversions.
28785
28786         (EmptyCast): New type for transparent casts.
28787
28788         (OpcodeCast): New type for casts of types that are performed with
28789         a sequence of bytecodes.
28790
28791         (BoxedCast): New type used for casting value types into reference
28792         types.  Emits a box opcode.
28793
28794         (Binary::DoNumericPromotions): Implements numeric promotions of
28795         and computation of the Binary::Type.
28796
28797         (Binary::EmitBranchable): Optimization.
28798
28799         (Binary::Emit): Implement code emission for expressions.
28800
28801         * typemanager.cs (TypeManager): Added two new core types: sbyte
28802         and byte.
28803
28804 2001-09-12  Ravi Pratap  <ravi@ximian.com>
28805
28806         * class.cs (TypeContainer::FindMembers): Method which does exactly
28807         what Type.FindMembers does, only we don't have to use reflection. No
28808         implementation yet.
28809
28810         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28811         typecontainer objects as we need to get at them.
28812         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28813
28814         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28815         typecontainer object.
28816
28817         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28818         of just a Report object.
28819
28820 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28821
28822         * class.cs (Event::Define): Go back to using the prefixes "add_" and
28823         "remove_"
28824         (TypeContainer::Populate): Now define the delegates of the type too.
28825         (TypeContainer.Delegates): Property to access the list of delegates defined
28826         in the type.
28827
28828         * delegates.cs (Delegate::Define): Implement partially.
28829
28830         * modifiers.cs (TypeAttr): Handle more flags.
28831
28832 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28833
28834         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28835         and not <=
28836         (Operator::Define): Re-write logic to get types by using the LookupType method
28837         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28838         (Indexer::Define): Ditto.
28839         (Event::Define): Ditto.
28840         (Property::Define): Ditto.
28841
28842 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28843
28844         * class.cs (TypeContainer::Populate): Now define operators too. 
28845         (TypeContainer.Operators): New property to access the list of operators
28846         in a type.
28847         (Operator.OperatorMethodBuilder): New member to hold the method builder
28848         for the operator we are defining.
28849         (Operator::Define): Implement.
28850
28851 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28852
28853         * class.cs (Event::Define): Make the prefixes of the accessor methods
28854         addOn_ and removeOn_ 
28855
28856         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28857         of the location being passed in too. Ideally, this should go later since all
28858         error reporting should be done through the Report object.
28859
28860         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28861         (Populate): Iterate thru the indexers we have and define them too.
28862         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28863         for the get and set accessors.
28864         (Indexer::Define): Implement.
28865
28866 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
28867
28868         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
28869         my previous implementation, did not work.
28870
28871         * typemanager.cs: Add a couple of missing types (the longs).
28872
28873         * literal.cs: Use TypeManager.bool_type instead of getting it.
28874
28875         * expression.cs (EventExpr): New kind of expressions.
28876         (Expressio::ExprClassFromMemberInfo): finish
28877
28878 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
28879
28880         * assign.cs: Emit stores to static fields differently.
28881
28882 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28883
28884         * Merge in changes and adjust code to tackle conflicts. Backed out my
28885         code in Assign::Resolve ;-) 
28886
28887 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28888
28889         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28890         instead Report.Error and also pass in the location.
28891         (CSharpParser::Lexer): New readonly property to return the reference
28892         to the Tokenizer object.
28893         (declare_local_variables): Use Report.Error with location instead of plain 
28894         old error.
28895         (CheckDef): Ditto.
28896
28897         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28898         (Operator.CheckBinaryOperator): Ditto.
28899
28900         * cs-parser.jay (operator_declarator): Update accordingly.
28901
28902         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28903         (CheckBinaryOperator): Same here.
28904
28905         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28906         on the name without any prefixes of namespace names etc. This is because we
28907         already might have something already fully qualified like 
28908         'System.Console.WriteLine'
28909
28910         * assign.cs (Resolve): Begin implementation. Stuck ;-)
28911
28912 2001-09-07  Ravi Pratap  <ravi@ximian.com>
28913
28914         * cs-tokenizer.cs (location): Return a string which also contains
28915         the file name.
28916
28917         * expression.cs (ElementAccess): New class for expressions of the
28918         type 'element access.'
28919         (BaseAccess): New class for expressions of the type 'base access.'
28920         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28921         respectively.
28922
28923         * cs-parser.jay (element_access): Implement action.
28924         (base_access): Implement actions.
28925         (checked_expression, unchecked_expression): Implement.
28926
28927         * cs-parser.jay (local_variable_type): Correct and implement.
28928         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28929
28930         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28931
28932         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28933         name and the specifiers.
28934
28935         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28936
28937         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
28938         making them all public ;-)
28939
28940         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28941         class anyways.
28942
28943 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
28944
28945         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28946         PropertyExprs.
28947         (FieldExpr, PropertyExprs): New resolved expressions.
28948         (SimpleName::MemberStaticCheck): Perform static checks for access
28949         to non-static fields on static methods. Maybe this should be
28950         generalized for MemberAccesses. 
28951         (SimpleName::ResolveSimpleName): More work on simple name
28952         resolution. 
28953
28954         * cs-parser.jay (primary_expression/qualified_identifier): track
28955         the parameter index.
28956
28957         * codegen.cs (CodeGen::Save): Catch save exception, report error.
28958         (EmitContext::EmitBoolExpression): Chain to expression generation
28959         instead of temporary hack.
28960         (::EmitStatementExpression): Put generic expression code generation.
28961
28962         * assign.cs (Assign::Emit): Implement variable assignments to
28963         local variables, parameters and fields.
28964
28965 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
28966
28967         * statement.cs (Block::GetVariableInfo): New method, returns the
28968         VariableInfo for a variable name in a block.
28969         (Block::GetVariableType): Implement in terms of GetVariableInfo
28970
28971         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28972         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28973
28974 2001-09-06  Ravi Pratap  <ravi@ximian.com>
28975
28976         * cs-parser.jay (operator_declaration): Continue on my quest : update
28977         to take attributes argument.
28978         (event_declaration): Ditto.
28979         (enum_declaration): Ditto.
28980         (indexer_declaration): Ditto.
28981
28982         * class.cs (Operator::Operator): Update constructor accordingly.
28983         (Event::Event): Ditto.
28984
28985         * delegate.cs (Delegate::Delegate): Same here.
28986
28987         * enum.cs (Enum::Enum): Same here.
28988
28989 2001-09-05  Ravi Pratap  <ravi@ximian.com>
28990
28991         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28992
28993         * ../tests/cs0658.cs : New file to demonstrate error 0658.
28994
28995         * attribute.cs (Attributes): New class to encapsulate all attributes which were
28996         being passed around as an arraylist.
28997         (Attributes::AddAttribute): Method to add attribute sections.
28998
28999         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
29000         (struct_declaration): Update accordingly.
29001         (constant_declaration): Update.
29002         (field_declaration): Update.
29003         (method_header): Update.
29004         (fixed_parameter): Update.
29005         (parameter_array): Ditto.
29006         (property_declaration): Ditto.
29007         (destructor_declaration): Ditto.
29008
29009         * class.cs (Struct::Struct): Update constructors accordingly.
29010         (Class::Class): Ditto.
29011         (Field::Field): Ditto.
29012         (Method::Method): Ditto.
29013         (Property::Property): Ditto.
29014         (TypeContainer::OptAttribute): update property's return type.
29015
29016         * interface.cs (Interface.opt_attributes): New member.
29017         (Interface::Interface): Update to take the extra Attributes argument.
29018
29019         * parameter.cs (Parameter::Parameter): Ditto.
29020
29021         * constant.cs (Constant::Constant): Ditto.
29022
29023         * interface.cs (InterfaceMemberBase): New OptAttributes field.
29024         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
29025         the attributes as a parameter.
29026         (InterfaceProperty): Update constructor call.
29027         (InterfaceEvent): Ditto.
29028         (InterfaceMethod): Ditto.
29029         (InterfaceIndexer): Ditto.
29030
29031         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
29032         pass the attributes too.
29033         (interface_event_declaration): Ditto.
29034         (interface_property_declaration): Ditto.
29035         (interface_method_declaration): Ditto.
29036         (interface_declaration): Ditto.
29037
29038 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
29039
29040         * class.cs (Method::Define): Track the "static Main" definition to
29041         create an entry point. 
29042
29043         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
29044         EntryPoint if we find it. 
29045
29046         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
29047         (EmitContext::ig): Make this variable public.
29048
29049         * driver.cs: Make the default output file be the first file name
29050         with the .exe extension.  
29051
29052         Detect empty compilations
29053
29054         Handle various kinds of output targets.  Handle --target and
29055         rename -t to --dumper.
29056
29057         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
29058         methods inherited from Expression return now an Expression.  This
29059         will is used during the tree rewriting as we resolve them during
29060         semantic analysis.
29061
29062         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
29063         the spec.  Missing entirely is the information about
29064         accessability of elements of it.
29065
29066         (Expression::ExprClassFromMemberInfo): New constructor for
29067         Expressions that creates a fully initialized Expression based on
29068         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
29069         a Type.
29070
29071         (Invocation::Resolve): Begin implementing resolution of invocations.
29072
29073         * literal.cs (StringLiteral):  Implement Emit.
29074
29075 2001-09-05  Ravi Pratap  <ravi@ximian.com>
29076
29077         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
29078         member.
29079
29080 2001-09-04  Ravi Pratap  <ravi@ximian.com>
29081
29082         * cs-parser.jay (attribute_arguments): Implement actions.
29083         (attribute): Fix bug in production. Implement action.
29084         (attribute_list): Implement.
29085         (attribute_target): Implement.
29086         (attribute_target_specifier, opt_target_specifier): Implement
29087         (CheckAttributeTarget): New method to check if the attribute target
29088         is valid.
29089         (attribute_section): Implement.
29090         (opt_attributes): Implement.
29091
29092         * attribute.cs : New file to handle attributes.
29093         (Attribute): Class to hold attribute info.
29094
29095         * cs-parser.jay (opt_attribute_target_specifier): Remove production
29096         (attribute_section): Modify production to use 2 different rules to 
29097         achieve the same thing. 1 s/r conflict down !
29098         Clean out commented, useless, non-reducing dimension_separator rules.
29099
29100         * class.cs (TypeContainer.attributes): New member to hold list
29101         of attributes for a type.
29102         (Struct::Struct): Modify to take one more argument, the attribute list.
29103         (Class::Class): Ditto.
29104         (Field::Field): Ditto.
29105         (Method::Method): Ditto.
29106         (Property::Property): Ditto.
29107
29108         * cs-parser.jay (struct_declaration): Update constructor call to
29109         pass in the attributes too.
29110         (class_declaration): Ditto.
29111         (constant_declaration): Ditto.
29112         (field_declaration): Ditto.
29113         (method_header): Ditto.
29114         (fixed_parameter): Ditto.
29115         (parameter_array): Ditto.
29116         (property_declaration): Ditto.
29117
29118         * constant.cs (Constant::Constant): Update constructor similarly.
29119         Use System.Collections.
29120
29121         * parameter.cs (Parameter::Parameter): Update as above.
29122
29123 2001-09-02  Ravi Pratap  <ravi@ximian.com>
29124
29125         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
29126         (TypeContainer.delegates): New member to hold list of delegates.
29127
29128         * cs-parser.jay (delegate_declaration): Implement the action correctly 
29129         this time as I seem to be on crack ;-)
29130
29131 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
29132
29133         * rootcontext.cs (RootContext::IsNamespace): new function, used to
29134         tell whether an identifier represents a namespace.
29135
29136         * expression.cs (NamespaceExpr): A namespace expression, used only
29137         temporarly during expression resolution.
29138         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
29139         utility functions to resolve names on expressions.
29140
29141 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
29142
29143         * codegen.cs: Add hook for StatementExpressions. 
29144
29145         * class.cs: Fix inverted test for static flag in methods.
29146
29147 2001-09-02  Ravi Pratap  <ravi@ximian.com>
29148
29149         * class.cs (Operator::CheckUnaryOperator): Correct error number used
29150         to make it coincide with MS' number.
29151         (Operator::CheckBinaryOperator): Ditto.
29152
29153         * ../errors/errors.txt : Remove error numbers added earlier.
29154
29155         * ../errors/cs1019.cs : Test case for error # 1019
29156
29157         * ../errros/cs1020.cs : Test case for error # 1020
29158
29159         * cs-parser.jay : Clean out commented cruft.
29160         (dimension_separators, dimension_separator): Comment out. Ostensibly not
29161         used anywhere - non-reducing rule.
29162         (namespace_declarations): Non-reducing rule - comment out.
29163
29164         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
29165         with TypeContainer::AddEnum.
29166
29167         * delegate.cs : New file for delegate handling classes.
29168         (Delegate): Class for declaring delegates.
29169
29170         * makefile : Update.
29171
29172         * cs-parser.jay (delegate_declaration): Implement.
29173
29174 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
29175
29176         * class.cs (Event::Define): Implement.
29177         (Event.EventBuilder): New member.
29178
29179         * class.cs (TypeContainer::Populate): Update to define all enums and events
29180         we have.
29181         (Events): New property for the events arraylist we hold. Shouldn't we move to using
29182         readonly fields for all these cases ?
29183
29184 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
29185
29186         * class.cs (Property): Revamp to use the convention of making fields readonly.
29187         Accordingly modify code elsewhere.
29188
29189         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
29190         the Define method of the Property class.
29191
29192         * class.cs : Clean up applied patch and update references to variables etc. Fix 
29193         trivial bug.
29194         (TypeContainer::Populate): Update to define all the properties we have. Also
29195         define all enumerations.
29196
29197         * enum.cs (Define): Implement.
29198
29199 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
29200
29201         * cs-parser.jay (overloadable_operator): The semantic value is an
29202         enum of the Operator class.
29203         (operator_declarator): Implement actions.
29204         (operator_declaration): Implement.
29205
29206         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
29207         validity of definitions.
29208         (Operator::CheckBinaryOperator): Static method to check for binary operators
29209         (TypeContainer::AddOperator): New method to add an operator to a type.
29210
29211         * cs-parser.jay (indexer_declaration): Added line to actually call the
29212         AddIndexer method so it gets added ;-)
29213
29214         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
29215         already taken care of by the MS compiler ?  
29216
29217 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
29218
29219         * class.cs (Operator): New class for operator declarations.
29220         (Operator::OpType): Enum for the various operators.
29221
29222 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
29223
29224         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
29225         ostensibly handle this in semantic analysis.
29226
29227         * cs-parser.jay (general_catch_clause): Comment out
29228         (specific_catch_clauses, specific_catch_clause): Ditto.
29229         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
29230         (catch_args, opt_catch_args): New productions.
29231         (catch_clause): Rewrite to use the new productions above
29232         (catch_clauses): Modify accordingly.
29233         (opt_catch_clauses): New production to use in try_statement
29234         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
29235         and re-write the code in the actions to extract the specific and
29236         general catch clauses by being a little smart ;-)
29237
29238         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
29239         Hooray, try and catch statements parse fine !
29240
29241 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29242
29243         * statement.cs (Block::GetVariableType): Fix logic to extract the type
29244         string from the hashtable of variables.
29245
29246         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
29247         I end up making that mistake ;-)
29248         (catch_clauses): Fixed gross error which made Key and Value of the 
29249         DictionaryEntry the same : $1 !!
29250
29251 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29252
29253         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
29254
29255         * cs-parser.jay (event_declaration): Correct to remove the semicolon
29256         when the add and remove accessors are specified. 
29257
29258 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29259
29260         * cs-parser.jay (IndexerDeclaration): New helper class to hold
29261         information about indexer_declarator.
29262         (indexer_declarator): Implement actions.
29263         (parsing_indexer): New local boolean used to keep track of whether
29264         we are parsing indexers or properties. This is necessary because 
29265         implicit_parameters come into picture even for the get accessor in the 
29266         case of an indexer.
29267         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
29268
29269         * class.cs (Indexer): New class for indexer declarations.
29270         (TypeContainer::AddIndexer): New method to add an indexer to a type.
29271         (TypeContainer::indexers): New member to hold list of indexers for the
29272         type.
29273
29274 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
29275
29276         * cs-parser.jay (add_accessor_declaration): Implement action.
29277         (remove_accessor_declaration): Implement action.
29278         (event_accessors_declaration): Implement
29279         (variable_declarators): swap statements for first rule - trivial.
29280
29281         * class.cs (Event): New class to hold information about event
29282         declarations.
29283         (TypeContainer::AddEvent): New method to add an event to a type
29284         (TypeContainer::events): New member to hold list of events.
29285
29286         * cs-parser.jay (event_declaration): Implement actions.
29287
29288 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
29289
29290         * cs-parser.jay (dim_separators): Implement. Make it a string
29291         concatenating all the commas together, just as they appear.
29292         (opt_dim_separators): Modify accordingly
29293         (rank_specifiers): Update accordingly. Basically do the same
29294         thing - instead, collect the brackets here.
29295         (opt_rank_sepcifiers): Modify accordingly.
29296         (array_type): Modify to actually return the complete type string
29297         instead of ignoring the rank_specifiers.
29298         (expression_list): Implement to collect the expressions
29299         (variable_initializer): Implement. We make it a list of expressions
29300         essentially so that we can handle the array_initializer case neatly too.
29301         (variable_initializer_list): Implement.
29302         (array_initializer): Make it a list of variable_initializers
29303         (opt_array_initializer): Modify accordingly.
29304
29305         * expression.cs (New::NType): Add enumeration to help us
29306         keep track of whether we have an object/delegate creation
29307         or an array creation.
29308         (New:NewType, New::Rank, New::Indices, New::Initializers): New
29309         members to hold data about array creation.
29310         (New:New): Modify to update NewType
29311         (New:New): New Overloaded contructor for the array creation
29312         case.
29313
29314         * cs-parser.jay (array_creation_expression): Implement to call
29315         the overloaded New constructor.
29316
29317 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
29318
29319         * class.cs (TypeContainer::Constructors): Return member
29320         constructors instead of returning null.
29321
29322 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
29323
29324         * typemanager.cs (InitCoreTypes): Initialize the various core
29325         types after we have populated the type manager with the user
29326         defined types (this distinction will be important later while
29327         compiling corlib.dll)
29328
29329         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29330         on Expression Classification.  Now all expressions have a method
29331         `Resolve' and a method `Emit'.
29332
29333         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29334         generation from working.     Also add some temporary debugging
29335         code. 
29336
29337 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
29338
29339         * codegen.cs: Lots of code generation pieces.  This is only the
29340         beginning, will continue tomorrow with more touches of polish.  We
29341         handle the fundamentals of if, while, do, for, return.  Others are
29342         trickier and I need to start working on invocations soon.
29343
29344         * gen-treedump.cs: Bug fix, use s.Increment here instead of
29345         s.InitStatement. 
29346
29347         * codegen.cs (EmitContext): New struct, used during code
29348         emission to keep a context.   Most of the code generation will be
29349         here. 
29350
29351         * cs-parser.jay: Add embedded blocks to the list of statements of
29352         this block.  So code generation proceeds in a top down fashion.
29353
29354 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
29355
29356         * statement.cs: Add support for multiple child blocks.
29357
29358 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
29359
29360         * codegen.cs (EmitCode): New function, will emit the code for a
29361         Block of code given a TypeContainer and its ILGenerator. 
29362
29363         * statement.cs (Block): Standard public readonly optimization.
29364         (Block::Block constructors): Link children. 
29365         (Block::Child): Child Linker.
29366         (Block::EmitVariables): Emits IL variable declarations.
29367
29368         * class.cs: Drop support for MethodGroups here, delay until
29369         Semantic Analysis.
29370         (Method::): Applied the same simplification that I did before, and
29371         move from Properties to public readonly fields.
29372         (Method::ParameterTypes): Returns the parameter types for the
29373         function, and implements a cache that will be useful later when I
29374         do error checking and the semantic analysis on the methods is
29375         performed.
29376         (Constructor::GetCallingConvention): Renamed from CallingConvetion
29377         and made a method, optional argument tells whether this is a class
29378         or a structure to apply the `has-this' bit.
29379         (Method::GetCallingConvention): Implement, returns the calling
29380         convention. 
29381         (Method::Define): Defines the type, a second pass is performed
29382         later to populate the methods.
29383
29384         (Constructor::ParameterTypes): implement a cache similar to the
29385         one on Method::ParameterTypes, useful later when we do semantic
29386         analysis. 
29387
29388         (TypeContainer::EmitMethod):  New method.  Emits methods.
29389
29390         * expression.cs: Removed MethodGroup class from here.
29391
29392         * parameter.cs (Parameters::GetCallingConvention): new method.
29393
29394 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
29395
29396         * class.cs (TypeContainer::Populate): Drop RootContext from the
29397         argument. 
29398
29399         (Constructor::CallingConvention): Returns the calling convention.
29400         (Constructor::ParameterTypes): Returns the constructor parameter
29401         types. 
29402
29403         (TypeContainer::AddConstructor): Keep track of default constructor
29404         and the default static constructor.
29405
29406         (Constructor::) Another class that starts using `public readonly'
29407         instead of properties. 
29408
29409         (Constructor::IsDefault): Whether this is a default constructor. 
29410
29411         (Field::) use readonly public fields instead of properties also.
29412
29413         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29414         track of static constructors;  If none is used, turn on
29415         BeforeFieldInit in the TypeAttributes. 
29416
29417         * cs-parser.jay (opt_argument_list): now the return can be null
29418         for the cases where there are no arguments. 
29419
29420         (constructor_declarator): If there is no implicit `base' or
29421         `this', then invoke the default parent constructor. 
29422
29423         * modifiers.cs (MethodAttr): New static function maps a set of
29424         modifiers flags into a MethodAttributes enum
29425         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
29426         MethodAttr, TypeAttr to represent the various mappings where the
29427         modifiers are used.
29428         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
29429
29430 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
29431
29432         * parameter.cs (GetParameterInfo): Fix bug where there would be no
29433         method arguments.
29434
29435         * interface.cs (PopulateIndexer): Implemented the code generator
29436         for interface indexers.
29437
29438 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
29439
29440         * interface.cs (InterfaceMemberBase): Now we track the new status
29441         here.  
29442
29443         (PopulateProperty): Implement property population.  Woohoo!  Got
29444         Methods and Properties going today. 
29445
29446         Removed all the properties for interfaces, and replaced them with
29447         `public readonly' fields. 
29448
29449 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
29450
29451         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29452         initialize their hashtables/arraylists only when they are needed
29453         instead of doing this always.
29454
29455         * parameter.cs: Handle refs and out parameters.
29456
29457         * cs-parser.jay: Use an ArrayList to construct the arguments
29458         instead of the ParameterCollection, and then cast that to a
29459         Parameter[] array.
29460
29461         * parameter.cs: Drop the use of ParameterCollection and use
29462         instead arrays of Parameters.
29463
29464         (GetParameterInfo): Use the Type, not the Name when resolving
29465         types. 
29466
29467 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
29468
29469         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29470         and instead use public readonly fields.
29471
29472         * class.cs: Put back walking code for type containers.
29473
29474 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
29475
29476         * class.cs (MakeConstant): Code to define constants.
29477
29478         * rootcontext.cs (LookupType): New function.  Used to locate types 
29479
29480
29481 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
29482
29483         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
29484         this System.Reflection code is.  Kudos to Microsoft
29485
29486         * typemanager.cs: Implement a type cache and avoid loading all
29487         types at boot time.  Wrap in LookupType the internals.  This made
29488         the compiler so much faster.  Wow.  I rule!
29489
29490         * driver.cs: Make sure we always load mscorlib first (for
29491         debugging purposes, nothing really important).
29492
29493         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
29494         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
29495
29496         * rootcontext.cs: Lookup types on their namespace;  Lookup types
29497         on namespaces that have been imported using the `using' keyword.
29498
29499         * class.cs (TypeContainer::TypeAttr): Virtualize.
29500         (Class::TypeAttr): Return attributes suitable for this bad boy.
29501         (Struct::TypeAttr): ditto.
29502         Handle nested classes.
29503         (TypeContainer::) Remove all the type visiting code, it is now
29504         replaced with the rootcontext.cs code
29505
29506         * rootcontext.cs (GetClassBases): Added support for structs. 
29507
29508 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
29509
29510         * interface.cs, statement.cs, class.cs, parameter.cs,
29511         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29512         Drop use of TypeRefs, and use strings instead.
29513
29514 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
29515
29516         * rootcontext.cs: 
29517
29518         * class.cs (Struct::Struct): set the SEALED flags after
29519         checking the modifiers.
29520         (TypeContainer::TypeAttr): new property, returns the
29521         TypeAttributes for a class.  
29522
29523         * cs-parser.jay (type_list): Oops, list production was creating a
29524         new list of base types.
29525
29526         * rootcontext.cs (StdLib): New property.
29527         (GetInterfaceTypeByName): returns an interface by type name, and
29528         encapsulates error handling here.
29529         (GetInterfaces): simplified.
29530         (ResolveTree): Encapsulated all the tree resolution here.
29531         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29532         types. 
29533
29534         * driver.cs: Add support for --nostdlib, to avoid loading the
29535         default assemblies.
29536         (Main): Do not put tree resolution here. 
29537
29538         * rootcontext.cs: Beginning of the class resolution.
29539
29540 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
29541
29542         * rootcontext.cs: Provide better error reporting. 
29543
29544         * cs-parser.jay (interface_base): set our $$ to be interfaces.
29545
29546         * rootcontext.cs (CreateInterface): Handle the case where there
29547         are no parent interfaces.
29548
29549         (CloseTypes): Routine to flush types at the end.
29550         (CreateInterface): Track types.
29551         (GetInterfaces): Returns an array of Types from the list of
29552         defined interfaces.
29553
29554         * typemanager.c (AddUserType): Mechanism to track user types (puts
29555         the type on the global type hash, and allows us to close it at the
29556         end). 
29557
29558 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
29559
29560         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29561         RecordInterface instead.
29562
29563         * cs-parser.jay: Updated to reflect changes above.
29564
29565         * decl.cs (Definition): Keep track of the TypeBuilder type that
29566         represents this type here.  Not sure we will use it in the long
29567         run, but wont hurt for now.
29568
29569         * driver.cs: Smaller changes to accomodate the new code.
29570
29571         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29572         when done. 
29573
29574         * rootcontext.cs (CreateInterface):  New method, used to create
29575         the System.TypeBuilder type for interfaces.
29576         (ResolveInterfaces): new entry point to resolve the interface
29577         hierarchy. 
29578         (CodeGen): Property, used to keep track of the code generator.
29579
29580 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
29581
29582         * cs-parser.jay: Add a second production for delegate_declaration
29583         with `VOID'.
29584
29585         (enum_body): Put an opt_comma here instead of putting it on
29586         enum_body or enum_member_declarations so we can handle trailing
29587         commas on enumeration members.  Gets rid of a shift/reduce.
29588
29589         (type_list): Need a COMMA in the middle.
29590
29591         (indexer_declaration): Tell tokenizer to recognize get/set
29592
29593         * Remove old targets.
29594
29595         * Re-add the parser target.
29596
29597 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29598
29599         * cs-parser.jay: Add precendence rules for a number of operators
29600         ot reduce the number of shift/reduce conflicts in the grammar.
29601
29602 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
29603
29604         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29605         and put it here.
29606
29607         Get rid of old crufty code.
29608
29609         * rootcontext.cs: Use this to keep track of the parsed
29610         representation and the defined types available to the program. 
29611
29612         * gen-treedump.cs: adjust for new convention.
29613
29614         * type.cs: Split out the type manager, and the assembly builder
29615         from here. 
29616
29617         * typemanager.cs: the type manager will live here now.
29618
29619         * cil-codegen.cs: And the code generator here. 
29620
29621 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
29622
29623         * makefile: Fixed up for easy making.
29624
29625 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29626
29627         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29628         the 
29629
29630         (unary_expression): Expand pre_increment_expression and
29631         post_decrement_expression to reduce a shift/reduce.
29632
29633 2001-07-11  Simon Cozens
29634
29635         * cs-tokenizer.cs: Hex numbers should begin with a 0.
29636
29637         Improve allow_keyword_as_indent name.
29638
29639 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
29640
29641         * Adjustments for Beta2. 
29642
29643 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
29644
29645         * decl.cs: Added `Define' abstract method.
29646         (InTransit): new property, used to catch recursive definitions. 
29647
29648         * interface.cs: Implement `Define'. 
29649
29650         * modifiers.cs: Map Modifiers.constants to
29651         System.Reflection.TypeAttribute flags.
29652
29653         * class.cs: Keep track of types and user-defined types.
29654         (BuilderInit): New method for creating an assembly
29655         (ResolveType): New function to launch the resolution process, only
29656         used by interfaces for now.
29657
29658         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29659         that are inserted into the name space. 
29660
29661 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
29662
29663         * ARGH.  I have screwed up my tree so many times due to the use of
29664         rsync rather than using CVS.  Going to fix this at once. 
29665
29666         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
29667         load types.
29668
29669 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
29670
29671         * Experiment successful: Use System.Type rather that our own
29672         version of Type.  
29673
29674 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
29675
29676         * cs-parser.jay: Removed nsAliases from here.
29677
29678         Use new namespaces, handle `using XXX;' 
29679
29680         * namespace.cs: Reimplemented namespace handling, use a recursive
29681         definition of the class.  Now we can keep track of using clauses
29682         and catch invalid using clauses.
29683
29684 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
29685
29686         * gen-treedump.cs: Adapted for all the renaming.
29687
29688         * expression.cs (Expression): this class now has a Type property
29689         which returns an expression Type.
29690
29691         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29692         `Type', as this has a different meaning now in the base
29693
29694 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
29695
29696         * interface.cs, class.cs: Removed from all the sources the
29697         references to signature computation, as we can not do method
29698         signature computation during the parsing time, as we are not
29699         trying to solve at that point distinguishing:
29700
29701         class X {
29702                 void a (Blah x) {}
29703                 void a (NS.Blah x) {}
29704         }
29705
29706         Which depending on the context might be valid or not, as we do not
29707         know if Blah is the same thing as NS.Blah at that point.
29708
29709         * Redid everything so the code uses TypeRefs now instead of
29710         Types.  TypeRefs are just temporary type placeholders, that need
29711         to be resolved.  They initially have a pointer to a string and the
29712         current scope in which they are used.  This is used later by the
29713         compiler to resolve the reference to an actual Type. 
29714
29715         * DeclSpace is no longer a CIR.Type, and neither are
29716         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
29717         are all DeclSpaces, but no Types. 
29718
29719         * type.cs (TypeRefManager): This implements the TypeRef manager,
29720         which keeps track of all the types that need to be resolved after
29721         the parsing has finished. 
29722
29723 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
29724
29725         * ARGH.  We are going to have to store `foreach' as a class rather
29726         than resolving it, as we need to verify error 1579 after name
29727         resolution.   *OR* we could keep a flag that says `This request to
29728         IEnumerator comes from a foreach statement' which we can then use
29729         to generate the error.
29730
29731 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
29732
29733         * class.cs (TypeContainer.AddMethod): we now add methods to the
29734         MethodGroup instead of the method hashtable.  
29735
29736         * expression.cs: Add MethodGroup abstraction, which gets us one
29737         step closer to the specification in the way we handle method
29738         declarations.  
29739
29740         * cs-parser.jay (primary_expression): qualified_identifier now
29741         tried to match up an identifier to a local variable reference or
29742         to a parameter reference.
29743
29744         current_local_parameters is now a parser global variable that
29745         points to the current parameters for the block, used during name
29746         lookup.
29747
29748         (property_declaration): Now creates an implicit `value' argument to
29749         the set accessor.
29750
29751 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
29752
29753         * parameter.cs: Do not use `param' arguments as part of the
29754         signature, per the spec.
29755
29756 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
29757
29758         * decl.cs: Base class for classes, structs and interfaces.  This
29759         is the "Declaration Space" 
29760
29761         * cs-parser.jay: Use CheckDef for checking declaration errors
29762         instead of having one on each function.
29763
29764         * class.cs: Factor out some code for handling error handling in
29765         accordance to the "Declarations" section in the "Basic Concepts"
29766         chapter in the ECMA C# spec.
29767
29768         * interface.cs: Make all interface member classes derive from
29769         InterfaceMemberBase.
29770
29771 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
29772
29773         * Many things: all interfaces are parsed and generated in
29774         gen-treedump.  Support for member variables, constructors,
29775         destructors, properties, constants is there.
29776
29777         Beginning of the IL backend, but very little done, just there for
29778         testing purposes. 
29779
29780 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
29781
29782         * cs-parser.jay: Fix labeled statement.
29783
29784         * cs-tokenizer.cs (escape): Escape " and ' always.
29785         ref_line, ref_name: keep track of the line/filename as instructed
29786         by #line by the compiler.
29787         Parse #line.
29788
29789 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
29790
29791         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29792         to match the values in System.CodeDOM.
29793
29794         Divid renamed to Divide.
29795
29796         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29797         statements. 
29798         (Statements.set): remove.
29799
29800         * System.CodeDOM/CodeCatchClause.cs: always have a valid
29801         statements. 
29802
29803         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29804         falseStatements always have valid values. 
29805
29806         * cs-parser.jay: Use System.CodeDOM now.
29807