2008-07-07 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-07-07  Marek Safar  <marek.safar@gmail.com>
2
3         A fix for bug #406648
4         * cs-parser.jay: Report nullable use in mcs for some cases.
5
6 2008-07-07  Marek Safar  <marek.safar@gmail.com>
7
8         * ecore.cs: Improved argument mismatch error messages.
9
10 2008-07-07  Marek Safar  <marek.safar@gmail.com>
11
12         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
13
14 2008-07-07  Marek Safar  <marek.safar@gmail.com>
15
16         * expression.cs (TypeOf): Mutate type argument.
17
18 2008-07-04  Marek Safar  <marek.safar@gmail.com>
19
20         * class.cs: Report missing partial modifier for correct type.
21
22 2008-07-04  Marek Safar  <marek.safar@gmail.com>
23
24         * ecore.cs, expression.cs (VariableReference): Variable property is 
25         protected.
26
27 2008-07-04  Marek Safar  <marek.safar@gmail.com>
28
29         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
30         
31 2008-07-04  Marek Safar  <marek.safar@gmail.com>
32
33         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
34         method delegates.
35
36 2008-07-04  Marek Safar  <marek.safar@gmail.com>
37
38         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
39         anonymous method storey to an instance method when only "this" is hoisted.
40
41 2008-07-03  Marek Safar  <marek.safar@gmail.com>
42
43         A fix for bug #321615
44         * expression.cs: Pointer comparisons use unsigned operator.
45
46 2008-07-03  Marek Safar  <marek.safar@gmail.com>
47
48         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
49
50 2008-07-02  Marek Safar  <marek.safar@gmail.com>
51
52         A fix for bug #404905
53         * class.cs: Always initialize local unsafe variables.
54
55 2008-06-30  Marek Safar  <marek.safar@gmail.com>
56
57         A fix for bug #396987
58         * expression.cs (NewInitialize): Clear local temporary variable for next run
59
60 2008-06-27  Marek Safar  <marek.safar@gmail.com>
61
62         A fix for bug #401020
63         * ecore.cs: Both types and modifiers have to match for ref and out arguments
64
65 2008-06-27  Marek Safar  <marek.safar@gmail.com>
66
67         A fix for bug #398319
68         * cs-parser.jay: Implemented undocumented base access expression inside
69         anonymous types.
70
71 2008-06-26  Marek Safar  <marek.safar@gmail.com>
72
73         A fix for bug #404227
74         * cs-parser.jay: Parse namespace declaration using qualified identifier.
75
76 2008-06-26  Marek Safar  <marek.safar@gmail.com>
77
78         A fix for bug #404227
79         * convert.cs: Fixed explicit array to interface cast.
80
81 2008-06-26  Marek Safar  <marek.safar@gmail.com>
82
83         A fix for bug #403894
84         * delegate.cs: Mutate DelegateInvocation type.
85
86 2008-06-26  Marek Safar  <marek.safar@gmail.com>
87
88         A fix for bug #379348
89         * delegate.cs: Box a load of generic parameters.
90
91 2008-06-26  Marek Safar  <marek.safar@gmail.com>
92
93         * expression.cs: Add an array creation arguments mutate.
94
95 2008-06-26  Marek Safar  <marek.safar@gmail.com>
96
97         A fix for bug #386068
98         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
99         parameter.
100
101 2008-06-25  Marek Safar  <marek.safar@gmail.com>
102
103         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
104         CloneTo.
105
106 2008-06-25  Marek Safar  <marek.safar@gmail.com>
107
108         A fix for bug #403518
109         * delegate.cs: Type correctly anonymous method new invocation.
110
111 2008-06-24  Marek Safar  <marek.safar@gmail.com>
112
113         A fix for bug #394826
114         * anonymous.cs: Fully qualify members when resolving anonymous type internal
115         calls.
116
117 2008-06-24  Marek Safar  <marek.safar@gmail.com>
118
119         A fix for bug #394826
120         * anonymous.cs, iterators.cs: Construct generic storey only when is really
121         needed.
122
123 2008-06-24  Marek Safar  <marek.safar@gmail.com>
124
125         * class.cs: Clone indexer parameters for localized capturing.
126
127 2008-06-24  Marek Safar  <marek.safar@gmail.com>
128
129         A fix for bug #402379
130         * expression.cs: Don't crash when an object initializer resolve fails.
131
132 2008-06-24  Marek Safar  <marek.safar@gmail.com>
133
134         A fix for bug #402888
135         * expression.cs: Mutate conditional expression.
136
137 2008-06-24  Marek Safar  <marek.safar@gmail.com>
138
139         A fix for bug #401012
140         * class.cs: Keep StructLayout in shared container.
141
142 2008-06-24  Marek Safar  <marek.safar@gmail.com>
143
144         A fix for bug #400438
145         * decl.cs, class.cs: Only properties can be automatically implemented.
146
147 2008-06-24  Marek Safar  <marek.safar@gmail.com>
148
149         * statement.cs (ChangeToIterator): Copy also labels.
150
151 2008-06-23  Marek Safar  <marek.safar@gmail.com>
152
153         * ecore.cs: Pass type argument details to parent extension method.
154
155 2008-06-23  Marek Safar  <marek.safar@gmail.com>
156
157         A fix for bug #375966
158         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
159
160 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
161
162         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
163
164 2008-06-22  Marek Safar  <marek.safar@gmail.com>
165
166         A fix for bug #394347
167         * anonymous.cs: Cache compatible delegates as compatibility check produces
168         a new method every time.
169
170 2008-06-20  Marek Safar  <marek.safar@gmail.com>
171
172         * anonymous.cs: Propagate storey reference for single references.
173
174 2008-06-20  Marek Safar  <marek.safar@gmail.com>
175
176         A fix for bug #387615
177         * assign.cs, expression.cs: Correctly clone compound assignment.
178
179 2008-06-19  Marek Safar  <marek.safar@gmail.com>
180
181         A fix for bug #359611, #359604
182         * anonymous.cs: Mutate all types of hoisted parameters.
183
184 2008-06-19  Marek Safar  <marek.safar@gmail.com>
185
186         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
187         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
188         expression.cs, codegen.cs, statement.cs
189         
190         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
191         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
192         
193         ** Anonymous methods, lambda expressions rewrite **
194         
195         Anonymous expressions are now resolved when an explicit block is resolved 
196         and they don't require any registration procedure anymore. Further,
197         anonymous methods are defined when explicit block is emitted which allows
198         better control of whole process and opens possibilities for more
199         optimizations as well as alternative to reverse whole process.
200         
201         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
202         process consistent and to correctly emit hoisted generic methods when they
203         have at least 1 hoisted variable.
204         
205 2008-06-17  Martin Baulig  <martin@ximian.com>
206
207         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
208         iterator method.
209         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
210         virtual property; check it in Emit().
211         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
212         an iterator.
213         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
214         an iterator.
215         (Indexer.Define): Likewise.
216
217 2008-06-17  Marek Safar  <marek.safar@gmail.com>
218
219         * convert.cs: Don't use IsInterface on type arguments.
220         
221         * delegate.cs: DelegateInvocation uses MethodInfo.
222         
223         * parameter.cs: Removed IsTypeParameter.
224         
225         * generic-mcs.cs: More missing stuff.
226
227 2008-06-16  Martin Baulig  <martin@ximian.com>
228
229         * modifiers.cs
230         (Modifiers.DEBUGGER_HIDDEN): New public const.
231
232         * typemanager.cs
233         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
234
235         * class.cs
236         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
237         (AbstractPropertyEventMethod): Likewise.
238         (Constructor.Emit): Likewise.
239         (SourceMethod.SetCompilerGenerated): Removed.
240
241         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
242         on MoveNext().
243
244         * anonymous.cs
245         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
246         if we're an `IteratorHost'.
247         (AnonymousMethodMethod..ctor): Don't set
248         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
249         not on the method.
250
251 2008-06-16  Marek Safar  <marek.safar@gmail.com>
252
253         * statement.cs: Clean-up foreach statements.
254
255 2008-06-12  Marek Safar  <marek.safar@gmail.com>
256
257         * class.cs: Stop using public method which should not exist.
258
259 2008-06-11  Martin Baulig  <martin@ximian.com>
260
261         * location.cs
262         (Location.LookupFile): Add `CompilationUnit' argument; when given
263         a relative file name, make it relative to the directory the .cs
264         file is located in instead of using the current directory.
265
266 2008-06-11  Martin Baulig  <martin@ximian.com>
267
268         * class.cs
269         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
270         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
271         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
272         (SourceMethod.SetCompilerGenerated): Likewise.
273
274 2008-06-11  Marek Safar  <marek.safar@gmail.com>
275
276         * codegen.cs, driver: Only write symbol file when it's asked for.
277
278 2008-06-11  Marek Safar  <marek.safar@gmail.com>
279
280         * codegen.cs: Don't use assembly writer error handling for symbol writer.
281
282 2008-06-10  Martin Baulig  <martin@ximian.com>
283
284         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
285
286 2008-06-09  Marek Safar  <marek.safar@gmail.com>
287
288         A fix for bug #316290
289         * expression.cs: Include decimal operators in predefined table.
290         
291         * parameters.cs: More readonlyness.
292
293 2008-06-09  Marek Safar  <marek.safar@gmail.com>
294
295         A fix for bug #397213
296         * cs-parser.jay: One more missing current_local_parameters reset.
297
298 2008-06-09  Marek Safar  <marek.safar@gmail.com>
299
300         A fix for bug #396633
301         * class.cs: Host backing field in partial container.
302
303 2008-06-09  Marek Safar  <marek.safar@gmail.com>
304
305         A fix for bug #397068
306         * expression.cs: Check both operand types when predefined operator is used.
307
308 2008-06-05  Martin Baulig  <martin@ximian.com>
309
310         Merged the `debugger-kahalo' branch.
311
312         * class.cs
313         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
314         we're an iterator method.
315         (SourceMethod): Reflect latest symbol writer changes;
316         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
317         now `start_row' and `end_row'.
318         (Constructor.Emit): Fix the logic whether to emit symbol information.
319
320         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
321         generated methods.
322
323         * location.cs
324         (CompilationUnit): New public class; derives from `SourceFile'.
325         (SourceFileEntry.DefineSymbolInfo): New public method.
326         (SourceFileEntry.SetChecksum): New public method.
327         (Location): Encode hidden line numbers by using `column == 255';
328         the .ctor now accepts `column == -1' to mark a hidden line number.
329         (Location.Hidden): New public property.
330         (Location.CheckPoint): Add `CompilationUnit'.
331         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
332         (Location.Push): Add `CompilationUnit compile_unit' argument.
333         (Location.CompilationUnit): New public property.
334
335         * statement.cs
336         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
337
338         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
339
340         * driver.cs: `SourceFile' -> `CompilationUnit'.
341
342         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
343
344         * namespace.cs: `SourceFile' -> `CompilationUnit'.
345
346         * cs-tokenizer.cs: Add support for `#pragma checksum' and
347         `#line hidden'.
348
349         * symbolwriter.cs
350         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
351         new symbol writer API to also pass the file.
352
353 2008-06-05  Marek Safar  <marek.safar@gmail.com>
354
355         * statement.cs: Emit catch variable assignment using variable expression.
356         
357 2008-06-05  Marek Safar  <marek.safar@gmail.com>
358
359         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
360         with other variable types.
361
362 2008-06-04  Marek Safar  <marek.safar@gmail.com>
363
364         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
365         GetLength method emit, it breaks resolve rules.
366         
367 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
368             Marek Safar  <marek.safar@gmail.com>
369                         
370         A fix for bug #395542
371         * cs-parser.jay: The trailing comma is allowed in anonymous type member
372         declaration.
373         
374 2008-06-02  Marek Safar  <marek.safar@gmail.com>
375
376         A fix for bug #395287
377         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
378
379 2008-05-31  Marek Safar  <marek.safar@gmail.com>
380
381         A fix for bug #395845
382         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
383         non-nullable parameter type.
384         
385 2008-05-31  Marek Safar  <marek.safar@gmail.com>
386
387         * class.cs: Handle contructor initializer as a statement in top-level block.
388
389 2008-05-30  Marek Safar  <marek.safar@gmail.com>
390
391         * attribute.cs: Don't mix old and new corlib types when emitting corlib
392         security attributes.
393
394 2008-05-24  Marek Safar  <marek.safar@gmail.com>
395
396         * ecore.cs, expression.cs: Small IVariable refactoring.
397
398 2008-05-22  Marek Safar  <marek.safar@gmail.com>
399
400         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
401
402 2008-05-21  Marek Safar  <marek.safar@gmail.com>
403
404         * cs-parser.jay: Removed redundant catch type check.
405
406 2008-05-21  Marek Safar  <marek.safar@gmail.com>
407
408         A fix for bug #390372
409         * nullable.cs: Set correct return type.
410
411 2008-05-21  Marek Safar  <marek.safar@gmail.com>
412
413         A fix for bug #391062
414         * typemanager.cs: Fixed crash when comparing null types.
415
416 2008-05-21  Marek Safar  <marek.safar@gmail.com>
417
418         A fix for bug #391871
419         * cs-parser.jay: Better error handling for invalid catch type.
420
421 2008-05-20  Marek Safar  <marek.safar@gmail.com>
422
423         A fix for bug #392155
424         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
425
426 2008-05-15  Marek Safar  <marek.safar@gmail.com>
427
428         A fix for bug #390666
429         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
430         expressions.
431
432 2008-05-15  Marek Safar  <marek.safar@gmail.com>
433
434         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
435         in getter.
436
437 2008-05-13  Marek Safar  <marek.safar@gmail.com>
438
439         A fix for bug #389625
440         * delegate.cs, generic.cs: Some progress on method group return type
441         inference.
442
443 2008-05-13  Marek Safar  <marek.safar@gmail.com>
444
445         A fix for bug #378419
446         * namespace.cs: Inspect also parent namespaces not only namespace entries.
447
448 2008-05-12  Marek Safar  <marek.safar@gmail.com>
449
450         * class.cs (Constructor): Added IsCompilerGenerated.
451
452 2008-05-12  Marek Safar  <marek.safar@gmail.com>
453
454         * expression.cs: Enum binary operators can accept non-enum operand only when
455         is implicitly convertible to underlying type.
456
457 2008-05-12  Marek Safar  <marek.safar@gmail.com>
458
459         A fix for bug #389272
460         * support.cs: Workaround System.InvalidOperationException for enums.
461
462 2008-05-12  Marek Safar  <marek.safar@gmail.com>
463
464         A fix for bug #389073
465         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
466
467 2008-05-10  Marek Safar  <marek.safar@gmail.com>
468
469         * driver.cs: Split Parse.
470         
471         * location.cs (LookupFile): Uses string.Empty.
472
473 2008-05-07  Marek Safar  <marek.safar@gmail.com>
474
475         * expression.cs, parameter.cs: Small ParameterReference clean up.
476
477 2008-05-07  Marek Safar  <marek.safar@gmail.com>
478
479         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
480         hack. Fixes #387502.
481
482 2008-05-06  Martin Baulig  <martin@ximian.com>
483
484         * class.cs (Constructor.Emit): Fix the logic whether to emit
485         symbol information.
486
487 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
488
489         Fix #385503
490         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
491         InvalidOperationException when the iterator is before the start or
492         after the end.
493
494 2008-05-06  Marek Safar  <marek.safar@gmail.com>
495
496         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
497         when left is nullable type.
498
499 2008-05-06  Marek Safar  <marek.safar@gmail.com>
500
501         A fix for bug #386628
502         * expression.cs (LocalVariableReference): Continue in resolving when
503         variable is not assigned.
504
505 2008-05-05  Marek Safar  <marek.safar@gmail.com>
506
507         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
508         nullable operations.
509
510 2008-05-04  Marek Safar  <marek.safar@gmail.com>
511
512         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
513         it saves many redundant temporary variables for nullable operations.
514
515 2008-05-03  Marek Safar  <marek.safar@gmail.com>
516
517         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
518         
519         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
520         method.
521         
522         * nullable.cs: Constant coalescing operator optimizations.
523
524 2008-05-03  Marek Safar  <marek.safar@gmail.com>
525
526         * constant.cs: Use unsigned conversion for values which are unsigned only.
527
528 2008-05-03  Marek Safar  <marek.safar@gmail.com>
529
530         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
531         coalescing operator as it should be.
532
533 2008-05-02  Marek Safar  <marek.safar@gmail.com>
534
535         A fix for bug #371016
536         * expression.cs: All predefined delegate operators require implicit method
537         group conversion.
538         
539 2008-05-02  Marek Safar  <marek.safar@gmail.com>
540
541         * constant.cs: Emit long constant as uint when fits the range.
542         
543         * convert.cs, expression.cs: Fixed few unsafe conversions.
544
545 2008-05-02  Marek Safar  <marek.safar@gmail.com>
546
547         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
548
549 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
550
551         Fix #385758
552         * convert.cs (ImplicitNumericConversion): Don't modify the type of
553         'expr'.
554         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
555
556 2008-05-01  Marek Safar  <marek.safar@gmail.com>
557
558         * constant.cs, literal.cs: IsLiteral property for error reporting.
559         
560         * ecore.cs, expression.cs: Implemented Property expression.
561
562 2008-05-01  Marek Safar  <marek.safar@gmail.com>
563
564         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
565         
566         * nullable.cs: Implemented nullable coalescing null operator.
567
568         * ecore.cs, expression.cs: Expression trees work.
569
570 2008-05-01  Marek Safar  <marek.safar@gmail.com>
571
572         * ecore.cs: CreateExpressionTree is finally abstract.
573
574         * expression.cs, linq.cs: Updated.
575
576 2008-05-01  Marek Safar  <marek.safar@gmail.com>
577
578         * expression.cs, ecore.cs: Block base access expression inside expression
579         tree.
580
581 2008-05-01  Marek Safar  <marek.safar@gmail.com>
582
583         A fix for bug #385058
584         * expression.cs: User-defined operator implementations always take
585         precedence over predefined operator implementations.
586
587 2008-04-30  Marek Safar  <marek.safar@gmail.com>
588
589         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
590         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
591         expression tree conversions.
592         
593 2008-04-30  Marek Safar  <marek.safar@gmail.com>
594
595         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
596         operators method details to Operator class.
597
598 2008-04-30  Marek Safar  <marek.safar@gmail.com>
599
600         * anonymous.cs: Pass unsafe flags to anonymous container.
601         
602         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
603         inside expression tree.
604
605 2008-04-29  Martin Baulig  <martin@ximian.com>
606
607         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
608         (Tokenizer.PopPosition): Also restore the `line'.
609
610 2008-04-29  Marek Safar  <marek.safar@gmail.com>
611
612         * delegate.cs: Implemented Invoke expression.
613
614 2008-04-29  Marek Safar  <marek.safar@gmail.com>
615
616         * expression.cs: Fixed equality reference comparison regression.
617
618 2008-04-29  Marek Safar  <marek.safar@gmail.com>
619
620         * ecore.cs: Clean up EmptyCast hack.
621         
622         * expression.cs, nullable.cs: Implemented enum binary and unary operations
623         using correct conversion rules. Also fixes #383993.
624
625 2008-04-28  Martin Baulig  <martin@ximian.com>
626
627         * class.cs (Constructor.Emit): Don't emit debugging information
628         for generated default .ctor's.
629
630 2008-04-28  Marek Safar  <marek.safar@gmail.com>
631
632         * convert.cs: Empty-cast ushort to int conversion.
633
634 2008-04-28  Marek Safar  <marek.safar@gmail.com>
635
636         A fix for bug #384191
637         * ecore.cs, expression.cs: Fixed expression cloning.
638
639 2008-04-28  Marek Safar  <marek.safar@gmail.com>
640
641         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
642
643 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
644
645         Fix #381559, test-638.cs, test-639.cs
646         * assign.cs (CompoundAssign.Helper): New wrapper.
647         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
648         access.
649         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
650         Pass unconverted expressions to the params array creation expression.
651         (FieldExpr.EmitAssign): Don't special-case StringConcat.
652         (PropertyExpr.EmitAssign): Likewise.
653         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
654         element if it is of kind CompoundAssign.Helper.
655         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
656         first before anything else.
657         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
658         (ArrayAccess.LoadArrayAndArguments): Simplify.
659
660 2008-04-27  Marek Safar  <marek.safar@gmail.com>
661
662         * expression.cs: Fixed cloning of typeof(void).
663
664 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
665
666         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
667         (Assign.Emit): Likewise.  Move it to ...
668         (CompoundAssign.DoResolve): ... here and ...
669         (CompoundAssign.Emit): ... here.
670         (EventAddOrRemove): New helper to handle += and -= on events, and
671         avoid the use of BinaryDelegates.
672         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
673         (EventExpr.EmitAddOrRemove): Improve.
674         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
675
676         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
677         create VarExprs for 'foo.bar.var'.
678         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
679         is a highly inappropriate name for its functionality.
680
681 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
682
683         Simplify handling of multiple assignments
684         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
685         inheritable-only.
686         (SimpleAssign): New.  Class to be used for normal assignments.
687         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
688         * expression.cs, parameter.cs, statement.cs: Likewise.
689
690 2008-04-25  Marek Safar  <marek.safar@gmail.com>
691
692         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
693         for incompatible underlying types, more to come, uff.
694
695 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
696
697         Fix gtest-388.cs
698         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
699         Handle 'leave_copy'.
700
701 2008-04-25  Marek Safar  <marek.safar@gmail.com>
702
703         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
704
705 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
706
707         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
708         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
709         * statement.cs (While, Do, For): Allow test to have side effects.
710         (For.DoEmit): Always emit InitStatement.
711
712         Fix test-635.cs
713         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
714         Always create SideEffectConstant.
715         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
716         of type EnumConstant.
717
718         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
719         Handle 'right' being SideEffectConstant of type 'bool'.
720
721         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
722         Use left.EmitBranchable instead of open coding it, so as to
723         improve optimization opportunities.
724
725         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
726
727         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
728         assumptions.
729         (Expression.EmitSideEffect): Document.
730
731 2008-04-23  Marek Safar  <marek.safar@gmail.com>
732
733         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
734
735 2008-04-23  Marek Safar  <marek.safar@gmail.com>
736
737         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
738
739 2008-04-23  Marek Safar  <marek.safar@gmail.com>
740
741         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
742         conversion to expression tree.
743
744 2008-04-23  Marek Safar  <marek.safar@gmail.com>
745
746         * ecore.cs: Removed unused expression.
747
748 2008-04-22  Marek Safar  <marek.safar@gmail.com>
749
750         * expression.cs: Implemented NegateChecked and New expressions.
751
752 2008-04-22  Marek Safar  <marek.safar@gmail.com>
753
754         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
755
756 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
757
758         Fix #351102
759         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
760         needing final 'ret' instruction.
761
762 2008-04-22  Marek Safar  <marek.safar@gmail.com>
763
764         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
765
766 2008-04-21  Marek Safar  <marek.safar@gmail.com>
767
768         * expression.cs: Emit ldnull and not null expression as an instance argument
769          of static method expression calls.
770
771 2008-04-21  Marek Safar  <marek.safar@gmail.com>
772
773         A fix for bug #378200
774         * expression.cs: Fixed crash when creating parameterless expression tree
775         method call.
776
777 2008-04-21  Marek Safar  <marek.safar@gmail.com>
778
779         A fix for bug #375297
780         * anonymous.cs: Fixed crash when inferring from null argument anonymous
781         method.
782
783 2008-04-21  Marek Safar  <marek.safar@gmail.com>
784
785         A fix for bug #377596
786         * decl.cs, class.cs: Emit delegate type argument attributes.
787
788 2008-04-21  Marek Safar  <marek.safar@gmail.com>
789
790         A fix for bug #365314
791         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
792         
793 2008-04-21  Marek Safar  <marek.safar@gmail.com>
794
795         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
796         only.
797
798 2008-04-21  Marek Safar  <marek.safar@gmail.com>
799
800         * generic.cs (TypeParameter): Removed redundant location.
801
802 2008-04-19  Marek Safar  <marek.safar@gmail.com>
803
804         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
805         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
806         FullNamedExpression in all declaration type expression, statements will come
807         later.
808
809 2008-04-18  Marek Safar  <marek.safar@gmail.com>
810
811         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
812         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
813
814 2008-04-18  Marek Safar  <marek.safar@gmail.com>
815
816         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
817         code.
818
819 2008-04-17  Marek Safar  <marek.safar@gmail.com>
820
821         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
822         constraints.
823
824 2008-04-17  Marek Safar  <marek.safar@gmail.com>
825
826         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
827         name expressions.
828         Also fixes #340463.
829
830 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
831
832         Hook up 'EmitSideEffect'
833         * constant.cs (Constant.EmitSideEffect): New.
834         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
835         (SideEffectConstant.EmitSideEffect): New.
836         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
837         unconditional branch in EmitBranchable.
838         (FieldExpr.EmitBranchable): New.
839         * expression.cs (Unary.EmitSideEffect): New.
840         (Binary.EmitSideEffect): New.
841         (VariableReference.EmitSideEffect): New.  Do nothing.
842
843 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
844
845         Introduce 'EmitSideEffect'
846         * ecore.cs (Expression.EmitSideEffect): New.
847         (TypeCast): Rename from EmptyCast.
848         (EmptyCast): New.
849         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
850         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
851         * convert.cs, nullable.cs: Update to changes.
852
853 2008-04-16  Marek Safar  <marek.safar@gmail.com>
854
855         * class.cs, cs-parser.jay: Early check for base types expression.
856
857 2008-04-16  Marek Safar  <marek.safar@gmail.com>
858
859         * decl.cs (MemberName): Declare PrettyName as obsolete.
860
861 2008-04-16  Marek Safar  <marek.safar@gmail.com>
862
863         * namespace.cs: Use MemberName comparison.
864
865 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
866
867         Fix build break
868         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
869         FullName.
870         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
871         (MemberName.FullyQualifiedName): New.  Provides the functionality
872         that users assume FullName would have.
873         * ecore.cs, namespace.cs: Update to changes.
874
875         * statement.cs (Using.assign): Make into ExpressionStatement.
876         (Using.EmitPreTryBody): Simplify.
877
878 2008-04-16  Marek Safar  <marek.safar@gmail.com>
879
880         * report.cs: ColorFormat is protected.
881         
882         * rootcontext.cs: Unused fields clean-up.
883         
884         * namespace.cs: Made UsingEntry name private.
885
886 2008-04-16  Marek Safar  <marek.safar@gmail.com>
887
888         * cs-tokenizer.cs, location.cs: Removed unused field.
889
890 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
891             Raja R Harinath  <harinath@hurrynot.org>
892
893         Fix #379822
894         * constant.cs (SideEffectConstant.value): Rename from 'left'.
895         (SideEffectConstant.side_effect): Rename from 'right'.
896         (SideEffectConstant..ctor): Normalize 'side_effect'.
897         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
898         value of this constant.
899         * cfold.cs: Update to changes.
900
901 2008-04-15  Marek Safar  <marek.safar@gmail.com>
902
903         * cs-paser.jay: Removed unused variable.
904         
905         * driver.cs: Made Compile instance method.
906
907 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
908
909         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
910
911 2008-04-15  Marek Safar  <marek.safar@gmail.com>
912
913         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
914
915 2008-04-13  Jb Evain  <jbevain@novell.com>
916
917         * namespace.cs: update the System.Core fullname for 2.1
918         * driver.cs: update the list of required assemblies for 2.1.
919         Merged from the Moonlight 2 branch.
920
921 2008-04-11  Marek Safar  <marek.safar@gmail.com>
922
923         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
924         types and user defined operators. User operators arguments has to be checked
925         for null value before invocation, which also means no operator is called
926         when any argument is not convertible to unwrapped nullable type.
927         
928 2008-04-09  Marek Safar  <marek.safar@gmail.com>
929
930         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
931         of Unary expressions to follow operator overloading rules precisely.
932         Also fixes #321794, #323794
933         
934 2008-04-08  Marek Safar  <marek.safar@gmail.com>
935
936         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
937         expression.
938         
939 2008-04-08  Marek Safar  <marek.safar@gmail.com>
940
941         * expression.cs, ecore.cs: Implemented MemberInit expression.
942         
943 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
944
945         Fix mono/tests/exception4.cs
946         * statement.cs (ExceptionStatement, TryCatch): Revert to using
947         ec.NeedReturnLabel () rather emitting a 'nop'.
948
949         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
950         simple heuristic.
951         (TryCatch.SomeCodeFollows): Likewise.
952         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
953         for 'break', 'continue' and 'return' statements inside a try.
954         We're fairly sure that the generated IL stream will have more
955         instructions textually following the try.
956         (FlowBranchingTryCatch): Likewise.
957
958         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
959         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
960         overrides.
961
962         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
963         wrapper -- forward everything to CollectionForeach.
964         (CollectionForeach.NonDisposableWrapper): New.
965         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
966         instead of a pop + branch to end.
967
968 2008-04-07  Marek Safar  <marek.safar@gmail.com>
969
970         A fix for bug #377485
971         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
972         Propagate location for extension method groups. Report conversion failure at
973         right place.
974
975 2008-04-07  Marek Safar  <marek.safar@gmail.com>
976
977         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
978         ListInit and Field expressions.
979
980 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
981
982         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
983         Since $PC is always -1 inside the body of MoveNext, the fault
984         handler is a no-op.
985         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
986         * statement.cs (ExceptionStatement.emit_finally): Likewise.
987         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
988
989         The denouement!  Fix #324708
990         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
991         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
992         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
993         'finally' inside the finally clause.
994
995         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
996         inside an iterator.  Don't emit the body of the 'finally' inside
997         the finally clause yet.
998
999         Use the ResumableStatement infrastructure for MoveNext ()
1000         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
1001         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
1002         'old_resume_points'.  Move dispatcher upfront.
1003         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
1004         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
1005         in an enumerator.  This encodes the main fix in this patch series
1006         -- we can only jump into the first instruction of a try from the
1007         outside, but we want to emit try/finally regions in iterators and
1008         resume in the middle of them.
1009
1010 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
1011
1012         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
1013         of NeedReturnLabel here.
1014
1015         Introduce a common point for emitting try/finally to IL
1016         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
1017         features of the various subclasses, which are now driven by ...
1018         (ExceptionStatement.EmitPreTryBody): ... this and ...
1019         (ExceptionStatement.EmitTryBody): ... this and the original
1020         EmitFinallyBody.
1021         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
1022         Remove DoEmit and update to follow above protocol.
1023
1024         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
1025         of the dispatcher are the same, skip emitting the 'switch'.
1026         * iterator.cs (Iterator.EmitDispose): Update to changes.
1027
1028         Clean up handling of 'using' statement
1029         * statement.cs (UsingTemporary): New.  Carved out of ...
1030         (Using): ... this.  Simplify drastically.  Handle exactly
1031         one variable.
1032         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
1033         or Using as appropriate.  If there are multiple variable declared,
1034         create nested Using statements.
1035         (resource_acquisition): Kill.
1036
1037         * statement.cs (ExceptionStatement.EmitForDispose): Use
1038         EmitFinallyBody, not EmitFinally.
1039
1040         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
1041         * iterator.cs: Update to changes.
1042
1043         Start using the ResumableStatement infrastructure
1044         * statement.cs (ResumeableStatement.PrepareForDispose): New.
1045         (ResumableStatement.EmitForDispose): New.
1046         (ExceptionStatement): Override them.
1047         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
1048         EmitForDispose to create the body of the Dispose method.  Don't
1049         use OldResumePoint.
1050
1051         * iterator.cs (Iterator.AddResumePoint): Move here from ...
1052         * statement.cs (Toplevel.AddResumePoint): ... here.
1053         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
1054         * flowanalysis.cs (FlowBranchingIterator): New.
1055         * codegen.cs (EmitContext): Update to changes.
1056
1057         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
1058         (Iterator.old_resume_points): Rename from 'resume_points'.
1059         (Iterator.MoveNextStatement): Remove unused class.
1060
1061         New infrastructure for try/finally in iterators (still unused)
1062         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
1063         (FlowBranchingToplevel.AddResumePoint): Hook into
1064         ToplevelBlock.AddResumePoint.
1065         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
1066         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
1067         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
1068         resume points and assign program-counter values.
1069         (ExceptionBlock.AddResumePoint): Collect resume points for
1070         de-muxer at the top of try block.
1071         * iterators.cs (Yield.CheckContext): Simplify.
1072         (Yield.Resolve): Use FlowBranching.AddResumePoint.
1073
1074 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
1075
1076         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
1077         argument to an ExitStatement.
1078         (FlowBranchingException): Refactor saved origins code.
1079         * statement.cs (ExitStatement): Update to cahges.
1080         * iterator.cs (YieldBreak): Likewise.
1081
1082         * statement.cs (ResumableStatement): New.  Common base class for
1083         YieldReturn and ExceptionStatement.
1084         (ExitStatement): New.  Common base class for Return and YieldBreak.
1085         (Return): Update to changes.
1086         * iterator.cs (YieldBreak): Likewise.
1087         * lambda.cs (ContextualReturn): Likewise.
1088
1089         Fix #377028
1090         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
1091         emit a meaningful error message.
1092
1093         Fix #324765, #319508
1094         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
1095         (VariableInfo.SetAssigned): Set it.
1096         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
1097         determine if CS0219 or CS0168 is appropriate.  Don't use
1098         flow-analysis information.
1099         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
1100         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
1101         (EmitContext.EndFlowBranching): ... this.
1102
1103 2008-04-03  Marek Safar  <marek.safar@gmail.com>
1104
1105         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
1106
1107 2008-04-03  Marek Safar  <marek.safar@gmail.com>
1108
1109         A fix for bug #376508
1110         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
1111         ImplicitConversionExists.
1112
1113 2008-04-03  Marek Safar  <marek.safar@gmail.com>
1114
1115         * expression.cs (Binary): Added remaining binary operators to expression
1116         tree builder.
1117
1118         * nullable.cs: Optimize shift with null argument.
1119
1120 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
1121
1122         Fix minor IL regression
1123         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
1124         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
1125         * cs-parser.jay (try_statement): Update to changes.
1126
1127         * statement.cs (TryFinally.need_exc_block): Delete.
1128         (TryFinally): Update to changes.
1129
1130         Now all ExceptionStatements are unconditional
1131         * statement.cs (CollectionForeach.DisposableWrapper): New.
1132         Extract out the try/finally code into a new wrapper.
1133         (CollectionForeach.Resolve): Use it to simplify the code.
1134
1135 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
1136
1137         Start at simplifying ExceptionStatement semantics a bit
1138         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
1139         * cs-parser.jay (try_statement): Update to changes.
1140         (opt_catch_clauses): Remove.
1141         * flowanalysis.cs: Update to changes.
1142         (FlowBranching.BranchingType.TryCatch): New.
1143         (FlowBranchingTryCatch): New.
1144
1145         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
1146         (FlowBranching.CreateBranching): Update to changes.
1147         (FlowBranchingBlock.AddSibling): Add sanity check.
1148         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
1149         Update to changes.
1150
1151         * iterators.cs (Iterator.MarkFinally): Remove.
1152         * statement.cs (ExceptionStatement): Update to changes.
1153
1154         Add support for skipping over finally blocks at runtime.  First
1155         in a series to fix #324708
1156         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
1157         (Iterator.EmitMoveNext): Initialize it.
1158         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
1159         branch over the body of the 'finally' clause.
1160
1161 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
1162
1163         Avoid lopsided use of Foo/DoFoo names
1164         * statement.cs (ExpressionStatement.EmitFinallyBody):
1165         Rename from EmitFinally.
1166         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
1167         * iterator.cs: Update to changes.
1168
1169 2008-04-02  Marek Safar  <marek.safar@gmail.com>
1170
1171         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
1172         based on UserOperatorCall. More binary nullable operators clean up.
1173
1174 2008-04-02  Martin Baulig  <martin@ximian.com>
1175
1176         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
1177
1178 2008-04-02  Marek Safar  <marek.safar@gmail.com>
1179
1180         * nullable.cs: Merge user and empty conversions when lifting expression
1181         trees.
1182         
1183         * expression.cs (StringConcat): Implemented expression tree representation.
1184
1185 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1186
1187         * nullable.cs: When lifting null literal and a user operator exists, no call 
1188         is made.
1189         
1190 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1191
1192         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
1193         null.
1194
1195 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1196
1197         * nullable.cs, expression.cs: Use namespace instead heavily nested
1198         monster abstract class.
1199
1200 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1201
1202         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
1203         lifting of null literal and user operators. Clean up of some temporary
1204         nullable hacks.
1205
1206 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
1207
1208         Fix #368224, test-629.cs
1209         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
1210         if it crossed an unwind-protect boundary.
1211         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
1212         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
1213         inside an unwind-protected region.
1214         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
1215         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
1216         'leave' instead of a 'br' if unwind-protected.
1217         (Iterator.EmitYieldBreak): Likewise.
1218
1219 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
1220
1221         * driver.cs: Only define versioninfo resources if no win32 resource
1222         file was specified.
1223
1224 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1225
1226         A fix for bug #372375
1227         * convert.cs: Fixed boxing of nullable types.
1228
1229 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1230
1231         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
1232         type.
1233
1234 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1235
1236         A fix for bug #374619
1237         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
1238         
1239 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1240
1241         * lambda.cs: Check return type only for invocation.
1242         
1243 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1244
1245         A fix for bug #374214
1246         * ecore.cs: Correctly report argument type mismatch.
1247
1248 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1249
1250         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
1251         and not rely on broken IsEnum.
1252
1253 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1254
1255         * nullable.cs: New file, extracted from generic.cs.
1256         
1257         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1258
1259 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1260
1261         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1262         predefined comparison operators and null literals.
1263         
1264         * report.cs: New warning ID.
1265         
1266 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1267
1268         A fix for bug #370577
1269         * lambda.cs: Check return type too.
1270
1271 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1272
1273         A fix for bug #372846
1274         * class.cs: Automatic properties can be declared as unsafe.
1275
1276 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1277
1278         * location.cs: Use string based concatenation.
1279         
1280         * expression.cs: LiftedBinaryOperator is gmcs only.
1281         
1282 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1283
1284         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1285         conversions rules and expression trees.
1286
1287 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1288
1289         * delegate.cs: Use extension method source as delegate target.
1290
1291 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1292
1293         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1294         binary operations to be purely based on binary operations and optimized
1295         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1296         and other ET refactoring.
1297         
1298         * typemanager.cs: Fixed warning.
1299         
1300 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1301
1302         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1303         
1304         * symbolwriter.cs: Fixed.
1305
1306 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1307
1308         * anonymous.cs, driver.cs: Reset anonymous types counters.
1309
1310 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1311
1312         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1313         
1314         * class.cs: Use fullname for all type member definitions.
1315         
1316 2008-02-19  Martin Baulig  <martin@ximian.com>
1317
1318         * class.cs
1319         (IMethodData.EmitExtraSymbolInfo): New interface method.
1320         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1321         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1322         interface method here as an empty public virtual method.
1323
1324         * anonymous.cs
1325         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1326         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1327         CodeGen.SymbolWriter.SetRealMethodName().       
1328
1329 2008-02-18  Martin Baulig  <martin@ximian.com>
1330
1331         * anonymous.cs
1332         (ScopeInfo.EmitType): Override this and emit debugging
1333         information for captured variables.
1334         (RootScopeInfo.EmitType): Override this and emit symbol
1335         information for a captured `this'.
1336
1337 2008-02-15  Martin Baulig  <martin@ximian.com>
1338
1339         * iterators.cs: Emit debugging info.
1340
1341         * codegen.cs
1342         (EmitContext.Flags): Add `OmitDebuggingInfo'.
1343         (EmitContext.OmitDebuggingInfo): New public property.
1344
1345         * statement.cs
1346         (While): Override Emit() and don't emit symbol info there; do it
1347         inside DoEmit() instead.
1348         (Block.Emit): Omit symbol information while emitting the scope
1349         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
1350         block logic.
1351         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1352         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1353         .ctor to make `IsIterator' work.
1354
1355 2008-03-14  Martin Baulig  <martin@ximian.com>
1356
1357         * symbolwriter.cs: Added the new symbol writer function from the
1358         debugger's `terrania' branch; temporarily enclose them inside
1359         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1360         my vacations.
1361
1362 2008-03-14  Martin Baulig  <martin@ximian.com>
1363
1364         * symbolwriter.cs
1365         (SymbolWriter): Make this a public static class.
1366
1367         * codegen.cs
1368         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1369         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1370
1371 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1372
1373         A fix for bug #370577
1374         * statement.cs, lambda.cs: Added extra limitations when dealing with void
1375         return type.
1376         
1377 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1378
1379         * typemanager.cs (CSharpName): Made 250 times faster.
1380
1381 2008-03-13  Marek Safar  <marek.safar@gmail.com>
1382
1383         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1384         
1385 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1386
1387         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1388         crash when predefined field does not exist.
1389         
1390 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1391
1392         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1393         
1394 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1395
1396         * class.cs (FixedField): Don't crash when contructors are missing.
1397
1398 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1399
1400         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1401         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1402         check internal types accessibility for internal and external types.
1403         Replaced EnumToUnderlying by GetEnumUnderlyingType.
1404
1405 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1406
1407         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1408         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1409         attribute.cs, statement: Use corect instance of predefined types (work
1410         related to #364674).
1411
1412 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1413
1414         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1415         
1416 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1417
1418         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
1419         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1420         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1421         predefined types clean up, delayed predefined types members initialization
1422         (work related to #364674).
1423
1424 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1425
1426         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1427         
1428 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1429
1430         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1431         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1432         predefined types clean up (work related to #364674).
1433
1434 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1435
1436         * ecore.cs: Print an error message instead of throwing exception.
1437         
1438 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1439
1440         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1441         expression.cs, statement.cs: Unififed null literal representation.
1442
1443 2008-03-03  Marek Safar  <marek.safar@gmail.com>
1444
1445         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1446         expression.cs: Refactored binary operators resolve phase and improved speed.
1447         The nullable code is still missing and won't work correctly, more fixes
1448         required.
1449
1450         It also fixes #323726, #324312, #324248, and many other unreported issues.
1451
1452 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
1453
1454         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
1455         instead of 'gmcs'.
1456
1457 2008-02-27  Marek Safar  <marek.safar@gmail.com>
1458
1459         * ecore.cs: Clean-up and split BetterConversion.
1460         
1461 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
1462
1463         Fix #363791
1464         * enum.cs (EnumMember.Value): Only access 'value' if
1465         ResolveValue says it's ok.
1466         (EnumMember.DoResolveValue): Don't set prev_member.value.
1467         (Enum.GetDefinition): Reverse arguments of Equals --
1468         EnumMember.Value can return 'null'.
1469
1470         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1471
1472 2008-02-22  Marek Safar  <marek.safar@gmail.com>
1473
1474         * generic.cs, expression.cs: More ongoing work on expression trees.
1475         
1476 2008-02-21  Marek Safar  <marek.safar@gmail.com>
1477
1478         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1479         handle missing matches when mutiple operators exist.
1480         
1481 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1482
1483         A fix for bug #363218
1484         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1485         initializers.
1486         
1487 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1488
1489         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1490         update. This time to deal correctly with SideEffectConstant expression used
1491         as an argument for another constant folding.
1492
1493 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
1494
1495         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1496         MethodBuilder.
1497
1498 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1499
1500         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1501
1502 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1503
1504         A fix for bug #328136
1505         * expression.cs: Do not fold immediately LogicalAnd operators when the left
1506         side is a false constant, because we still need to evaluate the right-hand
1507         side.
1508
1509         * statement.cs (If): Emit two types of boolean constants (simple constant,
1510         side-effect constant).
1511
1512 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1513
1514         * constant.cs (SideEffectConstant): Don't emit boolean constant.
1515
1516         * expression.cs: Fold immediately LogicalAnd operators when both sides are
1517         constants.
1518
1519 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1520
1521         A fix for bug #361457
1522         * ecore.cs (IsApplicable): Params methods have lower priority.
1523
1524         * support.cs: Return correct parameter modifier for params types.
1525
1526 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1527
1528         * generic.cs (TypeParameter): Cache attribute target name.
1529
1530         * support.cs: Removed unused variable.
1531
1532         * typemanager.cs: Removed debugging leftover.
1533
1534         * ecore.cs: Use local type instead of a property;
1535
1536         * class.cs (VerifyMembers): Consider also parent to test whether type member
1537         is local or public.
1538
1539         * expression.cs (FullMethodDesc): Removed.
1540
1541         * attribute.cs (IsValidArgumentType): Made static.
1542
1543 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
1544
1545         Cleanup to be more readable.
1546         * Makefile (GMCS_PROFILE): Remove.
1547         (COMPILER_NAME): New helper.
1548
1549 2008-02-15  Miguel de Icaza  <miguel@novell.com>
1550
1551         * cs-tokenizer.cs: if a conditional expression happens inside a
1552         (...) this also means that we do not need to de-ambiguate between
1553         an parenthesized expression and a cast.
1554
1555         Fixes 346484.
1556
1557         * constant.cs (SideEffectConstant): a constant value that happens
1558         to have a side effect.
1559
1560         Fixes the build regressions introduced by the fix for #359789
1561
1562 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
1563
1564         * expression.cs (Conditional.Emit): when emitting the ternary
1565         operator, use local variables to generate code verifiable code.
1566
1567         The verifier cannot infer that the type on stack before the
1568         stloc.0 is executed is of type ParentB. This happens because the
1569         stack merge algorithm uses only parent types when deciding which
1570         is the common type.  This is described in Part III 1.8.1.3 of ECMA
1571         335.
1572
1573         This code compiled with mcs is not verifiable under MS. The MS
1574         verifier picks the first common interface of Foo and Bar, which is
1575         wrong, but doesn't use a full join type of the 2 interfaces.
1576
1577         CSC uses a clever hack to compile such code in a verifiable
1578         way. It stores the intermediate values in a local variable with
1579         the expected type.
1580
1581         Fixes: #358102
1582
1583 2008-02-14  Miguel de Icaza  <miguel@novell.com>
1584
1585         * expression.cs: Do not fold BitwiseAnd operators when the left
1586         side is a false constant, because we still need to evaluate the
1587         right-hand side.
1588
1589         Fixes #359789
1590
1591         * support.cs: Instead of throwing an InternalErrorException when
1592         the position of the stream is outside the boundary of our buffer,
1593         reset the state of the reader, and restart the reading from the
1594         beginning of the file.
1595
1596 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1597
1598         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1599
1600 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1601
1602         A fix for bug #361686
1603         * decl.cs: A protected types used inside a private class which parents
1604         derives from the protected class are accessible.
1605
1606 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1607
1608         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1609         the parameterless constructor.
1610
1611 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1612
1613         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1614         lookup methods to use standard member cache when doing member lookup.
1615
1616 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1617
1618         * driver.cs: Don't report full path for referenced module as assembly error.
1619
1620 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1621
1622         * Makefile: Fixed `qh' target to work on all machines.
1623
1624         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1625         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1626         and HasElementType with TypeManager implementation.
1627
1628 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1629
1630         A fix for bugs #325134, #359749
1631         * expression.cs, ecore.cs: Try to resolve an extension method even if the
1632         first binds point to non-method member expression.
1633
1634 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1635
1636         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1637
1638 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1639
1640         A fix for bugs #321394, #323028
1641         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1642         Reworked naive IsAccessibleAs implementation to handle nested types.
1643
1644 2008-02-05  Jb Evain  <jbevain@novell.com>
1645
1646         * class.cs: use generic type comparison for parameters
1647         as well.
1648
1649 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1650
1651         A fix for bug #325372
1652         * class.cs: Use generic type comparison when testing method signatures.
1653
1654 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1655
1656         A fix for bug #357047
1657         * ecore.cs: Applied C# 3.0 changes to better conversion.
1658
1659 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1660
1661         A fix for bug #358374
1662         * cs-parser.jay: Correctly set modifiers for all constructor types.
1663
1664 2008-02-04  Marek Safar  <marek.safar@gmail.com>
1665
1666         A fix for bug #355251
1667         * generic.cs: Added base class constraint based type inference.
1668
1669 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1670
1671         A fix for bug #357255
1672         * decl.cs: One more missing visibility check.
1673
1674 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1675
1676         * support.cs: Fixed broken return.
1677
1678 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1679
1680         * report.cs: Correctly reset warnings count after probing.
1681
1682 2008-01-25  Martin Baulig  <martin@ximian.com>
1683
1684         * namespace.cs
1685         (NamespaceEntry.SymbolFileID): Make this work again after
1686         MemberName.ToString() is gone.
1687
1688 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1689
1690         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1691         expressions.
1692
1693 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1694
1695         * generic.cs: Use full implicit conversion for type inference fixing.
1696
1697 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1698
1699         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1700         Fixed user operator conversions.
1701
1702 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1703
1704         * generic.cs: Do nullable type to null comparison optimization during
1705         resolve phase.
1706
1707 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1708
1709         A fix for bug #355163
1710         * generic.cs: Enabled l-value resolve on nullable expressions.
1711
1712 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1713
1714         A fix for bug #353986
1715         * class.cs: Ingore static ctors with parameters for any further checks.
1716
1717 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1718
1719         A fix for bug #354310
1720         * namespace.cs: Removed redundant check.
1721
1722 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1723
1724         A fix for bug #354928
1725         * expression.cs: ElementInitializers can be resolved only once.
1726
1727 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1728
1729         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1730         Condition expressions.
1731
1732 2008-01-23  Marek Safar  <marek.safar@gmail.com>
1733
1734         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1735
1736 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1737
1738         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1739         not allowed.
1740
1741         * generic.cs: Implemented coalesce expression.
1742
1743 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1744
1745         A fix for bug #355145
1746         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1747         expression tree type inference.
1748
1749 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
1750
1751         Fix #354663
1752         * expression.cs (Binary.IsUnsignedType): Fix typo.
1753
1754 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1755
1756         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1757
1758 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1759
1760         A fix for bug #355161
1761         * ecore.cs, expression.cs: Wider range of extension method supported
1762         expressions.
1763
1764 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
1765
1766         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1767         AssemblyBuilder to operate in compiler context. Fixes mcs part of
1768         bug #354970.
1769
1770 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1771
1772         A fix for bug #355148
1773         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1774
1775 2008-01-22  Miguel de Icaza  <miguel@novell.com>
1776
1777         * expression.cs (CreateExpressionTree): Add support for or and
1778         logical or, and indent following the coding conventions.
1779
1780         * typemanager.cs (LinqExpression): renamed from
1781         ExpressionTreeManager, for a shorter name.
1782
1783         Use TypeManager.CoreLookupType to lookup types from our core
1784         assemblies and turn those into "Type" variables.
1785
1786         Consumers that previously used "Namespace" and "Type" from this
1787         class should instead use the TypeExpression which is a type that
1788         is fully resolved (without involving the regular C# resolution
1789         rules). 
1790
1791         This typically looks like this:
1792
1793         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1794         new MemberAccess (texpr, name, type_arguments, loc)
1795
1796         This avoids the problem in: #355178
1797
1798 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1799
1800         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1801         feature in parser only as we do in other cases.
1802         
1803 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1804
1805         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1806         typemanager.cs: A refactoring of params arguments to reuse existing
1807         expressions (params -> array initializer) to emit params argument instead
1808         of specialized handling.
1809         It was required by expression tree implementation and it has other benefits
1810         as well, we now apply same optimization for params arguments as we do for
1811         array initializers.
1812         
1813 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1814
1815         A fix for bug #353526
1816         * generic.cs: A type inference of params arguments may not required any
1817         temporary array creation.
1818         
1819 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1820
1821         A fix for bug #353534
1822         * generic.cs, ecore.cs, expression.cs: A method group type inference is
1823         supported for delegates only.
1824         
1825 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1826
1827         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1828         type for more than 1 candidates.
1829         
1830 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1831
1832         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1833         expressions.
1834         
1835 2008-01-16  Marek Safar  <marek.safar@gmail.com>
1836
1837         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1838         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1839         operator) expressions. 
1840                 
1841 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
1842
1843         * statement.cs: Avoid declaring an IL variable for this_variable since it is
1844         not accessed from the generated IL.
1845
1846 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1847
1848         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1849         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1850         statement.cs: The first expression tree implementation drop, mostly
1851         infrastructure work.
1852
1853 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1854
1855         * ecore.cs (IsNestedChild): Refactored.
1856
1857 2008-01-11  Marek Safar  <marek.safar@gmail.com>
1858
1859         * lambda.cs: Don't use a cast on unknown expression statement.
1860
1861 2008-01-10  Geoff Norton  <gnorton@novell.com>
1862
1863         * cs-tokenizer.cs: One more token to distinguish between method and lambda
1864         arguments
1865
1866 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1867
1868         * doc.cs: Report better /doc crash details.
1869         
1870 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1871
1872         A fix for bug #352536
1873         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1874
1875 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1876
1877         A fix for bug #352287
1878         * ecore.cs, expression.cs: Do `this' access checking in all member access
1879         expressions.
1880         
1881 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1882
1883         * rootcontext.cs, driver.cs: Switch to linq mode by default.
1884         
1885         * report.cs: Reset message stacks.
1886         
1887 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1888
1889         * generic.cs (InferInPhases): Correctly calculate params position.
1890         
1891 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1892
1893         * cs-tokenizer.cs: No need to parse full string when parsing lambda
1894         arguments.
1895
1896 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1897
1898         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1899         
1900         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1901         
1902         * driver.cs: Updated --help option.
1903         
1904 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1905
1906         * generic.cs (InferParamsTypeArguments): Removed.
1907         (InferInPhases): Add params type inference.
1908         (LowerBoundInference): Fixed scoring mechanism.
1909         
1910         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1911         
1912 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
1913
1914         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1915         byte array for unsigned "baked" assemblies.
1916
1917 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
1918
1919         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1920         array for assemblies that are not strongnamed.
1921
1922 2008-01-04  Marek Safar  <marek.safar@gmail.com>
1923
1924         A fix for bug #351481
1925         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1926         declaring type for nested generic types.
1927         
1928 2008-01-04  Marek Safar  <marek.safar@gmail.com>
1929
1930         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
1931         instead of ToString.
1932         
1933 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1934
1935         A fix for bug #351047
1936         * expression.cs (Binary.ResolveOperator): Allow equality operators between
1937         null and structs only when equality and inequality operators are defined
1938         either as an user-operators or predefined operators.
1939         
1940 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1941
1942         A fix for bug #351047
1943         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
1944         
1945 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1946
1947         A fix for bug #351257
1948         * cs-tokenizer.cs: Advance line number for '\r' correctly.
1949         
1950 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1951
1952         A fix for bug #351157
1953         * class.cs (Using): Fixed yet another broken cloning.
1954         
1955         (Block): Put back more sensible default value for statements.
1956         
1957 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
1958
1959         * codegen.cs: Allow AssemblyVersion with only major version component.
1960         Fixes bug #351055.
1961
1962 2007-12-29  Marek Safar  <marek.safar@gmail.com>
1963
1964         A fix for bug #324654
1965         * class.cs: Use FullName property as member name.
1966
1967 2007-12-28  Marek Safar  <marek.safar@gmail.com>
1968
1969         A fix for bug #342117
1970         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
1971         constructor constraint.
1972
1973 2007-12-28  Marek Safar  <marek.safar@gmail.com>
1974
1975         A fix for bug #338273
1976         * class.cs (ProbertyBase): Access modifier checks are required for overrides
1977         only.
1978
1979 2007-12-28  Marek Safar  <marek.safar@gmail.com>
1980
1981         A fix for bug #350839
1982         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
1983
1984 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
1985
1986         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1987         GHOP:
1988         
1989         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
1990
1991         * statement.cs: Changed some Hashtables to use HybridDictionaries
1992         instead. It was observed that some HashTables only contained a few
1993         items in the vast majority of cases. Since HybridDictionary is
1994         more efficient on small sets (<10 elements), "known_variables"
1995         from class ExplicitBlock as well as "labels" and "constants " from
1996         class Block were changed to HybridDictionaries. 
1997
1998         Atsai results: (56216kb->54987kb)
1999
2000         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
2001
2002
2003 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
2004
2005         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2006         GHOP:
2007         
2008         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
2009         
2010         * expression.cs: foreach loop to for loop, saved on allocation of
2011         enumerator (59333kb->59141kb)
2012
2013         * statement.cs. Changed foreach loops to for loops, saved on
2014         allocation of enumerator (59141kb->59006kb)
2015
2016         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
2017         when constructed with no specified capacity. This was causing a
2018         few ArrayLists to allocate more memory than they would potentially
2019         need in the Block class and MemberCache class. Setting the
2020         ArrayLists to construct with a capacity of 1 saves some
2021         memory. (56216kb->55585kb)
2022
2023 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2024
2025         A fix for bug #347189 (2nd issue)
2026         * expression.cs (MemberAccess): Nested type can be found in base non-generic
2027         type.
2028
2029 2007-12-27  Miguel de Icaza  <miguel@novell.com>
2030         
2031         * report.cs: Do not use colors if stdout and stderr are not a
2032         terminal.
2033
2034 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2035
2036         A fix for bug #346998
2037         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
2038         overloads.
2039
2040 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2041
2042         A fix for bug #343465
2043         * class.cs: Explicit method name for nested types uses dots only.
2044
2045 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2046
2047         A fix for bug #343707
2048         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
2049
2050 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2051
2052         * ecore.cs: Report type inference errors only when arguments count matches
2053         parameter count.
2054         
2055         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
2056         
2057         * expression.cs, report.cs: New warning.
2058         
2059         * typemanager.cs: Catch anonymous method type too.
2060
2061 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2062
2063         A fix for bug #346379
2064         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
2065
2066 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2067
2068         A fix for bug #347359
2069         * expression.cs (Invocation): Don't resolve already resolved expression.
2070
2071 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2072
2073         A fix for bug #347189
2074         * class.cs (FixedField): Use non-dependent code only in the define phase.
2075
2076 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2077
2078         A fix for bug #348076
2079         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
2080
2081 2007-12-22  Marek Safar  <marek.safar@gmail.com>
2082
2083         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
2084         discovered extension methods.
2085
2086 2007-12-22  Marek Safar  <marek.safar@gmail.com>
2087
2088         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
2089         method.
2090
2091 2007-12-21  Miguel de Icaza  <miguel@novell.com>
2092
2093         * report.cs (ErrorMessage): Add support for using colors on
2094         terminals that support it. 
2095
2096 2007-12-21  Marek Safar  <marek.safar@gmail.com>
2097
2098         * ecore.cs: Use information about expanded params for error reporting.
2099
2100 2007-12-21  Marek Safar  <marek.safar@gmail.com>
2101
2102         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
2103         and logic for params overloads.
2104         
2105 2007-12-15  Miguel de Icaza  <miguel@novell.com>
2106
2107         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
2108         as this is also created from the parser.  Fixes #349034
2109
2110 2007-12-12  Miguel de Icaza  <miguel@novell.com>
2111
2112         * statement.cs (Throw.CloneTo): it is valid to have empty
2113         expressions for throw. 
2114
2115 2007-12-03  Marek Safar  <marek.safar@gmail.com>
2116
2117         * cs-parser.jay: Set delegate constraint parsing region correctly.
2118
2119 2007-12-03  Marek Safar  <marek.safar@gmail.com>
2120
2121         A fix for bug #345467
2122         * typemanager.cs (IsEqual): Compare generic parameters position only.
2123         
2124 2007-11-28  Marek Safar  <marek.safar@gmail.com>
2125
2126         * expression.cs (BaseAccess): Type arguments can be null.
2127
2128 2007-11-27  Raja R Harinath  <harinath@gmail.com>
2129
2130         * statement.cs (Block.Resolve): Ensure flow-branching tree is
2131         consistent even when an error has occured.
2132         (Switch.Resolve): Likewise.
2133
2134 2007-11-22  Marek Safar  <marek.safar@gmail.com>
2135
2136         A fix for bug #334505
2137         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
2138         overrides.
2139         
2140 2007-11-22  Marek Safar  <marek.safar@gmail.com>
2141
2142         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
2143         refactorings required to resolve extension methods correctly when mixing
2144         generics and non-generics members.
2145         
2146 2007-11-20  Marek Safar  <marek.safar@gmail.com>
2147
2148         A fix for bug #342584
2149         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
2150         conversion.
2151         
2152 2007-11-19  Marek Safar  <marek.safar@gmail.com>
2153
2154         A fix for bug #342512
2155         * delegate.cs: Use delegate argument expression when is available. Don't
2156         emit virtual call when class is sealed.
2157         
2158 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2159
2160         A fix for bug #325423
2161         * assign.cs (FieldInitializer): Use resolved expression for emit.
2162         
2163         * class.cs: Print less confusing error message.
2164         
2165 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2166
2167         * cs-tokenizer.cs: Removed GMCS ifdefs.
2168         
2169         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
2170         mcs.
2171         
2172         * cs-parser.jay: Disabled nullable check.
2173         
2174         * generic-mcs: Copied more generic stuff.
2175                 
2176 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2177
2178         * gcs-parser.jay: Merged to cs-parser.jay.
2179         
2180         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
2181         * *.csproj, *.sources: Updated to use only jay parser file.
2182
2183 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2184
2185         * gcs-parser.jay: Added nullable and default expression feature checks.
2186         
2187 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2188
2189         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
2190         it fixes many TODOs and hidden bugs.
2191         
2192         * expression: Removed duplicate error check.
2193
2194 2007-11-15  Marek Safar  <marek.safar@gmail.com>
2195
2196         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
2197         implicitly type local variable only when it is used in a declaration.
2198
2199 2007-11-15  Marek Safar  <marek.safar@gmail.com>
2200
2201         * attribute.cs: Use CS0612 for empty strings.
2202
2203 2007-11-14  Marek Safar  <marek.safar@gmail.com>
2204
2205         * lambda.cs, statement.cs: Contextual return may act as a statement.
2206
2207 2007-11-14  Marek Safar  <marek.safar@gmail.com>
2208
2209         A fix for a regression cause by #324222
2210         * class.cs: Don't report unused even when it implements an interface.
2211         
2212 2007-11-13  Marek Safar  <marek.safar@gmail.com>
2213
2214         A fix for bug #341205
2215         * ecore.cs, expression.cs: Method group expression cannot do static
2216         method access with an instance reference check before overloading takes
2217         a place.
2218         
2219 2007-11-13  Marek Safar  <marek.safar@gmail.com>
2220
2221         A fix for bug #325359
2222         * class.cs: Use predictable name for automatically generated property.
2223         
2224 2007-11-12  Marek Safar  <marek.safar@gmail.com>
2225
2226         A fix for bug #324996
2227         * expression.cs (Is): Handle case where D is nullable and T is not
2228         correctly.
2229         
2230         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
2231         
2232 2007-11-12  Marek Safar  <marek.safar@gmail.com>
2233
2234         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
2235         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
2236         Flush small error reporting changes.
2237         
2238 2007-11-09  Marek Safar  <marek.safar@gmail.com>
2239
2240         A fix for bug #324996
2241         * expression.cs: Rewrote Is expression implementation to work with
2242         generics, nullable types, anonymous method. A const result expression 
2243         uses existing infrastructure instead of custom not fully-featured one.
2244         
2245 2007-11-08  Marek Safar  <marek.safar@gmail.com>
2246
2247         A fix for bug #340202
2248         * class.cs: Consider generics for volatile field.
2249
2250 2007-11-08  Marek Safar  <marek.safar@gmail.com>
2251
2252         A fix for bug #335594
2253         * expression.cs: Use conversion rules when handling string addition.
2254         
2255 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2256
2257         A fix for bug #336651
2258         * expression.cs: Fixed a crash when probing is on.
2259         
2260 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2261
2262         A fix for bug #324242
2263         * covert.cs: Added a conversion from any nullable-type with an 
2264         underlying enum-type to the type System.Enum.
2265         
2266 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2267
2268         A fix for bug #324222
2269         * class.cs: Report all non-used event fields.
2270         
2271 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2272
2273         A fix for bug #325161
2274         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2275         qualifier for generic types.
2276         
2277 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2278
2279         A fix for bug #322971
2280         * expression.cs, ecore.cs: Added intermediate result value check for
2281         indexers. 
2282         
2283 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2284
2285         A fix for bug #324754
2286         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2287         when it was requested.
2288
2289 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2290
2291         A fix for bug #325101
2292         * expression.cs: Do type not value comparison for `is' expression.
2293
2294 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2295
2296         A fix for bug #320236
2297         * convert.cs: Don't apply user conversion on underlying target type.
2298
2299 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2300
2301         * expression.cs: Don't use unresolved expression for error reporting.
2302  
2303 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2304
2305         A fix for bugs #337712, #324490
2306         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2307         overloading resolution too.
2308         
2309         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2310         the process consistent and more robust.
2311         
2312         * expression.cs, linq.cs, report.cs: Update.
2313
2314 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2315
2316         A fix for bug #332909
2317         * attribute.cs: Resolve attributes in correct context using error
2318         handling procedure.
2319         
2320         * rootcontext.cs: Define Obsolete attribute members as core members.
2321         
2322 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2323
2324         * statement.cs: Removed unused methods.
2325         
2326 2007-10-31  Wade Berrier  <wberrier@novell.com>
2327
2328         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
2329         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2330         during 'make dist')
2331
2332 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2333
2334         A fix for bug #338102
2335         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2336         methods registered as non-generics.
2337         
2338 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2339
2340         A fix for bugs #337712, #324490
2341         * delegate.cs: Delegate covariance and contravariance is not allowed for
2342         value types.
2343         
2344 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2345
2346         A fix for bug #337719 
2347         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2348         `from' keyword.
2349         
2350 2007-10-30  Marek Safar  <marek.safar@gmail.com>
2351  
2352         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2353
2354 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2355  
2356         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2357         query expressions.
2358
2359 2007-10-29  Raja R Harinath  <rharinath@novell.com>
2360
2361         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2362
2363 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2364  
2365         A fix for bug #334652
2366         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2367         extension methods when we have not found the best candidate in normal
2368         container.
2369
2370 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2371
2372         * AssemblyInfo.cs: Keep up-to-date.
2373
2374 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2375
2376         * Makefile: Fixed generics compiler name.
2377         
2378 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2379
2380         * lambda.test: removed, lambda parsing is done differently.
2381         
2382         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2383
2384 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
2385
2386         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2387
2388 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2389
2390         * Makefile, *.sources : All C# compilers are in mcs folder.
2391         
2392         * *.cs: Use existing 2_1 define for smcs.
2393
2394 2007-10-26  Marek Safar  <marek.safar@gmail.com>
2395
2396         A fix for bug #335847
2397         * assign.cs, expression.cs: Couple of changes to avoid creating a
2398         temporary variable for each object initializer assignment statement. It
2399         simplifies struct initialization too, otherwise two temporary variables
2400         would be required.
2401         Implemented optimization of redundant default element initializers.
2402         
2403 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2404
2405         A fix for bug #336766
2406         * expression.cs (Class.CheckBase): Use generic name when method is
2407         generic.
2408         
2409 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2410
2411         A fix for bug #334737
2412         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2413         variable and not variable argument for prepared copies.
2414
2415 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2416
2417         A fix for bug #325110
2418         * class.cs, expression.cs, attribute.cs: Use open generic method when
2419         checking conditional attribute.
2420         
2421 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2422
2423         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
2424         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2425         FeatureIsNotAvailable.
2426
2427 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2428
2429         ** C# 3.0 Partial methods
2430         
2431         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2432         methods support. Because of member cache issue with generics only
2433         non-generics partial methods are fully supported.
2434         
2435 2007-10-23  Marek Safar  <marek.safar@gmail.com>
2436         
2437         * class.cs, decl.cs: Rewrote member overloads check to cope with 
2438         generics and to use member cache for member checking. It also improves
2439         performance and fixes remaining overloads issues.
2440         
2441 2007-10-20  Marek Safar  <marek.safar@gmail.com>
2442         
2443         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2444         roottypes.cs, typemanager.cs:
2445                 
2446         A member cache creation logic changed to add members immediately and
2447         not rely on fallback. The member cache is now only prefered way
2448         how to access and find type declaration members. It saves 5 MB of memory
2449         during MWF compilation and makes code ready for more optimizations and
2450         clean-ups, it's also a pre-requirement for partial methods.
2451         
2452 2007-10-18  Raja R Harinath  <harinath@gmail.com>
2453
2454         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2455         handling for generic parameters.
2456
2457 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2458         
2459         * class.cs (FixedField): Removed redundant volatile check.
2460         
2461 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2462         
2463         * class.cs, decl.cs: Fixed overload members verification to do only one
2464         check per possible collision.
2465         
2466 2007-10-13  Marek Safar  <marek.safar@gmail.com>
2467         
2468         A fix for bug #325478
2469         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2470         and create only one disposable flags container.
2471         
2472 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2473         
2474         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2475         * statement.cs (Fixed): Fixed variables cloning.
2476         
2477 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2478         
2479         A fix for bug #333342
2480         * class.cs (EventField): Don't mark value type event as synchronized. 
2481         
2482 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2483         
2484         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2485         inference to identify best candidate method correctly.
2486         (ProperyExpr): A range variable is read only and cannot be modified.
2487         
2488 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2489         
2490         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2491         logic to identify best candidate method correctly.
2492         
2493 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2494         
2495         * location.cs (Equals, GetHashCode): Removed.
2496         
2497 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2498         
2499         * report.cs: Implemented message recorder. It is used mainly for lambda
2500         expressions to capture otherwise swallowed error messages.
2501         
2502         * anonymous.cs, lambda.cs.cs: Do full parameters check.
2503
2504         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2505         and not at the top.
2506         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2507                 
2508         * expression.cs (MemberAccess): Always report lookup failure.
2509         
2510         * location.cs: Implemented Equals, GetHashCode.
2511         
2512         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2513         
2514 2007-10-10  Jb Evain  <jbevain@novell.com>
2515
2516         * codegen.cs: re-enable assembly version check.
2517
2518 2007-10-09  Marek Safar  <marek.safar@gmail.com>
2519         
2520         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2521         checks.
2522         
2523         * namespace.cs (UsingAlias): Do correct version check.
2524         
2525 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2526         
2527         * expresison.cs, ecore.cs: Issue extension method error message when
2528         appropriate.
2529         
2530         * rootcontext.cs: Added ISO_2 compiler mode option.
2531
2532 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2533         
2534         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2535          message.
2536         
2537 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2538         
2539         * attribute.cs (GetString, GetBoolean): Work with both literal and
2540         constant.
2541         
2542         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2543         Moved method overload specific methods to MethodGroupExpr.
2544         
2545         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2546         it should be less memory consuming.
2547         
2548 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2549
2550         * codegen.cs: remove the assembly version check until the buildbot is
2551         fixed.
2552
2553 2007-10-07  Jb Evain  <jbevain@novell.com>
2554
2555         * attribute.cs (Attribute.GetString): if the value
2556         expression is a StringConstant, return its string value.
2557
2558 2007-10-07  Jb Evain  <jbevain@novell.com>
2559
2560         * typemanager.cs: add `assembly_version_attribute_type`.
2561         * codegen.cs: on attribute emission, check that the
2562         AssemblyVersionAttribute doesn't overflow.
2563
2564 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2565         
2566         A fix for bug #324677
2567         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2568         parent container of a scope container with currently resolved one. 
2569         
2570 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2571         
2572         A fix for bug #325534
2573         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2574         only.
2575         
2576 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2577         
2578         A fix for bug #327504
2579         * class.cs (Operator.Define): Refactored implicit and explicit user
2580         operator conversion rules.
2581         
2582 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2583         
2584         A fix for bug #327520
2585         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2586         
2587 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2588         
2589         A fix for bug #328022
2590         * class.cs (MethodData.Define): Use correct method to check whether
2591         a method implementents an accessor.
2592         
2593 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2594         
2595         A fix for bug #330069
2596         * statement.cs (Fixed.Resolve): Read the first array element only when
2597         an array is instantiated. 
2598         
2599 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2600         
2601         * expression.cs, assign.cs, generics.cs: Print correct operator when
2602         compound assignment is used.
2603         
2604 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2605         
2606         A fix for bug #325841
2607         * expression.cs (ArrayAccess): Use full argument cloning only for
2608         string compound concatenation.
2609         
2610 2007-10-03  Marek Safar  <marek.safar@gmail.com>
2611         
2612         A fix for bug #328774
2613         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2614         assignment.
2615         (PropertyExpr.EmitAssign): Fixed string concatenation compound
2616         assignment.
2617
2618 2007-10-03  Raja R Harinath  <rharinath@novell.com>
2619
2620         Fix #328490
2621         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2622         Event accessibility checks here.  Remove some bogus code that
2623         accidently made GenericMethods work.
2624         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2625
2626 2007-09-25  Marek Safar  <marek.safar@gmail.com>
2627         
2628         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2629         
2630         * statement.cs (Block): Refactored AddVariable to allow error handling
2631         customization.
2632         
2633         * generic.cs: New stub.
2634         
2635 2007-09-23  Marek Safar  <marek.safar@gmail.com>
2636         
2637         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2638         flag.
2639         
2640 2007-09-17  Marek Safar  <marek.safar@gmail.com>
2641
2642         * class.cs: Use partial container to record whether any partial part
2643         contains static field initializer and therefore default contructor has
2644         to be defined.
2645         
2646 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2647
2648         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2649         mono-list when only one of two partial parts has defined accessibility
2650         modifier.
2651         
2652 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2653
2654         A fix for bug #82845
2655         
2656         * class.cs (TypeContainer): Set correct resolve context for all field
2657         initializers.
2658         
2659 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2660
2661         * assign.cs: Fixed a crash when field is resolved twice with an error.
2662         
2663         * codegen.cs: Changed InFieldInitializer to be flag.
2664         
2665         * anonymous.cs, ecore.cs, expression.cs: Update after
2666         IsInFieldInitializer rename.
2667         
2668         * const.cs: Removed unused parameter.
2669         
2670         * class.cs: Changed the way how we resolve and emit field initializers.
2671         The field initilizers have to have access to contructor block to emit
2672         compiler generated code.
2673
2674 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2675
2676         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2677         generics use TypeContainer instead.
2678         
2679 2007-09-12  Marek Safar  <marek.safar@gmail.com>
2680         
2681         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2682
2683         * lambda.cs (ResolveParameters): Use more powerful
2684         InflateGenericArgument.
2685         
2686         * parameters.cs: Better exception message.
2687                 
2688 2007-09-10  Marek Safar  <marek.safar@gmail.com>
2689
2690         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2691         correct expression block type. 
2692         
2693         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2694         
2695         * expression.cs (Invocation): Extracted method group resolve to
2696         DoResolveOverload.
2697         
2698 2007-09-07  Marek Safar  <marek.safar@gmail.com>
2699
2700         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2701         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2702         
2703         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2704         generic extension methods.
2705
2706 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2707
2708         A fix for bug #82676 (Do I get it right now?)
2709         * convert.cs (Binary.ResolveOperator): An interface is converted to the
2710         object before a standard conversion is applied.
2711         
2712 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2713
2714         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2715         #82676.
2716         
2717 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2718
2719         A fix for bug #82676
2720         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2721         non-generic interface types.
2722         
2723 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2724
2725         A fix for bug #82690
2726         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2727         
2728 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2729
2730         A fix for bug #82571
2731         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
2732         modifier for container based methods.
2733         
2734 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2735
2736         A fix for bug #82676
2737         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2738         any interface-type T means to any of interface type T.
2739
2740 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2741
2742         * namespace.cs: We have 2 versions of System.Core assembly.
2743
2744 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2745
2746         A fix for bug #82652
2747         * class.cs (Class.GetClassBases): Compare types and not expressions.
2748
2749 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2750
2751         A fix for bug #82620
2752         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2753         actually never worked before.
2754         (IndexerAccess): Emit prepared arguments before they are modified.
2755         
2756 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2757
2758         A fix for bug #82563
2759         * assign.cs: Revert wrong fix.
2760         
2761         * expression.cs (VariableReference.EmitAssign): Handle ref reference
2762         correctly.
2763         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2764         Instead of ldelema/stdind we have to use temporary variables to handle
2765         cases like String.Concat (params string[]).
2766         
2767 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2768
2769         * class.cs: EmitAttributes to Emit rename.
2770         
2771         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2772         null.
2773         (MemberCore.HasClsCompliantAttribute): Don't depend on 
2774         GetClsCompliantAttributeValue execution.
2775         
2776 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2777
2778         * anonymous.cs: Use shorter type prefix.
2779         
2780         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2781         when exist.
2782         
2783         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2784         variables when probing is on.
2785         
2786         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
2787         unresolved variables.
2788         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2789         handle transparent identifiers.
2790         
2791 2007-08-26  Marek Safar  <marek.safar@gmail.com>
2792
2793         * attribute.cs (IsClsCompliant): Add nullable types test.
2794         
2795 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2796
2797         * doc.cs : catch other types of exception than XmlException to
2798           report CS1570. Fixed bug #82565.
2799
2800 2007-08-23  Marek Safar  <marek.safar@gmail.com>
2801
2802         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
2803         The number of delegate parameters has to match.
2804         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2805         arrays.
2806
2807 2007-08-21  Marek Safar  <marek.safar@gmail.com>
2808
2809         * anonymous.cs (AnonymousMethod): Generate private anonymous method
2810         to fix problem with private arguments.
2811
2812 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2813
2814         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2815         
2816         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
2817         
2818         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2819         empty. Add cloning suport.
2820         
2821         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2822
2823 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2824
2825         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
2826         to create EmptyCast. It handles EmptyConstantCast specialization for
2827         constants.
2828         
2829 2007-08-18  Marek Safar  <marek.safar@gmail.com>
2830
2831         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2832         (EmitArrayArgument): One routine for array arguments.
2833         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
2834         
2835 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2836
2837         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2838
2839 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2840
2841         * anonymous.cs: MemberLookupFinal update.
2842
2843         * class.cs (ConstructorInitializer): Is expression based.
2844         
2845         * delegate.cs: MethodGroupExpr update.
2846         
2847         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
2848         messages.
2849         (Error_MemberLookupFailed): Customizable error override.
2850         (MethodGroupExpr): Keep queried type for later usage.
2851         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2852         resolve.
2853         
2854         * expression.cs: Error_MemberLookupFailed refactoring.
2855         (New.DoResolve): Resolve as much as possible.
2856         (ElementInitializer.Error_MemberLookupFailed): Object initializer
2857         customization for invalid member types.
2858
2859         * statement.cs: MethodGroupExpr update.
2860         
2861 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2862
2863         * modifier.cs (Check): Check all modifiers and not only accessibility
2864         ones.
2865
2866 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2867
2868         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2869         type and not an expression.
2870
2871 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2872
2873         * statement.cs (Catch.Clone): Type and variable can be null.
2874
2875 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2876
2877         A fix for bug #81979
2878         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2879         I am really not sure whether this is the best fix.
2880         
2881         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2882         only once.
2883         
2884 2007-08-14  Marek Safar  <marek.safar@gmail.com>
2885
2886         ** C# 3.0 Object and collection initializers (major re-write)
2887         
2888         * assign.cs (DoResolve): Initializers are not assign related.
2889         
2890         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2891         used during collection or object initialization.
2892         
2893         * expression.cs (Error_InvalidArguments): Add initializers specific
2894         messages. More will come later because it requires some general
2895         refactoring.
2896         (New.DoResolve): Better error handling for unsafe types.
2897         (EmptyExpressionStatement): New class.
2898         (ElementInitializer): An object initializer expression.
2899         (CollectionElementInitializer): A collection initializer expression.
2900         (CollectionOrObjectInitializers): A block of object or collection
2901         initializers.
2902         (NewInitialize): New expression with element/object initializers.
2903         
2904         * statement.cs: Reverted object/collection initializer hacks.
2905         
2906         * typemanager.cs (CSharpName): Filter __arglist type.
2907         
2908 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2909
2910         ** C# 3.0 Anonymous Types (update to the latest standard)
2911         
2912         * expression.cs (Binary.ResolveOperator): Threat all null based types
2913         same.
2914         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2915         (AnonymousTypeParameter): Updated.
2916         
2917         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2918         (AnonymousTypeClass): New anonymous type container.
2919         
2920         * class.cs (AddField): Return operation result.
2921         
2922         * generic.cs: Another empty TypeArguments overload.
2923         
2924         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2925         are stored at top of normal hierarchy.
2926         
2927         * typemanager.cs (CSharpName): Filter anonymous types.
2928         
2929 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2930
2931         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
2932         as single Concat call. How could we miss that :-(
2933         
2934 2007-08-08  Marek Safar  <marek.safar@gmail.com>
2935
2936         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
2937         
2938 2007-08-07  Miguel de Icaza  <miguel@novell.com>
2939
2940         * expression.cs: Fix the previous commit, the creation of the
2941         arguments array list needs also to be conditional on the arguments
2942         not being null.
2943
2944         * class.cs: Add a little bit of help to help narrow down problems.
2945
2946         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
2947         not try to copy in that case. 
2948
2949         * driver.cs: When building SMCS, include a new different set of
2950         default assemblies here.   Do this here so we can control whether
2951         to include the default assemblies with /noconfig.
2952
2953 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2954
2955         A fix for bug #81979
2956         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
2957         only.
2958
2959 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2960
2961         A fix for bug #82300
2962
2963         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
2964         we are in probing scope.
2965
2966 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2967
2968         A fix for bug #82301
2969
2970         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
2971         (Statement.CloneTo): Clone and not map children blocks.
2972
2973 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2974
2975         A fix for bug #82299
2976
2977         * expression.cs (LocalVariableReference.CloneTo): Remap local info
2978         variable too.
2979         
2980         * statement.cs (Statement.CloneTo): Clone variables before statements
2981         to allow remaping of local variables.
2982
2983 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2984
2985         A fix for bug #82296
2986
2987         * anonymous.cs,
2988         * report.cs: Log crash details for future clone problems.
2989         
2990         * statement.cs (Return.Clone): Don't clone non-existent expression.
2991
2992 2007-08-03  Raja R Harinath  <harinath@gmail.com>
2993
2994         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
2995         (Class.AddBasesForPart): Move CS0537 check here from ...
2996         * cs-parser.jay (class_declaration): ... here.  Move calling of
2997         'AddBasesForPart' to ...
2998         (class_bases): ... here.
2999         (struct_declaration, interface_declaration): Update to changes.
3000
3001 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3002
3003         A fix for bug #81923
3004
3005         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
3006         conversion is allowed.
3007
3008 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3009
3010         A fix for bug #81564
3011
3012         * ecore.cs (EventExpr): Add IsBase handling.
3013
3014         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
3015         too.    
3016         
3017 2007-08-02  Raja R Harinath  <harinath@gmail.com>
3018
3019         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
3020         * cs-parser.jay: Some whitespace cleanups.
3021         (current_delegate): New.
3022         (type_name): New.
3023         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
3024         a dummy code block, and use 'type_name' instead of 'member_name'.
3025         (interface_declaration, class_declaration): Likewise.
3026         (delegate_declaration): Likewise.  Rearrange slightly and use
3027         'current_delegate'.
3028         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
3029         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
3030
3031 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3032
3033         A fix for bug #82039
3034
3035         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
3036         available.
3037
3038         * typemanager.cs (CSharpName): Split to string overload.
3039
3040 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3041
3042         * expression.cs,
3043         * report.cs: Updated warning CS0472.
3044
3045 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3046
3047         A fix for bug #82181
3048         * cs-parser.jay,
3049         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
3050
3051 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3052
3053         A fix for bug #82277
3054         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
3055
3056 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3057
3058         ** C# 3.0 Type Inference (major bits are working)
3059         
3060         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
3061         (.ImplicitStandardConversionExists): Uses compatible.
3062         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
3063         (.InferReturnType): New method.
3064         (.Compatible): Refactored.
3065         (.ResolveParameters): Uses factory to create resolved parameters.
3066         (.CompatibleMethod): Add probing mode support.
3067         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
3068         clearly distinguish between 2 different operations.
3069         (LambdaMethod): Moved to lambda.cs.
3070         (AnonymousMethod): Removed unused fields and methods.
3071         (AnonymousDelegate): Simplified.
3072         
3073         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
3074         
3075         * convert. cs (ImplicitConversionStandard): Compatible works differently.
3076         
3077         * delegate.cs (Delegate): New mehods to reduce code duplication.
3078         (.GetConstructor): New method.
3079         (.GetInvokeMethod): New method.
3080         (DelegateCreation): Updated.
3081         
3082         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
3083         does not exist.
3084         (OverloadResolve): Made probing little bit faster.
3085         
3086         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
3087         when probing is on.
3088         
3089         * generic.cs (TypeInferenceContext): Dummy implementation.
3090         
3091         * iterators.cs: Updated after Resolve/Define rename.
3092         
3093         * lambda.cs (LambdaExpression)
3094         (.ResolveParameters): Handles both type of arguments and type inference too.
3095         
3096         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
3097         (InflateTypes): Updated.
3098         
3099         * support.cs (InflateTypes): Changed signature and updated.
3100         
3101         * typemanager.cs (LookupMemberCache): Better dynamic type check.
3102         (MemberLookup_FindMembers): More MS tricks.
3103         (GetParameterData): Ditto.
3104         (GetDelegateParameters): Uses quick path for dynamic types.
3105         
3106 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3107
3108         * class.cs (MethodData.Define): EmitContext is required for generic stuff
3109         only.
3110
3111 2007-07-31  Marek Safar  <marek.safar@gmail.com>
3112
3113         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
3114         syntax.
3115         
3116 2007-07-26  Jb Evain  <jbevain@novell.com>
3117
3118         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
3119         which takes a boolean 'report_errors', similar to the GetMethod.
3120         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
3121         in .net 2.1, do not report errors here.
3122
3123         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
3124         System.Runtime.CompilerServices.RequiredAttributeAttribute and
3125         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
3126         in .net 2.1.
3127
3128         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
3129         of the type InternalsVisibleToAttribute before the first call
3130         to CoreLookupType which is allowed to fail (third boolean parameter
3131         to true). Because, during the resolution for a type that is not
3132         immediately found, we try to check if the type is not defined in
3133         a friend assembly, and to do so, we need the
3134         InternalVisibleToAttribute.
3135
3136 2007-07-23  Miguel de Icaza  <miguel@novell.com>
3137
3138         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
3139         feature that allows structs to be compared against null and inline
3140         the result as true or false.
3141
3142         Notice that the same code is not permitted inside a generic block
3143         of code that would do:
3144
3145         class Foo<T> where T : struct {
3146             bool Eval (T x)
3147             {
3148                  return x == null;
3149             }
3150         }
3151
3152         It is only allowed if the type of T is not bound (no where
3153         clause).   In my opinion, this CSC 2 behavior is broken but people
3154         seem to be using it (IronRuby does, a few bug reports on bugzilla
3155         have it and some people have complained about it).
3156
3157         All of the users that depend on this behavior have code that is
3158         very likely broken. 
3159         
3160         * report.cs (Warning, Error): make these take object arguments,
3161         not strings, as that allows us to take advantage of Format.
3162
3163 2007-07-20  William Holmes  <billholmes54@gmail.com>
3164
3165         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
3166           Left member variable for the Count.
3167         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
3168           MemberName.CountTypeArguments to avoid a NRE. 
3169
3170         This code is contributed under the MIT X11 license
3171
3172 2007-07-18  Marek Safar  <marek.safar@gmail.com>
3173
3174         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
3175
3176 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
3177
3178         * doc.cs : generic method arguments are written as ``x while generic
3179           type arguments are `x. Combined with the previous change, fixed bug
3180           #79706.
3181
3182 2007-07-18  Raja R Harinath  <rharinath@novell.com>
3183
3184         Fix #82120
3185         * expression.cs (Binary.ResolveOperator): When converting
3186         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
3187
3188 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
3189
3190         * doc.cs : when T: or whatever x: is specified, it does not really
3191           check the doc comment's syntax correctness. Fixed bug #82006.
3192
3193 2007-07-18  Marek Safar  <marek.safar@gmail.com>
3194
3195         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
3196         LambdaExpression better.
3197         
3198         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
3199         
3200         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
3201         
3202         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
3203         as it can be generated.
3204         
3205         * expression.cs (Invocation.Error_InvalidArguments): Show correct
3206         modifiers.
3207         
3208         * lambda.cs (LambdaExpression): Refactored to share same code with
3209         AnonymousMethodExpression.
3210         
3211 2007-07-17  Marek Safar  <marek.safar@gmail.com>
3212
3213         * anonymous.cs (MakeName): Include host name for easier debugging.
3214         (LambdaMethod): New class for lambda spcecific stuff.
3215         
3216         * attribute.cs: Set EmitContext return type.
3217
3218         * class.cs: Set EmitContext return type.
3219         
3220         * codegen.cs (EmitContext): Return type cannot be null to stop messing
3221         with null/void meaning.
3222         
3223         * iterators.cs (ContainerType): Implemented.
3224         
3225         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
3226         
3227         * statement.cs (Return): Updated to lambda expressions.
3228         (Block.CloneTo): Parent can be null.
3229                 
3230 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3231
3232         A fix for bug #81917
3233         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
3234         
3235         * class.cs (FixedField): Check whether field is in unsafe scope.
3236
3237         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
3238         (FieldExpr.Emit): Fixed buffers cannot be volatile.
3239
3240         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
3241         FieldExpr.
3242         
3243         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
3244                 
3245 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3246
3247         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
3248         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
3249         from Report class.
3250
3251 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3252
3253         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
3254         
3255 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3256
3257         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3258         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3259         
3260         * codegen.cs(EmitContext): Add ProbingMode flag.
3261         
3262         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3263         
3264         * driver.cs: For now set both warning values.
3265         
3266         * ecore.cs (SimpleName): Name is readonly.
3267         (MethodGroup.OverloadResolve): One quick path for probing.
3268         
3269         * expression.cs (Unary): Set Oper r/o.
3270         (Binary): Set Oper r/o.
3271         (ParameterReference): Set few instance variables as r/o.
3272         (ParameterReference.DoResolveBase): Don't capture aruments when 
3273         the probing is on.
3274         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3275         (Arglist): arguments are private.
3276         (SizeOf): type is private and r/o.
3277         (MemberAccess): arguments are private.
3278
3279         * report.cs: Enhanced reporting on/off capabilities.
3280         
3281         * lambda.cs: Uses ec.IsInProbingMode.
3282         (ContextualReturn): Derives from return.
3283         
3284         * rootcontext.cs: For now set both warning values.
3285         
3286         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3287         copy if one exists.
3288         (Return.Resolve): Don't die immediately.
3289         (Block.Resolve): Speed-up probing.
3290         (Block.CloneTo): Clone only child blocks.
3291
3292 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3293
3294         * iterators.cs: reverted Miguel's latest change (r81925) as it
3295         breaks the build in System.
3296
3297 2007-07-13  Miguel de Icaza  <miguel@novell.com>
3298
3299         * iterators.cs (Yield.CheckContext): Check for the iterator type
3300         also here as we can call into Yield even in codepaths that are not
3301         directly checked by
3302         (MethodOrOperator is the only path that was checked).
3303
3304         In addition to the standard check, use a more specific check for
3305         constructors to report a more verbose error. 
3306
3307 2007-07-12  Miguel de Icaza  <miguel@novell.com>
3308
3309         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3310         report the warning and continue 
3311
3312         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3313         values on the stack on the call to Emit.   Use EmitStatement if
3314         possible, or using Emit + Pop if not possible.   Fixes #82064
3315
3316 2007-07-12  Raja R Harinath  <rharinath@novell.com>
3317
3318         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3319         avoid try...finally in some cases.
3320
3321 2007-07-10  Marek Safar  <marek.safar@gmail.com>
3322
3323         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3324         
3325         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3326         instead of method. Re-use standard error handling.
3327         (ConstructorInitializer.Emit): Simplified.
3328         
3329         * delegate.cs: Updated after Invocation.EmitCall change.
3330         
3331         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3332         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3333         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3334         method and don't permanently changing input arguments.
3335         (MethodGroupExpr): Introduced resolved best_candidate, when method group
3336         is resolved it has one of the candidates is the best one which is later
3337         used to emit. Removed a few unused method.
3338         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3339
3340         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3341         (Binary.ResolveOperator): Ditto.
3342         (ConditionalLogicalOperator.DoResolve): Ditto.
3343         (Invocation): Uses method group.
3344         (Invocation.DoResolve): Simplified.
3345         (Invocation.EmitCall): Removed useless is_static.
3346         (Invocation.Emit): Delegate to method group.
3347         (Invocation.EmitStatement): Simplified.
3348         (New): Uses method group.
3349         (MemberAccess.DoResolve): Don't destroy original expression.
3350         
3351         * statement.cs (ForEach.Resolve): Use null for no method arguments.
3352         
3353 2007-07-04  Marek Safar  <marek.safar@gmail.com>
3354
3355         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3356         
3357         * anonymous.cs,
3358         * lambda.cs: Add custom error message type.
3359
3360 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3361
3362         * lambda.cs: Simplified little bit.
3363         
3364         * parameter.cs: Introduced ImplicitLambdaParameter.
3365         (Parameters.CreateFullyResolved): New factory instead of ctor.
3366         
3367         * anonymous.cs,
3368         * class.cs,
3369         * delegate.cs: Updated parameter creation.
3370         
3371 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3372
3373         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3374         arguments.
3375         
3376         * generic.cs: Synchronized with gmcs.
3377         
3378 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3379
3380         * class.cs (Indexer): Check return type as soon as possible.
3381         
3382         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3383         members too.
3384         
3385         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3386         
3387         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3388         
3389         * parameter.cs (Parameter): Use expression type when it is available.
3390         
3391         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3392         method modifier for the first parameter only.
3393
3394 2007-06-24  Marek Safar  <marek.safar@gmail.com>
3395
3396         A fix for bug #81938
3397         * typemanager.cs (ChangeType): Fixed couple of char conversions.
3398         
3399         * constant.cs: Tide up an exception message.
3400
3401 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3402
3403         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3404         an uninitialized variable is used.
3405         
3406         * expression.cs (LocalVariableReference.DoResolve): Ditto.
3407
3408 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3409
3410         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3411         not found error handling.
3412
3413         * expression.cs (ArrayCreation): Removed redundant fields and little bit
3414         simplified.
3415         (ArrayCreation.ResolveArrayElement): To be ready to customization.
3416         (ArrayCreation.DoResolve): Simplified.
3417         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3418         its own resolve process.
3419         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3420
3421 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3422
3423         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3424         more error details.
3425         
3426 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3427
3428         * cs-tokenizer.cs: Removed var related stuff.
3429         
3430         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3431         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3432         a type and a keyword at same time.
3433         
3434         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3435         matches to "var".
3436         
3437         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3438         implicitly typed arrays, more changes will follow.
3439         
3440         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3441         
3442 2007-06-19  Marek Safar  <marek.safar@gmail.com>
3443
3444         * ecore.cs (VarExpr): Removed Handled field.
3445         
3446         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3447         build-in assign functionality.
3448         (ForEach.Resolve): Removed all implicitly typed local variable code and
3449         simplified.
3450         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3451         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3452
3453 2007-06-18  Marek Safar  <marek.safar@gmail.com>
3454
3455         * assign.cs: Removed implicitly typed local variable check.
3456         
3457         * expression.cs (LocalVariableReference.DoResolve): Add check for self
3458         referencing implicitly typed local variable.
3459         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3460         variable here.
3461         
3462         * statement.cs (Fixed): Removed unsupported implicitly typed local
3463         variable code.
3464
3465 2007-06-15  Marek Safar  <marek.safar@gmail.com>
3466
3467         * decl.cs (MemberName): Moved all Unbound stuff to parser.
3468
3469 2007-06-14  Marek Safar  <marek.safar@gmail.com>
3470
3471         A fix for bugs #81855 and #76274
3472         * attribute.cs (AttachTo): Always set owner for global attributes to
3473         prefined owner.
3474         
3475         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3476         usefull too.
3477         
3478         * cs-parser.jay: Assembly and module attributes must precede all other
3479         elements except using clauses and extern alias declarations.
3480
3481 2007-06-13  Marek Safar  <marek.safar@gmail.com>
3482
3483         A fix for bug #81748
3484         * cs-tokenizer.cs,
3485         * expression.cs: More checks for non ISO-1 features.
3486
3487 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3488
3489         A fix for bug #81807
3490         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3491         present inside switch statement and it is required by nullable check.
3492
3493 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3494
3495         A fix for bug #81840
3496         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3497         when type matching fails.
3498         
3499         * namespace.cs: Tiny error message change.
3500
3501 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3502
3503         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3504         reporting. Added automatic property check.
3505         
3506         * class.cs: Updated after CheckAbstractAndExtern relocation.
3507         (AEventPropertyAccessor.GetSignatureForError): Customized.
3508         
3509 2007-06-11  Marek Safar  <marek.safar@gmail.com>
3510
3511         * class.cs (DefineBaseTypes): Base type can be undefined.
3512         
3513         * ecore.cs (TypeLookup): Minor refactoring.
3514         (DoResolveAsTypeStep): Removed redundant check.
3515
3516         * namespace.cs (Lookup): Removed redundant check.
3517                 
3518         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
3519         ResolveAsTypeTerminal step.
3520         (BootstrapCorlib_*): Simplified.
3521         (PopulateCoreType): Core types can be now external.
3522
3523 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3524
3525         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3526          verification only.
3527          (InferTypeArguments): Infers anonymous expression type arguments.
3528          (Compatible): Split to Compatible and InferTypeArguments. 
3529         
3530         * lambda.cs: Updated.
3531
3532 2007-06-08  Marek Safar  <marek.safar@gmail.com>
3533
3534         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3535
3536 2007-06-07  Raja R Harinath  <harinath@gmail.com>
3537
3538         Fix #80477, cs0135-2.cs, cs0135-3.cs
3539         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3540         names to the "known" variables list.
3541         (Block.CheckInvariantMeaningInBlock): Handle the fact the
3542         parameter names are also "known".
3543         (Block.CheckError136): Remove.
3544         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
3545         null.
3546
3547 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3548
3549         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3550
3551 2007-06-06  Marek Safar  <marek.safar@gmail.com>
3552
3553         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3554         internal error not an user error.
3555          
3556         * expression.cs (IsApplicable): Refactored to make debugging easier.
3557
3558         * support.cs: More tricks for non-mono runtimes.
3559         
3560         * typemanager.cs (CoreLookupType): Made public.
3561         (InitSystemCore): All linq specific stuff moved to linq.cs
3562
3563 2007-06-05  Marek Safar  <marek.safar@gmail.com>
3564
3565         * typemanager.cs (CSharpSignature): One more missing build-in types
3566         replacement.
3567         More tricks for non-mono runtime.
3568
3569 2007-06-05  Raja R Harinath  <harinath@gmail.com>
3570
3571         * statement.cs (Block.CheckError136_InParents): Remove.
3572         (Block.AddVariable): Use GetParameterInfo instead.
3573         (ToplevelBlock.ProcessArguments): Likewise.
3574
3575 2007-06-04  Raja R Harinath  <rharinath@novell.com>
3576
3577         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
3578         information too.
3579         (ToplevelBlock.GetParameterInfo): Split out of ...
3580         (ToplevelBlock.GetParameterRefernce): ... this.
3581         (ToplevelBlock.ParameterMap): Remove.
3582         * expression.cs (ParameterReference): Update to use
3583         ToplevelParameterInfo.
3584
3585         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3586         regression.
3587
3588         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3589         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3590
3591         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3592         (ToplevelBlock.ProcessParameters) ... here.
3593         (ToplevelBlock..ctor): Invoke it.
3594
3595         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3596         new parameters.
3597
3598         * statement.cs (IKnownVariable): New interface.
3599         (LocalInfo): Implement it.
3600         (ToplevelParameterInfo): New class.
3601         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3602         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
3603         GetKnownVariableInfo.
3604
3605 2007-06-03  Raja R Harinath  <harinath@gmail.com>
3606
3607         Partly speed up CS0136 error checks.
3608         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3609         'recurse' parameter.
3610         (Block.DoCheckError136): Only check errors in parameters.  Move
3611         local variable checks ...
3612         (Block.AddVariable): ... here, and ...
3613         (ToplevelBlock.ResolveMeta): ... here.
3614
3615 2007-06-02  Raja R Harinath  <harinath@gmail.com>
3616
3617         * statement.cs (Block.IsChildOf): Remove.
3618
3619         * statement.cs (Statement.Clone): Move special case code ...
3620         (Block.CloneTo): ... here.
3621
3622 2007-05-29  Raja R Harinath  <rharinath@novell.com>
3623
3624         * statement.cs (ToplevelBlock.container): Remove field.  It's
3625         redundant with 'Parent'.
3626         (ToplevelBlock.ContainerBlock): Remove accessor.
3627         (ToplevelBlock..ctor): Update to changes.  Register anonymous
3628         child with parent here, ...
3629         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
3630         current_block.
3631         (start_anonymous): Don't save current_block.
3632         (top_current_block): Remove.
3633
3634         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3635         (Block.Resolve): Update to changes.
3636         (Block..ctor): Move setting of "correct" 'Toplevel'
3637         and 'Explicit' fields to ...
3638         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3639
3640 2007-05-27  Raja R Harinath  <harinath@gmail.com>
3641
3642         Kill Block.Implicit
3643         * statement.cs (Block.Implicit): Remove.
3644         (Block): Update to changes.
3645         * flowanalysis.cs: Likewise.
3646
3647         Mildly speed up CheckInvariantMeaningInBlock
3648         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3649         Recursively call AddKnownVariable to all enclosing blocks.
3650         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3651         Remove recursive calls.
3652         (Block): Update to changes.
3653
3654         New ExplicitBlock invariants
3655         * statement.cs (Block.Explicit): New field.  It points to the
3656         immediately enclosing non-implicit block.
3657         (Block..ctor): Maintain the invariant.
3658         * cs-parser.jay: Take advantage of invariant.
3659
3660         Introduce ExplicitBlock
3661         * statement.cs (ExplicitBlock): New.
3662         (ToplevelBlock): Derive from it.
3663         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3664         sense of flag.
3665         (Block.Implicit): Update to changes.
3666         * cs-parser.jay: Update to changes.
3667
3668         Remove unused field
3669         * codegen.cs (EmitContext.IsLastStatement): Remove.
3670         * statement.cs (Block.DoEmit): Update to changes.
3671
3672 2007-05-25  Raja R Harinath  <rharinath@novell.com>
3673
3674         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3675         modifying current_block directly.
3676
3677 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
3678         
3679         * class.cs: Implemented automatic properties (C# 3.0)
3680           Thanks to Marek for the help.
3681
3682 2007-05-23  Raja R Harinath  <rharinath@novell.com>
3683
3684         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3685         variable as assigned, note also that all its components are
3686         assigned too.
3687         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
3688
3689 2007-05-19  Marek Safar  <marek.safar@gmail.com>
3690
3691         * anonymous.cs, class.cs: Emit Compiler generated attribute when
3692         member is marked as compiler generated.
3693         
3694         * decl.cs (MemberCore): Refactored ModFlags into property.
3695
3696         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3697         (Check): Check only accessibility modifiers.
3698
3699 2007-05-18  Raja R Harinath  <rharinath@novell.com>
3700
3701         Track all assignable slots in one bit array
3702         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3703         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
3704         logic from VariableMap constructor here.  Use the same 'offset'
3705         variable that's later used for computing offsets of local
3706         variables.
3707         * flowanalysis.cs (UsageVector.parameters): Remove.
3708         (UsageVector): Update to changes.
3709         (VariableMap): Remove.
3710
3711         Avoid creating ParameterMap in every block
3712         * statement.cs (Block.ParameterMap): Move ...
3713         (ToplevelBlock.ParameterMap): ... here.
3714         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3715         only once.
3716         * flowanalysis.cs (FlowBranching.param_map): Remove.
3717         (FlowBranching.UsageVector): Update to changes.
3718         (FlowBranchingToplevel.CheckOutParameters): Likewise.
3719
3720         * statement.cs (Block.CloneTo): Clone Toplevel field too.
3721
3722         * expression.cs (ParameterReference): Distinguish between block
3723         where parameter was referenced and declared.
3724
3725 2007-05-18  Marek Safar  <marek.safar@gmail.com>
3726
3727         * flowanalysis.cs, statement.cs: Put back improved error handling.
3728
3729 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
3730         
3731         * assign.cs:
3732         * expression.cs:
3733           Imporved object and collection initialization (C# 3.0).
3734
3735 2007-05-15  Marek Safar  <marek.safar@gmail.com>
3736
3737         A fix for bug #81380
3738         * expression.cs (Is.DoResolve): Only value types have constant `is'
3739         behaviour.
3740
3741 2007-05-15  Raja R Harinath  <rharinath@novell.com>
3742
3743         * statement.cs (ToplevelBlock.child): Remove.
3744
3745 2007-05-15  Raja R Harinath  <harinath@gmail.com>
3746
3747         Rationalize ResolveMeta: refactoring
3748         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
3749         out constant handling code into ...
3750         (Block.DoResolveConstants): ... this.
3751
3752         Rationalize ResolveMeta: kill local_map
3753         * statement.cs (Block.local_map, Block.LocalMap): Remove.
3754         (Block.AssignableSlots): New.
3755         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
3756         for locals -- move code from VariableMap here.  Avoid unnecessary
3757         allocations.
3758         * flowanalysis.cs (FlowBranching.local_map): Remove.
3759         (FlowBranching..ctor): Use Block.AssignableSlots.
3760         (VariableMap): Remove unused constructors.
3761
3762 2007-05-11  Raja R Harinath  <rharinath@novell.com>
3763
3764         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3765
3766 2007-05-11  Marek Safar  <marek.safar@gmail.com>
3767
3768         * typemanager.cs (IsFriendAssembly): Should not be called for building
3769         assembly.
3770
3771 2007-05-09  Marek Safar  <marek.safar@gmail.com>
3772
3773         * literal.cs (NullConstant): Print null in all cases.
3774         
3775         * expression.cs (Binary.ResolveOperator): Implemented delegate
3776          comparison based on C# 2.0 changes.
3777
3778 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
3779
3780         This code is contributed under the MIT X11 license
3781         
3782         The following enables support for several C# 3.0 language features:
3783         
3784         * cs-tokenizer.cs: Added support for the "var" keyword.
3785         
3786         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3787           Added VarExpr class to facilitate type inferencing.
3788         
3789         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3790           to support anonymous types.
3791         
3792         * assign.cs: Added support for type inferencing and initialization.
3793         
3794         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3795         
3796         * expression.cs: Added implicit array support to ArrayCreation.
3797           Added 5 types and 1 interface:
3798           
3799           IInitializable                Implementing classes can inject initializing
3800                                         statements after object instantiation.
3801           
3802           Initializer                   Stores data for object initialization.
3803           
3804           AnonymousType                 An expression for anonymous types.
3805           
3806           AnonymousTypeParameter        Stores data about an anonymous type's field.
3807           
3808           NewInitialize                 An expression for object initialization.
3809           
3810           CollectionInitialize          An expression for collection initialization.
3811         
3812         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3813           statements.
3814
3815 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3816
3817         A fix for bug #81500
3818         * cs-tokenizer.cs: Add special handling for coalescing operator.
3819
3820 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3821
3822         A fix for bug #81529
3823         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3824         its value from base class until it is redefined.
3825
3826 2007-05-02  Raja R Harinath  <rharinath@novell.com>
3827
3828         Fix regression in cs0631-3.cs
3829         * cs-parser.jay (operator_declarator): Add opt_attributes to error
3830         fallback.  Make error fallback catch more cases.
3831
3832 2007-05-01  Miguel de Icaza  <miguel@novell.com>
3833
3834         * cs-parser.jay: Allow parameters in operator declarations to have
3835         attributes. 
3836
3837 2007-04-27  Miguel de Icaza  <miguel@novell.com>
3838
3839         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3840         exists. 
3841
3842         * lambda.cs (ContextualReturn.Resolve): An expression is valid
3843         inside the ContextualReturn, it does not have to be an
3844         ExpressionStatement. 
3845
3846 2007-04-24  Miguel de Icaza  <miguel@novell.com>
3847
3848         * lambda.cs (ContextualReturn.Resolve): if the return type is not
3849         set, set it.
3850
3851 2007-04-23  Miguel de Icaza  <miguel@novell.com>
3852
3853         * anonymous.cs (AnonymousContainer): split the virtual Resolve
3854         method in two methods: ResolveNoDefine and Resolve.
3855
3856         ResolveNoDefine will stop just after ResolveTopBlock has been
3857         called.   
3858
3859         Resolve will then continue by creating a method and issuing the
3860         call to method.Define ().
3861
3862         (AnonymousMethod): Split and implement the new Resolve and
3863         ResolveNoDefine as well.
3864
3865         * lambda.cs (LambdaExpression): Split the anonymous method
3866         resolution code into a separate routine (CoreCompatibilityTest)
3867         from DoCompatibleTest.
3868
3869         (LambdaExpression.TryBuild): New method, this method tries to
3870         build the LambdaExpression with the given set of types to be used
3871         as the types for the various parameters of the lambda expression. 
3872
3873         If the compilation succeed with the given types, the infered type
3874         of the Anonymous method is returned, otherwise null is returned.
3875
3876 2007-04-23  Marek Safar  <marek.safar@gmail.com>
3877
3878         A fix for bug #81414
3879         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3880
3881 2007-04-22  Miguel de Icaza  <miguel@novell.com>
3882
3883         * cs-tokenizer.cs: Change various identifiers here from the
3884         camelCasing to the recommended Linux-like style for instance
3885         variables from the Coding Guidelines. 
3886
3887 2007-04-19  Martin Baulig  <martin@ximian.com>
3888
3889         * convert.cs
3890         (Convert.ImplicitReferenceConversionCore): Allow conversions from
3891         System.Enum to System.ValueType.
3892
3893 2007-04-13  Martin Baulig  <martin@ximian.com>
3894
3895         Rewrote implicit reference conversions.  We need to distinguish
3896         between implicit reference conversions (13.1.4) and implicit
3897         boxing conversions (13.1.5).
3898
3899         According to the spec, there's an an implicit conversion
3900         "From a one-dimensional array-type S[] to IList<T> and base
3901         interfaces of this interface, provided there is an implicit
3902         reference conversion from S to T."  Note that this does not
3903         include boxing conversions.
3904
3905         * convert.cs
3906         (Convert.ImplicitTypeParameterBoxingConversion): New method.
3907         (Convert.ImplicitReferenceConversion): Split into
3908         ImplicitReferenceConversionCore() and
3909         ImplicitBoxingConversionExist().
3910         (Convert.ImplicitReferenceConversionExists): Use the new
3911         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3912
3913 2007-04-12  Martin Baulig  <martin@ximian.com>
3914
3915         * convert.cs (Convert.ImplicitReferenceConversion): Move the
3916         `TypeManager.null_type' checks up to the top of the method.
3917
3918 2007-04-11  Marek Safar  <marek.safar@gmail.com>
3919
3920         A fix for bug #81350
3921         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3922         extension methods.
3923
3924 2007-04-11  Martin Baulig  <martin@ximian.com>
3925
3926         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3927         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
3928         to make this work for generic classes; fixes #79561.
3929
3930 2007-04-11  Martin Baulig  <martin@ximian.com>
3931
3932         * expression.cs (As): Add support for nullable types; fixes #79371.
3933
3934 2007-04-11  Martin Baulig  <martin@ximian.com>
3935
3936         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
3937         `type.FullName' is null; fixes #80243.
3938
3939 2007-04-11  Martin Baulig  <martin@ximian.com>
3940
3941         * expression.cs (Invocation.IsApplicable): Don't modify the method
3942         if type inference succeeded, but the method was not applicable.
3943         Fixes #81250.
3944
3945 2007-04-10  Marek Safar  <marek.safar@gmail.com>
3946
3947         A fix for bug #81324
3948         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
3949         internal and external namespaces containers.
3950
3951 2007-04-10  Martin Baulig  <martin@ximian.com>
3952
3953         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
3954         TypeManager.DropGenericMethodArguments() so we also call
3955         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
3956
3957 2007-04-10  Martin Baulig  <martin@ximian.com>
3958
3959         * iterators.cs (Iterator.CreateIterator): Don't crash if
3960         `method.ReturnType' is null.  This happens if something went wrong
3961         while resolving that typ (we already reported an error in this case).
3962
3963 2007-04-10  Martin Baulig  <martin@ximian.com>
3964
3965         * expression.cs (New.DoResolve): Don't call CheckComImport() on
3966         generic interfaces; report the CS0144 directly.
3967
3968 2007-04-10  Martin Baulig  <martin@ximian.com>
3969
3970         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
3971         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
3972
3973 2007-04-10  Martin Baulig  <martin@ximian.com>
3974
3975         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
3976
3977 2007-04-09  Raja R Harinath  <rharinath@novell.com>
3978
3979         A better fix
3980         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
3981         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
3982
3983         Fix #81338
3984         * statement.cs (For.Resolve): If resolution fails, use
3985         KillFlowBranching.
3986
3987 2007-04-08  Marek Safar  <marek.safar@gmail.com>
3988
3989         * anonymous.cs (MakeName): Make faster and zero-based.
3990         (VerifyExplicitParameterCompatibility): Back to mode where generic
3991         parameter is ignored.
3992         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
3993
3994         * class.cs (EmitType): Method can emit another new method.
3995
3996         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
3997
3998         * driver.cs: Updated.
3999
4000         * lambda.cs: Reuse predefined empty parameters.
4001
4002         * parameter.cs: Updated
4003
4004         * support.cs: Implemented InflateTypes.
4005
4006         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
4007         (InitSystemCore): Introduced to isolate 3.0 dependencies.
4008
4009 2007-04-03  Martin Baulig  <martin@ximian.com>
4010
4011         Fix #80632.
4012
4013         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
4014         version of TypeManager.IsOverride() which also works with generic
4015         types.  
4016
4017 2007-04-03  Martin Baulig  <martin@ximian.com>
4018
4019         Fix #81044.
4020
4021         * convert.cs
4022         (Convert.ExplicitReferenceConversion): We need to cast when
4023         converting from IList<T> to S[].
4024
4025 2007-04-01  Marek Safar  <marek.safar@gmail.com>
4026
4027         * decl.cs (FindExtensionMethods): Consider all candidates with same name
4028         at this level.
4029         
4030         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
4031
4032 2007-03-31  Marek Safar  <marek.safar@gmail.com>
4033
4034         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
4035         argument and return type inferring.
4036
4037         * codegen.cs (InferReturnType): Flag whether return can be inferred.
4038         (ReturnType): Turned to property.
4039
4040         * statement.cs (Return): Implemented return type inferring.
4041
4042         * support.cs (ReflectionParameters): Use local types if possible.
4043
4044 2007-03-30  Raja R Harinath  <rharinath@novell.com>
4045
4046         * flowanalysis.cs (FlowBranching.Reachability): Remove.
4047         (FlowBranching.UsageVector): Update to changes.
4048
4049         Prepare to kill 'Reachability'
4050         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
4051         argument of constructor.
4052
4053 2007-03-29  Raja R Harinath  <rharinath@novell.com>
4054
4055         Prepare to kill 'Reachability'
4056         * flowanalysis.cs (UsageVector.is_unreachable): New.
4057         (UsageVector): Update to maintain 'is_unreachable' in parallel to
4058         'reachability', and verify they're consistent.
4059
4060         Fix #81121
4061         * expression.cs (New.EmitStatement): Handle type parameters here too.
4062
4063 2007-03-29  Martin Baulig  <martin@ximian.com>
4064
4065         Fix #79148.
4066
4067         * anonymous.cs
4068         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
4069         CompilerGeneratedClass.
4070         (ScopeInfo.EmitScopeInstance): Make this protected.
4071         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
4072         `ec.CurrentAnonymousMethod.Scope == Scope'.
4073
4074         * statement.cs (Block.ScopeInfo): Make this a property.
4075
4076 2007-03-27  Raja R Harinath  <harinath@gmail.com>
4077
4078         Prepare to kill 'Reachability'
4079         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
4080         (FlowBranching.UsageVector.Reachability): Remove property.
4081         (FlowBranching.UsageVector.IsUnreachable): New property.
4082         (FlowBranching.UsageVector.ResetBarrier): New.
4083         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
4084         * codegen.cs, statement.cs: Update to changes.
4085
4086 2007-03-27  Martin Baulig  <martin@ximian.com>
4087
4088         Fix #81209.
4089
4090         * decl.cs
4091         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
4092         generic types.
4093
4094 2007-03-26  Raja R Harinath  <rharinath@novell.com>
4095
4096         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
4097         instead of TriState.  Remove all mention of TriState.
4098
4099         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
4100         replaced by a boolean.  Add boolean 'is_unreachable' field, check
4101         and maintain invariants.
4102
4103 2007-03-25  Marek Safar  <marek.safar@gmail.com>
4104
4105         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
4106
4107 2007-03-25  Marek Safar  <marek.safar@gmail.com>
4108
4109         * expression.cs: Stop using obsolete 2.0 opcodes.
4110
4111 2007-03-25  Marek Safar  <marek.safar@gmail.com>
4112
4113         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
4114         one of the latests Martin's fixes.
4115
4116 2007-03-23  Miguel de Icaza  <miguel@novell.com>
4117
4118         * expression.cs: On BigEndian systems, swap the bytes, temporary
4119         solution until we get a new bitconverter class.
4120
4121 2007-03-23  Martin Baulig  <martin@ximian.com>
4122
4123         Fix #81158.
4124
4125         * decl.cs (MemberCache.AddMembers): Add generic methods both as
4126         "Method" and "Method`1".  Normally, a cache lookup is done on the
4127         "Method" form (ie. without the generic arity), but this one makes
4128         lookups on the full form work as well.
4129
4130 2007-03-22  Raja R Harinath  <rharinath@novell.com>
4131
4132         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
4133         unused properties.
4134
4135 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
4136         * class.cs: 
4137         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
4138         ordered_member_list, to TypeBuilder to store members to be defined
4139         in the order they were parsed in.
4140         - ordered_explicit_member_list contains all properties indexers
4141           and methods that are defined as explicit implementation of an
4142           interface or base class.
4143         - ordered_member_list contains all properties indexers and methods
4144           that are not defined as explicit implementation of an interface
4145           or base class.
4146
4147         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
4148         functionality in these removed classes has been replaced with 
4149         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
4150         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
4151
4152         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
4153         to CheckForDuplications inside GetMethod and SetMethod Define Method
4154         to handle method property and indexer name conflicts.
4155
4156         Fixes #79434
4157
4158         All code is contributed under the MIT/X11 license.
4159
4160 2007-03-20  Martin Baulig  <martin@ximian.com>
4161
4162         * class.cs (TypeContainer.Interfaces): Removed; they're now
4163         included in `TypeContainer.Types'.
4164
4165 2007-03-20  Martin Baulig  <martin@ximian.com>
4166
4167         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
4168
4169         * class.cs (TypeContainer.CreateType): New public method.  This is
4170         now called before DefineType() to create the TypeBuilders.
4171         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
4172         has already been created by CreateType().
4173         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
4174         don't resolve our base classes here; this has been moved into
4175         DefineBaseTypes().  We're now called from CreateType().
4176         (TypeContainer.DefineBaseTypes): New private method; resolve our
4177         base classes here.  We're now called from DefineType().
4178
4179         * rootcontext.cs
4180         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
4181         our types first to create all the TypeBuilders.  After that, call
4182         TypeContainer.DefineType() on all the types which'll resolve their
4183         base classes and setup the resolve order.
4184
4185 2007-03-20  Martin Baulig  <martin@ximian.com>
4186
4187         * class.cs (TypeContainer.Enums): Removed; they're now included in
4188         `TypeContainer.Types'.  
4189
4190 2007-03-20  Martin Baulig  <martin@ximian.com>
4191
4192         * class.cs
4193         (TypeContainer.DefineType): Don't call ResolveMembers() here.
4194         (TypeContainer.DoResolveMembers): Call DefineType() on our
4195         `compiler_generated' classes; moved here from DefineNestedTypes().
4196
4197         * rootcontext.cs
4198         (RootContext.ResolveTree): Call ResolveMembers() on all
4199         TypeContainer's in the `type_container_resolve_order'.
4200
4201 2007-03-19  Marek Safar  <marek.safar@gmail.com>
4202
4203         * class.cs: Use corlib to handle InternalMethodImplAttribute.
4204
4205 2007-03-17  Marek Safar  <marek.safar@gmail.com>
4206
4207         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
4208         implementation flags.
4209
4210 2007-03-17  Marek Safar  <marek.safar@gmail.com>
4211
4212         * class.cs: More optimizations for type parameters.
4213
4214 2007-03-15  Marek Safar  <marek.safar@gmail.com>
4215
4216         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
4217
4218         * ecore.cs, parameter.cs: More common code for both corlibs.
4219
4220         * typemanager.cs (IsGenericMethod): Simplified.
4221
4222 2007-03-15  Raja R Harinath  <rharinath@novell.com>
4223
4224         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4225         'returns'.
4226         * statement.cs, iterators.cs, lambda.cs: Update to changes.
4227
4228         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
4229         unconditionally.  Simplify explanation.
4230         (Try.Resolve, Using.Resolve): Likewise.
4231
4232 2007-03-15  Martin Baulig  <martin@ximian.com>
4233
4234         Fix #80731.
4235
4236         * decl.cs (DeclSpace): If we're a partial class, use our
4237         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
4238
4239 2007-03-15  Raja R Harinath  <rharinath@novell.com>
4240
4241         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4242         'throws'.
4243         (FlowBranching.UsageVector): Update to changes.
4244         (FlowBranching.MergeSiblings): Likewise.
4245         * statement.cs: Likewise.
4246
4247 2007-03-15  Martin Baulig  <martin@ximian.com>
4248
4249         Fix #79302.
4250
4251         * decl.cs
4252         (MemberCache): Added a special .ctor for type parameters.
4253
4254         * typemanager.cs
4255         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
4256         `MemberCache'.  
4257
4258 2007-03-09  Martin Baulig  <martin@ximian.com>
4259
4260         * enum.cs (Enum): Make this a TypeContainer.
4261         (EnumMember): Derive from `Const'.
4262
4263         * const.cs
4264         (Const.DoResolveValue): New protected virtual method; move most of
4265         the functionality of ResolveValue() here so we can override it in
4266         `EnumMember'.
4267         (Const.CreateConstantReference): Make this virtual.
4268
4269         * class.cs (Kind): Add `Kind.Enum'.
4270         (TypeContainer.Emit): Don't emit the enums here; they're already
4271         in the `RootContext.typecontainer_resolve_order'.
4272
4273         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4274         here; they're already in the `typecontainer_resolve_order'.
4275
4276         * ecore.cs (EnumConstant.ConvertImplicitly): Add
4277         TypeManager.DropGenericTypeArguments().
4278
4279         * typemanager.cs
4280         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4281         (TypeManager.IsEnumType): Likewise.
4282         (TypeManager.EnumToUnderlying): Likewise.
4283         (TypeManager.IsEqual): Add support for enums.
4284
4285 2007-03-12  Raja R Harinath  <rharinath@novell.com>
4286
4287         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4288         DefaultParameterValueAttribute to be undefined, say if System.dll
4289         is not referenced.
4290
4291 2007-03-11  Marek Safar  <marek.safar@gmail.com>
4292
4293         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4294         any mscorlib.
4295
4296 2007-03-10  Marek Safar  <marek.safar@gmail.com>
4297
4298         * class.cs, parameter.cs: Unified parameters verification.
4299
4300 2007-03-08  Martin Baulig  <martin@ximian.com>
4301
4302         * cs-parser.jay (constructor_header): Pass the location to the
4303         newly created TopLevelBlock.
4304
4305 2007-03-07  Martin Baulig  <martin@ximian.com>
4306
4307         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4308
4309 2007-03-06  Miguel de Icaza  <miguel@novell.com>
4310
4311         * convert.cs (ExplicitReferenceConversionExists): Sync this method
4312         with the changes from David, fixes the build.
4313
4314 2007-03-05  David Mitchell  <dmitchell@logos.com>
4315
4316         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4317         and its base interfaces to a one-dimensional array type S[],
4318         provided there is an implicit or explicit reference conversion
4319         from S to T.
4320
4321 2007-03-03  Marek Safar  <marek.safar@gmail.com>
4322
4323         * cs-tokenizer.cs: Implemented basic linq grammar.
4324
4325         * driver.cs: Set linq lang version on demand.
4326
4327 2007-02-26  Marek Safar  <marek.safar@gmail.com>
4328
4329         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4330
4331 2007-02-25  Marek Safar  <marek.safar@gmail.com>
4332
4333         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4334         (Fixes #80455)
4335
4336         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4337         here.
4338         Check property and event extern attributes.
4339
4340         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4341         charset.
4342
4343 2007-02-24  Marek Safar  <marek.safar@gmail.com>
4344
4345         A fix for bug #80407
4346         * ecore.cs: Don't report ambiguity error when methods have same parent.
4347
4348 2007-02-23  Marek Safar  <marek.safar@gmail.com>
4349
4350         A fix for bug #80878
4351         * class.cs, cs-parser.jay: Event property can host anonymous methods.
4352
4353 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4354
4355         * attribute.cs: Enable ExtensionAttribute presence test.
4356
4357 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4358
4359         * class.cs: Warn about missing GetHashCode only when Equals is override.
4360
4361         * decl.cs: Check accessibility of type arguments.
4362
4363         * typemanager.cs: Correctly report nullable array.
4364
4365 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4366
4367         * class.cs, report.cs: Capture more details when things go wrong.
4368
4369 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4370
4371         A fix for bug #80650
4372         * cs-parser.jay: Anonymous container starts at constructor declaration
4373         and not at block beginning because it has to be usable in constructor
4374         initializer.
4375
4376         * statement.cs: Use context location and not block one for error reporting.
4377
4378 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4379
4380         A fix for bug #78712
4381         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4382         too.
4383
4384 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4385
4386         A fix for bug #80493 by Atsushi Enomoto
4387         * cs-parser.jay: Ignore invalid attribute target.
4388
4389 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4390  
4391         * cs-tokenizer.cs: Ignore '\0' as white space character.
4392
4393 2007-02-17  Miguel de Icaza  <miguel@novell.com>
4394
4395         * cs-parser.jay: Add support for lambda expressions to the mcs
4396         compiler as well.
4397
4398         * lambda.cs: Only clone when we are probing, not on the final call
4399         (Compatible is the final call). 
4400
4401         * statement.cs (CloneContext): Introduce class to provide block
4402         remapping during clone.
4403
4404         All statements Clone themselves now.
4405
4406         (Clone): special handling for blocks, when we clone a block, we
4407         register the block inside this routine, as children of the block
4408         might trigger a lookup. 
4409         
4410         * expression.cs: Add support for CloneContext in all expressions. 
4411         
4412 2007-02-17  Marek Safar  <marek.safar@gmail.com>
4413  
4414         A fix for bug #80493
4415         * statement.cs: Report ambiguous warning when interfaces are not related.
4416
4417 2007-02-15  Marek Safar  <marek.safar@gmail.com>
4418
4419         C# 3.0 extension methods.
4420
4421         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4422         cannot be used directly.
4423
4424         * class.cs (Class.Emit): Emit extension attribute if any class method
4425         is extension method.
4426         (Method.Define): Add basic extension method validation conditions.
4427         (Method.Emit): Emit extension attribute for method.
4428
4429         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4430         extension method exists. Currently we follow same approach as Microsoft
4431         does, emit even if a method or a class are private but this can change
4432         later.
4433
4434         * cs-parser.jay: Add handling of `this' keyword in method parameters
4435         context.
4436
4437         * decl.cs (DeclSpace.IsStaticClass): New property.
4438         (MemberCache.FindExtensionMethods): Looks for extension methods with
4439         defined name and extension type.
4440
4441         * doc.cs: Updated after OverloadResolve changes.
4442
4443         * driver.cs: Add new soft reference to System.Core.dll.
4444
4445         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4446         (ExtensionMethodGroupExpr): Represents group of extension methods.
4447
4448         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4449         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4450         to MethodGroupExpr and made non-static for easier customization.
4451         (Invocation.DoResolve): Add extension method lookup when no standard
4452         method was found.
4453         (MemberAccess.DoResolve): Try extension methods if no member exists.
4454
4455         * modifiers.cs: Add METHOD_EXTENSION modifier.
4456
4457         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4458         as well as candidate extension type.
4459         (ComputeNamespaces): When assembly constains extension methods registers
4460         them.
4461         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4462         extension method lookup.
4463         (Namespace.LookupExtensionMethod): Looks for extension method in this
4464         namespace.
4465         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4466         find a method which matches name and extensionType.
4467
4468         * parameter.cs (Parameter): Add This modifer.
4469         (HasExtensionMethodModifier): New property.
4470         (Resolve): Add extension parameter check.
4471         (ModFlags): turned to property to exclude this modifier as it is not real
4472         parameter modifier.
4473         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4474
4475         * support.cs (ParameterData): Add ExtensionMethodType.
4476         (ReflectionParameters): Implemented ExtensionMethodType interface property.
4477
4478         * typemanager.cs: Add type and ctor extension attribute type.
4479
4480 2007-02-15  Miguel de Icaza  <miguel@novell.com>
4481
4482         * report.cs (DisableErrors, EnableErrors): used to prevent error
4483         output when we are "trying" to compile various methods with
4484         different types. 
4485
4486         * ecore.cs (Expression): Add Clone method that calls the virtual
4487         CloneTo method.  The current CloneTo method in Expression throws
4488         an exception so we can track down all the places where this must
4489         be implemented (not using abstract, because that would be a lot of
4490         up-front-work before we can start testing the implementation
4491         idea). 
4492
4493         Important: we only need Clone capabilities for expressions created
4494         by the parser, as the expressions we will be cloning are
4495         expressions in the pre-resolved state.   This vastly simplifies
4496         the work required. 
4497         
4498         (SimpleName): Add CloneTo that does nothing.
4499         (EmptyCast): Add CloneTo.
4500         
4501         * expression.cs (Binary): Implement CloneTo.
4502         (Invocation.IsApplicable): Store the current ec in
4503         EmitContext.TempEc and restore it on return.  This is used so we
4504         do not have to sprinkle hundres of methods with an extra
4505         EmitContext, we know that the only user is the lambda expression
4506         ImplicitConversionExists code. 
4507         
4508         (Argument): Add Cloning capabilities.
4509         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4510         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4511         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4512         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4513         IndexerAccess): Add Clone capability.
4514
4515         (LocalVariableReference, This): TODO: needs cloned Block mapping.
4516
4517         (Argument): Add cloning capability.
4518
4519         * assign.cs (Assign): Implement CloneTo.
4520
4521         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4522         
4523         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4524         version by calling Convert with the EmitContext (that we are
4525         currently storing in ec, this is not great, but will do for now,
4526         to avoid passing EmitContext parameters to hundreds of functions
4527         that do not need them now).
4528
4529         (SetExpression): Remove, it is not needed.
4530         
4531         (ContextualReturn): Implement CloneTo.
4532
4533         * statement.cs (Statement): Implement cloning infrastructure,
4534         similar to expressions.
4535
4536         (Block): Partial implementation of Clone for statements.
4537
4538         (Return): Implement clone.
4539         
4540         * constant.cs (Constant.CloneTo): New method, does nothing.
4541
4542         * codegen.cs (TempEc): Add a static EmitContext as a temporary
4543         solution, until we decide how to exactly do this.  
4544         
4545 2007-02-14  Marek Safar  <marek.safar@gmail.com>
4546  
4547         A fix for bug #80493
4548         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4549         a property is override we need to use second accessor.
4550
4551 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4552  
4553         A fix for bug #80418
4554         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4555         methods.
4556
4557 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4558
4559         Another fix for bug #80749
4560         * pending.cs: Abstract class has priority over interfaces.
4561
4562 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4563
4564         Another fix for bug #80749
4565         * pending.cs: Abstract class has priority over interfaces.
4566
4567 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4568
4569         Another fix for bug #80749
4570         * pending.cs: Abstract class has priority over interfaces.
4571
4572 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4573
4574         Another fix for bug #80749
4575         * pending.cs: Abstract class has priority over interfaces.
4576
4577 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4578
4579         * class.cs Better error message.
4580
4581         * driver.cs: Add shorter versions of -optimize option.
4582
4583 2007-02-13  Martin Baulig  <martin@ximian.com>
4584
4585         * class.cs (Constructor.Emit): Check the return value of
4586         ec.ResolveTopBlock() and return on error.
4587
4588 2007-02-13  Raja R Harinath  <rharinath@novell.com>
4589
4590         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4591         message to fix error message regression.
4592
4593 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4594
4595         * delegate.cs: Delegate creation expression cannot be of Nullable type.
4596
4597 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4598
4599         A fix for bug #80749
4600         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4601         its parent container.
4602
4603         * class.cs (DefineFieldInitializers): Each initializer can has different
4604         resolve context.
4605
4606         * const.cs: Updated.
4607
4608 2007-02-11  Miguel de Icaza  <miguel@novell.com>
4609
4610         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4611         now all the heavy lifting to check that embedded statements or
4612         expressions have the right form is done in the ContextualReturn.
4613
4614         (ContextualReturn): New class.  
4615
4616         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4617         method that can be invoked to report 201, so we do not replicate
4618         this everywhere.
4619
4620         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4621         
4622         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4623         treating tabs as spaces. 
4624
4625 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4626
4627         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4628         * assign.cs: Use full implicit conversion for right side check.
4629
4630 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4631
4632         * statement.cs (Switch): Switch over boolean type is not standardized.
4633
4634 2007-02-08  Marek Safar  <marek.safar@gmail.com>
4635
4636         A fix for bug #80755
4637         * decl.cs (FindBaseEvent): Don't use method cache for events.
4638
4639 2007-02-07  Marek Safar  <marek.safar@gmail.com>
4640
4641         * cs-parser.jay: Better syntax error handling.
4642
4643         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4644         instead of underlying type value.
4645
4646 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4647
4648         * driver.cs: Check define identifier before is registered.
4649
4650         * namespace.cs: Use existing error message.
4651
4652         * report.cs: New warning.
4653
4654 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4655
4656         A fix for bug #80742
4657         * expression.cs: Delegate Invoke method can be called directly.
4658
4659 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4660
4661         A fix for bug #80676
4662         * class.cs (IsEntryPoint): The Main method can have params modifier.
4663
4664 2007-02-04  Miguel de Icaza  <miguel@novell.com>
4665
4666         * parameter.cs (Parameter, Parameters): Add Clone method.
4667
4668         * anonymous.cs (Compatible): Turn method into virtual method, so
4669         LambdaExpression can implement a different behavior.
4670
4671         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4672         out the basic checking here, so it can be used by
4673         LambdaExpressions.
4674         
4675         * lambda.cs: Introduce "Compatible" function that will do the
4676         heavy lifting.
4677
4678 2007-02-02  Marek Safar  <marek.safar@gmail.com>
4679
4680         * attribute.cs: Unified one error message.
4681
4682         * class.cs (Class): Use type attributes and not properties to test static
4683         class.
4684         (IsEntryPoint): Don's pass local variable.
4685
4686         * convert.cs: Removed duplicate check.
4687
4688         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4689
4690         * driver.cs: Don't crash when soft reference does not exist.
4691
4692         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4693         (UsingEntry): Removed redundant allocation.
4694
4695         * parameter.cs: Add fast path for type parameters.
4696
4697         * support.cs: Don't allocate attribute when it's not used.
4698
4699 2007-01-30  Miguel de Icaza  <miguel@novell.com>
4700
4701         * anonymous.cs
4702         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4703         this into a virtual method, so we can override it in LambdaExpression.
4704
4705         * driver.cs: Improve diagnostics in case of failure. 
4706
4707         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4708         write a function that is slightly more complex and that parses:
4709
4710         type identifier [, type identifier]* )
4711
4712         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4713         this expression:
4714
4715                 (canEmpty ? i >= 0 : i > 0)
4716
4717 2007-01-30  Raja R Harinath  <rharinath@novell.com>
4718
4719         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4720         exception on possibly valid code.
4721
4722 2007-01-29  Raja R Harinath  <rharinath@novell.com>
4723
4724         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4725         Push/PopPosition.
4726         (parse_opt_type_arguments): Remove.  It's almost the same as
4727         parse_less_than.
4728         (parse_namespace_or_typename): Use parse_less_than.
4729
4730 2007-01-28  Miguel de Icaza  <miguel@novell.com>
4731
4732         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4733         this bug took a few hours to find, because the state saved and
4734         restored by PushPosition and PopPosition was ignoring the state of
4735         parse_generic_less_than.
4736
4737         I can also now remove the handling of OP_LT and OP_GT, this solves
4738         the big mistery.
4739         
4740         * cs-tokenizer.cs: store the location for the ARROW token, we use
4741         that in the parser.
4742
4743         (PushPosition, PopPosition): save/restore also `current_token',
4744         restore `parse_generic_less_than' (was missing).
4745
4746         (parse_opt_type_arguments): use parse_type, not
4747         parse_namespace_or_typename to parse types.
4748
4749         * lambda.cs: Empty new file, will eventually have the lambda
4750         expression implementation.
4751
4752         * lambda.test: used to test the internal tokenizer. 
4753
4754         * report.cs (FeatureIsNotISO1): Rename from
4755         FeatureIsNotStandardized, because it was about the language level
4756         (1 vs 2) it was not about standarization.
4757
4758         (FeatureRequiresLINQ): New.
4759
4760         * support.cs (SeekableStreamReader): Only require that the reader
4761         is a TextReader, not a StreamReader, so we can plug StringReader. 
4762
4763         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4764         given position in the input stream the following tokens can be
4765         parsed as a type followed by an identifier.
4766
4767         (is_punct): after a '(' if parse_type_and_parameter returns true,
4768         then return a special token OPEN_PARENS_LAMBDA which is used to
4769         avoid reduce/reduce errors in the grammar for the
4770         lambda_expression rules.
4771
4772         (parse_type): implement a type parser inside the
4773         tokenizer, the parser only returns true or false depending on
4774         whether the input at a given position can be parsed as a type.
4775
4776         (peek_token): new method used during type parsing.
4777
4778 2007-01-28  Raja R Harinath  <rharinath@novell.com>
4779
4780         Fix #80531
4781         * anonymous.cs (ScopeInfo.InflateParameters): New.
4782         (AnonymousContainer.Resolve): Use it to redirect types of
4783         delegate parameters.
4784
4785 2007-01-27  Raja R Harinath  <rharinath@novell.com>
4786
4787         Fix #80530
4788         * expression.cs (Error_InvalidArguments): Don't use two different
4789         messages for CS1503.  Use ExtraInformation and
4790         SymbolRelatedToPreviousError instead.
4791
4792         Fix #80358
4793         * decl.cs (DeclSpace.initialize_type_params): Don't access
4794         'type_params' of a partial class directly.
4795
4796 2007-01-26  Miguel de Icaza  <miguel@novell.com>
4797
4798         * constant.cs: Removed a handful of out-of-range checks that were
4799         not necessary. 
4800
4801 2007-01-25  Marek Safar  <marek.safar@gmail.com>
4802
4803         * expression.cs (CheckUselessComparison): Add additional check for char
4804         constants.
4805
4806         * namespace.cs: Fixed typo.
4807
4808 2007-01-23  Miguel de Icaza  <miguel@novell.com>
4809
4810         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4811         gone, instead we inline the test, preventing the needless casts to
4812         longs, ulongs and doubles for the parameters, avoiding calls to
4813         methods that overchecked stuff, and instead inlined things
4814         nicely. 
4815
4816 2007-01-20  Marek Safar  <marek.safar@gmail.com>
4817
4818         * cs-parser.jay: Better parameter error handling.
4819
4820 2007-01-17  Marek Safar  <marek.safar@gmail.com>
4821
4822         A fix for bug #80368, #80522
4823         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4824         whether array initializer contains constants only.
4825         (ArrayCreation.Emit): Use better formula to decide when
4826         are array initializers for static initialization.
4827         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4828         have to emit even constants otherwise they are pre-initialized.
4829
4830 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
4831             Raja R Harinath  <rharinath@novell.com>
4832
4833         Fix emit order of 'get' vs. 'set'.
4834         * support.cs (Accessors): New.
4835         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4836         Note the order in which accessors are declared in the source.
4837         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4838         Refactored from Property.Define and Indexer.Define.
4839         (PropertyBase.DefineAccessors): New helper that calls the above in
4840         appropriate order as noted by the parser.
4841         (Property.Define, Indexer.Define): Update to changes.
4842         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4843
4844 2007-01-17  Raja R Harinath  <rharinath@novell.com>
4845
4846         Fix cs0029-6.cs and gcs0029-2.cs (regression)
4847         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4848         there's an implicit conversion from the current type to the target
4849         type before converting the underlying constant.
4850
4851 2007-01-16  Marek Safar  <marek.safar@gmail.com>
4852
4853         * const.cs (ResolveValue): Updated after constant conversion was made more
4854         generic.
4855
4856         * constant.cs (GetAttributableValue): constant to object conversion is
4857         used for attributes only.
4858         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4859         constant conversions.
4860         (LongConstant.ConvertImplicitly): Ditto.
4861
4862         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4863         (ImplicitConversionStandard): Handle constant conversion as extra step.
4864         It solves the issue when constant conversion was called indirectly like
4865         inside array initializer and constant folding was skipped.
4866
4867         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4868         this change.
4869
4870         * statement.cs(ImplicitConversionStandard): Updated after constant
4871         conversion was made more generic.
4872
4873 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
4874
4875         * expression.cs (As.DoResolve): Use GenericConstraints instead of
4876         Constraints, solves the problem where the compiler incorrectly
4877         reported that a type parameter was not constrained to a class (Bug
4878         80518)
4879
4880 2007-01-14  Marek Habersack  <grendello@gmail.com>
4881
4882         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4883
4884 2007-01-14  Marek Safar  <marek.safar@gmail.com>
4885
4886         A fix for bug #80368
4887         * assign.cs (FieldInitializer): New class implements field
4888         initializer statement.
4889
4890         * attribute.cs: Update after FieldMember rename.
4891
4892         * class.cs (PropertyBasedMember): New common class for property based
4893         types.
4894         (InterfaceMemberBase): New base class for all members which can be used as
4895         an interface members.
4896         (MethodCore): Moved really common code to InterfaceMemberBase.
4897         (Method.Define): Equal and GetHasCode detection is relevant for methods
4898         only.
4899         (MethodData.Define): Don't assume that public event implements an
4900         interface automatically.
4901         (MethodData.DefineMethodBuilder): Issue an error even if only extern
4902         modifier is used.
4903         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4904         (FieldMember): Merged with FieldBase.
4905         (EventProperty.AEventPropertyAccessor): New specialization to check whether
4906         event extern modifier can be used.
4907         (EventField.EventFieldAccessor): Moved event field specific code here.
4908         (Event.AllowedModifiers): Even event can be extern.
4909         (Event.FindOutBaseMethod): New override specific to events.
4910         (Indexer.parameters): Reintroduce parameters because base class holds
4911         only properties common data.
4912         (Indexer.CheckForDuplications): Indexers are threated as methods so we
4913         need do extra parameters check.
4914
4915         * const.cs: Update after FieldMember rename.
4916
4917         * decl.cs (MemberCache.FindBaseEvent): New method.
4918
4919         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4920         to reflect that indexer is now derived from PropertyBased.
4921
4922         * ecore.cs (GetMemberType): Made public.
4923         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4924         obsolete event.
4925
4926         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
4927         
4928         * typemanager.cs (CSharpSignature): Correctly print event accessors.
4929         (RegisterEvent): Removed.
4930         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
4931         (GetPrivateFieldOfEvent): Renamed to GetEventField.
4932
4933 2007-01-11  Raja R Harinath  <rharinath@novell.com>
4934
4935         Fix #80249
4936         * statement.cs (CollectionForeach.TryType): Prefer generic
4937         GetEnumerator over non-generic variant.  Fix code to follow comments.
4938
4939 2007-01-09  Raja R Harinath  <rharinath@novell.com>
4940
4941         Fix #80446
4942         * support.cs (ReflectionParameter): Don't use an invalid index on
4943         the generic parameter data.
4944
4945 2007-01-08  Miguel de Icaza  <miguel@novell.com>
4946
4947         * driver.cs: Just add a tiny bit of infrastructure.
4948
4949 2007-01-02  Marek Safar  <marek.safar@gmail.com>
4950
4951         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
4952         where field type is struct from current assembly.
4953         
4954         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
4955         it is possible.
4956
4957 2007-01-02  Marek Safar  <marek.safar@gmail.com>
4958
4959         A fix for bug #80381
4960         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
4961         the core types.
4962
4963         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
4964         messages.
4965         (Namespace.LookupType): Always use core types from corlib when speficied.
4966
4967         * report.cs: A new warning.
4968
4969         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
4970         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
4971         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
4972
4973         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
4974         (InitCoreTypes): Set expression type of object_type and value_type
4975         immediately after lookup.
4976
4977 2007-01-01  Miguel de Icaza  <miguel@novell.com>
4978
4979         * cs-tokenizer.cs: Accept Pc class characters (Connector
4980         Punctuation) as valid identifiers.  Fixes #78259
4981
4982         * expression.cs (Invocation.DoResolve): Moved the check for the
4983         use of `this' for doing method calls to the Invocation resolution
4984         step, after overload resolution has taken place instead of doing
4985         the check at the low-level `This.DoResolve' level.
4986
4987         The `This.DoResolve'(appens before overload resolution, so it has
4988         no way of knowing if the method that will be called will be
4989         instace or static, triggering an erroneous report for cs0188 (Bug
4990         78113).
4991
4992         We now do the check for instance method invocations after we know
4993         what method will be called.
4994
4995         (This.CheckThisUsage): Move the actual use of this structure
4996         checking into its own method and expose it. 
4997
4998         * Everywhere that called Error_ValueCannotBeConverted: pass a new
4999         EmitContext.
5000
5001         Exceptions: Null.ConvertImplicitly,
5002         Constant.ImplicitConversionRequired as there are too many call
5003         sites for passing the ec. 
5004
5005         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
5006         EmitContext, if the value is null, then we do not try to provide
5007         the extra information from the error (If a userdefined conversion
5008         exists, as UserDefinedConversion requires a non null-EmitContext).
5009
5010         Fixes: #80347
5011
5012 2006-12-30  Raja R Harinath  <rharinath@novell.com>
5013
5014         * flowanalysis.cs (MyBitVector): Document some invariants.
5015         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
5016         introduced below, and add a couple of others, 
5017
5018 2006-12-30  Marek Safar  <marek.safar@gmail.com>
5019
5020         * attribute.cs (GetMethodObsoleteAttribute): Uses new
5021         GetPropertyFromAccessor and GetEventFromAccessor.
5022         
5023         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
5024         overrides non-obsolete one.
5025         (Indexer.Define): Error message has been moved to the parser.
5026
5027         * cs-parser.jay: Better syntax errors handling.
5028
5029         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
5030         when an invocation has no arguments.
5031
5032         * ecore.cs: Removed not used caching.
5033
5034         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
5035         implementation.
5036
5037         * report.cs: Add a new warning.
5038
5039         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
5040
5041         * typemanager.cs (enumeration_type): Removed.
5042         (CSharpSignature): Reuses IsSpecialMethod.
5043         (IsEqual): Hack for MS BCL.
5044         (GetPropertyFromAccessor): New method.
5045         (GetEventFromAccessor): New method.
5046         (IsSpecialMethod): Fixed to handle more cases.
5047
5048 2006-12-30  Marek Safar  <marek.safar@gmail.com>
5049
5050         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
5051         Made white spaces array static.
5052
5053         * ecore.cs (RemoveGenericArity): Optimized.
5054
5055         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
5056         10 times faster).
5057         (MyBitVector.initialize_vector): Simplified.
5058
5059 2006-12-22  Miguel de Icaza  <miguel@novell.com>
5060
5061         * ecore.cs: Am not entirely happy with this hack, but it seems to
5062         address the issue in 80257 (a small test case for
5063         CreativeDocs.NET). 
5064
5065         I set the MethodGroupExpr.Type to an internal compiler type
5066         (itself in this case) to force the resolution to take place.   Why
5067         it does not take place with a null is beyond me.
5068
5069 2006-12-20  Marek Safar  <marek.safar@gmail.com>
5070
5071         A fix for bug #80288
5072         * expression.cs (ResolveOperator): Consider user defined conversion for
5073         logical and operator too.
5074         (EmitBranchable): Optimization for logical and when full constant folding
5075         could not be applied but one operand is constant.
5076
5077 2006-12-19  Marek Safar  <marek.safar@gmail.com>
5078
5079         * class.cs (GetClassBases): Write 5 times every day, will never use
5080         FullName for error reporting.
5081
5082         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
5083
5084 2006-12-19  Martin Baulig  <martin@ximian.com>
5085
5086         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
5087         the symbol file info here.
5088
5089 2006-12-18  Marek Safar  <marek.safar@gmail.com>
5090
5091         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
5092         of `elseif' is taking then following sections are not taking.
5093         Fixes an issue reported on mono mailing list.
5094
5095 2006-12-18  Marek Safar  <marek.safar@gmail.com>
5096
5097         A fix for bug #80300
5098         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
5099         a caller is not taking.
5100
5101 2006-12-18  Raja R Harinath  <rharinath@novell.com>
5102
5103         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
5104         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
5105         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
5106         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
5107         * class.cs: Update to changes.
5108
5109 2006-12-17  Marek Safar  <marek.safar@gmail.com>
5110
5111         A fix for bug #79934
5112         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
5113         partial container.
5114
5115         * class.cs (ResolveMembers): Register an iterator in current container and
5116         not in shared one.
5117
5118 2006-12-16  Raja R Harinath  <rharinath@novell.com>
5119
5120         Fix test-543.cs
5121         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
5122         satisfy a params annotated parameter.
5123
5124 2006-12-16  Marek Safar  <marek.safar@gmail.com>
5125
5126         A fix for bug #77014
5127         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
5128         paramters correctly and not rely on hacks in Parameters class.
5129         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
5130         at any possition.
5131         (Invocation.VerifyArgumentsCompat): Ditto.
5132         (Invocation.EmitArguments): Changed to correctly emit params arguments at
5133         any possition.
5134
5135         * parameter.cs (HasParams): Don't assume that params is the last one.
5136
5137         * support.cs (ReflectionParameters.ctor): Look for params attribute
5138         correctly.
5139         (ReflectionParameters.ParameterType): Removed hack when we returned last
5140         parameter for out of range parameters.
5141         (ParameterName, ParameterModifier): Ditto.
5142
5143 2006-12-14  Marek Safar  <marek.safar@gmail.com>
5144
5145         A fix for bug #79987
5146         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
5147         when assembly is not CLS compliant but type is. I have no idea why is this
5148         allowed.
5149
5150         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
5151
5152 2006-12-13  Miguel de Icaza  <miguel@novell.com>
5153
5154         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
5155         in struct constructors, they are basically no-ops.
5156
5157 2006-12-12  Marek Safar  <marek.safar@gmail.com>
5158
5159         * cs-tokenizer.cs (Position): Save preprocessor status too.
5160
5161 2006-12-12  Marek Safar  <marek.safar@gmail.com>
5162
5163         A fix for bug #77794
5164         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
5165
5166 2006-12-12  Marek Safar  <marek.safar@gmail.com>
5167
5168         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
5169         Fixes #69299.
5170         (pp_expr): Report error for an invalid expression.
5171         (handle_preprocessing_directive): Simplified; add more error checking.
5172
5173 2006-12-11  Marek Safar  <marek.safar@gmail.com>
5174
5175         A fix for bug #74939
5176         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
5177         directives handling.
5178
5179 2006-12-10  Marek Safar  <marek.safar@gmail.com>
5180
5181         A fix for bugs #80093, and #75984
5182         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
5183         logic, it seems to me as it worked before "by coincidence".
5184         (xtoken): Simplified to use reworked handle_preprocessing_directive.
5185         (cleanup): Enabled endif check.
5186
5187 2006-12-09  Marek Safar  <marek.safar@gmail.com>
5188
5189         A fix for bug #80162
5190         * statement.cs (CollectionForeach.TryType): Generics and non-generics
5191         enumerators are never ambiguous.
5192
5193 2006-12-08  Raja R Harinath  <rharinath@novell.com>
5194
5195         Fix #80060
5196         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
5197
5198 2006-12-06  Marek Safar  <marek.safar@gmail.com>
5199
5200         A fix for bug #80144
5201         * class.cs (EventProperty.Define): Explicit implementation means
5202         that an even is used.
5203
5204 2006-12-06  Marek Safar  <marek.safar@gmail.com>
5205
5206         Fixes the operators implementation (part II)
5207
5208         * cfold.cs (DoConstantNumericPromotions): Renamed to
5209         DoBinaryNumericPromotions and simplified.
5210         (BinaryFold): Couple of conversion fixes; simplified.
5211
5212         * constant.cs, ecore.cs, literal.cs
5213         (ToType): Renamed to ConvertImplicitly.
5214         (Reduce): Renamed to ConvertExplicitly.
5215
5216         * class.cs, convert.cs: Updated.
5217
5218         * expression.cs: TryReduce doesn't throw an exception.
5219
5220 2006-12-01  Marek Safar  <marek.safar@gmail.com>
5221
5222         A fix for bug #80108
5223         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
5224         compatible.
5225
5226 2006-11-30  Marek Safar  <marek.safar@gmail.com>
5227
5228         Fixes unary operators implementation (part I)
5229         Also fixes #80026
5230
5231         * cfold.cs (Error_CompileTimeOverflow): Made internal
5232
5233         * const.cs (IConstant): Changed to use reference to constant and
5234         not constant itself.
5235         Updated IConstant implementations.
5236
5237         * constant.cs (CreateConstant): New factory method.
5238         Updated IConstant implementation.
5239
5240         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
5241
5242         * ecore.cs: Updated to use CreateConstantReference.
5243
5244         * enum.cs: Reflects IConstant changes.
5245
5246         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
5247
5248         * literal.cs (NullConstant): Change to be independently usable.
5249
5250 2006-11-29  Martin Baulig  <martin@ximian.com>
5251
5252         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
5253         we need to emit the scope initializer before calling the base .ctor.
5254
5255         * anonymous.cs: Merged back from the new anonymous methods branch.
5256         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
5257
5258         * expression.cs (ParameterReference.DoResolveBase): Create a
5259         "normal" ScopeInfo when capturing parameters rather than using the
5260         root scope; this makes things work with anonymous methods having
5261         parameters.
5262
5263         * statement.cs
5264         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5265
5266 2006-11-22  Marek Safar  <marek.safar@gmail.com>
5267
5268         A fix for bug #79987
5269         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5270         check to a base class.
5271         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5272         only when assembly has missing attribute.
5273         * report.cs: Update.
5274
5275 2006-11-21  Marek Safar  <marek.safar@gmail.com>
5276
5277         * cs-tokenizer.cs: Merged with gmcs version.
5278
5279 2006-11-20  Marek Safar  <marek.safar@gmail.com>
5280
5281         * cs-tokenizer.cs,
5282         * cs-parser.jay: Better error message when partial keyword is misplaced.
5283
5284 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
5285
5286         A fix for bug #79810
5287         report.cs: CS1058 only applies to 2.0 profile (gmcs).
5288         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5289         a RuntimeWrappedException by default.
5290
5291 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5292
5293         A fix for bug #79843
5294         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5295         implementation.
5296         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5297
5298 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5299
5300         * driver.cs, namespace.cs: Uses faster IndexOf version.
5301
5302 2006-11-17  Marek Safar  <marek.safar@gmail.com>
5303
5304         A fix for bug #79941
5305         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5306         operators.
5307         (Operator.Define): Implicit/Explicit operator of same type is duplicate
5308         even if internal name is different.
5309         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5310         (UserDefinedConversion): Simplified as the operators cannot be internal.
5311         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5312         conversions.
5313         (MethodLookup): Replaced EmitContext with parentType.
5314         * expression.cs: Updated.
5315
5316 2006-11-09  Raja R Harinath  <rharinath@novell.com>
5317
5318         * driver.cs (BadAssembly): Handle all the ugliness of
5319         DefineDynamicAssembly.
5320
5321 2006-11-08  Raja R Harinath  <rharinath@novell.com>
5322
5323         Address parts of #58244 -- most of what's left is in the runtime
5324         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
5325         CS1509 error checks, and handle them for all assembly loads, not
5326         just the first invocation.
5327         (LoadModule): Likewise.  Move handling of 'adder_method' ...
5328         * codegen.cs (AssemblyClass.AddModule): ... here.
5329
5330 2006-11-02  Marek Safar  <marek.safar@gmail.com>
5331
5332         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5333         IEnumerable<T> is ambiguous.
5334
5335 2006-10-31  Marek Safar  <marek.safar@gmail.com>
5336
5337         A fix for bug #67689
5338         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5339         GetEnumerator is ambiguous.
5340
5341         * report.cs: Add new warning.
5342
5343 2006-10-29  Marek Safar  <marek.safar@gmail.com>
5344
5345         A fix for bug #78602
5346         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5347         to protected member can be nested type.
5348
5349 2006-10-28  Marek Safar  <marek.safar@gmail.com>
5350
5351         A fix for bug #78965
5352         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5353         to protected member must derive from current type.
5354
5355 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5356
5357         assign.cs: Reuses error method.
5358
5359         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5360         instead of type for constants.
5361         (Expression.Error_ValueAssignment): Common error method.
5362
5363         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5364         for any assignment.
5365
5366 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5367
5368         A fix for bug #79081
5369         * expression.cs (MemberAccess.DoResolve): Check nested type
5370         accessibility.
5371
5372 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
5373
5374         * doc.cs : nested delegates were not handled. Fixed bug #79754.
5375
5376 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5377
5378         A fix for bug #76591
5379         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5380
5381 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5382
5383         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5384         type forwarder of the same type multiple times.
5385
5386 2006-10-26  Raja R Harinath  <rharinath@novell.com>
5387
5388         Fix #78820
5389         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5390         instance as an rvalue, even when we later resolve as an lvalue.
5391
5392 2006-10-25  Martin Baulig  <martin@ximian.com>
5393
5394         * anonymous.cs: Fix #79673.
5395
5396 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
5397
5398         A fix for bug #79666
5399         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5400         ignored when is optimized (= default value) as its value is already set.
5401
5402 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5403
5404         A fix for bug #79724
5405         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5406         TypeContainer for type lookup.
5407
5408 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5409
5410         A fix for bug #79231
5411         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5412         * expression.cs (OverloadResolve): Always convert type name for
5413         an error message.
5414         (ResolveNamespaceOrType): Don't confuse a nested type with any 
5415         other member.
5416
5417 2006-10-18  Martin Baulig <martin@ximian.com>
5418
5419         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5420
5421 2006-10-17  Miguel de Icaza  <miguel@novell.com>
5422
5423         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5424         an int32, but requesting an int64 from the conversion
5425
5426 2006-10-12  Martin Baulig  <martin@ximian.com>
5427
5428         * anonymous.cs
5429         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
5430         
5431 2006-10-12  Martin Baulig  <martin@ximian.com>
5432
5433         * statement.cs
5434         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5435
5436 2006-10-11  Miguel de Icaza  <miguel@novell.com>
5437
5438         * convert.cs: Remove broken code: I was doing the "Existance"
5439         tests for Implicit conversions.
5440
5441 2006-10-10  Miguel de Icaza  <miguel@novell.com>
5442
5443         * convert.cs: Added one missing case in
5444         ImplicitStandardConversionExists uint64 to intptr.
5445
5446         Fixes #59800
5447         
5448         * typemanager.cs (uintptr_type): another core known type.   
5449
5450         * ecore.cs (OperatorCast): routine used to do cast operations that
5451         depend on op_Explicit.  We could change some of the Decimal
5452         conversions to use this.
5453
5454         This one has a probe mechanism that checks both types for an op_
5455         which it coudl be used to eliminate two classes: CastToDecimal
5456         and CastFromDecimal.
5457
5458         * convert.cs: Implement the conversions documented in #59800
5459         
5460 2006-10-10  Martin Baulig  <martin@ximian.com>
5461
5462         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5463         before RootScope.ResolveMembers().
5464
5465         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5466         `CurrentType' if appropriate.
5467
5468 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
5469
5470         A fix for bug #78568
5471         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5472         when contains binary operators.
5473         * cs-parser.jay: Updated.
5474
5475 2006-10-09  Martin Baulig  <martin@ximian.com>
5476
5477         * delegate.cs
5478         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5479         moved that into Define() and also do the other type parameter
5480         checks there.  Fixes #79094.  Added gtest-292.cs.
5481
5482         * expression.cs
5483         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5484         since that doesn't include type parameters; don't use `Ldelema'
5485         for type parameters.  Fixes #78980.  Added gtest-293.cs.
5486
5487 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
5488
5489         A fix for #77796
5490         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5491         conversion is allowed.
5492
5493 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5494
5495         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5496         error reporting when no error occurs.
5497
5498 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5499
5500         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5501         does not exist.
5502
5503 2006-10-06  Raja R Harinath  <rharinath@novell.com>
5504
5505         Fix #79584
5506         * class.cs (DefineTypeBuilder): Check circular dependencies before
5507         setting the parent of the TypeBuilder.
5508         (CheckRecursiveDefinition): Don't use 'BaseType', since
5509         it may not be valid until after DefineTypeBuilder.  Use
5510         'base_type' instead.
5511
5512 2006-10-04  Martin Baulig  <martin@ximian.com>
5513
5514         Merged the Anonymous Methods patch.
5515
5516         * anonymous.cs, iterators.cs: The new anonymous methods code.
5517
5518         * statement.cs (Variable): New public abstract class.
5519         (LocalInfo.Variable): New public property.
5520         (LocalInfo.ResolveVariable): New public method.
5521         (Block.Flags): Add `IsIterator'.
5522         (Block.AddVariable): Improved the CS0136 check.
5523         (Block.AnonymousChildren): New public property.
5524         (Block.AddAnonymousChild): New public method.
5525         (ToplevelBlock): Update to use the new anonymous method framework.
5526         (ToplevelBlock.ctor): `container' is now a `Block' and not a
5527         `ToplevelBlock'; this is required to correctly implement the
5528         CS0136 check.
5529         (Fixed, Using): Use `TemporaryVariable' instead of directly
5530         creating the `LocalBuilder'.
5531
5532         * parameter.cs (Parameter.ResolveVariable): New public method.
5533         (Parameters.ResolveVariable): Likewise.
5534
5535         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5536
5537         * class.cs (TypeContainer): Replaced the `iterators' list and
5538         corresponding methods with a list of `CompilerGeneratedClass'es.
5539         (TypeContainer.ResolveMembers): New public method.
5540         (Method): `IIteratorContainer' has been replaced by
5541         `IAnonymousHost'.
5542
5543         * expression.cs (VariableReference): New public abstract base
5544         class for `LocalVariableReference', `ParameterReference' and
5545         `This'.
5546
5547         * codegen.cs (EmitContext): Removed `capture_context',
5548         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5549         (EmitContext.EmitThis): Removed.
5550
5551         * cs-parser.jay: Replace `iterator_container' with
5552         `anonymous_host'.       
5553
5554 2006-10-04  Martin Baulig  <martin@ximian.com>
5555
5556         * generic.cs (GenericMethod): Don't make this abstract.
5557         (Constraints.Clone): Added dummy implementation.
5558
5559 2006-10-04  Raja R Harinath  <harinath@gmail.com>
5560
5561         Fix #79577
5562         * namespace.cs (LookForAnyGenericType): Avoid nullref on
5563         'declspaces'.  Avoid allocating arrays willy-nilly.
5564
5565         Fix #79553
5566         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5567         cases out of the switch.
5568
5569 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5570
5571         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5572         message when non-generic type is used with the type arguments.
5573         * expression.cs: Updated.
5574
5575 2006-09-28  Raja R Harinath  <rharinath@novell.com>
5576
5577         Fix #79013
5578         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5579         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5580         Change semantics slightly.  Don't insist on having only one
5581         temporary EmptyExpression -- just throttle the creation of new ones.
5582
5583         Fix #79451
5584         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5585         non-interfaces too.  If no methods are found, don't try to create
5586         a MethodGroupExpr.
5587
5588 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5589
5590         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5591         generic type.
5592
5593         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5594         us produce better error message.
5595
5596 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
5597
5598         * expression.cs (Binary.ResolveOperator): Warn about a side effect
5599         of the `|' operator.
5600
5601         * report.cs: A new warning added.
5602
5603 2006-09-27  Martin Baulig  <martin@ximian.com>
5604
5605         * generic.cs (GenericMethod): Don't make this abstract.
5606
5607 2006-09-27  Martin Baulig  <martin@ximian.com>
5608
5609         * report.cs
5610         (InternalErrorException): Added overloaded ctor taking a params array.
5611
5612 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
5613
5614         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5615         Fixed the cases when same error was reported twice.
5616
5617         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5618         now report symbol information.
5619
5620 2006-09-25  Martin Baulig  <martin@ximian.com>
5621
5622         * class.cs: Completely unified with the gmcs version.
5623
5624 2006-09-25  Martin Baulig  <martin@ximian.com>
5625
5626         * typemanager.cs (TypeManager.IsNullableType): New public function.
5627         (TypeManager.IsNullableTypeOf): Likewise.
5628         (TypeManager.IsNullableValueType): Likewise.
5629
5630         * class.cs (MethodCore): Added the `GenericMethod' argument from
5631         gmcs and also unified all classes derived from `MethodCore' with gmcs.
5632
5633 2006-09-24  Raja R Harinath  <harinath@gmail.com>
5634
5635         * convert.cs: Unify with gmcs version.
5636
5637 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5638
5639         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5640         verify them as well.
5641
5642         * report.cs: New warning.
5643
5644 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5645
5646         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5647         for anonymous block with out argument.
5648
5649 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5650
5651         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5652         not used private events only.
5653
5654 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
5655
5656         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5657
5658         * const.cs (Const.Define): Check for constant type.
5659         (Const.IsConstantTypeValid): Looks for valid constant types.
5660
5661         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5662
5663         * ecore.cs (EmptyConstantCast): New common class for all constant based
5664         EmptyCast(s).
5665
5666         * expression.cs (Is.DoResolve): Handle null constant especially.
5667         (New.DoResolve): Check for new void().
5668         (MemberAccess.DoResolve): Cope with all kind of nulls.
5669
5670         * literal.cs (NullConstant): Uses EmptyConstantCast.
5671         (NullDefault): Based on EmptyConstantCast.
5672         (NullLiteral): Uses EmptyConstantCast.
5673
5674         * statement.cs (Block.ResolveMeta): Check for constant type.
5675
5676 2006-09-22  Martin Baulig  <martin@ximian.com>
5677
5678         * delegate.cs, attribute.cs: Merged with the gmcs versions.
5679
5680 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5681
5682         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5683         not the null type.
5684
5685         Fix part of #79451
5686         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5687         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
5688         code slightly.
5689
5690 2006-09-22  Martin Baulig  <martin@ximian.com>
5691
5692         * ecore.cs: Merged with the gmcs version.
5693
5694         * generic.cs (ConstructedType): New dummy class.
5695         (TypeArguments): Don't make this abstract.
5696
5697         * typemanager.cs
5698         (TypeManager.IsGenericTypeDefinition): New method.
5699         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5700
5701 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5702
5703         * expression.cs (ComposedCast): Check for arrays of TypedReference
5704         before creating the type, not after.
5705
5706 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
5707
5708         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5709         after ToType change.
5710
5711         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5712         when constant must be implicitly convertible.
5713
5714         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5715
5716         * ecore.cs (NullCast): Derives from NullConstant.
5717
5718         * expression.cs (Is.DoResolve): Removed useless variables.
5719         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5720         (New.Constantify): Add enum support.
5721         (MemberAccess.DoResolve): Add warning when accessing null constant or
5722         variable.
5723
5724         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5725         property.
5726
5727         * literal.cs (NullConstant): New abstract class with common
5728         functionality for all null specializations.
5729         (NullDefault): Represents default(X) when result can be
5730         reduced to null.
5731         (NullLiteral): Updated.
5732
5733         * report.cs: Add new warning.
5734
5735 2006-09-21  Martin Baulig  <martin@ximian.com>
5736
5737         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5738
5739 2006-09-21  Martin Baulig  <martin@ximian.com>
5740
5741         * generic.cs (GenericConstraints): New dummy class.
5742         (Constraints): Likewise.
5743         (TypeParameter): Likewise.
5744         (TypeParameterName): Likewise.
5745         (GenericMethod): Likewise.
5746
5747         * typemanager.cs (TypeManager.GetGenericArguments): New method.
5748
5749         * decl.cs: Merged with the gmcs version.
5750
5751 2006-09-21  Raja R Harinath  <rharinath@novell.com>
5752
5753         * generic.cs (TypeParameter): Implement IMemberContainer.
5754         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
5755
5756         * rootcontext.cs: Unify with gmcs version.
5757
5758         * report.cs: Unify with gmcs version.
5759         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5760         from gmcs/generics.cs.
5761         * generics.cs (TypeParameter): New dummy class.
5762
5763         * support.cs: Unify with gmcs version.
5764
5765 2006-09-20  Raja R Harinath  <rharinath@novell.com>
5766
5767         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5768         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5769
5770         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5771         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5772         * mcs.exe.sources: Add generic.cs.
5773
5774         * codegen.cs: Unify with gmcs version.
5775
5776         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5777         (EmitContext): Add GenericDeclContainer implementation.
5778         * decl.cs (MemberCore, DeclSpace): Likewise.
5779         * namespace.cs: Remove #ifdef GMCS_SOURCE.
5780
5781         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5782         MCS TypeManager has a corresponding dummy method.
5783
5784 2006-09-19  Martin Baulig  <martin@ximian.com>
5785
5786         * expression.cs: Completely merged with the gmcs version.
5787
5788 2006-09-19  Martin Baulig  <martin@ximian.com>
5789
5790         * expression.cs (Invocation): Merged with the gmcs version.
5791         (ArrayAccess.GetStoreOpcode): Likewise.
5792
5793 2006-09-19  Martin Baulig  <martin@ximian.com>
5794
5795         * typemanager.cs
5796         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5797         (TypeManager.IsGenericMethodDefinition): Likewise.
5798
5799 2006-09-19  Martin Baulig  <martin@ximian.com>
5800
5801         * typemanager.cs
5802         (TypeManager.IsEqual): Moved the gmcs implementation here.
5803         (TypeManager.DropGenericTypeArguments): Likewise.
5804         (TypeManager.DropGenericMethodArguments): Likewise.
5805         (TypeManager.GetTypeArguments): Moved here from gmcs.
5806         (TypeManager.HasGenericArguments): Likewise.
5807
5808 2006-09-19  Martin Baulig  <martin@ximian.com>
5809
5810         * expression.cs (Binary): Merged with the gmcs version.
5811
5812 2006-09-19  Martin Baulig  <martin@ximian.com>
5813
5814         * expression.cs (Probe, As, Is): Merged with the gmcs version.
5815
5816 2006-09-19  Martin Baulig  <martin@ximian.com>
5817
5818         * typemanager.cs: Merged with the gmcs version.
5819
5820 2006-09-16  Raja R Harinath  <rharinath@novell.com>
5821
5822         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5823         * driver.cs: Likewise.
5824
5825 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
5826
5827         A fix for #79401
5828         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5829         only if parent type is class.
5830         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5831         update.
5832
5833 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
5834
5835         * cs-parser.jay,
5836         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5837         keywords are used.
5838         * typemanager.cs(CSharpName): Converts NullType to null.
5839
5840 2006-09-15  Martin Baulig  <martin@ximian.com>
5841
5842         * typemanager.cs
5843         (TypeManager.GetMethodName): Added mcs implementation.
5844         (TypeManager.IsEqual): Likewise.
5845
5846         * ecore.cs
5847         (SimpleName.RemoveGenericArity): Added dummy implementation.
5848
5849         * pending.cs: Merged with the gmcs version.     
5850
5851 2006-09-15  Martin Baulig  <martin@ximian.com>
5852
5853         * statement.cs: Merge with the gmcs version.
5854
5855 2006-09-15  Martin Baulig  <martin@ximian.com>
5856
5857         * statement.cs (Switch): Merge with the gmcs implementation
5858         (without nullables), which is newer.
5859
5860 2006-09-15  Martin Baulig  <martin@ximian.com>
5861
5862         * statement.cs (Block.Variables): Make this public.
5863         (ToplevelBlock.Parameters): Make this a property.
5864         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5865
5866 2006-09-15  Martin Baulig  <martin@ximian.com>
5867
5868         * namespace.cs: Merge with the gmcs version.
5869
5870 2006-09-15  Martin Baulig  <martin@ximian.com>
5871
5872         * decl.cs (MemberName): Minor code cleanups.
5873
5874 2006-09-15  Martin Baulig  <martin@ximian.com>
5875
5876         * parameter.cs: Merge with the gmcs version.
5877
5878 2006-09-15  Martin Baulig  <martin@ximian.com>
5879
5880         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5881         and an error in mcs.
5882
5883 2006-09-15  Martin Baulig  <martin@ximian.com>
5884
5885         * flowanalysis.cs: Merged from GMCS; added the generics code into
5886         a `GMCS_SOURCE' conditional so we can share this file.
5887
5888 2006-09-08  Martin Baulig  <martin@ximian.com>
5889
5890         * typemanager.cs (TypeManager.interlocked_type): New public field.
5891         (TypeManager.int_interlocked_compare-exchange): New public field.
5892         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5893         enumerator types here and call InitGenericCoreTypes().
5894         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5895         after calling InitEnumUnderlyingTypes().
5896
5897         * rootcontext.cs
5898         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5899         `classes_second_stage'. 
5900
5901 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
5902
5903         * assign.cs, ecore.cs, expression.cs: Share error message text.
5904         * class.cs (FieldMember.Define): Check for varible of static type.
5905         * driver.cs (LoadAssembly): Uses error output for errors.
5906         * statement.cs: Updated.
5907
5908 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
5909
5910         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5911         type instance.
5912
5913 2006-09-07  Martin Baulig  <martin@ximian.com>
5914
5915         * driver.cs
5916         (MainDriver): Revert r62663 from Marek; see #70506 for details.
5917
5918 2006-08-29  Miguel de Icaza  <miguel@novell.com>
5919
5920         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5921         
5922 2006-08-17  Miguel de Icaza  <miguel@novell.com>
5923
5924         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5925         #52019 and #79064, the use of the \uXXXX sequence in source code
5926         to represent unicode characters.
5927
5928 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
5929
5930         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
5931         support.
5932         * class.cs, ecore.cs, statement.cs: Merged to one error message.
5933
5934 2006-08-13  Miguel de Icaza  <miguel@novell.com>
5935
5936         * assign.cs: Catch attempts to assign to a method groups in += and
5937         report as 1656
5938
5939 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
5940
5941         A fix for #79056
5942         * cs-parser.jay: Don't destroy current array type by typeof of array's.
5943
5944 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
5945
5946         * class.cs (Method.Define): Issue a warning when generic method looks like
5947         an entry point.
5948         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
5949         as well.
5950
5951 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
5952  
5953         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
5954         looking for ctor.
5955         * decl.cs (MemberCache.FindMembers): When container is interface we need to
5956         search all base interfaces as a member can be ambiguous.
5957         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
5958         Constructor member type filter. 
5959         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
5960         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
5961         reporting for returned memberinfos.
5962         * report.cs: Updated.
5963         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
5964         version to work on all runtimes.
5965         (TypeManager.RealMemberLookup): Removed members filtering.
5966
5967 2006-08-08  Raja R Harinath  <rharinath@novell.com>
5968
5969         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
5970         (PropertyExpr.EmitAssign): Likewise.
5971         * expression.cs (Indirection.EmitAssign): Likewise.
5972         (LocalVariableReference.EmitAssign): Likewise.
5973         (ParameterReference.EmitAssign): Likewise.
5974         (Invocation.EmitArguments): Likewise.
5975         (ArrayAccess.EmitAssign): Likewise.
5976         (IndexerAccess.EmitAssign): Likewise.
5977         (This.EmitAssign): Likewise.
5978         (ConditionalLogicalOperator.Emit): Likewise.
5979
5980         Fix #79026
5981         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
5982         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
5983         leave it in after returning it.
5984         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
5985
5986 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
5987
5988         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
5989         message.
5990
5991 2006-08-03  Raja R Harinath  <rharinath@novell.com>
5992
5993         Fix cs0146-3.cs and cs0146-4.cs.
5994         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
5995         enclosing types don't depend on the current type.
5996
5997 2006-08-02  Raja R Harinath  <rharinath@novell.com>
5998
5999         Fix #77963
6000         * class.cs (TypeContainer.DoDefineMembers): Use
6001         FindBaseMemberWithSameName on Parent, since we're interested in
6002         whether we hide inherited members or not.
6003         (FindBaseMemberWithSameName): Make slightly more robust.
6004
6005         Fix the non-generic testcase from #77396
6006         * decl.cs (DeclSpace.DeclContainer): Remove override.
6007
6008         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
6009         declspaces for doppelgangers too.
6010         (UsingEntry): Implement IResolveContext.
6011         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
6012         'this' as the resolve context.
6013         (LocalAliasEntry): Likewise.
6014
6015         Implement parts of #77403
6016         * roottypes.cs (RootDeclSpace): New.  Used to represent the
6017         toplevel declaration space.  Each namespace declaration introduces
6018         a "partial" root declaretion space.
6019         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
6020         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
6021         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
6022         from 'current_namespace.SlaveDeclSpace'.
6023         (namespace_declaration): Likewise.
6024         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
6025         check.  It can't happen now.
6026         * decl.cs (DeclSpace.LookupType): Likewise.
6027         * driver.cs (MainDriver): Sanity check.
6028
6029 2006-08-01  Raja R Harinath  <rharinath@novell.com>
6030
6031         * decl.cs (DeclSpace.FindNestedType): Remove.
6032         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
6033         LookupTypeContainer to get the container of the nested type.
6034         * class.cs (TypeContainer.FindNestedType): Make non-override.
6035
6036 2006-07-31  Raja R Harinath  <rharinath@novell.com>
6037
6038         * decl.cs (DeclSpace.PartialContainer): Move field from ...
6039         * class.cs (TypeContainer.PartialContainer): ... here.
6040         (TypeContainer.AddBasesForPart): New helper.
6041         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
6042         instead.
6043         * cs-parser.jay (current_class): Convert to DeclSpace.
6044         (struct_declaration, interface_declaration, class_declaration):
6045         Use AddBasesForPart instead of .Bases directly.
6046         * const.cs, iterators.cs: Update to changes.
6047
6048 2006-07-28  Raja R Harinath  <rharinath@novell.com>
6049
6050         * class.cs (TypeContainer.AddMemberType): Rename from
6051         AddToTypeContainer.
6052         (TypeContainer.AddMember): Rename from AddToMemberContainer.
6053         (AddTypeContainer): New.  Combine AddClassOrStruct and
6054         AddInterface.
6055         (AddPartial): Update.  Add 'is_partial' argument.
6056         * roottypes.cs: Update to changes.
6057         * cs-parser.jay (push_current_class): New helper for handling
6058         current_container and current_class.
6059         (struct_declaration, interface_declaration, class_declaration):
6060         Use it.
6061
6062 2006-07-26  Raja R Harinath  <rharinath@novell.com>
6063
6064         * roottypes.cs: Rename from tree.cs.
6065
6066         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
6067         * tree.cs (Tree, ITreeDump): Remove types.
6068         * rootcontext.cs (tree, Tree): Remove fields.
6069         (root, ToplevelTypes): New.
6070         * *.cs: Update to rename.
6071
6072         * tree.cs (Tree.RecordDecl): Remove.
6073         (RootTypes.AddToTypeContainer): Record the toplevel type in its
6074         namespace here.
6075         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
6076
6077 2006-07-23  Raja R Harinath  <harinath@gmail.com>
6078
6079         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
6080         DoFlowAnalysis and OmitStructFlowAnalysis here.
6081         (ec.With): Rename from WithUnsafe and generalize.
6082         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
6083         (ec.WithFlowAnalyis): New.
6084         * ecore.cs, expression.cs, statement.cs: Update.
6085
6086 2006-07-22  Raja R Harinath  <harinath@gmail.com>
6087
6088         * statement.cs (Block.ResolveMeta): Simplify slightly.
6089
6090         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
6091         multiple boolean fields.  Convert InUnsafe, constant_check_state,
6092         check_state to flags.
6093         (CheckState, ConstantCheckState): Update.
6094         (InUnsafe): New read-only property.
6095         (FlagsHandle): Rename from CheckStateHandle and convert to handle
6096         arbitrary flags.
6097         (WithUnsafe): New helper similar to WithCheckState.
6098         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
6099         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
6100
6101 2006-07-21  Raja R Harinath  <rharinath@novell.com>
6102
6103         Make comparisons use the same IL irrespective of whether they're
6104         in a 'checked' or 'unchecked' context: one of the issues in #78899
6105         * codegen.cs (EmitContext.CheckState): Make read-only property.
6106         (EmitContext.ConstantCheckState): Likewise.
6107         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
6108         helper that implement a save/restore stack for CheckState
6109         values.  This is the only way to change check-state.
6110         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
6111         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
6112         (CheckedExpr.EmitBranchable): New forwarding method.
6113         (UnCheckedExpr): Likewise.
6114         * statement.cs (Block.ResolveMeta): Use WithCheckState.
6115         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
6116         (Checked.Resolve, checked.DoEmit): Likewise.
6117
6118 2006-07-20  Miguel de Icaza  <miguel@novell.com>
6119
6120         * anonymous.cs: Cache the resolved anonymous delegate, and return
6121         this so that the ResolveTopBlock is only triggered once, not
6122         twice.
6123
6124         Currently we trigger ResolvetopBlock twice due to a first pass of
6125         argument check compatibility, and a second pass that does the
6126         actual resolution.   
6127         
6128 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
6129
6130         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
6131         modifiers.
6132         * rootcontext.cs (Reset): Add helper_classes.
6133
6134 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
6135
6136         A fix for #78860
6137         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
6138         correctly.
6139
6140 2006-07-13  Miguel de Icaza  <miguel@novell.com>
6141
6142         * statement.cs (Lock): Handle expressions of type
6143         TypeManager.null_type specially.  Fixes #78770
6144
6145 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
6146
6147         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
6148         to an event.
6149
6150 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
6151
6152         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
6153         for accessors as well.
6154         * ecore.cs (EventExpr): Add AccessorTable.
6155
6156 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
6157
6158         A fix for #78738
6159         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
6160         for CS0122 where appropriate.
6161         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
6162         level attributes.
6163         (Filter): Assembly can be null in the case of top level attributes.
6164
6165 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
6166
6167         A fix for #78690
6168
6169         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
6170         is done at global level.
6171
6172 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
6173
6174         A fix for #77002, Implemented TypeForwarder support.
6175
6176         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
6177         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
6178         * typemanager.cs (): Add type_forwarder_attr_type.
6179
6180 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
6181
6182         * report.cs: Add CS0469 warning.
6183
6184 2006-06-21  Martin Baulig  <martin@ximian.com>
6185
6186         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
6187         the `try'-block, so we also report CS0016 etc. there.
6188
6189 2006-06-21  Martin Baulig  <martin@ximian.com>
6190
6191         * delegate.cs
6192         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
6193
6194 2006-06-21  Martin Baulig  <martin@ximian.com>
6195
6196         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
6197         also report CS1686 for parameters.
6198
6199 2006-06-21  Martin Baulig  <martin@ximian.com>
6200
6201         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
6202         instead of an error if the value is not implicitly convertible to
6203         the switch types; fixes #77964.
6204
6205 2006-06-21  Raja R Harinath  <rharinath@novell.com>
6206
6207         Fix #78673
6208         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
6209         FieldBuilder is null.
6210
6211         Fix #78662
6212         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
6213         'left' and 'right' before error-checking.
6214
6215 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
6216
6217         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
6218         Fixed bug #78601.
6219         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
6220         (FieldExpr.DoResolve): likewise.
6221         (PropertyExpr.InstanceResolve): likewise.
6222         (EventExpr.InstanceResolve): likewise. 
6223
6224 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
6225
6226         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
6227         attribute applicable tests for attribute argument.
6228
6229 2006-06-02  Raja R Harinath  <rharinath@novell.com>
6230
6231         Fix #78079
6232         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
6233         (Binary.OverloadResolve_PredefinedIntegral): New.
6234         (Binary.OverloadResolve_PredefinedFloating): New.
6235         (Binary.OverloadResolve_PredefinedString): New.
6236         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
6237         Follow the standard more closely, and treat numeric promotions in
6238         terms of overload resolution.
6239         (Binary.CheckShiftArguments): Simplify.
6240
6241 2006-06-01  Raja R Harinath  <rharinath@novell.com>
6242
6243         * flowanalysis.cs (MyBitVector): Simplify representation.
6244         (MyBitVector.Clone): Avoid allocating BitArray.
6245         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
6246         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
6247         (*): Update.  Change all references to MyBitVector.And and
6248         MyBitVector.Or to &= and |=.
6249
6250 2006-05-29  Raja R Harinath  <rharinath@novell.com>
6251
6252         Fix cs0231-[34].cs.
6253         * cs-parser.jay (formal_parameter_list): Extend the pattern below
6254         to param arguments too.
6255
6256 2006-05-26  Miguel de Icaza  <miguel@novell.com>
6257
6258         * cs-parser.jay: Catch another parsing form for arglist being
6259         followed by other arguments.  Fixes #78313.
6260
6261 2006-05-24  Raja R Harinath  <rharinath@novell.com>
6262
6263         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6264         checking of out parameters to ...
6265         (FlowBranchingToplevel.Merge): ... here.
6266         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6267         set, propagate the origin upward, and only complain if there was
6268         no other error.
6269         (FlowBranchingException.AddContinueOrigin): Likewise.
6270         (FlowBranchingException.AddReturnOrigin): Likewise.
6271         (FlowBranchingException.AddGotoOrigin): Likewise.       
6272
6273 2006-05-23  Raja R Harinath  <rharinath@novell.com>
6274
6275         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6276         unreachable, skip it.
6277         (FlowBranchingException.Merge): Always propagate jumps, even if
6278         the finally block renders subsequent code unreachable.
6279
6280 2006-05-18  Raja R Harinath  <rharinath@novell.com>
6281
6282         Fix #77601
6283         * statement.cs (Goto.Resolve): Move responsibility for resolving
6284         'goto' to FlowBranching.AddGotoOrigin.
6285         (Goto.SetResolvedTarget): New.  Callback to set the
6286         LabeledStatement that's the target of the goto.
6287         (Goto.DoEmit): Use Leave instead of Br when crossing an
6288         unwind-protect boundary.
6289         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6290         LookupLabel and adjust to new semantics.
6291         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6292         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6293         Goto.SetResolvedTarget to update target.
6294         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6295         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6296         AddBreakOrigin & co.  Delay propagation until ...
6297         (FlowBranchingException.Merge): ... this.
6298
6299         * statement.cs (Block.Resolve): Always depend on flow-branching to
6300         determine unreachability.  Kill workaround that originally emitted
6301         only one statement after an "unreachable" label (see infloop in
6302         test-515.cs).
6303
6304         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6305         This is still "wrong", but anything better would probably need a
6306         multi-pass algorithm.
6307         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6308         usage vector.  Force current usage vector to be reachable, to
6309         optimistically signify backward jumps.
6310         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6311         detected.
6312         (FlowBranchingLabeled.Merge): New.  If no backward jump was
6313         detected, return the original salted-away usage vector instead,
6314         updated with appropriate changes.  Print unreachable warning if
6315         necessary.
6316         * statement.cs (Block.Resolve): Don't print unreachable warning on
6317         a labeled statement.
6318
6319 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
6320
6321         * driver.cs: Pass filename without path to AssemblyBuilder's 
6322         AddResourceFile. Fixes bug #78407.
6323
6324 2006-05-17  Raja R Harinath  <rharinath@novell.com>
6325
6326         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6327         * flowanalysis.cs (FlowBranchingLabeled): ... here.
6328         (FlowBranching.MergeChild): Overwrite
6329         reachability information from Labeled branchings too.
6330
6331 2006-05-16  Raja R Harinath  <rharinath@novell.com>
6332
6333         * statement.cs (Goto.Resolve): Merge jump origins here ...
6334         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6335
6336         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6337         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
6338         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
6339         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6340         here, ...
6341         * statement.cs (Goto.Resolve): ... not here.
6342         (Goto.Emit): Remove CS1632 check.
6343
6344 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
6345
6346         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6347         error message.
6348
6349 2006-05-11  Raja R Harinath  <rharinath@novell.com>
6350
6351         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6352         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6353         (FlowBranchingException.Label): Likewise.
6354
6355         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
6356         given value.
6357         (MyBitVector.Or): Use it to avoid losing information (Count).
6358         (FlowBranching.MergeOrigins): Likewise.
6359
6360         * flowanalysis.cs (UsageVector.IsDirty): Remove.
6361         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6362         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6363         (UsageVector.ToString): Simplify.
6364         (UsageVector.MergeSiblings): Move here from ...
6365         (FlowBranching.Merge): ... here.
6366         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6367         not a MyBitVector.
6368
6369 2006-05-10  Raja R Harinath  <rharinath@novell.com>
6370
6371         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6372         null bitvector is treated as all-true.
6373
6374         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6375         (MyBitVector): Rationalize invariants.  'vector != null' implies
6376         that we have our own copy of the bitvector.  Otherwise,
6377         'InheritsFrom == null' implies all inherited bits are true.
6378
6379 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
6380
6381         * statement.cs (LocalInfo): Add IsConstant.
6382         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6383         local variable for constants.
6384
6385 2006-05-09  Raja R Harinath  <rharinath@novell.com>
6386
6387         * flowanalysis.cs (MyBitVector.Empty): New.
6388         (MyBitVector): Don't allow InheritedFrom to be null.
6389         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6390         (UsageVector, FlowBranching): Update to changes.
6391
6392         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6393         recursion.  The 'Parent == null' condition isn't sufficient for
6394         anonymous methods.
6395         (FlowBranching.AddBreakOrigin): Likewise.
6396         (FlowBranching.AddContinueOrigin): Likewise.
6397         (FlowBranching.AddReturnOrigin): Likewise.
6398         (FlowBranching.StealFinallyClauses): Likewise.
6399         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6400         (FlowBranching.CheckOutParameters): Likewise.
6401         (FlowBranchingToplevel): Terminate all the above recursions here.
6402         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6403         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6404
6405         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
6406         toplevel block.
6407         (FlowBranchingToplevel): New.  Empty for now.
6408         (FlowBranching.MergeTopBlock): Update.
6409         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6410         branching for the anonymous delegate.
6411         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6412
6413         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6414         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6415         information at the start of the merge.  Reorganize.
6416
6417 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6418
6419         * class.cs (MethodData.Define): Method cannot implement interface accessor.
6420
6421 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6422
6423         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6424         to newly introduced ctor.
6425
6426         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6427         message to one place.
6428         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6429         global namespace.
6430
6431 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6432
6433         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6434
6435         * ecore.cs (Expression.ResolveAsConstant): Updated.
6436
6437         * statement.cs (ResolveMeta): Updated.
6438
6439 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6440
6441         * cs-parser.jay: __arglist cannot be used in initializer.
6442
6443 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6444
6445         A fix for #77879
6446         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6447         private types.
6448
6449 2006-05-05  Raja R Harinath  <rharinath@novell.com>
6450
6451         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6452         (LabeledStatement): Add 'name' parameter.
6453         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6454         (Block.AddLabel): Update to changes.
6455         * cs-parser.jay (labeled_statement): Likewise.
6456
6457         * flowanalysis.cs (BranchingType.Labeled): New.
6458         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6459         (FlowBranchingLabeled): New.  Does nothing for now, but will
6460         eventually handle 'goto' flows.
6461         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6462         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6463         that's terminated ...
6464         (Block.Resolve): ... here.
6465
6466         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6467         (UsageVector.MergeFinallyOrigins): Likewise.
6468         (FlowBranching.InTryOrCatch): Likewise.
6469         (FlowBranching.AddFinallyVector): Likewise.
6470         (FlowBranchingException): Update to changes.
6471
6472         Fix #78290
6473         * statement.cs (Return.Resolve): Move error checking to ...
6474         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6475         (FlowBranchingException): Handle return origins like break and
6476         continue origins.
6477         (FlowBranching.UsageVector.CheckOutParameters): Remove.
6478
6479 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6480
6481         A fix for #76122
6482         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6483         filter.
6484
6485 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6486
6487         A fix for #77543
6488         * class.cs (MethodData.Define): Do public accessor check only when method
6489         implements an interface.
6490
6491 2006-05-04  Raja R Harinath  <rharinath@novell.com>
6492
6493         Remove special handling of 'break'
6494         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6495         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
6496         (UsageVector.Break): Remove.
6497         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6498         reachability.
6499         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6500
6501         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6502         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
6503
6504 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6505
6506         A fix for #75726
6507         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6508         be the interface member.
6509
6510 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6511
6512         A fix for #60069
6513         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6514         for emitting small (int) values.
6515
6516 2006-05-03  Raja R Harinath  <rharinath@novell.com>
6517
6518         Fix #59427
6519         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6520         control-flow passes through the 'finally' after merging-in all the
6521         control-flows from 'try' and the 'catch' clauses.
6522
6523         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6524         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
6525         always true at the only non-recursive entry point.
6526         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6527         FlowBranchingBreakable.
6528         (FlowBranchingLoop): Remove.
6529         * statement.cs (Return.DoResolve): Update to changes.
6530
6531         Fix #76471, #76665
6532         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6533         (FlowBranching.CreateBranching): Handle it: create a
6534         FlowBranchingContinuable.
6535         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6536         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6537         except that it handles the 'continue' command.
6538         (FlowBranching.UsageVector.MergeOrigins): Rename from
6539         MergeBreakOrigins.
6540         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6541         except that it overrides AddContinueOrigin.
6542         (FlowBranchingException): Override AddContinueOrigin, similar to
6543         AddBreakOrigin.
6544         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6545         Create a new branching around the embedded statement.
6546         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
6547         control flow after the embedded statement.
6548         (Continue.Resolve): Move all error checking to AddContinueOrigin.
6549
6550         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6551         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6552         FlowBranchingBreakable.
6553         (FlowBranchingSwitch): Remove.
6554
6555         Fix test-503.cs
6556         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
6557         error reporting to ...
6558         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6559         Rename from 'AddBreakVector'.  Add new location argument.  Return
6560         a bool indicating whether the 'break' crosses an unwind-protect.
6561         (FlowBranchingException.AddBreakOrigin): Add.
6562         (FlowBranchingException.Merge): Propagate 'break's to surrounding
6563         flowbranching after updating with the effects of the 'finally'
6564         clause.
6565         (FlowBranchingBreakable): New common base class for
6566         FlowBranchingLoop and FlowBranchingSwitch.
6567
6568         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6569         embedded statement.
6570         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6571
6572 2006-05-02  Raja R Harinath  <rharinath@novell.com>
6573
6574         * statement.cs (Do.Resolve): If the loop is infinite, set the
6575         barrier.
6576         (While.Resolve, For.Resolve): Set a barrier after the embedded
6577         statement.  There's no direct control flow that goes from the end
6578         of the embedded statement to the end of the loop.
6579         * flowanalysis.cs (FlowBranching.Infinite): Remove.
6580         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
6581         above ensure that the reachability is correctly computed.
6582
6583         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6584         (UsageVector.MergeBreakOrigins): If the current path is
6585         unreachable, treat it as if all parameters/locals are initialized.
6586         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
6587         infinite loops before merging-in break origins.
6588
6589         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6590         (Reachability.Reachable): Split part into ...
6591         (Reachability.Unreachable): ... this.  Simplify.
6592         (Reachability.IsUnreachable): Use 'Unreachable' instead.
6593
6594         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6595         (Reachability.SetThrowsSometimes): Likewise.
6596         (FlowBranchingBlock.MergeTopBlock): Don't compare against
6597         TriState.Always, use corresponding property.
6598         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6599         (Block.Resolve): Likewise.  Remove some redundant checks.
6600
6601 2006-05-02  Raja R Harinath  <harinath@gmail.com>
6602
6603         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6604         (Reachability.Meet): Don't bother checking AlwaysThrows --
6605         barrier is always set.
6606         (FlowBranchingBlock.Merge): Likewise.
6607
6608 2006-05-01  Raja R Harinath  <harinath@gmail.com>
6609
6610         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6611         checks for unreachable.
6612
6613 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
6614
6615         A fix for #77980
6616         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6617
6618         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6619         whether field is really assigned.
6620
6621 2006-04-30  Raja R Harinath  <harinath@gmail.com>
6622
6623         * flowanalysis.cs (Reachability): Make 4-argument constructor
6624         private.
6625         (Reachability.Meet): Rename from 'And'.  Remove static variant.
6626         (Reachability.Always): Rename from the highly misleading
6627         'Reachability.Never'.
6628         (FlowBranching.Merge): Update to changes.  Mark an impossible
6629         situation with a 'throw'.
6630         (*): Update to changes.
6631
6632 2006-04-29  Raja R Harinath  <harinath@gmail.com>
6633
6634         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6635         Remove 'Undefined'.
6636         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6637         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6638         (*): Update to changes.
6639         * statement.cs: Update to changes.
6640
6641 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
6642
6643         A fix for #78049
6644         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6645
6646 2006-04-28  Raja R Harinath  <harinath@gmail.com>
6647
6648         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6649         dummy UsageVector.
6650
6651         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6652         argument to two arguments: an usage-vector and a bool.  Move call
6653         to FlowBranching.Merge () ...
6654         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6655
6656         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6657         handling of loop and switch reachability to ...
6658         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6659
6660 2006-04-27  Raja R Harinath  <harinath@gmail.com>
6661
6662         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6663         handling to FlowBranchingLoop.InLoop.
6664         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6665
6666 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
6667
6668         A fix for #78115
6669         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6670         anonymous method is allowed from AnonymousContainer here.
6671
6672         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6673
6674 2006-04-24  Raja R Harinath  <rharinath@novell.com>
6675
6676         Fix #78156
6677         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6678
6679 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
6680
6681         A fix for #49011.
6682         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6683         (DoubleConstant.Reduce): Ditto.
6684
6685 2006-04-23  Raja R Harinath  <rharinath@novell.com>
6686
6687         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6688         Remove 'lvalue_right_side' argument.  Move parts to ...
6689         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6690         (LocalVariable.DoResolveLValue): ... these.
6691
6692 2006-04-21  Raja R Harinath  <rharinath@novell.com>
6693
6694         Fix cs1655.cs
6695         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6696         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6697         (LocalVariableReference.DoResolveBase): Use it to implement new
6698         CS1655 check.
6699         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6700         (Argument.Resolve): Simplify.  Move CS1510 check ...
6701         * ecore.cs (Expression.ResolveLValue): ... here.
6702         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6703         (PropertyExpr.DoResolveLValue): Likewise.
6704         (FieldExpr.Report_AssignToReadonly): Likewise.
6705         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
6706         LValueMemberAccess or LValueMemberOutAccess on instance depending
6707         on it.
6708         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6709         DoResolve as appropriate.
6710
6711 2006-04-20  Raja R Harinath  <rharinath@novell.com>
6712
6713         Fix #75800
6714         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6715         implicit conversions on 'out' and 'ref' arguments.
6716
6717         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6718         improve clarity.  Remove dead code.
6719
6720         Fix #66031
6721         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6722         (Catch.Resolve): Resolve VarBlock if it exists.
6723
6724 2006-04-19  Miguel de Icaza  <miguel@novell.com>
6725
6726         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6727         twice, this was some residual code, the enumerator was emitted
6728         properly in the two branche of if later.
6729
6730 2006-04-19  Raja R Harinath  <rharinath@novell.com>
6731
6732         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
6733         cast is never an lvalue.
6734         (Cast.DoResolve, Cast.ResolveRest): Combine.
6735         (Argument.Emit): Simplify slightly.  Move 'Expr is
6736         IMemoryLocation' check ...
6737         (Argument.Resolve): ... here.
6738         (Argument.Error_LValueRequired): Remove.  Inline into only user.
6739
6740         Simplifications.  Fix cs0191-2.cs
6741         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6742         CS1649 and CS1651 to ...
6743         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
6744         the actual selection of the error code and message to a lookup
6745         table.  Add a dummy return value to simplify callsites.
6746         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6747         readonly fields of other instances of the same type.  Move CS0197
6748         warning from ...
6749         * expression.cs (Argument.Resolve): ... here.  Simplify code.
6750         Ensure that ec.InRefOutArgumentResolving is only set during LValue
6751         resolution of an out or ref argument.  The code simplification
6752         above uses this invariant.
6753
6754 2006-04-18  Raja R Harinath  <rharinath@novell.com>
6755
6756         Possibly fix #77752.  Fix cs1690-[4-7].cs.
6757         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6758         CheckMarshallByRefAccess.  Drop parameter.
6759         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
6760         warning.
6761         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6762         InstanceExpression.
6763         * report.cs (AllWarnings): Add CS1690.
6764         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6765         for ref access too.
6766         (LocalVariableReference.DoResolveBase): Update.
6767
6768 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6769
6770         * class.cs (MethodOrOperator): Moved common parts from method class.
6771         detect obsolete attributes.
6772         (Method.Define): Simplified as it reuses code from base.
6773         (Constructor.ValidAttributeTargets): Fixed issue found during
6774         refactoring.
6775         (Destructor.ValidAttributeTargets): Fixed issue found during
6776         refactoring.
6777         (Operator): Finished refactoring set off by #78020. Operator class is now
6778         ordinary method class.
6779
6780         * anonymous.cs: Updated.
6781
6782         * decl.cs (DeclSpace): Add IsGeneric
6783
6784 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6785
6786         * class.cs (Constructor.Emit): Don't emit the attributes twice.
6787
6788 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6789
6790         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6791         detect obsolete attributes.
6792         (Method.CreateEmitContext): Moved to MethodOrOperator.
6793
6794 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6795
6796         A fix for #78048.
6797         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6798         customized exception to make crash detection easier.
6799         (MethodOrOperator): Started to work on new base class for methods and
6800         operators.
6801         (Method): Derives from MethodOrOperator.
6802         (Constructor.Emit): Emits its own attributes.
6803         (AbstractPropertyEventMethod.Emit): Ditto.
6804         (Operator): Derives from MethodOrOperator, will refactor fully in extra
6805         patch.
6806         (Operator.Emit): It's temporary more tricky than should be.
6807         
6808         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6809
6810         * report.cs (InternalErrorException): Add ctor with inner exception.
6811
6812 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
6813
6814         A fix for #76744.
6815         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6816         only not visible.
6817
6818 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
6819
6820         A fix for #77916.
6821         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6822         array.
6823
6824 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6825
6826         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6827         attribute is present and Guid not.
6828         (Interface.ApplyAttributeBuilder): Ditto.
6829
6830         * attribute.cs: Add error message.
6831
6832 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6833
6834         A fix for #78020.
6835
6836         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6837         sources (it's composite) so hold them in extra array as they are used in
6838         Emit phase only. It worked in the previous versions by mistake.
6839         (Attribute.Emit): Emit attribute for more owners when exist.
6840
6841         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6842         it has now different behaviour.
6843
6844 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
6845
6846         * constant.cs (Constant.IsDefaultInitializer): New method.
6847
6848         * class.cs: Updated.
6849
6850         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6851         re-initialize default values. It saves KBs almost for every assembly.
6852         Thanks Zoltan for the idea.
6853         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6854         (ArrayCreation.DoResolve): Resolve only once.
6855         (ArrayCreation.Emit): Emit static initializer only when it is faster.
6856         (ArrayCreation.GetAttributableValue): Cope with optimized values.
6857
6858 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
6859
6860         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6861         From #77961.
6862
6863 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6864
6865         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6866         in an embedded statement too.
6867
6868 2006-04-01  Raja R Harinath  <rharinath@novell.com>
6869
6870         Fix #77958
6871         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6872
6873 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6874
6875         A fix for #77966.
6876
6877         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6878         was not specified.
6879
6880         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6881
6882 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
6883
6884         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6885         phase.
6886
6887         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6888         LocalTemporary change.
6889
6890         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6891         TypeContainer.
6892         (ClassOrStruct.DefineFieldInitializers): Implemented static field
6893         initializers optimization.
6894         (ClassOrStruct.TypeAttr): Moved from modifiers.
6895         (Constructor.CheckBase): Don't crash when static ctor has parameters.
6896         (FieldBase.ResolveInitializer): Resolves initializer.
6897         (FieldBase.HasDefaultInitializer): New property.
6898
6899         * cs-parser.jay: Removed message.
6900
6901         * expression.cs (CompilerGeneratedThis): New specialization.
6902
6903         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6904
6905 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
6906
6907         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6908
6909 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6910
6911         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6912         be now EnumConstants only.
6913
6914 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6915
6916         * attribute.cs, driver.cs: Reset more caches.
6917
6918 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6919
6920         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6921
6922 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6923
6924         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6925         for easier reuse. Updated all overrides.
6926         (IntegralConstant): New base class for all integral constants.
6927         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
6928         of the constant range, report custom error.
6929         (UIntConstant.Reduce): Fixed uint conversion.
6930
6931         * ecore.cs, literal.cs: Reduce updates.
6932
6933 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6934
6935         A fix for #75813.
6936
6937         * class.cs (Constructor.Define): Removed extra if for default ctors.
6938         A patch from Atsushi Enomoto.
6939
6940 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6941
6942         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
6943         GetAttributableValue.
6944
6945         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
6946         when required.
6947
6948         * convert.cs (ImplicitConversionRequired): Error message moved to
6949         DoubleLiteral.
6950
6951         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
6952         automatic implicit conversion of an output value.
6953         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
6954
6955         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
6956         conversion.
6957         (TypeOf.GetAttributableValue): Add extra handling for object type.
6958
6959         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
6960         special error message.
6961
6962 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
6963
6964         * class.cs (Constructor.Emit): Don't crash when struct ctor is
6965         InternalCall.
6966         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
6967         compatible with MS runtime.
6968
6969 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
6970
6971         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
6972         attribute arguments here.
6973
6974         * class.cs (Indexer.Define): The check was moved to attribute class.
6975
6976 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
6977
6978         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
6979         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
6980         easier.
6981
6982 2006-03-22  Raja R Harinath  <rharinath@novell.com>
6983
6984         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
6985         mcs to keep code differences small.
6986         * attribute.cs (Attribute.GetParameterDefaultValue): New.
6987         * typemanager.cs (parameter_default_value_attribute_type): New.
6988         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
6989         CS1908 check.
6990
6991 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
6992
6993         * expression.cs (StringConcat.Append): Reverted back to no warning state.
6994
6995 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
6996
6997         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
6998
6999         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
7000         the blocks too.
7001
7002 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
7003
7004         * doc-bootstrap.cs : fix build.
7005
7006 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
7007
7008         * expression.cs (StringConcat.Append): Issue a warning when empty string
7009         is going to append.
7010
7011 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
7012
7013         * assign.cs (CompoundAssign.ResolveSource): Removed.
7014
7015         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
7016         clean up.
7017
7018         * class.cs (TypeContainer.FindMethods): Removed.
7019         (TypeContainer.CheckMemberUsage): Made static.
7020
7021         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
7022
7023         * constant.cs (CheckRange): Removed unused type argument.
7024         (CheckUnsigned): Removed unused type argument.
7025
7026         * cs-parser.jay: Updated after MemberAccess clean up.
7027         Uses Length for empty string test.
7028
7029         * cs-tokenizer.cs: Uses Length for empty string test.
7030         (IsCastToken): Made static.
7031         (is_hex): Made static.
7032         (real_type_suffix): Made static.
7033
7034         * decl.cs (SetupCache): Made static.
7035         (OnGenerateDocComment): Removed unused ds argument.
7036
7037         * delegate.cs (VerifyDelegate): Removed unused argument.
7038
7039         * doc.cs: Uses Length for empty string test.
7040
7041         * driver.cs: Uses Length for empty string test.
7042
7043         * enum.cs (IsValidEnumType): Made static
7044
7045         * expression.cs (EnumLiftUp): Removed unused argument.
7046         (ResolveMethodGroup): Ditto.
7047         (BetterConversion): Ditto.
7048         (GetVarargsTypes): Ditto.
7049         (UpdateIndices): Ditto.
7050         (ValidateInitializers): Ditto.
7051         (MemberAccess.ctor): Ditto.
7052         (GetIndexersForType): Ditto.
7053
7054         * flowanalysis.cs: (MergeFinally): Removed unused argument.
7055
7056         * iterators.cs: Updated after MemberAccess clean up.
7057
7058         * location.cs: Uses Length for empty string test.
7059
7060         * namespace.cs: Uses Length for empty string test.
7061
7062          * report.cs (CheckWarningCode): Made static.
7063
7064         * statement.cs (LabeledStatement): Removed unused argument.
7065
7066         * typemanager.cs (FilterNone): Removed.
7067
7068 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7069
7070         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
7071         obsolete.
7072
7073         * class.cs: Updated.
7074
7075 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7076
7077         * cs-parser.jay.cs: __arglist is not allowed for delegates.
7078
7079 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7080
7081         A fix for #77822.
7082
7083         * expression.cs (VerifyArgumentsCompat): Reverted to double error
7084         reporting, it's more tricky than I thought.
7085
7086 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7087
7088         A fix for #77816.
7089
7090         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
7091         host container.
7092         (AnonymousMethod.ImplicitStandardConversionExists): New method.
7093         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
7094         Add more error reporting; Fixed issue with params.
7095
7096         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
7097
7098         * cs-parser.jay: AnonymousMethod requires host container.
7099
7100         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
7101
7102 2006-03-18  Raja R Harinath  <harinath@gmail.com>
7103
7104         * class.cs: Change 'TypeContainer ds' constructor argument to
7105         'DeclSpace parent'.  Some classes were missed below due to
7106         different naming convention.
7107
7108         * class.cs (MemberCore.Parent): Delete.  This makes the
7109         ParentContainer changes below enforceable by the compiler.
7110
7111         Treat pointers to enclosing declaration space as 'DeclSpace', not
7112         'TypeContainer'.
7113         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
7114         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
7115
7116         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
7117         of TypeContainer.
7118         (Block.AddThisVariable): Likewise.
7119         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
7120         (AbstractPropertyEventMethod.Emit): Likewise.
7121         (AbstractPropertyEventMethod.EmitMethod): Likewise.
7122         (GetMethod.Define, SetMethod.Define): Likewise.
7123         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
7124         (DelegateMethod.EmitMethod): Likewise.
7125
7126         Fix regression test-partial-13.cs.
7127         Rationalize use of PartialContainer.  Ensure that the partial
7128         class semantics can be tied to type-correctness, i.e., any
7129         violation will cause a compile error.
7130         * class.cs, const.cs: Access all fields that belong to class
7131         TypeContainer via ParentContainer.  Arguments of EmitContexts and
7132         Resolve()-like functions still use 'Parent'.
7133
7134         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
7135         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
7136         (PropertyMethod.CheckModifiers): Remove unused argument.
7137         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
7138         DeclSpace.
7139
7140 2006-03-17  Raja R Harinath  <harinath@gmail.com>
7141
7142         Make semantics of PartialContainer simpler.
7143         * decl.cs (DeclSpace.IsPartial): Remove.
7144         * class.cs (TypeContainer.IsPartial): Likewise.
7145         (TypeContainer..ctor): Set PartialContainer to point to self.
7146         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
7147         (TypeContainer.FindNestedType): Likewise.
7148         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
7149
7150 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
7151
7152         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
7153
7154 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
7155
7156         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
7157         classes.
7158
7159 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
7160
7161         * class.cs (Operator.Define): An error for base conversion was not
7162         reported correctly.
7163
7164 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
7165
7166         * iterator.cs : yield break is allowed in try statement which has
7167           catch clauses. Fixed bug #77767.
7168
7169 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
7170
7171         A fix for #77593, #77574.
7172
7173         * class.cs (MethodCore.CheckBase): Another if for operator.
7174
7175 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
7176
7177         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
7178         were not resolved
7179
7180         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
7181         (DelegateCreation.ImplicitStandardConversionExists): New method for just
7182         conversion test.
7183         
7184         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
7185         not needed.
7186
7187         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
7188         Updated after another emitcontext usage was clean up. It should help us to
7189         synchronize with gmcs easier.
7190
7191 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
7192
7193         A fix for #77353.
7194
7195         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
7196         (Event.Define): ditto
7197         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
7198
7199         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
7200         Removed redundant code and set NewSlot for Invoke method too.
7201
7202         * parameter.cs (Parameters.ctor): Add custom, type ctor.
7203         (Parameters.MergeGenerated): New method. Use this method when you merge
7204         compiler generated argument with user arguments.
7205
7206 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
7207
7208         * attribute.cs (ResolveAsTypeTerminal): Removed.
7209
7210         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
7211         specialization for predefined types; 30% speed up.
7212         Finally placed obsolete check to right place.
7213         (Expression.ResolveType): Removed.
7214
7215         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
7216         Updated after ResolveType was removed.
7217
7218         * expression.cs (Cast.ctor): Check void cast.
7219         (Binary.ResolveAsTypeTerminal): Is never type.
7220         (Conditional.ResolveAsTypeTerminal): Is never type.
7221
7222         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
7223
7224 2006-03-01  Raja R Harinath  <rharinath@novell.com>
7225
7226         Fix #77679.
7227         * expression.cs (ParameterReference.DoResolveBase): Change return
7228         type to bool.
7229         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
7230         Update.
7231
7232         Fix #77628.
7233         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
7234
7235         Fix #77642.
7236         * typemanager.cs (GetFullNameSignature): Don't nullref on
7237         protected accessors.
7238
7239 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
7240
7241         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
7242         these two separated members to simplify the code.
7243         (Attribute.Resolve): Refactored to use new fields and methods.
7244         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
7245         implemented obsolete attribute checking.
7246         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
7247         implemented obsolete checking again. It look line never ending quest ;-)
7248         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
7249
7250         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
7251
7252         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
7253
7254         *class.cs (Property.Define): Add RegisterProperty call.
7255
7256         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
7257         argument groups (only 2).
7258
7259         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7260         encoding expression to arguments.
7261         (Expression.ExprClassToResolveFlags): Just turned to property.
7262
7263         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7264         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7265         optimized as well as implemented support for zero-length attributes.
7266
7267         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7268         Add caching of PropertyInfo's.
7269
7270 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7271
7272         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7273         error multiple times.
7274
7275 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7276
7277         New partial class implementation.
7278         A fix for #77027, #77029, #77403
7279
7280         * attribute.cs (Attributable): Made attributes protected.
7281
7282         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7283         the replacements of ClassPart and PartialContainer.
7284         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7285         (TypeContainer.AddInterface): Ditto.
7286         (TypeContainer.AddPartial): The main method for partial classes. It checks
7287         for errors and merges ModFlags and attributes. At the end class is added to
7288         partial_parts list.
7289         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7290         required here.
7291         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7292         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7293         from the rest of partial classes.
7294         (TypeContainer.GetClassBases): Simplified.
7295         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7296         DefineType.
7297         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7298         (TypeContainer.HasExplicitLayout): Uses Flags now.
7299         (PartialContainer): Removed.
7300         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7301         (StaticClass): Was merged with Class.
7302         (Class.GetClassBases): class and static class bases are verified here.
7303         (Class.TypeAttr): Added static attributes when class is static.
7304         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7305         (MemberBase): In some cases we need to call parent container for partial
7306         class. It should be eliminated but it's not easy now.
7307
7308         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7309
7310         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7311         partial classed to accumulate class comments.
7312         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7313
7314         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7315
7316         * driver.cs (MainDriver): Tree.GetDecl was removed.
7317
7318         * modifiers.cs (Modifiers): Add partial modifier.
7319
7320         * tree.cs (Tree.decl): Removed.
7321         (RootTypes): Started to use this class more often for root types
7322         specializations.
7323
7324 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7325
7326         A fix for #77615
7327
7328         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7329         external interface does not have an attribute.
7330
7331 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7332
7333         Another prerequisites for new partial classs implementation.
7334         
7335         * attribute.cs (Attribute.Equal): Implemented.
7336         (Attribute.Emit): Changed as attributes can be applied more than twice.
7337         (Attributes.Emit): Check for duplicate attributes here.
7338
7339         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7340         as a parameter, clean-up.
7341
7342 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7343
7344         A fix for #77485
7345
7346         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7347         contains obsolete attribute check which can in some cases look for base
7348         type of current class which is not initialized yet.
7349         (TypeContainer.BaseType): Replacement of ptype.
7350
7351         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7352
7353 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7354
7355         First of prerequisites for new partial classs implemention.
7356         
7357         * attribute.cs (Attributable): Extended by ResolveContext;
7358         Attributes finally have correct context for resolving in all cases.
7359         (AttachTo): Attribute owner is assigned here.
7360
7361         * codegen.cs (IResolveContext): Introduce new interface to hold
7362         all information needed in resolving phase.
7363         (EmitContext): Implements IResolveContext; more clean-up needed here.
7364         
7365         * decl.cs (MemberCore): Implemented IResolveContext.
7366
7367         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7368         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7369         parameter.cs, statement.cs, tree.cs, typemanager.cs:
7370         Refactored to use new IResolveContext instead of EmitContext; cleanup
7371
7372 2006-02-06  Miguel de Icaza  <miguel@novell.com>
7373
7374         * codegen.cs (EmitScopeInitFromBlock): check here the
7375         capture_context, there is no need to make two calls to the
7376         EmitContext. 
7377
7378         * anonymous.cs: Add some debugging messages that might help me
7379         track other instances of this problem in the future (the
7380         regression of test 467).
7381
7382         * cs-parser.jay: track the variable block, as we need to initalize
7383         any captured variables declared in this block for the "catch"
7384         portion of the "Try" statement.
7385
7386         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7387         scope initialization for captured variables. 
7388
7389         Also, move the emit for the variables after the block location has
7390         been marked.
7391
7392 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
7393
7394         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7395
7396 2006-02-02  Miguel de Icaza  <miguel@novell.com>
7397
7398         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7399         commit yesterday, the initialization for the roots is necessary.
7400         What is not necessary is the scope activation.
7401
7402 2006-02-02  Raja R Harinath  <rharinath@novell.com>
7403
7404         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7405         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7406         CS0206 checks.
7407         (Argument.Resolve): Remove CS0206 checks.
7408
7409 2006-02-01  Miguel de Icaza  <miguel@novell.com>
7410
7411         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7412         scopes for all the roots, the scopes will now be emitted when the
7413         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
7414
7415         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7416         code.  This reduces a lot of existing cruft.
7417         
7418         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7419         that the ScopeInfo is generated as we enter the scope, not at the
7420         time of use, which is what we used to do before.
7421
7422         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7423         every time a Block is about to be emitted if we have a
7424         CaptureContext. 
7425
7426 2006-02-01  Raja R Harinath  <rharinath@novell.com>
7427
7428         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7429         (Reset): Update.
7430         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7431
7432         * typemanager.cs (cons_param_array_attribute): Make private.
7433         (Reset): Set it to null.
7434         (InitCoreHelpers): Don't initialize it.
7435         (ConsParamArrayAttribute): New.  Initialize it as needed.
7436         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7437
7438 2006-01-31  Miguel de Icaza  <miguel@novell.com>
7439
7440         * expression.cs: There might be errors reported during the
7441         selection of applicable methods.  If there are errors, do not
7442         continue execution as it will lead the compiler to crash.
7443
7444 2006-01-30  Miguel de Icaza  <miguel@novell.com>
7445
7446         * expression.cs: Member access is not allowed on anonymous
7447         methods.  Fixes #77402.
7448
7449 2006-01-30  Raja R Harinath  <rharinath@novell.com>
7450
7451         Fix #77401
7452         * cs-parser.jay (VariableDeclaration): Don't set
7453         current_array_type to null.
7454         (field_declaration, event_declaration, declaration_statement):
7455         Set it to null here.
7456
7457 2006-01-28  Raja R Harinath  <harinath@gmail.com>
7458
7459         * typemanager.cs (GenericParameterPosition): New.
7460         * doc.cs: Use it.
7461
7462 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
7463
7464         * doc.cs : To process "include" elements, first we should create
7465           another list than XmlNodeList, because it could result in node
7466           removal, which could result in that the XmlNodeList gives up
7467           yielding next node.
7468
7469           (Also made code identical to gmcs again.)
7470
7471 2006-01-25  Miguel de Icaza  <miguel@novell.com>
7472
7473         * ecore.cs: Introduce an error report that we were not catching
7474         before, if not silent, we must report the error.  Gonzalo ran into
7475         it.
7476
7477 2006-01-23  Miguel de Icaza  <miguel@novell.com>
7478
7479         A fix for bug: #76957
7480         
7481         * iterators.cs (MoveNextMethod.CreateMethodHost): call
7482         ComputeMethodHost before creating the method, this is a new
7483         requirement. 
7484
7485         * anonymous.cs (AnonymousContainer): Now we track all the scopes
7486         that this method references (RegisterScope).  The actual scope
7487         where the method is hosted is computed with the ComputeMethodHost
7488         before we create the method.
7489
7490         Moved the Deepest routine here.
7491
7492         (AnonymousContainer.ComputeMethodHost): New routine used to
7493         compute the proper ScopeInfo that will host the anonymous method.
7494
7495         (ScopeInfo): Deal with multiple roots.  The problem was that we
7496         did not have a unique root where all ScopeInfos could be hanged
7497         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
7498         of roots.  
7499
7500         Remove AdjustMethodScope which is now computed at the end.  Remove
7501         LinkScope which did a partial link, instead link all ScopeInfos
7502         before code generation from the new "LinkScopes" routine. 
7503
7504         Simplify all the Add* routines as they no longer need to maintain
7505         the tree, they just need to record that they are using variables
7506         from a ScopeInfo.
7507
7508         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7509         routines to produce the forest of ScopeInfo trees.
7510
7511         * class.cs (TypeContainer.AppendMethod): This is just like
7512         AddMethod, but ensures that an interface implementation method
7513         (IEnumerable.XXX) is not inserted at the beginning of the queue of
7514         methods, but at the end.
7515
7516         We use this functionality to ensure that the generated MoveNext
7517         method in the iterator class is resolved/emitted before the
7518         enumerator methods created.   
7519
7520         This is required because the MoveNext method computes the right
7521         ScopeInfo for the method.  And the other methods will eventually
7522         need to resolve and fetch information computed from the anonymous
7523         method. 
7524
7525 2006-01-21  Raja R Harinath  <harinath@gmail.com>
7526             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
7527
7528         Fix rest of #76995.
7529         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7530         the 'aliases' hash.
7531         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7532         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7533
7534 2006-01-18  Raja R Harinath  <rharinath@novell.com>
7535
7536         Fix #76656, cs0231-2.cs.
7537         * cs-parser.jay (formal_parameter_list): Make error case catch
7538         more issues.
7539         (parenthesized_expression_0): Add CS1026 check.
7540         (invocation_expression): Remove unused { $$ = lexer.Location }.
7541
7542 2006-01-17  Raja R Harinath  <rharinath@novell.com>
7543
7544         Fix #76824.
7545         * cs-parser.jay (statement_expression): Don't list out the
7546         individual statement-expressions.  Convert syntax error into
7547         CS0201 check.
7548
7549 2006-01-16  Raja R Harinath  <rharinath@novell.com>
7550
7551         Fix #76874.
7552         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7553         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
7554         CheckIntermediateModification.
7555         (FieldExpr.DoResolve): Add new two-argument version that
7556         allows us to resolve the InstanceExpression as an lvalue.
7557         The one-argument variant is now just a wrapper.
7558         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7559         Resolve the lhs as an lvalue if the it has a value type.
7560         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7561         from Assign.DoResolve.
7562         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7563         resolved as an lvalue.
7564         (PropertyExpr.DoResolve): Update.
7565         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7566         has a value type.  Move CS1612 check here from
7567         CheckIntermediateModification.
7568         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7569         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
7570         'right_side' of a ResolveLValue on an 'out' argument.
7571         (EmptyExpression.LValueMemberAccess): New.  Used as the
7572         'right_side' of a propagated ResolveLValue on a value type.
7573         (LocalVariableReference.DoResolveBase): Recognize
7574         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7575         Add CS1654 check.
7576         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7577         EmptyExpression.Null.
7578
7579 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
7580
7581         * typemanager.cs : added IsGenericParameter(). In mcs it always
7582           return false.
7583         * doc.cs : for generic parameters, use GenericParameterPosition,
7584           not FullName.
7585
7586 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
7587
7588         * expression.cs: Fix Console.WriteLine ((this = x).foo);
7589
7590 2006-01-12  Miguel de Icaza  <miguel@novell.com>
7591
7592         This fixes the problem where we used ldfld instead of ldflda to
7593         load the "THIS" pointer on captured parameters, when THIS is a
7594         value type.  See bug #77205.
7595         
7596         * iterators.cs (CapturedThisReference.Emit): Pass false to
7597         EmitThis (we do not need the address).
7598
7599         * codegen.cs (EmitThis): it needs to know whether we need the
7600         address of `this' or not.  This is used by value types.  
7601
7602         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7603         every other call passes false.
7604
7605 2006-01-12  Raja R Harinath  <rharinath@novell.com>
7606
7607         Fix #77221.
7608         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7609         GetOverride.
7610         * expression.cs (Invocation.OverloadResolve): Update.
7611         (Invocation.DoResolve): Avoid double resolution of invocation.
7612
7613 2006-01-11  Raja R Harinath  <rharinath@novell.com>
7614
7615         Fix #77180.
7616         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7617         unary negation of floating point types as 0-expr; negation cannot
7618         overflow in floating point types.
7619
7620         Fix #77204.
7621         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7622         on operands of 'void' type.
7623
7624         Fix #77200.
7625         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7626         and ExclusiveOr for boolean constants too.
7627
7628 2006-01-09  Raja R Harinath  <rharinath@novell.com>
7629
7630         Fix #75636.
7631         * expression.cs (Invocation.OverloadResolve): Replace reflected
7632         override methods with their base virtual methods, rather than
7633         skipping over them.
7634         * typemanager.cs (TypeManager.GetOverride): New.
7635
7636 2006-01-05  Jb Evain  <jbevain@gmail.com>
7637
7638         * class.cs (Property.Define, Indexer.Define): do not tag the
7639         properties as SpecialName | RTSpecialName.
7640
7641 2006-01-04  Miguel de Icaza  <miguel@novell.com>
7642
7643         * class.cs (MethodCore.IsDuplicateImplementation): This method was
7644         doing a low-level comparission of parameter types.  It was lacking
7645         a check for __argslist. 
7646
7647 2005-12-30  Miguel de Icaza  <miguel@novell.com>
7648
7649         * expression.cs (ParameterReference.DoResolveBase): Allow
7650         reference parameters if they are local to this block. 
7651
7652         This allows the ref and out parameters of a delegate to be used in
7653         an anonymous method, for example:
7654
7655         delegate void set (out int x);
7656
7657         set s = delegate (out int x){
7658                 x = 0;
7659         };
7660
7661         This is used by functionality introduced late in the C# language.
7662         
7663         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7664         method that take ref and out parameters. 
7665
7666         Fixes #77119 which was a late change in the spec.
7667
7668 2005-12-23  Miguel de Icaza  <miguel@novell.com>
7669
7670         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7671         parent if its the same scope.  Fixes #77060.
7672
7673 2005-12-21  Miguel de Icaza  <miguel@novell.com>
7674
7675         * driver.cs: Report the case of no source files and no -out:
7676         argument provided.
7677
7678 2005-12-20  Raja R Harinath  <rharinath@novell.com>
7679
7680         Fix #77035.
7681         * expression.cs (ComposedCast.GetSignatureForError): Define.
7682
7683 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7684
7685         Fix #76995
7686
7687         * namespace.cs (NamespaceEntry): Add extern_aliases as a
7688         ListDictionary, to contain the ExternAliasEntry entries (in
7689         addition to the NamespaceEntry.aliases hashtable). This field is
7690         shared between the original entry and its doppelganger (bodyless 
7691         copy of it).
7692         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7693         extern_aliases field.
7694         (NamespaceEntry.Lookup): Move the IsImplicit check after the
7695         lookup in extern_aliases.
7696
7697 2005-12-16  Raja R Harinath  <rharinath@novell.com>
7698
7699         Fix #77006.
7700         * class.cs (TypeContainer.Mark_HasEquals): New.
7701         (TypeContainer.Mark_HasGetHashCode): New.
7702         (ClassPart): Override them.
7703         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7704
7705         Fix #77008.
7706         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7707         'parent' argument to the base constructor.
7708
7709         Remove all mention of TypeContainer from decl.cs.
7710         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7711         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7712         (DeclSpace.DeclSpace): Likewise.
7713         (DeclSpace.DefineMembers): Remove unused argument.
7714         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
7715         debugging check -- we don't care if the debug code throws an
7716         InvalidCastException instead of an InternalErrorException.
7717         * class.cs (TypeContainer.DefineMembers): Update to changes.
7718         (TypeContainer.DoDefineMembers): Likewise.
7719         (TypeContainer.GetMethods): Likewise.
7720         (PropertyMember.Define): Likewise.
7721         (MemberBase.Parent): New property that forwards to
7722         MemberCore.Parent, but ensures that we get a TypeContainer.
7723         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7724         (RootContext.PopulateTypes): Likewise.  Remove special case code
7725         for !RootContext.StdLib: DefineMembers is idempotent.
7726
7727 2005-12-14  Miguel de Icaza  <miguel@novell.com>
7728
7729         * convert.cs (ExplicitConversionCore): Check the return value from
7730         ExplicitConversionCore which can return null on failure.  Fixes #76914
7731
7732 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
7733
7734         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7735
7736 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
7737
7738         * doc.cs : The search for referenced namespace was insufficient to
7739           get global one as it used to do. Fixed bug #76965.
7740
7741 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
7742
7743         * doc.cs : check name in cref in the last phase that whether it is
7744           namespace or not.
7745
7746 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7747
7748         * cs-tokenizer.cs : reverted the latest change: it somehow broke
7749           Mono.C5.
7750
7751 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7752
7753         * doc.cs : so it turned out that we cannot skip override check for 
7754           interface members. Fixed bug #76954.
7755
7756 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7757
7758         * cs-tokenizer.cs : fixed bug #75984:
7759           - #warning and #error should not be handled when the source line
7760             is disabled.
7761           - #line is not checked strictly when the source line is disabled.
7762           - #define and #undef is on the other hand checked strictly at any
7763             state.
7764
7765 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
7766
7767         * cs-tokenizer.cs : missing Location (actually, filename) in one of
7768           CS1027 report.
7769
7770 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7771
7772         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7773
7774         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7775         event initializers.
7776         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7777         (FieldBase.Initializer): Initializer is now optional.
7778         (EventField.Define): Only event field can have initializer.
7779
7780         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7781
7782         * const.cs (Const): Reuse initializer.
7783
7784         * cs-parser.jay: Updated after FieldBase changes.
7785         Added current_array_type to simplify array initializers.
7786
7787         * ecore.cs (NullCast.IsDefaultValue): Implemented.
7788
7789         * expression.cs, iterators.cs: Updated.
7790
7791         * namespace.cs (NamespaceEntry): Made UsingFound private.
7792
7793 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7794
7795         * parameterCollection.cs: Obsolete, removed.
7796         * parser.cs: Obsolete, removed.
7797
7798 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7799
7800         Fix #76849.
7801         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7802
7803         * enum.cs (Enum.Define): Set obsolete context here.
7804
7805 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7806
7807         * doc.cs :
7808           - FindDocumentedMember() now expects 1) paramList as null
7809             when "we don't have to check the number of parameters" and
7810             2) Type.EmptyTypes when "there is no arguments".
7811           - Introduced FoundMember struct to hold the exact type which was
7812             used to find the documented member (the above change broke
7813             test-xml-044; it might be better just to use DeclaringType than
7814             what MS does, like this change does, but it depends on usage.)
7815
7816 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7817
7818         * doc.cs : documented member might be from DeclaringType for nested
7819           types. Fixed bug #76782.
7820
7821 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
7822
7823         * anonymous.cs: Have the param code handle leaving copies on the
7824         stack etc. Allows anonymous params to take part in the assignment
7825         code (++, +=, etc). Fixes bug #76550
7826
7827         * expression.cs: Handle the prepare_for_load/leave_copy by passing
7828         it down to the anon code.
7829
7830         * iterators.cs: Use dummy var here
7831
7832         * codegen.cs: Handle new vars
7833
7834 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7835
7836         Fix #76849.
7837         * class.cs (MethodData.Define): Set proper Obsolete context.
7838
7839         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7840         obsolete context.
7841         (FieldExpr.DoResolve): Ditto.
7842
7843 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7844
7845         Fix #76849.
7846         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7847         parent is not obsolete.
7848
7849 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
7850
7851         * doc.cs : (FindDocumentedMember) find parameterless members first
7852           and get CS0419 in the early stage. Fixed first case of bug #76727.
7853
7854 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
7855
7856         Fix #76859.
7857         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7858         no error was reported.
7859
7860         *expression.cs (Binary.DoResolve): left can be null.
7861
7862 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
7863
7864         Fix #76783.
7865         * class.cs (MethodData.Emit): Parameters should be labeled first.
7866
7867 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
7868
7869         Fix #76761.
7870         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7871
7872 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
7873
7874         * attribute.cs (AreParametersCompliant): Moved to Parameter.
7875
7876         * class.cs (MethodCore): Parameter clean up.
7877         (IMethodData): Added ParameterInfo.
7878         (MethodData): Parameter clean up.
7879         (Indexer.Define): Parameter clean up.
7880
7881         * anonymous.cs,
7882         * codegen.cs,
7883         * cs-parser.jay,
7884         * decl.cs,
7885         * doc.cs,
7886         * ecore.cs,
7887         * flowanalysis.cs,
7888         * iterators.cs,
7889         * pending.cs,
7890         * statement.cs,
7891         * typemanager.cs: Parameter clean up.
7892
7893         * delegate.cs (Define): Get rid of duplicated code.
7894
7895         * expression.cs (ParameterReference): Removed useless parameters
7896         and simplified.
7897         (Invocation): Ditto.
7898
7899         * parameter.cs (ParamsParameter): New class, params specialization.
7900         (ArglistParameter): Attemp to separate arglist.
7901         (Parameter): Refactored to be reusable and faster.
7902         (Parameter.Modifier): Made understandable.
7903         (Parameters): Changed to be used as a class for `this' assembly
7904         parameters. Refactored to use new specialized classes.
7905
7906         * support.cs (ParameterData): Added Types property.
7907         (InternalParameters): Deleted.
7908
7909 2005-08-20  Martin Baulig  <martin@ximian.com>
7910
7911         Merging this patch from GMCS to fix #75867.
7912
7913         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7914         scope if we don't already have it.
7915
7916 2005-11-17  Martin Baulig  <martin@ximian.com>
7917
7918         * anonymous.cs
7919         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7920         inherit the scope from our parent.  Fixes #76653.
7921
7922 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7923
7924         * doc.cs : the previous patch does not actually fix the bug.
7925           PropertyInfo override check is now implemented and really fixed it.
7926         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
7927
7928 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7929
7930         * doc.cs : apply "override filter" also to properties.
7931           Fixed bug #76730.
7932
7933 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7934
7935         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
7936           no need to check overrides. For classes, omit those results from 
7937           interfaces since they must exist in the class. Fixed bug #76726.
7938
7939 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7940
7941         * typemanager.cs : (GetFullNameSignature) differentiate indexers
7942           with different parameters. Fixed the second problem in #76685.
7943
7944 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7945
7946         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
7947           get expected 'protected' access in CheckValidFamilyAccess()).
7948           Fixed bug #76692.
7949
7950 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7951
7952         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
7953           Fixed bug #76705.  CS1569 was incorrectly commented out.
7954
7955 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
7956
7957         * doc.cs : use Invocation.IsOverride() to do real override check.
7958         * expression.cs : made Invocation.IsOverride() internal.
7959
7960 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
7961
7962         * doc.cs : use TypeManager.FindMembers() instead of (possible)
7963           TypeBuilder.FindMembers() and filter overriden base members out.
7964           Fixed bug #76990.
7965
7966 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7967
7968         * doc.cs : ref/out parameters are represented as '@' (instead of
7969           '&' in type FullName). Fixed bug #76630 (additionally crefs).
7970
7971 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7972
7973         * doc.cs : when there was no '.' in cref to methods in doc comment,
7974           then parameters were missing in the output. Fixed bug #76691.
7975
7976 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7977
7978         * driver.cs : don't output docs when there is an error.
7979           Fixed bug #76693.
7980
7981 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7982
7983         * doc.cs :
7984           Now it should detect indexers. Fixed primary concern in bug #76685.
7985           Fixed CS0419 message to not show the identical member signature in
7986           the message.
7987
7988 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7989
7990         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
7991           instead of Type.FindMembers() since it does not handle events.
7992           Fixed bug #71604.
7993
7994 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
7995
7996         * codegen.cs: Fixed typo (speficied -> specified).
7997
7998 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
7999
8000         Fix #76369.
8001         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
8002
8003 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
8004
8005         * attribute.cs: Changed error message.
8006
8007         * cs-tokenizer.cs: One more check.
8008
8009 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
8010
8011         * statement.cs (Block.Resolve): Ignore empty statement.
8012
8013 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
8014
8015         * report.cs: Made error/warning methods more strict to avoid
8016         their misuse.
8017
8018         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
8019         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
8020         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
8021         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
8022
8023 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
8024
8025         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
8026         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
8027
8028         * class.cs (TypeContainer.IsComImport): New property.
8029         (Constructor.Define): Create proper ctor for ComImport types.
8030
8031         * expression.cs (New.CheckComImport): Fixed.
8032
8033 2005-11-07  Miguel de Icaza  <miguel@novell.com>
8034
8035         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
8036         that a parameter has been captured does not mean that we do not
8037         have to do the rest of the processing.  This fixes the second part
8038         of #76592.  If there was another anonymous method capturing
8039         values in the past, the Scope would never be set for the second
8040         method that captured the same parameter.
8041
8042         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
8043         properly manipulate the stack.   Second part of fix for #76592.
8044
8045         * expression.cs (New): Add support for invoking "new" on
8046         interfaces that have been flagged with the ComImport attribute and
8047         the CoClass.  Fixes #76637 
8048
8049         * statement.cs (Try.DoEmit): When a variable is captured, do not
8050         try to emit the vi.LocalBuilder variable as it has been captured.
8051         Create a temporary variable and store the results on the
8052         FieldBuilder.  Fixes #76642
8053
8054 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
8055
8056         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
8057
8058         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
8059
8060         * expression.cs (Binary.DoResolve): Added && optimalization.
8061     
8062         * typemanager.cs (AddUserType): Removed useless argument.
8063
8064 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
8065
8066         * statement.cs (Block.variables): Uses ListDictionary.
8067
8068 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
8069
8070         Fix #75969.
8071         * class.cs (PartialContainer.EmitType): Customized to emit
8072         security attributes.
8073         (ClassPart.ApplyAttributeBuilder): Transform security attribute
8074         for partial classes.
8075
8076 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
8077
8078         Fix #76599.
8079         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
8080         access has to be fixed.
8081         
8082         * typemanager.cs (IsUnmanagedType): Wrong common field type.
8083
8084 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
8085
8086         Fix #76590.
8087         * ecore.cs (NullCast.Reduce): Implemented.
8088
8089         * expression.cs (ArrayCreation.CheckIndices): Correcly check
8090         constant type.
8091         
8092         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
8093         properly.
8094         (Foreach.Resolve): Catch null properly.
8095
8096 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
8097  
8098         * cs-tokenizer.cs: Warning text fix.
8099
8100         * driver.cs: AllWarningNumbers exposed on public interface.
8101
8102         * report.cs (): Reviewed warning numbers.
8103         (IsValidWarning): Use binary search.
8104
8105 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
8106  
8107         * driver.cs: Implemeted resource visibility.
8108         (Resources): New class for code sharing between /res: and
8109         /linkres:
8110  
8111 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
8112
8113         Fix #76568.
8114         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
8115         folding.
8116         
8117         * convert (Convert.ImplicitReferenceConversion): NullCast holds
8118         contants only.
8119         
8120         * ecore.cs (NullCast): Child is contant only.
8121         
8122         * literal.cs (NullLiteral.Reduce): null can be converted to any
8123         reference type.
8124
8125 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
8126
8127         * driver.cs: Use Encoding.Default as default code page instead
8128           of ISO-28591.
8129
8130 2005-10-27  Raja R Harinath  <rharinath@novell.com>
8131
8132         Fix #76085.
8133         * expression.cs (Invocation.Error_InvalidArguments): Handle
8134         __arglist parameters.
8135         (Invocation.VerifyArgumentsCompat): Likewise.
8136         * support.cs (ReflectionParameters.GetSignatureForError): Print
8137         __arglist parameters.
8138         (InternalParamters.GetSignatureForError): Likewise.
8139         * parameter.cs (Parameters.GetSignatureForError): Likewise.
8140
8141 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
8142
8143         * attribute.cs (GetPropertyValue): Made public.
8144
8145         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
8146         Resolve.
8147         Add new property WrapNonExceptionThrows to handle 2.0 assembly
8148         attribute.
8149         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
8150         is not defined.
8151         
8152         * driver.cs: Reflect method name change.
8153         
8154         * statement.cs (Try.Resolve): Warn when try has both general
8155         exception handlers.
8156         
8157         * typemanager.cs: runtime_compatibility_attr_type new predefined
8158         type.
8159
8160 2005-10-26  Raja R Harinath  <harinath@gmail.com>
8161
8162         Fix #76419.
8163         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
8164         treat it as an empty parameter list.
8165
8166 2005-10-26  Raja R Harinath  <rharinath@novell.com>
8167
8168         Fix #76271.     
8169         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
8170         ResolveAsTypeStep silent.
8171         * statement.cs (Block.AddConstant): Mark block as used.
8172         (Block.ResolveMeta): Avoid piling on error messages
8173         if a constant initializer resolution fails.
8174
8175 2005-10-25  Raja R Harinath  <rharinath@novell.com>
8176
8177         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
8178         Remove.
8179         (NamespaceEntry.VerifyAllUsing): New.
8180         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
8181         behaviour.  Delegates actual resolution of alias to ...
8182         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
8183         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
8184         Update.
8185         * driver.cs (Driver.MainDriver): Update.
8186         
8187         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
8188         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
8189         property.
8190         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
8191         Remove.
8192         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
8193         RootNamespace.DefineNamespacesForAll.
8194
8195 2005-10-24  Raja R Harinath  <harinath@gmail.com>
8196
8197         * typemanager.cs (assemblies, external_aliases, modules)
8198         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
8199         (ComputeNamespaces, GetRootNamespace): Remove extra staging
8200         overhead.  Move resposibility ...
8201         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
8202         * driver.cs, attribute.cs, codegen.cs: Update to changes.
8203
8204 2005-10-23  Raja R Harinath  <harinath@gmail.com>
8205
8206         * namespace.cs (RootNamespace.all_namespaces): Renamed from
8207         cached_namespaces.  Improve usage.
8208         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
8209         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
8210         Move from GlobalRootNamespace and simplify.
8211         (RootNamespace.Global): Make instance variable.
8212         (RootNamespace.RootNamespace): Add "alias name" parameter.
8213         (GlobalRootNamespace): Simplify drastically.
8214         (Namespace.Lookup): Don't use GetNamespace.
8215         * typemanager.cs (GetRootNamespace): Rename from
8216         ComputeNamespaceForAlias.
8217         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
8218
8219 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8220
8221         * anonymous.cs (AnonymousContainer): Don't crash when container
8222         doesn't exist.
8223
8224 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8225
8226         * expression.cs (Binary.DoResolve): Warn when comparing same
8227         values.
8228
8229 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8230
8231         Fix #76486.
8232         * expression.cs (Binary.DoResolve): It looks like there are no
8233         convetsion rules in enum context.
8234
8235 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8236
8237         Add support for extern alias qualifiers.
8238         * typemanager.cs: Move some LookupTypeReflection code
8239         to namespace.cs, to have cleaner code. Added some methods
8240         to help us keep track of the extern aliased references.
8241         * driver.cs: Add suport for extern alias assemblies on command
8242         line and check for their warnings/errors. Also keep track of the
8243         extern aliased assemblies.
8244         * namespace.cs: Move the global functionality of Namespace
8245         to GlobalRootNamespace/RootNamespace. Now the global namespace
8246         is GlobalRootNamespace.Globa. Also the code moved from 
8247         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
8248         Finally added LocalAliasEntry (AliasEntry before) and
8249         ExternAliasEntry, to handle alias statements.
8250         * cs-parser.jay: Add support in the grammar for extern alias
8251         statement.
8252         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
8253         Update callings to Namespace (now in GlobalRootNamespace).
8254
8255 2005-10-18  Raja R Harinath  <rharinath@novell.com>
8256
8257         Fix #76371.
8258         * class.cs (TypeContainer.DefineType): Move updating of
8259         topological sort earlier in the code.
8260         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8261
8262 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
8263
8264         Fix #76273.
8265         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8266         
8267         * constant.cs (Constant.TryReduce): Moved from Cast class.
8268         (Reduce): Made little bit more OO and fixed missing conversions.
8269         
8270         * ecore.cs (Reduce): Implemented.
8271         (Binary.EnumLiftUp): New method to upgrade values to enum values.
8272         
8273         * literal.cs (Reduce): Implemented.
8274         
8275         * class.cs: Reverted Miguel's wrong commit.
8276
8277 2005-10-14  Miguel de Icaza  <miguel@novell.com>
8278
8279         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8280
8281 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
8282
8283         * cs-parser.jay, expression.cs : CS0214 was missing error location
8284           for constants. Fixed bug #76404.
8285
8286 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
8287
8288         Fix #76370.
8289         * convert.cs (ExplicitConversionCore): Fixed object->enum
8290         conversion.
8291
8292 2005-10-10  Raja R Harinath  <rharinath@novell.com>
8293
8294         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8295         InstanceExpression.
8296         (PropertyExpr.EmitCall): Likewise.
8297         * expression.cs (Invocation.EmitArguments): Handle case where
8298         arguments == null.
8299         (Invocation.EmitCall): Avoid allocating temporary variable if
8300         there are no arguments.
8301
8302 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8303
8304         Fix #76323.
8305         * convert.cs (ImplicitConversionStandard): Move conversion of
8306         void* to arbitrary pointer types ...
8307         (ExplicitConversionStandard): .. here.
8308         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8309         error to always print typenames.
8310
8311 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8312
8313         * convert.cs (GetConversionOperator): Rename from
8314         GetConversionOperators.  Move operator selection code from ...
8315         (UserDefinedConversion): ... here.
8316
8317 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
8318
8319         * convert.cs (ExplicitConversionCore): Removed duplicate enum
8320         conversion.
8321
8322 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
8323
8324         * assign.cs (Assign.DoResolve): Error method changed.
8325
8326         * cfold.cs (DoConstantNumericPromotions): Error method changed.
8327         
8328         * const.cs (ResolveValue): Reset in_transit immediately.
8329         
8330         * constant.cs: Error method changed.
8331         
8332         * convert.cs: Removed useless location parameter.
8333         (ExplicitNumericConversion): Don't do double enum check.
8334         (ExplicitConversionCore): Renamed from ExplicitConversion.
8335         (ExplicitUnsafe): Extracted from ExplicitConversion.
8336         (ExplicitConversion): Uses for error reporting.
8337         
8338         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8339         error messages.
8340         (ResolveBoolean): Uses common error method.
8341         (CastToDecimal): Get rid of ec.
8342         (CastFromDecimal): Optimized.
8343         (ConvCast): Get rid of ec.
8344         
8345         * enum.cs (ResolveValue): Reset in_transit immediately.
8346         (Emit): Return after first error.
8347         
8348         * expression.cs: Convert changes.
8349         
8350         * literal.cs: Error method changed.
8351         
8352         * statement.cs: Error method changed.
8353
8354 2005-10-03  Raja R Harinath  <rharinath@novell.com>
8355
8356         * support.cs (SeekableStreamReader.Position): Don't error out when
8357         the requested position is just beyond the end of the current
8358         buffered data.
8359
8360 2005-09-28  Raja R Harinath  <rharinath@novell.com>
8361
8362         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
8363         try to keep in sync with the byte count of the underlying Stream.
8364         However, this limits us to a window size of 2048 characters: i.e.,
8365         the maximum lookahead of our lexer/parser can be 2048 characters.
8366
8367 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
8368
8369         Fix #76255.
8370         * driver.cs: Fix compilation files with full root path.
8371
8372 2005-09-25  Miguel de Icaza  <miguel@novell.com>
8373
8374         * report.cs (SymbolRelatedToPreviousError): Format the output so
8375         it does not use an open parenthesis that is never closed. 
8376
8377         * driver.cs: Follow coding guidelines
8378
8379 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8380
8381         Fix #72930.
8382         * const.cs (Const.ResolveValue): Check for assigning non-null
8383         value to reference type.
8384
8385 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8386
8387         * anonymous.cs: Implemented ExprClassName.
8388         
8389         * assign.cs (Assign.DoResolve): Don't chrash when type is not
8390         delegate.
8391         
8392         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8393         check.
8394         
8395         * class.cs (StaticClass.DefineContainerMembers): Report protected
8396         members as error.
8397         
8398         * codegen.cs: if(ed) PRODUCTION.
8399         
8400         * convert.cs (Error_CannotImplicitConversion): Better error
8401         distinction.
8402         
8403         * cs-parser.jay: More error checks.
8404         
8405         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8406         
8407         * driver.cs (CSCParseOption): Enabled wrong option check.
8408         
8409         * ecore.cs (Expression.ExprClassName): Turned to property.
8410         (MemberExpr.CheckIntermediateModification): For checking boxed
8411         value types     modification.
8412         
8413         * statement.cs (Fixed.Resolve): Expression type must be
8414         convertible to fixed type.
8415         (CollectionForeach.GetEnumeratorFilter,TryType):
8416         Small refactoring for easier error checking.
8417
8418 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
8419
8420         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8421         attributes.
8422         
8423         * class.cs (GeneratedBaseInitializer): New class for customization
8424         compiler generated initializers.
8425         (MemberBase.DoDefine): Check Obsolete attribute here.
8426         (FieldMember.DoDefine): Ditto.
8427         
8428         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8429         constants.
8430         
8431         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8432         (MemberCore.GetObsoleteAttribute): Removed argument.
8433         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8434         (MemberCore.CheckObsoleteType): New helper.
8435         
8436         * delegate.cs,
8437         * enum.cs,
8438         * statement.cs: Updates after MemberCore changes.
8439         
8440         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8441         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8442         
8443         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8444         obsolete attribute for compiler construct.
8445         (As.DoResolve): Cache result.
8446         
8447         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8448
8449 2005-09-26  Raja R Harinath  <rharinath@novell.com>
8450
8451         Fix #76133.
8452         * expression.cs (This.VerifyFixed): In a value type T, the type of
8453         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
8454         value type R, 'this' is treated as a value parameter.
8455
8456 2005-09-22  Miguel de Icaza  <miguel@novell.com>
8457
8458         * statement.cs (Lock): Use the TemporaryVariable class instead of
8459         manually using local variables as those do not work when variables
8460         are captured.
8461
8462         * ecore.cs: Moved the TemporaryVariable class from being a nested
8463         class inside Foreach to be a public class that can be employed in
8464         other places. 
8465
8466 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
8467
8468         * cs-parser.jay: interface_accessors replaced by
8469         accessor_declarations.
8470
8471         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8472         location.
8473         
8474         * statement.cs (GotoCase.Resolve): Convert null constant to
8475         null case.
8476         (SwitchLabel.ResolveAndReduce): Ditto.
8477         (SwitchLabel.NullStringCase): Custom null stamp.
8478         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8479         
8480         typemanager.cs (CSharpSignature): Don't skip first argument
8481         for full names.
8482
8483 2005-09-18  Miguel de Icaza  <miguel@novell.com>
8484
8485         * driver.cs: Set InEmacs based on the environment variable EMACS. 
8486
8487         * location.cs (InEmacs): in this mode, do not report column
8488         location as it confuses Emacs.
8489
8490 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
8491
8492         * cfold.cs, constant.cs, convert.cs, ecore.cs,
8493         expression.cs, iterators.cs, literal.cs: Store constants and
8494         literals location.
8495         
8496         * class.cs (MemberBase.ShortName): Pass location.
8497         
8498         * cs-parser.jay: Some location fixes.
8499         
8500         * ecore.cs (Expression.Location): Made virtual.
8501
8502 2005-09-05  Miguel de Icaza  <miguel@novell.com>
8503
8504         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8505         if the underlying types are the same, otherwise we need to produce
8506         code that will do the proper cast.
8507
8508         This was exposed by Marek's constant rewrite which produced
8509         invalid code for the call site:
8510
8511         enum X : long { a }
8512         void Method (X v) {}
8513
8514         Method ((X) 5)
8515
8516         This fixes test-49.cs
8517
8518 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8519
8520         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8521           Type/Object should be allowed as well. Fixed bug #75968.
8522
8523 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8524
8525         * expression.cs : (Binary.DoResolve): when one is enum constant and
8526           another is constant 0, then return enum one *as enum type*.
8527           Fixed bug 74846.
8528
8529 2005-09-02  Raja R Harinath  <rharinath@novell.com>
8530
8531         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8532         internal.
8533
8534         Fix #75941.
8535         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8536         flow-branching for LocalVariableReferences in case we were invoked
8537         from a MemberAccess.
8538         * expression.cs (LocalVariableReference.VerifyAssigned): New.
8539         Carved out of ...
8540         (LocalVariableReference.DoResolveBase): ... this.
8541         (MemberAccess.Resolve): Do the check that was disabled during
8542         SimpleNameResolve.
8543
8544 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8545
8546         * class.cs :
8547           (PartialContainer.Create): check abstract/sealed/static strictly
8548           but abstract/sealed can exist only at one side. Fixed bug #75883.
8549
8550 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
8551
8552         Fix #75945.
8553         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8554         specified, don't default to UnmanagedType.I4.
8555
8556 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8557
8558         * expression.cs : conditional operator should check possibly
8559           incorrect assign expression. Fixed bug #75946.
8560
8561 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8562
8563         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8564           Reverting the change. gmcs is much complex than mcs on this matter.
8565
8566 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8567
8568         * cs-tokenizer.cs : To read another token ahead of the actual 
8569           consumption, use new SavedToken and cache token instead of moving
8570           back the stream with SeekableStreamReader (it seemed problematic).
8571         * cs-parser.jay,
8572           driver.cs : Thus use StreamReader directly.
8573         * support.cs : Thus removed SeekableStreamReader.
8574
8575 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8576
8577         Fix #75934.
8578         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8579         (ScopeInfo.EmitScopeType): Use it to construct field names from
8580         names of captured locals.
8581
8582         Fix #75929.
8583         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8584         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8585         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
8586         (ExplicitConversion): Remove enum cases already handled by
8587         implicit conversion.  Move implicit conversion check to the beginning.
8588         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8589         * expression.cs (ArrayCreation.EmitDynamicInitializers):
8590         Don't treat System.Enum as a struct.
8591
8592 2005-08-30  Jb Evain  <jbevain@gmail.com>
8593
8594         * attribute.cs: handles as expression in parameters.
8595
8596 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8597
8598         Fix #75802.
8599         * class.cs (TypeContainer.VerifyClsName): Don't use a
8600         PartialContainer when verifying CLS compliance.
8601         (AbstractPropertyEventMethod): Set Parent here, ...
8602         (PropertyMethod): ... not here.
8603
8604 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
8605
8606         * attribute.cs : escaped attribute name should not be allowed to be
8607           resolved (e.g. @class as classAttribute). Fixed bug #75930.
8608
8609 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8610
8611         Fix #75927.
8612         * convert.cs (ImplicitStandardConversionExists): Allow zero also
8613         when converting a long constant to unsigned long.
8614         * expression.cs (Invocation.OverloadResolve): Add sanity check to
8615         detect where IsApplicable and VerifyArgumentsCompat disagree.
8616
8617 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8618         and Carlos Alberto Cortez  <carlos@unixmexico.org>
8619
8620         Fix #75848.
8621         * class.cs (TypeContainer.CanElideInitializer): New helper.
8622         (TypeContainer.EmitFieldInitializers): Use it to determine if we
8623         can safely emitting the initializer of a field.
8624
8625 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8626
8627         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8628           allowed inside a switch (without loop). Fixed bug #75433.
8629
8630 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
8631
8632         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8633         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8634
8635 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8636
8637         * driver.cs : kinda reverting the default encoding changes (not exact 
8638           revert since I noticed that "codepage:reset" might not work fine).
8639
8640 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8641
8642         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8643           Location. Now getter and setter store location correctly.
8644           (errors/cs0111-12.cs now reports the expected location.)
8645
8646 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8647
8648         * driver.cs : Use default encoding on the environment.
8649           Removed (now that) extra parameter for SeekableStreamReader.
8650         * support.cs : (SeekableStreamReader) third .ctor() argument for
8651           StreamReader is not required (always true). preamble size could
8652           be acquired in simpler and safe way.
8653
8654 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
8655
8656         * cs-parser.jay: report CS0642 at warning level 3
8657           and report CS0642 for an if else statement also
8658           fixes bug #74745. Patch by John Luke (and a bit
8659           modified by me).
8660           Removed extra CS0642 warning check for "while",
8661           "for" and "fixed".
8662         * statement.cs: In Block.Resolve(), CS0642 check
8663           is reimplemented to check a sequence of an empty
8664           statement and a block.
8665
8666           Both fix bug #66777.
8667
8668 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
8669
8670         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8671         detection until I fix it.
8672         
8673         * cs-tokenizer.cs: Changed error message.
8674         
8675         * cs-parser.jay: Fixed 2 error locations.
8676         
8677         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8678         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8679         properties.
8680         
8681         * enum.cs (GetSignatureForError): Fixed.
8682         
8683         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8684         method detection.
8685         
8686         * class.cs,
8687         * typemanager.cs (RegisterProperty): Removed.
8688         
8689         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8690
8691 2005-08-24  Raja R Harinath  <rharinath@novell.com>
8692
8693         Fix #75874.
8694         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8695         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8696
8697 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8698
8699         * expression.cs : tiny fix is required for not warning positive ulong.
8700           See test-441.cs.
8701
8702 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8703
8704         * expression.cs : add CS0652 check for constant and integral
8705           expression. Fixed bug #53974.
8706
8707 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8708
8709         * expression.cs : in DoNumericPromotions(), check if there is implicit
8710           conversion overload for string (to check CS0034). Fixed bug #52492.
8711
8712 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8713
8714         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8715
8716 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8717
8718         * ecore.cs : report location when it is *not* Null.
8719
8720 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8721
8722         * codegen.cs,
8723           ecore.cs,
8724           flowanalysis.cs,
8725           expression.cs:
8726           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8727           correctly. Fixed bug #75721.
8728
8729 2005-08-23  Raja R Harinath  <rharinath@novell.com>
8730
8731         * support.cs (SeekableStreamReader.Position): Avoid an expensive
8732         loop that performs 'min (pos, char_count)'.
8733
8734         Fix #75862.
8735         * expression.cs (Unary.ResolveOperator): Don't discard implicit
8736         converted value in Operator.OnesComplement.
8737
8738 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
8739
8740         * anonymous.cs: If the anon method is pulled into a helper class,
8741         it needs to be `internal' not `private'. Fixes runtime behavior on
8742         msft. bug #75704
8743
8744 2005-08-20  Martin Baulig  <martin@ximian.com>
8745
8746         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8747         scope if we don't already have it.
8748
8749         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8750         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8751         fixes #75867.
8752
8753 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
8754
8755         Fix #75803
8756         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8757         is a partial class.
8758
8759 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
8760
8761         The big constants rewrite
8762         Fix #75746, #75685 and more
8763         As a side effect saved 1MB for MWF ;-)
8764         
8765         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8766         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8767         enum based for corlib compilation.
8768         
8769         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8770         subtractions.
8771         
8772         * class.cs (FixedField.Define): Use ResolveAsConstant.
8773         
8774         * const.cs (IConstant): Interface constants and enums.
8775         (Const.ResolveValue): New method for constant resolvning.
8776         (ExternalConstant): Constants from imported assemblies.
8777         
8778         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8779         conversion; like enums.
8780         (Constant.ToType): Converts this constant to different type.
8781         (Constant.Increment): Adds 1.
8782         
8783         * convert.cs (ImplicitConversionRequired): Simplified.
8784         
8785         * cs-parser.jay: Create EnumMember directly.
8786         
8787         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8788         
8789         * doc.cs (GenerateEnumDocComment): Removed.
8790         
8791         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8792         (ConvertIntLiteral): Removed.
8793         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8794         
8795         * enum.cs (EnumMember): Implement IConstant.
8796         (Enum.IsValidEnumConstant): Removed.
8797         (Enum.GetNextDefaultValue): Removed.
8798         (Enum.FindMembers): Updated.
8799         (Enum.GenerateDocComment): Iterate enum members.
8800         
8801         * expression.cs (Cast.TryReduce): Handle enums correctly.
8802         (New.Constantify): Made public.
8803         (MemberAccess.DoResolve): Removed contant specific if(s).
8804         
8805         * literal.cs (NullLiteral): Implement new abstract methods.
8806         
8807         * statement.cs (GotoCase.Resolve): Use new constant methods.
8808         (SwitchLabel.ResolveAndReduce): Use new constant methods.
8809         
8810         * typemanager.cs (LookupEnum): Removed.
8811         (IsEnumType): Fixed to work with corlib.
8812         (RegisterConstant): Removed.
8813         (LookupConstant): Removed.
8814         (GetConstant): Changed to work with IConstant.
8815
8816 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
8817
8818         * location.cs : Fixed overflown (>255) column number.
8819
8820 2005-08-03  Raja R Harinath  <rharinath@novell.com>
8821
8822         First cut of the qualified-alias-member feature.
8823         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8824         token.
8825         * cs-parser.jay (DOUBLE_COLON): New token.
8826         (namespace_or_type_name): Add rule for recognizing
8827         qualified-alias-members.
8828         (primary_expression): Likewise.
8829         (element_access): Allow QualifiedAliasMember as a possible
8830         type-bearing expression.
8831         (local_variable_type, local_variable_pointer_type): Likewise.
8832         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
8833         aliases in the current and enclosing namespace declarations.
8834         (NamespaceEntry.UsingAlias): Add CS0440 warning.
8835         * decl.cs (MemberName.is_double_colon): New.
8836         (MemberName.MemberName): Add new constructor for alias-member.
8837         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8838         * expression.cs (QualifiedAliasMember): New expression type.
8839
8840 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8841
8842         * location.cs : it borked when no argument was specified.
8843
8844 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8845
8846         * location.cs : tiny ToString() format fix.
8847
8848 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8849
8850         * statement.cs : oops, it was missing.
8851
8852 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8853
8854         A set of fixes for precise line/column location.
8855
8856         * location.cs :
8857           "token" field now holds a file/line "delta", a line number offset 
8858           from the segment, and a column number. See also:
8859           http://lists.ximian.com/pipermail/mono-devel-list/2004-
8860           December/009508.html
8861           Removed static IsNull. Use instance IsNull property instead.
8862         * cs-tokenizer.cs :
8863           For some tokens it stores Location. For Identifier it stores
8864           LocatedToken which is a pair of string name and location.
8865           Column numbers are adjusted only at getChar().
8866         * report.cs :
8867           Use Location.ToString() for reporting (it now contains column).
8868         * cs-parser.jay :
8869           Largely modified to use LocatedToken instead of
8870           string (IDENTIFIER), and to acquire Location from some tokens.
8871         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8872           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8873           codegen.cs :
8874           Now MemberName holds Location. DeclSpace.ctor() receives Location
8875           as a parameter. Removed extra parameters to all derived classes.
8876           Replaced Location.IsNull() with instance property.
8877         * assign.cs, expression.cs :
8878           Added .ctor() overload that omits Location.
8879         * attribute.cs :
8880           Added "nameEscaped" flag that indicates the identifier was escaped
8881           in the source file. This fixes bug #57047.
8882
8883 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
8884
8885         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8886         New method, looking for lo-case imported cls type.
8887
8888         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8889         here.
8890
8891         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8892
8893         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8894
8895         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8896         all_imported_types.
8897         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8898
8899         Optimized to save 3.5 MB for SWF compilation.
8900
8901 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8902
8903         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8904         (PartialContainer.Create): Moved logic AddToContainer.
8905         (PartialContainer.MarkForDuplicationCheck): Shares name.
8906         
8907         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8908         place.
8909         
8910         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8911         initialization.
8912         (Namespace.GetSignatureForError): New method.
8913         
8914         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8915         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8916
8917 2005-08-01  Raja R Harinath  <rharinath@novell.com>
8918
8919         Fix #75669.
8920         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8921         member lookup rather than qualifier_type, since qualifier_type can
8922         be null.
8923
8924 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8925
8926         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
8927         enum member.
8928
8929 2005-07-31  Miguel de Icaza  <miguel@novell.com>
8930
8931         * statement.cs: Copy the local exception into the exception
8932         captured local.  Fixes 75674
8933
8934 2005-07-31  Raja R Harinath  <harinath@gmail.com>
8935
8936         Fix #75658.
8937         * expression.cs (Invocation.OverloadResolve): Don't report error
8938         CS1501 if error CS1502 has been reported.
8939         (New.DoResolve): Delegate CS1501 reporting to
8940         Invocation.OverloadResolve.
8941
8942         Fix #75656.
8943         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
8944         invariant-meaning-in-block property in an enclosing block if
8945         necessary.
8946
8947 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
8948
8949         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
8950         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
8951         (Switch.CheckSwitch): Just save 50kb for SWF.
8952
8953 2005-07-27  Martin Baulig  <martin@ximian.com>
8954
8955         * anonymous.cs (CaptureContext.AddField): Added
8956         `AnonymousContainer am' argument; compute its toplevel scope if
8957         it's not already computed.  Fixes #75649.
8958
8959 2005-07-26  Raja R Harinath  <rharinath@novell.com>
8960
8961         Fix #75628.
8962         * class.cs (Constructor.Emit): Reset block to null if the block
8963         resolve fails.
8964
8965 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
8966
8967         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
8968
8969 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
8970
8971         * class.cs (MethodData.Define): Check whether accessor implementing
8972         interface is public.
8973
8974         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
8975
8976 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
8977
8978         Fix #57245
8979         * namespace.cs (LookupType): Moved same type check to...
8980         
8981         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
8982         with the same name.
8983
8984 2005-07-21  Raja R Harinath  <rharinath@novell.com>
8985
8986         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
8987         already found a typebuilder.
8988         * class.cs (MethodCore.IsDuplicateImplementation): Compare
8989         MemberNames, not strings.
8990
8991         * const.cs (Error_ExpressionMustBeConst): 
8992         Rename from Error_EpressionMustBeConst.
8993         * const.cs, class.cs, statement.cd: Update.
8994
8995 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
8996
8997         Fix #65573
8998
8999         * const.cs (Const.LookupConstantValue): Report missing contant expression
9000         everytime.
9001         (Error_EpressionMustBeConstant): Only one error method.
9002
9003         * class.cs, statement.c: Updated.
9004
9005 2005-07-20  Raja R Harinath  <rharinath@novell.com>
9006
9007         * statement.cs (Block.Flags): Add back HasVarargs.
9008         (Block.flags): Make protected.
9009         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
9010
9011         * typemanager.cs (types, typecontainers, user_types): Remove.
9012         (UserTypes, TypeContainers): Likewise.
9013         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
9014         (CleanUp, Reset): Update.
9015         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
9016         (GetNestedType): Use Type.GetNestedType.
9017         (CoreLookupType): Take two arguments, the namespace and the
9018         basename of the type.  Update to use the Namespace.Lookup
9019         mechanism.
9020         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
9021         (RealMemberLookup): Use IsNestedChildOf instead of playing with
9022         string concatenation and substring matches.
9023         * class.cs, enum.cs, delegate.cs: Update to changes.
9024
9025 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
9026
9027         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
9028         Expression and made virtual.
9029
9030         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
9031         (ImplicitStandardConversionExists): Fixed `byte' typo ?
9032
9033         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
9034
9035         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
9036         error message.
9037
9038         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
9039         change.
9040
9041 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
9042
9043         Fix #57707
9044         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
9045         AssemblyCultureAttribute is not used on executable.
9046
9047         * rootcontext.cs,
9048         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
9049
9050 2005-07-16  Raja R Harinath  <rharinath@novell.com>
9051
9052         Fix #60638.
9053         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
9054         New.  Reports CS0252/CS0253.
9055         Mostly taken from preliminary patch by Duncak Mak.
9056         (Binary.DoResolveOperator): Store results of operator lookup.
9057         Use them to detect if we need to warn about unintended reference
9058         comparisons.
9059
9060 2005-07-15  Raja R Harinath  <rharinath@novell.com>
9061
9062         Fix #72969.
9063         * namespace.cs (Namespace.Lookup): Add back location parameter.
9064         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
9065         * delegate.cs, ecore.cs, expression.cs: Update to changes.
9066
9067         * codegen.cs (EmitContext.DeclSpace): Make readonly.
9068         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
9069         (Namespace.LookupType): ... this.
9070         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
9071         of namespaces.
9072         * typemanager.cs (LookupTypeReflection): Remove buggy code that
9073         purported to handle pointers.
9074         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
9075         CoreLookupType.
9076
9077 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
9078
9079         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
9080         type as namespace.
9081
9082 2005-07-15  Raja R Harinath  <rharinath@novell.com>
9083
9084         * namespace.cs (Namespace.Lookup): Drop location parameter.
9085         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
9086         (NamespaceEntry.Lookup): ... this.
9087         (NamespaceEntry.Error_AmbiguousTypeReference):
9088         Move here from DeclSpace.
9089         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
9090         names ...
9091         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
9092         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
9093         Move to NamespaceEntry.
9094         * delegate.cs, expression.cs: Update to changes.
9095
9096 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
9097
9098         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
9099         CheckAttributeType and refactored.
9100         (Attribute.ResolvePossibleAttributeType): Changed to reuse
9101         ResolveAsTypeTerminal error handling.
9102         (ResolveAsTypeTerminal): Introduced because of global attributes extra
9103         handling.
9104         (GetSignatureForError): Print errors in same way.
9105
9106         * class.cs,
9107         * codegen.cs: Reflect attribute GetSignatureForError change.
9108
9109         * ecore.cs,
9110         * expression.cs: Add silent parameter to ResolveAsTypeStep.
9111
9112         * namespace.cs (UsingEntry): Refactored to make fields private.
9113
9114         * assign.cs,
9115         statement.cs: Error_UnexpectedKind has extra parameter.
9116
9117 2005-07-14  Raja R Harinath  <rharinath@novell.com>
9118
9119         * ecore.cs (IAlias): Remove.
9120         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
9121         that implement the interface.
9122         * namespace.cs (Namespace): Likewise.
9123         (Namespace.declspaces): Renamed from 'defined_names'.
9124         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
9125         DeclSpace instead of an IAlias.
9126         * tree.cs (Tree.AddDecl): Update.
9127
9128 2005-07-12  Raja R Harinath  <rharinath@novell.com>
9129
9130         * statement.cs (Block.Flags); Remove HasVarargs.
9131         (Block.HasVarargs): Move to ToplevelBlock.
9132         (Block.ThisVariable, Block.AddThisVariable): Likewise.
9133         (Block.Variables): Make protected.  Initialize variable hashtable
9134         if necessary.
9135         (Block.AddVariable): Update.
9136         (Block.Resolve): Update to changes.
9137         (ToplevelBlock.HasVarargs): New boolean.
9138         (ToplevelBlock.ThisVariable): Move here from Block.
9139         (ToplevelBlock.AddThisVariable): Likewise.
9140         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
9141         * expression.cs (This.ResolveBase): Update to changes.
9142         (ArglistAccess.DoResolve): Likewise.
9143
9144 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
9145
9146         Fix #75321
9147         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
9148
9149         * class.cs (TypeContainer.VerifyMembers): Distinguish between
9150         not used and not used & assigned.
9151         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
9152
9153 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
9154
9155         Fix #75053
9156         * expression.cs (Is.DoResolve): null is never provided type.
9157
9158 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
9159
9160         Fix #52496
9161         * cs-parser.jay: Less strict event error rule to catch more errors.
9162
9163 2005-07-08  Martin Baulig  <martin@ximian.com>
9164
9165         Fix test-iter-10.cs - distinguish whether we `yield' in a property
9166         gettter (allowed) or setter (not allowed).
9167
9168         * class.cs (Accessor): Implement IIteratorContainer.
9169         (Accessor.Yields): New public field.
9170         (PropertyBase.PropertyMethod.Define): Handle iterators on a
9171         per-accessor basis.
9172
9173         * cs-parser.jay
9174         (get_accessor_declaration, set_accessor_declaration): Set the
9175         `yields' flag on the accessor, not the property.
9176         (property_declaration): Do the iterators check on a per-accessor
9177         basis and not for the whole property.
9178
9179 2005-07-08  Martin Baulig  <martin@ximian.com>
9180
9181         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
9182         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
9183
9184 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
9185
9186         Fix #74975
9187         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
9188         (ExtractSecurityPermissionSet): Cope with self referencing security
9189         attributes properly.
9190
9191         * driver.cs (SetOutputFile): Made public property OutputFile.
9192
9193 2005-07-07  Raja R Harinath  <rharinath@novell.com>
9194
9195         Fix #75486.
9196         * class.cs (TypeContainer.first_nonstatic_field): Rename from
9197         has_nonstatic_fields.  Make into a FieldBase pointer.
9198         (TypeContainer.AddField): Add CS0282 check.
9199         (TypeContainer.EmitType): Update.
9200
9201 2005-07-06  Miguel de Icaza  <miguel@novell.com>
9202
9203         * cs-tokenizer.cs (consume_identifier): Do not create strings to
9204         compare if they start with __.
9205
9206 2005-07-06  Raja R Harinath  <rharinath@novell.com>
9207
9208         * statement.cs (Switch.SwitchGoverningType): Only look at
9209         UserCasts that don't need implicit standard conversions to one of
9210         the allowed switch types (Fixes test-322.cs).
9211         (LocalInfo.Resolve): Re-enable sanity-test.
9212
9213 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
9214
9215         * cs-tokenizer.cs (consume_identifier): Detect double undescores
9216         
9217         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
9218         
9219         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
9220
9221 2005-07-06  Raja R Harinath  <rharinath@novell.com>
9222
9223         Fix #75472.
9224         * ecore.cs (SimpleName.GetSignatureForError): Add.
9225         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
9226         (MemberAccess.GetSignatureForError): Add.
9227
9228 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
9229  
9230         The big error and warning messages review.
9231         
9232         * anonymous.cs,
9233         * assign.cs,
9234         * attribute.cs,
9235         * class.cs,
9236         * codegen.cs,
9237         * convert.cs,
9238         * cs-parser.jay,
9239         * cs-tokenizer.cs,
9240         * decl.cs,
9241         * delegate.cs,
9242         * doc.cs,
9243         * driver.cs,
9244         * ecore.cs,
9245         * enum.cs,
9246         * expression.cs,
9247         * flowanalysis.cs,
9248         * iterators.cs,
9249         * literal.cs,
9250         * location.cs,
9251         * modifiers.cs,
9252         * namespace.cs,
9253         * parameter.cs,
9254         * pending.cs,
9255         * report.cs,
9256         * rootcontext.cs,
9257         * statement.cs,
9258         * support.cs,
9259         * tree.cs,
9260         * typemanager.cs: Updated.
9261         
9262         * class.cs: (MethodCore.SetYields): Moved here to share.
9263         (PropertyMethod.Define): Moved iterator setup here.
9264         
9265         * iterators.cs: Add orig_method to have full access to parent
9266         container.
9267
9268 2005-07-05  Raja R Harinath  <rharinath@novell.com>
9269
9270         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9271         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9272         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9273         variable of struct type.
9274         * expression.cs (Unary.ResolveOperator): Update to change.
9275         (Indirection.VerifyFixed): Likewise.
9276         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9277         (ParameterReference.VerifyFixed): Value parameters are fixed.
9278         (This.VerifyFixed): Treat 'this' as a value parameter.
9279         * statement.cs (LocalInfo.IsFixed): Remove.
9280
9281 2005-07-01  Martin Baulig  <martin@ximian.com>
9282
9283         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9284         `ec.EmitThis ()' to get the correct scope.
9285
9286 2005-07-01  Martin Baulig  <martin@ximian.com>
9287
9288         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9289         instance is a ParameterReference; fixes #75299.
9290
9291 2005-07-01  Martin Baulig  <martin@ximian.com>
9292
9293         Reverted Marek's latest patch (r46725):
9294         - it contains structural changes which are neither mentioned in
9295           the ChangeLog nor explained anywhere; for example the additional
9296           argument of EmitContext's and Iterator's .ctor's and the
9297           TypeContainer.DefineMembers() change.
9298         - structural changes like this should go in in seperate patches
9299           and not be hidden in a huge patch which just seems to affect
9300           warnings and errors.
9301           a big and hard to understand patch.
9302         - it breaks iterators and causes regressions, for instance in
9303           test-iter-03.cs.      
9304
9305 2005-06-30  Raja R Harinath  <rharinath@novell.com>
9306
9307         Fix #75412.
9308         * expression.cs (Indexers.map): Remove.
9309         (Indexers.Append): Filter out inaccessible setters and getters.
9310         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9311
9312         Fix #75283.
9313         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
9314         Refactored from ...
9315         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9316         (FieldExpr.Emit, PropertyExpr.Emit): Update.
9317         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9318         * expression.cs (Invocation.EmitCall): Add CS0120 check.
9319
9320 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
9321
9322         Fix #75322
9323         * class.cs (FieldBase.GetInitializerExpression): One more field
9324         for backup.
9325
9326 2005-06-28  Miguel de Icaza  <miguel@novell.com>
9327
9328         * pending.cs: Do not define a proxy if the base method is virtual,
9329         it will be picked up by the runtime (bug 75270).
9330
9331 2005-06-08  Martin Baulig  <martin@ximian.com>
9332
9333         The big Iterators rewrite :-)
9334
9335         * iterators.cs: Rewrite this to use the anonymous methods framework.
9336
9337         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9338         before the TypeContainers; see 2test-21.cs.
9339
9340         * class.cs
9341         (TypeContainer.DefineType): Don't create a new EmitContext if we
9342         already have one (this only happens if we're an Iterator).
9343         (TypeContainer.Define): Also call Define() on all our iterators.
9344         (Method.CreateEmitContext): Added support for iterators.
9345
9346         * anonymous.cs
9347         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9348         (AnonymousContainer.CreateMethodHost): Moved here from
9349         AnonymousMethod and made abstract.
9350         (AnonymousContainer.CreateScopeType): New abstract method.
9351         (AnonymousContainer.IsIterator): New public property.
9352         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9353         get the ScopeTypeBuilder rather than manually defining it here. 
9354         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9355         iterators here.
9356
9357         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9358         before RootContext.DefineTypes().
9359
9360         * codegen.cs (EmitContext.RemapToProxy): Removed.
9361         (EmitContext.CurrentAnonymousMethod): Changed type from
9362         AnonymousMethod -> AnonymousContainer.
9363         (EmitContext.ResolveTopBlock): Protect from being called twice.
9364         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9365         (EmitContext.EmitThis): Removed the iterators hacks; use the
9366         anonymous methods framework for that.
9367
9368         * statement.cs
9369         (ToplevelBlock.Container): Make this a property, not a field.
9370         (ToplevelBlock.ReParent): New public method; move the
9371         ToplevelBlock into a new container.
9372         (Foreach.TemporaryVariable): Simplify.
9373
9374 2005-06-05  Martin Baulig  <martin@ximian.com>
9375
9376         * statement.cs (LocalInfo.CompilerGenerated): New flag.
9377         (Block.AddTemporaryVariable): New public method; creates a new
9378         `LocalInfo' for a temporary variable.
9379         (Block.EmitMeta): Create the LocalBuilders for all the temporary
9380         variables here.
9381         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9382         non-iterator variables.
9383
9384 2005-06-05  Martin Baulig  <martin@ximian.com>
9385
9386         * statement.cs (Foreach.TemporaryVariable): Create the
9387         LocalBuilder in the Emit phase and not in Resolve since in some
9388         situations, we don't have an ILGenerator during Resolve; see
9389         2test-19.cs for an example.
9390
9391 2005-06-04  Martin Baulig  <martin@ximian.com>
9392
9393         **** Merged r45395 from GCS ****
9394
9395         The big Foreach rewrite - Part II.
9396
9397         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9398         with `PropertyInfo ienumerator_getcurrent'.
9399
9400         * codegen.cs (VariableStorage): Removed.
9401
9402         * statement.cs
9403         (Foreach): Derive from Statement, not ExceptionStatement.
9404         (Foreach.CollectionForeach): New nested class.  Moved all the code
9405         dealing with collection foreach here.
9406         (Foreach.ForeachHelperMethods): Removed.
9407         (Foreach.TemporaryVariable): Implement IMemoryLocation.
9408
9409 2005-05-23  Martin Baulig  <martin@ximian.com>
9410
9411         * statement.cs (Try.DoResolve): Don't create a `finally' if we
9412         don't need to.  Fix #75014.
9413
9414 2005-05-20  Martin Baulig  <martin@ximian.com>
9415
9416         Merged r44808 from GMCS.
9417
9418         * class.cs (TypeContainer.CircularDepException): Removed.
9419         (TypeContainer.DefineType): Removed the `InTransit' stuff.
9420         (TypeContainer.CheckRecursiveDefinition): Check for circular class
9421         (CS0146) and interface (CS0529) dependencies here.
9422
9423 2005-06-21  Raja R Harinath  <rharinath@novell.com>
9424
9425         * expression.cs (Invocation.EmitCall): Fix initialization
9426         'this_call' to reflect current behaviour.  Fix indentation.
9427
9428         * convert.cs (FindMostEncompassedType): Add two trivial special
9429         cases (number_of_types == 0 || number_of_types == 1).
9430         (FindMostEncompasingType): Likewise.
9431
9432 2005-06-17  Raja R Harinath  <rharinath@novell.com>
9433
9434         Some cleanups preparing for the fix of #75283.
9435         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9436         error testing.
9437         (EventExpr.InstanceResolve): Likewise.
9438         (EventExpr.DoResolve): Remove redundant checks.
9439
9440 2005-06-10  Duncan Mak  <duncan@novell.com>
9441
9442         * cs-tokenizer.cs (process_directives): New flag for controlling
9443         the processing of preprocessor directives.
9444         (x_token): After seeing a '#', return Token.NONE instead of going
9445         to handle_preprocessing_directive() when not processing
9446         directives. This avoids unnecessary processing during the token peek in
9447         is_punct().
9448
9449         This fixes #74939.
9450
9451         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9452         the existing error reporting methods instead of Report.Error.
9453
9454         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9455         after Raja's rewrite.
9456
9457 2005-06-08  Miguel de Icaza  <miguel@novell.com>
9458
9459         * class.cs: Small fix.
9460
9461 2005-06-08  Raja R Harinath  <rharinath@novell.com>
9462
9463         Fix #75160.
9464         * class.cs (GetPartialBases): Fix return value check of
9465         part.GetClassBases.
9466
9467 2005-06-07  Raja R Harinath  <rharinath@novell.com>
9468
9469         Ensure that partial classes are registered in their enclosing
9470         namespace.  Initial part of fix of #75160.
9471         * tree.cs (Tree.RecordDecl): Add new namespace argument.
9472         Register declspace with namespace here, not in
9473         DeclSpace.RecordDecl.
9474         * cs-parser.jay: Pass namespace to RecordDecl.
9475         * class.cs (PartialContainer.Create): Likewise.
9476         (ClassPart.DefineType): New sanity-check.  Throws an exception if
9477         called.
9478         * decl.cs (Declspace.RecordDecl): Remove.
9479         * namespace.cs (NamespaceEntry.DefineName): Remove.
9480
9481 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
9482
9483         * rootcontext.cs: Reset TargetExt as well.
9484
9485 2005-06-03  Raja R Harinath  <rharinath@novell.com>
9486
9487         * ecore.cs (Expression.Resolve): Emit CS0654 error when
9488         -langversion:ISO-1.
9489
9490 2005-06-02  Raja R Harinath  <rharinath@novell.com>
9491
9492         Fix #75080, cs0119.cs.
9493         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
9494         of ...
9495         (Expression.Resolve): ... this.  Use it.  Remove bogus code
9496         allowing ExprClass.Type and ExprClass.Namespace for
9497         ResolveFlags.VariableOrValue.
9498         (Expression.Resolve) [1-argument variant]: Change default resolve
9499         flags based on language version.
9500         (Expression.Error_UnexpectedKind): Use a simple string array
9501         rather than an ArrayList.
9502         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9503         not ExprClass.Type.
9504         (TypeOfVoid.DoResolve): Likewise.
9505         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
9506         flags argument -- it always has the same value.
9507
9508 2005-05-31  Raja R Harinath  <rharinath@novell.com>
9509
9510         Fix #75081.
9511         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9512         Use it in the error message.
9513         * assign.cs, expression.cs, statement.cs: Update.
9514
9515 2005-05-30  Raja R Harinath  <rharinath@novell.com>
9516
9517         Fix #75088.
9518         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9519         the "almostMatchedMember" case too.
9520         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9521         that failed the accessibility checks to 'almost_match'.
9522
9523 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
9524
9525         * attribute.cs: Use internal MethodBuilder methods to set
9526         ExactSpelling and SetLastError on PInvoke methods, instead
9527         of passing them via charset.  Fixes #75060.
9528
9529 2005-05-27  Raja R Harinath  <rharinath@novell.com>
9530
9531         * parameter.cs (Parameter): Remove TODO comment.
9532         (Parameter.DefineParameter): Remove Location parameter.
9533         (Parameters.LabelParameters): Likewise.
9534         * class.cs (Constructor.Emit): Update to change.
9535         (MethodData.Emit): Likewise.
9536         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
9537         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9538
9539 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
9540
9541         * parameter.cs,
9542           Removed Parameters.Location and added Parameter.Location instead.
9543           Removed Location parameter from Emit() and GetSignature().
9544         * anonymous.cs,
9545           class.cs,
9546           cs-parser.jay,
9547           delegate.cs,
9548           iterators.cs,
9549           statement.cs :
9550           Modified all related calls.
9551
9552 2005-05-26  Raja R Harinath  <rharinath@novell.com>
9553
9554         Improve user-defined conversion handling.
9555         * convert.cs (GetConversionOperators): Rewrite.  Return only the
9556         applicable operators.
9557         (AddConversionOperators): New.  Helper for GetConversionOperators.
9558         (FindMostEncompassedType, FindMostEncompassingType): Verify that
9559         there is only one most encompassed/encompassing type.
9560         (FindMostSpecificSource, FindMostSpecificTarget): Remove
9561         "applicable operator" handling.
9562         (UserConversion): Move cache here from GetConversionOperators.
9563         Directly cache the chosen operator, rather than the whole
9564         MethodGroup.
9565         (ExplicitNumericConversion): Fix buggy implementation of Decimal
9566         case.  Allow conversion of decimal to sbyte and byte too.
9567         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9568         New static methods.  Used to avoid allocating EmptyExpressions in
9569         convert.cs.
9570
9571 2005-05-24  Duncan Mak  <duncan@novell.com>
9572
9573         * ecore.cs (CastFromDecimal): New class for casting a decimal to
9574         another class, used in Convert.ExplicitNumericConversion.
9575         (CastToDecimal): New class, similar to above, but casts to
9576         System.Decimal, used in Convert.ImplicitNumericConversion and also
9577         in explicit convesion from double/float to decimal.
9578
9579         * convert.cs (ImplicitNumericConversion): Handle implicit
9580         conversions to System.Decimal.
9581         (ExplicitNumericConversion): handle explicit conversions to
9582         System.Decimal.
9583
9584         This fixes #68711.
9585         
9586 2005-05-20  Miguel de Icaza  <miguel@novell.com>
9587
9588         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9589         know the type at this stage, just break through.   Fixes #75008 
9590
9591 2005-05-19  Martin Baulig  <martin@ximian.com>
9592
9593         * delegate.cs
9594         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9595         to disable error reporting.
9596
9597         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9598         here since we don't want to report an error; see the new test-336.cs.
9599
9600 2005-05-19  Raja R Harinath  <rharinath@novell.com>
9601
9602         * statement.cs (ToplevelBlock.GetParameterReference)
9603         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9604         Move here from class Block.
9605         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9606         * expression.cs (ParameterReference.DoResolveBase): Likewise.
9607
9608 2005-05-18  Martin Baulig  <martin@ximian.com>
9609
9610         Fix #74978.
9611
9612         * flowanalysis.cs
9613         (FlowBranching.Reachability): Add non-static public And() and Or()
9614         methods.
9615         (FlowBranchingSwitch): New class; do the `break_origins' thing
9616         like in FlowBranchingLoop.
9617         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9618         reachability, not just locals and parameters.
9619         (FlowBranching.MergeChild): Remove some of the hacks for loop and
9620         switch; MergeBreakOrigins() now takes care of that.
9621
9622 2005-05-18  Martin Baulig  <martin@ximian.com>
9623
9624         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9625         a loop and may leave it, reset the barrier; fixes #74974.
9626
9627 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
9628         
9629         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9630         is back.
9631         
9632         * cs-parser.jay: Catch more lexical errors.
9633         
9634         * report.cs: Add one more Error method.
9635         
9636         * rootcontext.cs,
9637         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9638
9639 2005-05-17  Martin Baulig  <martin@ximian.com>
9640
9641         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9642         #70970. 
9643
9644 2005-05-16  Raja R Harinath  <rharinath@novell.com>
9645
9646         Fix test-382.cs.  Emit values of decimal constants.
9647         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9648         Carved out of ...
9649         (TypeContainer.AddField): ... this.
9650         (TypeContainer.EmitFieldInitializers): Allow the list of fields
9651         with initializers to include 'Const's.
9652         (ClassPart.RegisterFieldForInitialization): Forward to
9653         PartialContainer.
9654         * const.cs (Const.Const): Pass initializer to base class.
9655         (Const.Define): In case of decimal constants, register them for
9656         initialization in a static constructor.
9657
9658 2005-05-14  Martin Baulig  <martin@ximian.com>
9659
9660         * statement.cs (Block.Resolve): Correctly handle unreachable code;
9661         do not call ResolveUnreachable() on unreachable statements in
9662         here, see the comment in the source code.
9663
9664 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9665
9666         Fix #74934.
9667         * expression.cs (BinaryResolveOperator): If one of the operands of
9668         an equality comparison is 'null' and the other is a pointer type,
9669         convert the null to a NullPointer.
9670         * convert.cs (ImplicitReferenceConversion): If the expression is a
9671         NullLiteral and the target type is a pointer type, return a
9672         NullPointer instead.
9673         (ImplicitConversionStandard): Likewise.
9674
9675 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
9676         
9677         * cs-parser.jay: Set readonly context based on special constructs.
9678         
9679         * expression.cs (LocalVariableReference.DoResolveBase): Improved
9680         readonly variable error handling.
9681         
9682         * rootcontext.cs (EmitCode): Don't verify members when error
9683         occurred.
9684         
9685         * statement.cs (LocalInfo): Add reaodnly context information.
9686         (SetReadOnlyContext, GetReadOnlyContext): New methods.
9687
9688 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9689
9690         * statement.cs (Block.Resolve): Revert change below.  Modify fix
9691         for #74041 to initialize 'resolved' to false only for explicit
9692         blocks.  Fixes #74873.
9693
9694 2005-05-12  Raja R Harinath  <harinath@gmail.com>
9695
9696         Fix #74920.
9697         * typemanager.cs (unmanaged_enclosing_types): New.
9698         (IsUnmanagedType): Avoid infloops by using
9699         'unmanaged_enclosing_types' to talk with recursive invocations.
9700
9701 2005-05-13  Martin Baulig  <martin@ximian.com>
9702
9703         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9704         instance variable, not a local.  Fix #74873.
9705         (Block.ResolveUnreachable): Set it to true here.
9706
9707 2005-05-11  Duncan Mak  <duncan@novell.com>
9708
9709         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9710         continuing to process for 'arg'.
9711         (handle_preprocessing_directive): Check the argument of the #endif
9712         directive and report error CS1025 if there are any trailing
9713         characters.
9714
9715         According to the C# spec, having even whitespace after the #endif
9716         directive is illegal; however, because we call arg.TrimEnd ()
9717         beforehand, we have the same behavior as csc, allowing whitespace
9718         after the directive.
9719
9720         Fixes #74892.
9721
9722 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
9723
9724         Fix #74863.
9725         
9726         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9727         (Constructor.GetObsoleteAttribute): Implemented correctly.
9728
9729 2005-05-10  Martin Baulig  <martin@ximian.com>
9730
9731         * support.cs (ReflectionParameters.ParameterModifier): Use
9732         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9733         and `ParameterAttributes.In'.  Fixes #74884.
9734
9735 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
9736
9737         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9738         
9739         * expression.cs (Argument.GetParameterModifier): Turned to property.
9740         (Invocation.Error_InvalidArguments): Add more descriptive errors.
9741         
9742         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9743         its C# equivalent.
9744         
9745 2005-05-09  Raja R Harinath  <rharinath@novell.com>
9746
9747         Fix #74852.
9748         * decl.cs (MemberCache.AddMethods): Register override methods,
9749         rather than non-override methods.
9750         * typemanager.cs (RegisterOverride): New.
9751         (IsOverride): Update.
9752
9753 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
9754
9755         Fix #73105.
9756         
9757         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9758         recursive declaration.
9759         
9760         * statement.cs (Block.ResolveMeta): Report any error in resolving.
9761         
9762 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
9763
9764         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9765         
9766         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9767
9768 2005-05-05  Raja R Harinath  <rharinath@novell.com>
9769
9770         Fix #74797.
9771         * decl.cs (DeclSpace.FamilyAccessible): 
9772         Use TypeManager.IsNestedFamilyAccessible.
9773
9774         Fix reopened #64812.
9775         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9776         internal'.
9777
9778 2005-05-04  Raja R Harinath  <rharinath@novell.com>
9779             Abin Thomas  <projectmonokochi@rediffmail.com>
9780             Anoob V E  <projectmonokochi@rediffmail.com>
9781             Harilal P R  <projectmonokochi@rediffmail.com>
9782
9783         Fix #64812.
9784         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9785         allow access to all static members.
9786
9787 2005-05-04  Martin Baulig  <martin@ximian.com>
9788
9789         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9790
9791 2005-05-04  Martin Baulig  <martin@ximian.com>
9792
9793         Fix #74655.
9794
9795         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9796         section at the end; make things work if `default' is not the last
9797         section.        
9798
9799 2005-05-04  Martin Baulig  <martin@ximian.com>
9800
9801         Fix #70400.
9802
9803         * statement.cs (Switch): Replaced the `got_default' field with a
9804         `default_section' one.
9805         (Switch.CheckSwitch): Set `default_section' here.
9806         (Switch.Resolve): If we're a constant switch and the constant is
9807         not found, use the default section.
9808
9809 2005-05-03  Martin Baulig  <martin@ximian.com>
9810
9811         * expression.cs (ArrayAccess.EmitGetLength): New public method.
9812
9813         * statement.cs (Foreach.ArrayForeach): New nested class.
9814         (Foreach.TemporaryVariable): New nested class.
9815         (Foreach.EmitArrayForeach): Removed; this is now in the new
9816         ArrayForeach class.
9817
9818 2005-05-03  Raja R Harinath  <rharinath@novell.com>
9819
9820         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
9821         more conservative.
9822         (VerifyPendingMethods): Revert change below.
9823
9824         * typemanager.cs (IsOverride, RegisterNonOverride): New.
9825         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9826         that used to trigger warning -28.  Remove warning -28.
9827         * expression.cs (Invocation.OverloadResolve): Use
9828         TypeManager.IsOverride to distinguish override methods.
9829
9830         Fix #74773.
9831         * pending.cs (VerifyPendingMethods): If a base type implements the
9832         requested interface, don't bother checking individual methods of
9833         the base type.  As a side-effect, this prevents the creation of
9834         unnecessary proxies.
9835
9836 2005-05-02  Martin Baulig  <martin@ximian.com>
9837
9838         Fix #70182.
9839
9840         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9841         Also `And' the locals if the old vector is null.
9842         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9843         null; in this case we basically reset all the variables.        
9844
9845 2005-05-02  Martin Baulig  <martin@ximian.com>
9846
9847         Fix #74529.
9848
9849         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9850         Added `FlowBranching branching' argument; always `and' the
9851         variables instead of `or'ing them unless we're an infinite loop.
9852
9853         * statement.cs (While.Resolve): Create a new sibling unless we're
9854         infinite.       
9855
9856 2005-05-02  Martin Baulig  <martin@ximian.com>
9857
9858         Fix #70140.
9859
9860         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9861         arguments; use it instead of creating a new TopLevelBlock.
9862         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9863         our ConstructorInitializer.
9864
9865         * statement.cs
9866         (TopLevelBlock.TopLevelBranching): New public property.
9867         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9868         and create our `TopLevelBranching'.
9869
9870         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9871         anonymous method host, use `block.TopLevelBranching' rather than
9872         creating a new branching.
9873
9874 2005-04-20  Miguel de Icaza  <miguel@novell.com>
9875
9876         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9877         a ScopeInfo, if any of the current children is a child of the new
9878         entry, move those children there.
9879
9880 2005-04-30  Martin Baulig  <martin@ximian.com>
9881
9882         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9883         at the beginning of a SwitchSection.  Fix #73335.
9884
9885 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
9886
9887         Fix #74378
9888         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9889         
9890         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9891         (FieldExpr.DoResolve): Obsolete members are ignored for field
9892         initializers.
9893         
9894 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
9895
9896         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9897         of arrays detection.
9898
9899         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9900         verification.
9901         (Field.VerifyClsCompliance): Volatile fields are not compliant.
9902
9903         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9904         arrays report.
9905
9906 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
9907
9908         * cs-parser.jay: Use the prefered version of -unsafe in error
9909         message.
9910
9911 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
9912
9913         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9914         circumstances.
9915
9916 2005-04-20  John Luke  <john.luke@gmail.com>
9917
9918         * driver.cs: fix typo in error message, --outout to --output
9919
9920 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
9921
9922         * codegen.cs (InRefOutArgumentResolving): New field.
9923         
9924         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9925         fields outside contructor.
9926         
9927         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
9928         
9929 2005-04-19  Miguel de Icaza  <miguel@novell.com>
9930
9931         * anonymous.cs (CaptureContext.EmitParameterInstance): The
9932         parameter code was not completed ever, so it was not as up-to-date
9933         as local variables.  Must finish it.
9934
9935         The bug fix was to compare the Toplevel of the block, not the
9936         current block.  Thanks for Ben for pointing this out. 
9937
9938 2005-04-19  Raja R Harinath  <rharinath@novell.com>
9939
9940         * decl.cs (AddMethods): Use the declaring type of the problem
9941         method to determine if we want to squash a warning.
9942
9943 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
9944
9945         * attribute.cs: Removed debug output.
9946
9947         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
9948         
9949         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
9950         Report.Stderr.
9951         
9952 2005-04-18  Raja R Harinath  <rharinath@novell.com>
9953
9954         Fix #74481.
9955         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
9956         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
9957         all null comparisons against reference types.
9958
9959 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
9960
9961         Fix# 74565
9962         * class.cs (TypeContainer.CircularDepException) New nested
9963         exception class.
9964         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
9965         (TypeContainer.DefineType): Removed error, reset InTransit before
9966         exit.
9967         (Class.DefineType): Throw exception when is in Transit.
9968         Catch exception and report error.
9969         (Struct.DefineType): Throw exception when is in Transit.
9970         Catch exception and report error.
9971         (Interface.DefineType): Throw exception when is in Transit.
9972         Catch exception and report error.
9973
9974         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
9975         handle nested exception handlers.
9976
9977         * flowanalysis.cs (InTryWithCatch): New method, search for try with
9978         a catch.
9979
9980         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
9981         InFinally and InCatch storage.
9982
9983         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
9984         (Catch.Resolve): Set and Restore ec.InCatch.
9985         (Try.Resolve): Set and Restore ec.InFinally.
9986         (Try.HasCatch): True when try has catch.
9987
9988 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
9989
9990         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
9991           for the same event member, so exclude such cases from warning 419.
9992           Fixed bug #74633.
9993
9994 2005-04-16  Miguel de Icaza  <miguel@novell.com>
9995
9996         * expression.cs (Binary.ResolveOperator): Apply patch from John
9997         Luke to fix bug 59864: operators &, | and ^ on enumerations
9998         require that the same enum type on both sides.
9999
10000         * driver.cs: Add warnings to old flag usage, this is to assist
10001         people who produce Makefiles and hope that the Makefiles will be
10002         used on Windows.
10003
10004         * class.cs (TypeContainer.EmitType): Moved the definition of the
10005         special $PRIVATE$ field from the resolve phase to the Emit phase.
10006         During resolve we do not know if we are a struct with
10007         HasExplicitLayout, we know this only after the attributes for the
10008         type are emitted.
10009
10010         Set the FieldOffset to zero on the dummy field that we create for
10011         the class.   Fixes 74590.
10012
10013 2005-04-16  Raja R Harinath  <rharinath@novell.com>
10014
10015         Fix #73834.
10016         * ecore.cs (PropertyExpr.resolved): New.
10017         (DoResolve): Use it to handle a case of double resolution here.
10018         Handle a case of identical-name-and-type-name.
10019         * expression.cs (ArrayCreation.CheckIndices): Avoid double
10020         resolution by storing the results of expression resolution back
10021         into the "probes" array.
10022
10023 2005-04-15  Raja R Harinath  <rharinath@novell.com>
10024
10025         Fix cs0208-7.cs and cs0208-8.cs.
10026         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
10027         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
10028         error reporting to point out the reason a struct is not unmanaged.
10029
10030 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10031
10032         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
10033           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
10034
10035 2005-04-13  Raja R Harinath  <rharinath@novell.com>
10036
10037         Fix #74528.
10038         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
10039         IdenticalNameAndTypeName here.
10040         (EventExpr.InstanceResolve): Likewise.
10041
10042 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
10043
10044         C# 2.0 DefaultCharSetAttribute implementation
10045         
10046         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
10047         which allows us to set GlobalNamespace for every resolve.
10048         (Attribute.ResolveArguments): Cut from Resolve.
10049         (Attribute.GetCharSetValue): Returns CharSet named argument.
10050         (Attribute.DefinePInvokeMethod): Gets default charset from
10051         module settings.
10052         (GlobalAttribute.ResolveAsTypeStep): Override.
10053         (GlobalAttribute.ResolveArguments): Override.
10054         
10055         * class.cs (TypeAttr): Is protected.
10056         
10057         * codegen.cs (ModuleClass.DefaultCharSet): New member.
10058         (ModuleClass.DefaultCharSetType): New memeber.
10059         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
10060         
10061         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
10062         charset from module.
10063         
10064         * delegate.cs (TypeAttr): Override.
10065         (Delegate.DefineType): Use this TypeAttr.
10066         
10067         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
10068         at very early stage (before types are defined) to resolve model
10069         module attributes. It will probably not work with corlib but it
10070         should be ok.
10071         
10072         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
10073         charset from module.
10074         
10075         * typemanager.cs (default_charset_type): New type.
10076
10077 2005-04-13  Raja R Harinath  <rharinath@novell.com>
10078
10079         * decl.cs (MemberCache.AddMethods): Don't warn if
10080         System.Object.Finalize has buggy MethodAttributes.
10081
10082         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
10083         removed below.
10084
10085 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10086
10087         * doc.cs : detect ambiguous reference to overloaded members.
10088           Fixed bug #71603. MS 1.1 csc does not detect it.
10089
10090 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10091
10092         * doc.cs : delegates must not be referenced with parameters.
10093           Fixed bug #71605.
10094
10095 2005-04-12  Miguel de Icaza  <miguel@novell.com>
10096
10097         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
10098
10099 2005-04-10  Miguel de Icaza  <miguel@novell.com>
10100
10101         * driver.cs (MainDriver): Stop processing if the CLS stage found
10102         errors. 
10103
10104         (CompilerCallableEntryPoint.InvokeCompiler): Always
10105         reset after execution;   Take a TextWriter argument for the
10106         output.
10107
10108         * report.cs: Use the error stream instead of hardcoding stderr. 
10109
10110 2005-04-09  Miguel de Icaza  <miguel@novell.com>
10111
10112         * class.cs: Reduce code paths to test, too small of an
10113         optimization to make it worth the extra testing.  Always perform
10114         it. 
10115
10116 2005-04-08  Raja R Harinath  <rharinath@novell.com>
10117
10118         Fix #74510.
10119         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
10120         operators that had errors reported on them.
10121
10122 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
10123
10124         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
10125         argument types.
10126         (Attribute.Resolve): Add named argument type checking.
10127         
10128         * class.cs (FixedField.Define): Use IsPrimitiveType
10129         
10130         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
10131         
10132         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
10133         unsafe parameter types.
10134         
10135         * statement.cs (Using.ResolveExpression): Add better error description.
10136         
10137         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
10138         
10139 2005-04-08  Raja R Harinath  <rharinath@novell.com>
10140
10141         Fix #74484.
10142         * attribute.cs (Attribute.GetAttributeUsage): Resolve
10143         AttributeUsageAttribute in the emitcontext of the attribute class,
10144         not in the emitcontext of the attributable entity it was attached to.
10145         * cs-parser.jay: Use 'current_class', not 'current_container',
10146         when creating a GlobalAttribute.
10147
10148 2005-04-08  Alp Toker  <alp@atoker.com>
10149
10150         * pending.cs: The fix to #58413 failed to compile methods implementing
10151         interfaces with/without params modifiers and vice versa, even though
10152         params modifiers aren't part of the signature. Make the modifier check
10153         less strict as in csc.
10154
10155 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
10156             Anoob V E  <projectmonokochi@rediffmail.com>
10157             Harilal P R  <projectmonokochi@rediffmail.com>
10158
10159         Fix #58413.
10160         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
10161         modifiers of pending methods.
10162         (PendingImplementation.PendingImplementation): Initialize it.
10163         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
10164         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
10165         with ParameterData.  Add check for modifiers.
10166         * class.cs (MethodData.Define): Update to changes.
10167
10168 2005-04-07  Raja R Harinath  <rharinath@novell.com>
10169
10170         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
10171
10172 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
10173
10174         * class.cs (PropertyMethod.Define): Check private accessor in abstract
10175         property.
10176         
10177         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
10178         
10179         * rootcontext.cs,
10180         * typemanager.cs: Registered RequiredAttributeAttribute.
10181         
10182 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
10183
10184         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
10185         Warning CS0169 is back at level 3.
10186         (IMethodData.SetMemberIsUsed): New method.
10187         
10188         * decl.cs (IsUsed): New value; moved from FieldBase.Status
10189         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
10190         
10191         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
10192
10193         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
10194         contants.
10195         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
10196         is used.
10197         
10198         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
10199         is used.
10200         
10201         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
10202         to avoid the problems with nested types.
10203
10204 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
10205             Anoob V.E  <projectmonokochi@rediffmail.com>
10206             Harilal P.R  <projectmonokochi@rediffmail.com>
10207             Raja R Harinath  <rharinath@novell.com>
10208
10209         Fix #73820.
10210         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
10211         attribute.
10212         * typemanager (GetConstructor): Make public.
10213
10214 2005-04-05  John Luke  <john.luke@gmail.com>
10215             Raja R Harinath  <rharinath@novell.com>
10216
10217         Fix #62232.
10218         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
10219         struct too.  Return false quicker in a few cases.
10220         (VerifyUnManaged): Use it.
10221
10222 2005-04-05  Raja R Harinath  <rharinath@novell.com>
10223
10224         Fix #74041.
10225         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
10226         not 'unreachable_seen'.
10227
10228 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
10229
10230         * attribute.cs (Attribute.GetValue): Removed unused.
10231         
10232         * codegen.cs (CodeGen.TrimExt): Removed unused.
10233         
10234         * cs-parser.jay (output): Removed unused.
10235         
10236         * cs-tokenizer.cs (hex_digits): Removed unused.
10237         
10238         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
10239         
10240         * expression.cs (Indirection.LoadExprValue): Removed unused.
10241         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
10242         
10243         * iterators.cs (Iterator.param_types): Removed unused.
10244         
10245         * statement.cs (Goto.block): Removed unused.
10246         (ToplevelBlock.did): Removed unused.
10247         (Switch.ResolveConstantSwitch): Removed unused.
10248
10249 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
10250
10251         * rootcontext.cs: Allow mcs to bootstrap with the compilation
10252         resetting thingy.
10253
10254 2005-04-01  Raja R Harinath  <rharinath@novell.com>
10255
10256         Fix #74232 and cs0208-3.cs.
10257         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10258         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10259         unmanaged type.  Don't use FieldBuilders when 't' is a
10260         TypeBuilder.  Use ModFlags and MemberType fields.
10261         * class.cs (MemberBase.member_type): Rename from MemberType.
10262         (MemberBase.MemberType): New property.  Determines member_type on
10263         demand.
10264         (MemberBase.DoDefine): Don't initialize MemberType here.
10265         (FieldMember.Define): Likewise.
10266
10267 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
10268
10269         Fix #74241
10270         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10271         Attributes are emitted there.
10272         
10273 2005-04-01  Raja R Harinath  <rharinath@novell.com>
10274
10275         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10276         keyword in 'partial enum' too.
10277         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10278         is not allowed).
10279         Report from Kamil Skalski <nazgul@omega.pl>.
10280
10281         Fix #74309.
10282         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10283         have partial containers too.
10284
10285         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10286         in block' checks to Block.CheckInvariantMeaningInBlock.
10287         * statement.cs (Block.GetKnownVariableInfo): Make private.
10288         (Block.IsVariableUsedInChildBlock): Remove.
10289         (Block.IsVariableUsedInBlock): Likewise.
10290         (Block.CheckInvariantMeaningInBlock): New.  Show location of
10291         conflicting declaration.
10292         (Block.AddVariable): Make error messages less long-winded and more
10293         specific.  Show location of conflicting declaration.
10294         * parameter.cs (Parameters.Location): New readonly property.
10295
10296 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10297
10298         Clean up semantics of invoking ResolveMemberAccess.
10299         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10300         can have an instance, ensure that we pass in a non-TypeExpression
10301         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
10302         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10303         argument.  Update to changes and simplify.
10304         (FieldExpr.Emitinstance): Remove CS0120 check.
10305         (PropertyExpr.EmitInstance): Likewise.
10306         * expression.cs (Argument.Resolve): Likewise.
10307         (Invocation.DoResolve): Update to changes in semantics of
10308         InstanceExpression.
10309
10310 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
10311
10312         Fix #74241
10313         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10314         customization.
10315         
10316         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10317
10318 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10319
10320         Fix difference in behaviour with commandline invocation.
10321         * driver.cs (Driver.Reset): New.
10322         (CompilerCallableEntryPoint): Call it.
10323
10324         * statement.cs (If.Resolve): Avoid spurious "uninitialized
10325         variable" warnings if the boolean expression failed to resolve.
10326
10327 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
10328
10329         * attribute.cs: Fix the union of several permissions when some of them
10330         are unrestricted (so the result isn't an unrestricted permission set).
10331         Fix #74036.
10332
10333 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10334
10335         * ecore.cs (MemberExpr): New class.  Convert from interface
10336         IMemberExpr.
10337         (MemberExpr.ResolveMemberAccess): Refactor and move here from
10338         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
10339         error checks.
10340         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10341         (MethodGroupExpr.IsExplicitImpl): Remove.
10342         (Expression.GetFieldFromEvent): Remove.
10343         (SimpleName.MemberStaticCheck): Remove.
10344         (SimpleName.DoSimpleNameResolve): Update to changes.
10345         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10346         (MemberAccess.IdenticalNameAndTypeName): Remove.
10347         (MemberAccess.error176): Move to MemberExpr.
10348         (MemberAccess.DoResolve): Update to changes.
10349         (BaseAccess.DoResolve): Likewise.
10350
10351 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
10352
10353         C# 2.0 Conditional attribute class implementation
10354         
10355         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10356         Analyzes class whether it has attribute which has ConditionalAttribute
10357         and its condition is not defined.
10358         
10359         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10360         (Class.IsExcluded): New method. Search for at least one defined
10361         condition in ConditionalAttribute of attribute class.
10362
10363 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10364
10365         * ecore.cs (PropertyExpr): Derive from Expression, not
10366         ExpressionStatement.
10367         (PropertyExpr.EmitStatement): Remove.
10368
10369 2005-03-29  Raja R Harinath  <rharinath@novell.com>
10370
10371         Fix #74060.
10372         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10373         internal field "value__" of an enum be private.  The examples for
10374         "value__" that I found on MSDN all used FieldAttributes.Private.
10375
10376         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10377         Don't mention IL method attribute names.
10378
10379         Fix #47991.  Remove a TODO.
10380         * statement.cs (Block.Toplevel): Make into a field.
10381         (Block.Parameters): Move into ToplevelBlock.
10382         (Block.known_variables): Rename from child_variable_names.
10383         (Block.Block): Remove variants that take Parameters.  Initialize
10384         'Toplevel' with the immediately surrounding toplevel block.
10385         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
10386         LocalInfo parameter.
10387         (Block.GetKnownVariableInfo): New.
10388         (Block.IsVariableNameUsedInChildBlock): Update.
10389         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
10390         the block, even though it may not be in scope.
10391         (Block.AddVariable): Remove Parameters parameter.  Use
10392         Toplevel.Parameters instead.
10393         (Block.AddConstant): Remove Parameters parameter.
10394         (Block.GetParameterReference): Update to use Toplevel.Parameters.
10395         (Block.IsParamaterReference): Likewise.
10396         (Block.IsLocalParameter): Likewise.  Simplify a lot.
10397         (ToplevelBlock.Parameters): New.  Moved from Block.
10398         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
10399         initialize Parameters to a non-null value.
10400         * cs-parser.jay: Update to changes.
10401         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10402         simple names that mean different things in the same block.  Use
10403         Block.IsVariableNameUsedInBlock.
10404
10405 2005-03-28  Raja R Harinath  <rharinath@novell.com>
10406
10407         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10408         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10409         GetTypeHandle.  It is possible for a reflected type to derive from
10410         a TypeBuilder (e.g., int[] derives from the TypeBuilder
10411         System.Array during mscorlib compilation).
10412         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10413         contain a method_hash, don't create one either.  Don't create a
10414         deep copy of the base cache's method_hash.
10415         (MemberCache.SetupCache): Rename back from DeepCopy.
10416         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10417         already initialized.  If we see an override function, add its
10418         underlying base virtual function to the member_hash too.
10419
10420         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10421
10422 2005-03-26  Raja R Harinath  <harinath@acm.org>
10423
10424         Fix #73038.
10425         * assign.cs (Assign.DoResolve): When the RHS of an assignment
10426         fails to resolve, ensure that the LHS is still resolved as an
10427         lvalue.
10428
10429 2005-03-25  Raja R Harinath  <harinath@acm.org>
10430
10431         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10432         ec.ContainerType.
10433         (Enum.current_ec): Remove.
10434         (Enum.LookupEnumValue): Remove EmitContext argument.
10435         Just uses the one created during DefineType.
10436         (Enum.FindMembers): Update.
10437         * expression.cs (MemberAccess.DoResolve): Update.
10438
10439 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
10440
10441         * assign.cs (Assign.DoResolve): Check for CS1717 when
10442         source and target are same (uses Equals).
10443
10444         * expression.cs (LocalVariableReference, ParameterReference,
10445         This): Implemented Equals, GetHashCode.
10446
10447         * statement.cs (Block.GetParameterReference): Removed useless
10448         local variable.
10449
10450 2005-03-22  Raja R Harinath  <rharinath@novell.com>
10451
10452         Fix cs0128.cs
10453         * statement.cs (Block.AddVariable): Ensure that we skip implicit
10454         blocks before deciding whether the error is cs0136 or cs0128.
10455
10456         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10457         (using_alias_directive, using_namespace_directive): Pass
10458         MemberName, not an expression to Namespace.UsingAlias and
10459         Namespace.Using.
10460         (MakeName): Use the MemberName of the namespace.
10461         * namespace.cs (Namespace.MemberName): New.
10462         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10463         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10464         Likewise.
10465         * decl.cs (MemberName.Name): Make readonly.
10466         (MemberName.FromDotted): New "constructor".
10467         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10468         (MemberCore.Name): Compute from MemberName on demand.
10469         (MemberCore.SetMemberName): Provide a way to change the
10470         MemberName.
10471         (MemberCore.AddToContainer): Don't take a fullname parameter.
10472         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10473         fully qualified name of the container to the member name.
10474         (TypeContainer.AddToTypeContainer): Use a fully qualified name
10475         only if the type is a member of the root container.
10476         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10477         MemberName.Left rather than searching for an embedded ".".
10478         (PartialContainer.CreatePart): Update to changes in RootContext.
10479         (MemberBase.ShortName): Turn into a property.  Use
10480         MemberCore.SetMemberName.
10481         (MemberBase.ExplicitInterfaceName): Remove.
10482         (MemberBase.UpdateMemberName): Remove.
10483         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10484         (PropertyBase.SetMemberName): New override.
10485         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10486         (Tree.GetDecl): New.
10487         (Tree.AllDecls): Rename from Decls.
10488         * attribute.cs, enum.cs, report.cs: Update to changes.
10489         * driver.cs (MainDriver): Use MemberName.FromDotted on
10490         RootContext.MainClass.
10491
10492 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
10493
10494         * class.cs (FixedField.Define): Check for CS1664 and more sanity
10495         checks.
10496
10497         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10498
10499 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
10500
10501         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10502         property accessor modifiers.
10503
10504         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10505         fixed buffer attribute (CS1716).
10506         (PropertyMethod.HasCustomAccessModifier): When property accessor
10507         has custom modifier.
10508
10509         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10510         modifiers.
10511         (PropertyExpr.DoResolveLValue): Add CS0272.
10512
10513 2005-03-17  Miguel de Icaza  <miguel@novell.com>
10514
10515         * convert.cs: When converting to a pointer, use the proper Conv.U
10516         or Conv.I depending on the source data type.
10517
10518         * cs-tokenizer.cs: Make the size for large decimal constants,
10519         fixes #72957.
10520
10521 2005-03-17  Martin Baulig  <martin@ximian.com>
10522
10523         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10524         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
10525
10526 2005-03-17  Martin Baulig  <martin@ximian.com>
10527
10528         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10529         to bool so we can return an error condition.
10530         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10531         returned an error.
10532
10533 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
10534
10535         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10536         attributes.
10537
10538 2005-03-16  Raja R Harinath  <rharinath@novell.com>
10539
10540         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10541         Refactor to avoid traversing the list of assemblies, and to avoid
10542         string concatenation.
10543         * typemanager.cs (guid_attr_type): Remove.
10544         (negative_hits, pointers, references): Remove hashes.
10545         (type_hash): New.
10546         (GetConstructedType): New.  Uses type_hash to handle constructed
10547         types (arrays, references, pointers).
10548         (GetReferenceType, GetPointerType): Use it.
10549         (GetNestedType): New.  Uses type_hash to handle nested types of
10550         reflected types.
10551         (LookupType, LookupTypeDirect): Remove.
10552         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
10553         'types' hash and LookupTypeReflection directly.
10554         (params_string, params_object): Use GetConstructedType.
10555         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
10556         top-level types.
10557         (Namespace.Lookup): Use cached_types.
10558         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10559         provided by old TypeManager.LookupType.
10560         * rootcontext.cs (MakeFQN): Remove.
10561         * decl.cs (DeclSpace.MakeFQN): Likewise.
10562         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10563         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10564         TypeManager.GetConstructedType.
10565         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10566
10567 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
10568
10569         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10570         indexers.
10571
10572         * cs-parser.jay: Reports CS1527 for any namespace element.
10573
10574         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10575         Added CS0407.
10576
10577         * expression.cs (ParameterReference.IsAssigned): Changed error to
10578         CS0269.
10579         (Error_WrongNumArguments): Moved CS0245 detection here.
10580
10581         * statement.cs (Return.Resolve): Add CS1622 report.
10582
10583 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
10584
10585         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10586
10587 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
10588
10589         * attribute.cs expression.cs: Get rid of some allocations.
10590
10591 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
10592
10593         * doc.cs : just eliminate the latest change.
10594
10595 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10596
10597         * doc.cs : commented out the latest change. It breaks xml-030.cs
10598
10599 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10600
10601         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10602           fail. So invoke CreateType() in FindDocumentedType().
10603
10604 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10605
10606         * cs-tokenizer.cs : added IsKeyword().
10607         * doc.cs : Detect keyword incorrectly used as identifier.
10608           Allow identifiers prefixed by @.
10609
10610 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
10611
10612         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10613         It caused exception in namespace resolving (again!).
10614         
10615         * class.cs (Class.ctor): Removed exit.
10616         (PropertyMethod.ctor): ditto.
10617         
10618         * codegen.cs (Codegen.Reset): Reset static data.
10619         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10620         
10621         * cs-tokenizer.cs (Cleanup): Removed.
10622         
10623         * driver.cs (GetSystemDir): Rewrote to one line command.
10624         It caused problem with unloaded dynamic modules.
10625         (UnixParseOption): Removed Exit.
10626         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10627         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10628         Now can be mcs used as library.
10629         
10630         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10631         empty location.
10632         
10633         * location.cs (Reset): Reset static data.
10634         
10635         * namespace.cs (Reset): Reset static data.
10636         
10637         * report.cs (Report.Reset): Reset static data.
10638         
10639         * rootcontext.cs (RootContext.Reset): Reset static data.
10640         
10641         * tree.cs (RootTypes.ctor): Use Location.Null
10642         
10643         * typemanager.cs (TypeManager.Reset): Reset static data.
10644         (CoreLookupType): Removed Exit.
10645         (TypeHandle.Reset): Reset static data.
10646         
10647 2005-03-10  Raja R Harinath  <rharinath@novell.com>
10648
10649         Fix #73516.
10650         * typemanager.cs (ComputeNamespaces): Import namespaces from
10651         referenced modules too.
10652
10653 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10654
10655         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10656         than '.'.
10657
10658 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10659
10660         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10661         enclosing DeclSpace.  This ensures that a name-lookup populates
10662         more caches and there are fewer 'TypeExpression's.  Carve out
10663         nested type lookup into ...
10664         (LookupNestedTypeInHierarchy): ... this.
10665
10666 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10667
10668         Clean up a few partial-class semantics.  
10669         Fixes test-357.cs and cs1618-2.cs.
10670         * cs-parser.jay (struct_declaration): Use 'current_class' as
10671         parent of newly-created struct.  Remove call to Register ().
10672         Use 'pop_current_class' to complete handing the current struct.
10673         (interface_declaration): Likewise.
10674         (class_declaration): Likewise.
10675         (enum_declaration): Use 'current_class' as parent of newly created
10676         enum.
10677         (delegate_declaration): Likewise.
10678         (pop_current_class): New function.  This is used to handle closing
10679         up the 'current_class' and 'current_container', and pointing them
10680         to the enclosing class/container.
10681         (CSharpParser): Initialize 'current_class' too.
10682         * decl.cs (MemberCore): Add check for invariant: a partial
10683         container is not a parsed entity, and thus does not enclose any
10684         parsed members.
10685         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10686         (DeclSpace.BaseTypeExpr): Use it.
10687         (DeclSpace.LookupType): Add check for invariant.
10688         * class.cs (TypeContainer): Add check for invariant: a nested
10689         class should have the same NamespaceEntry as its enclosing class.
10690         (TypeContainer.EmitFieldInitializers): Make virtual.
10691         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10692         MemberCore.
10693         (TypeContainer.Register): Remove.
10694         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10695         null.  Use TypeResolveEmitContext for resolving base types and
10696         interfaces.  Move initialization of Parts.TypeBuilder here from
10697         ...
10698         (TypeContainer.DefineNestedTypes): ... here.
10699         (PartialContainer): Take a Namespace not a NamespaceEntry.
10700         (PartialContainer.Create): Don't use Register.  Call the
10701         appropriate Add... function directly.
10702         (ClassPart): Take both the PartialContainer and the enclosing
10703         class as constructor arguments.
10704         (ClassPart.EmitFieldInitializers): Override.
10705         (ClassPart.PartFindNestedTypes): Remove.
10706         (FieldBase.GetInitializerExpression): Resolve the initializer
10707         expression in the emit context of the enclosing class.
10708         * tree.cs (RootTypes): Remove Register ().
10709         
10710 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
10711
10712         * cs-parser.jay: Removed CS0134.
10713         
10714         * driver.cs: Removed CS1901.
10715         
10716         * expression.cs (SizeOf.DoResolve): Don't report CS0233
10717         for predefined types.
10718
10719 2005-03-07  Duncan Mak  <duncan@novell.com>
10720
10721         * codegen.cs (Save):  Catch UnauthorizedAccessException as
10722         well. Fixes bug #73454.
10723
10724 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
10725
10726         * cs-tokenizer.cs (xtoken): Add CS1035.
10727         
10728         * class.cs (MethodData.Define): Add CS0683.
10729         (FieldMember.ctor): Add CS0681.
10730
10731 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10732
10733         * ecore.cs (SimpleName.DoResolve): Rename from
10734         SimpleName.DoResolveAllowStatic.
10735         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10736         Pass 'intermediate' flag to MemberStaticCheck.
10737         (SimpleName.MemberStaticCheck): Skip "static check" only in case
10738         of "intermediate" lookups via MemberAccess.
10739         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
10740         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10741
10742 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10743
10744         Fix #73394.
10745         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10746         slipped in because of variable names that are identical to a
10747         builtin type's BCL equivalent ('string String;', 'int Int32;').
10748         (PropertyExpr.EmitInstance): Likewise.
10749
10750 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
10751
10752         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10753         
10754         * report.cs (warning_ignore_table): Made public.
10755
10756 2005-03-04  Raja R Harinath  <rharinath@novell.com>
10757
10758         Fix #73282.
10759         * class.cs (MethodData.Emit): Pass 'container' to
10760         container.GetObsoleteAttribute instead of 'container.Parent'.
10761
10762 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
10763
10764         * cs-parser.jay: Add 1534 error test.
10765
10766         * iterators.cs (Yield.CheckContext): Add error 1629.
10767         (Iterator.ctor): Save unsafe modifier.
10768         (MoveNextMethod.DoEmit): Restore unsafe context.
10769
10770         * namespace.cs (UsingAlias): Better error message.
10771
10772 2005-03-03  Dan Winship  <danw@novell.com>
10773
10774         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10775         the warning message [#73219]
10776
10777 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10778
10779         Fix compile with MCS 1.0.0.0.
10780         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10781         w_restore to not depend on string constant folding.
10782
10783 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10784
10785         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
10786         CS0246 check to users who passed 'silent = false'.
10787         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10788         check.
10789         (SimpleName.SimpleNameResolve): Update.
10790         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10791         (MemberAccess.IdenticalNameAndTypeName): Update.
10792         * doc.cs (FindDocumentedTypeNonArray): Update.
10793
10794 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
10795
10796         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10797         * parameters.cs (ComputeAndDefineParameters): Remove.
10798         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10799         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10800         Use GetParameterInfo.
10801
10802 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
10803
10804         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10805
10806 2005-03-02  Raja R Harinath  <rharinath@novell.com>
10807
10808         Unify DeclSpace.LookupType and DeclSpace.FindType.
10809         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
10810         is in charge of defining nested types on demand.
10811         (DeclSpace.LookupType): Use it when the current_type is a
10812         TypeBuilder.  Use LookupTypeDirect for reflected types.
10813         (DeclSpace.FindType): Remove.
10814         (DeclSpace.LookupInterfaceOrClass): Likewise.
10815         (DeclSpace.DefineTypeAndParents): Likewise.
10816         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10817         DeclSpace.LookupType.
10818         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10819         * typemanager.cs (LookupType): Simplify.
10820         (AddUserType): Remove type from negative_hits.
10821         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10822         * class.cs (TypeContainer.FindMembers): Move handling of nested
10823         types ...
10824         (TypeContainer.FindMembers_NestedTypes): ... here.
10825         (TypeContainer.FindNestedType): Implement override.
10826         (ClassPart.FindNestedType): Delegate to PartialContainer.
10827         (ClassPart.PartFindNestedType): Looks up the nested types of the
10828         part alone.
10829
10830 2005-03-02  Martin Baulig  <martin@ximian.com>
10831
10832         * class.cs (TypeContainer.DoDefineMembers): We also need a default
10833         static constructor in static classes.
10834
10835 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
10836
10837         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10838         sizeParamIndex is not specified.
10839
10840 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
10841
10842         Fix #73117
10843         * report.cs (WarningMessage.IsEnabled): Missing null check.
10844
10845 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10846
10847         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10848         in the fields and not in the properties.
10849
10850 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
10851
10852         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
10853         fields as well.
10854
10855 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10856
10857         * attribute.cs: Small refactoring (improved robustness).
10858         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10859         (ValidateGuid): Removed.
10860         (Resolve): Removed referenced to above mentioned.
10861         (GetAttributeUsage): Made private and changed to work without
10862         class assistance.
10863         (GetIndexerAttributeValue): Don't crash.
10864         (GetConditionalAttributeValue): Ditto.
10865         (GetClsCompliantAttributeValue): Ditto.
10866         (ExtractSecurityPermissionSet): All attributes exceptions are
10867         error 648.
10868         (GetPropertyValue): New helper.
10869         (GetMethodImplOptions): New method.
10870         (DefinePInvokeMethod): Reuse common code. Implemented handling of
10871         some missing properties.
10872         
10873         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10874         (Method.ApplyAttributeBuilder): Updated.
10875         
10876         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10877         exception.
10878
10879 2005-02-28  Raja R Harinath  <rharinath@novell.com>
10880
10881         Fix #73052.
10882         * report.cs (Report.SymbolRelatedToPreviousError): Handle
10883         non-simple types (array, pointer, reference).
10884
10885 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10886
10887         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10888
10889         * class.cs (MethodCore.IsDuplicateImplementation): Special error
10890         for operators.
10891         (Method.CheckBase): Catch wrong destructor here.
10892         (MethodData.Define): Add errors 550, 668.
10893
10894         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10895
10896         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10897
10898         * pending.cs (VerifyPendingMethods): Add error 551.
10899
10900         * typemanager.cs (CSharpName): Next error report helper.
10901
10902 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
10903
10904         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10905         attributes. Removed useless attribute double check.
10906         It saves almost 2MBs for corlib.
10907
10908 2005-02-25  Raja R Harinath  <rharinath@novell.com>
10909
10910         Fix #72924.
10911         * statement.cs (ExpressionStatement.Resolve): Make robust to being
10912         called twice in case of error.
10913
10914 2005-02-23  Chris Toshok  <toshok@ximian.com>
10915
10916         Fix compiler portions of #72827.
10917         * statement.cs (Block.Emit): call Begin/EndScope on the
10918         EmitContext instead of the ILGenerator.
10919
10920         * codegen.cs (EmitContext.BeginScope): new method, call
10921         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10922         we have one.)
10923         (EmitContext.BeginScope): same, but EndScope and CloseScope
10924
10925         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10926         offset and call the superclass's OpenScope(int) with it.
10927         (SymbolWriter.CloseScope): get the current il
10928         offset and call superclass's CloseScope(int) with it.
10929
10930 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
10931
10932         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
10933         CS1677 for out and ref as well.
10934
10935         * class.cs (Method.Define): Add error CS1599 detection.
10936         
10937         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
10938         
10939         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
10940         
10941         * delegate.cs (Delegate.Define): Add error CS1599 detection.
10942         
10943         * support.cs.cs (ModifierDesc): New helper method.
10944
10945 2005-02-23  Raja R Harinath  <rharinath@novell.com>
10946             Abin Thomas  <projectmonokochi@rediffmail.com>
10947             Anoob V E  <projectmonokochi@rediffmail.com>
10948             Harilal P R  <projectmonokochi@rediffmail.com>
10949
10950         Fix #57851, #72718.
10951         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
10952         MemberLookup (used for error reporting) actually returns a result.
10953         Fix error report number (122, not 112).
10954
10955 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
10956             Anoob V E  <projectmonokochi@rediffmail.com>
10957             Harilal P R  <projectmonokochi@rediffmail.com>
10958
10959         Fix #71134.
10960         * pending.cs (PendingImplementation.GetAbstractMethods):
10961         Find NonPublic members too.
10962
10963 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
10964
10965         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
10966         Fixed error 217.
10967         
10968         * class.cs (MethodCore.CheckMethodAgainstBase):
10969         Add error 239 report.
10970
10971 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10972
10973         Fix #68955.
10974         * expression.cs (Invocation.IsApplicable): Make public.
10975         (Invocation.IsParamsMethodApplicable): Likewise.
10976         * delegate.cs (Delegate.VerifyApplicability): Don't use
10977         Invocation.VerifyArgumentCompat for parameter applicability
10978         testing.  Use Invocation.IsApplicable and
10979         Invocation.IsParamsMethodApplicable.
10980
10981 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
10982
10983         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
10984         
10985         * class.cs (Operator.Define): Add error 217 report.
10986         
10987 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10988
10989         * namespace.cs (UsingEntry.Resolve): Undo change below.
10990
10991 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10992
10993         Fix #72756.
10994         * ecore.cs (Expression.MemberLookupFailed): Add argument to
10995         disable the error message when the extended MemberLookup also
10996         fails.
10997         (Expression.MemberLookupFinal): Update.
10998         (SimpleName.DoSimpleNameResolve): Update.
10999         * expression.cs (MemberAccess.ResolveNamespaceOrType):
11000         Don't use MemberLookupFinal.
11001         (New.DoResolve): Update.
11002         (BaseAccess.CommonResolve): Update.
11003
11004 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11005
11006         Fix #72732.
11007         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
11008         occured previously, don't resolve again.
11009
11010 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
11011
11012         Fix #69949
11013         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
11014         argument. Call ResolveAttributeUsage for unresolved.
11015         when types doesn't match ctor arguments.
11016         
11017         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
11018         for nested attribute classes.
11019         (Class.attribute_usage): Removed.
11020         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
11021         for attribute class.
11022         
11023         * ecore.cs (IsAttribute): Removed.
11024         
11025         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
11026         
11027         * rootcontext.cs (RegisterAttribute): Removed, attributes are
11028         now normal types.
11029         (attribute_types): Removed.
11030         (EmitCode): Global attributes are emited as the latest.
11031
11032 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
11033
11034         * class.cs (EmitFieldInitializers): Don't emit field initializer
11035         for default values when optimilization is on.
11036         
11037         * constant.cs (Constant.IsDefaultValue): New property.
11038         
11039         * driver.cs: Add /optimize handling.
11040         
11041         * constant.cs,
11042         * ecore.cs,
11043         * literal.cs: Implement new IsDefaultValue property.
11044         
11045         * rootcontext.cs (Optimize): New field, holds /optimize option.
11046
11047 2005-02-18  Raja R Harinath  <rharinath@novell.com>
11048
11049         Fix crasher in re-opened #72347.
11050         * namespace.cs (Namespace.Lookup): Return null if
11051         DeclSpace.DefineType returns null.
11052
11053         Fix #72678.
11054         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
11055
11056 2005-02-18  Raja R Harinath  <rharinath@novell.com>
11057
11058         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
11059         now returns null if it cannot resolve to an lvalue.
11060         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
11061         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
11062         returned null.  Remove check for SimpleName.
11063         (EventExpr.DoResolveLValue): New.
11064         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
11065         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
11066         error from ...
11067         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
11068         avoid CS0131 error.
11069         (Unary.ResolveOperator): Move CS0211 check ...
11070         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
11071         CS0131 error.
11072         (Unary.DoResolveLValue): Simplify.
11073         (AddressOf.DoResolveLValue): New.
11074         (ArrayAccess.DoResolveLValue): New.
11075
11076 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
11077
11078         * attribute.cs (Attribute.Resolve): Add arguments casting for
11079         when types doesn't match ctor arguments.
11080
11081 2005-02-16  Raja R Harinath  <rharinath@novell.com>
11082
11083         Fix parts of #63202.
11084         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
11085         lookup of operator in base type.  Ensure that all checks happen
11086         when the operator resolves to an "op_..." method.
11087
11088 2005-02-15  Raja R Harinath  <rharinath@novell.com>
11089
11090         Fix #71992.
11091         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
11092         'ignore_cs0104' parameter.  Pass it to ...
11093         (NamespaceEntry.Lookup): ... this.
11094         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
11095         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
11096         (TypeLookupExpression.DoResolveAsTypeStep): Update.
11097         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
11098         Update.  Request that cs0104 errors be ignored.
11099         (ComposedCast.ResolveAsTypeStep): Update.
11100
11101 2005-02-14  Raja R Harinath  <rharinath@novell.com>
11102
11103         Fix #59209.
11104         * expression.cs (Invocation.BetterFunction): Remove support for
11105         comparing virtual functions and their overrides.
11106         (Invocation.IsOverride): New.
11107         (Invocation.OverloadResolve): Don't consider 'override' functions
11108         during candidate selection.  Store them in a lookaside list.
11109         If the selected method is a 'virtual' function, use the list to
11110         find any overrides that are closer to the LHS type.
11111
11112 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
11113
11114         * expression.cs (New.DoResolve): Add complex core type reduction.
11115         (New.Constantify): Converts complex core type syntax like 'new int ()'
11116         to simple constant.
11117         
11118 2005-02-14  Raja R Harinath  <rharinath@novell.com>
11119
11120         * decl.cs (EntryType.EntryType): New constructor to create an
11121         updated copy of a cache entry.
11122         (MemberCache.AddMethods): Use it.
11123         (MemberCache.ClearDeclaredOnly): Remove.
11124         (MemberCache.MemberCache): Update.
11125
11126 2005-02-11  Miguel de Icaza  <miguel@novell.com>
11127
11128         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
11129         variable.  This one is represents the actual low-level declaration
11130         of the method, as opposed to the semantic level `IsStatic'.   
11131
11132         An anonymous method which is hosted into a static method might be
11133         actually an instance method.  IsStatic would reflect the
11134         container, while MethodIsStatic represents the actual code
11135         generated.
11136
11137         * expression.cs (ParameterReference): Use the new MethodIsStatic
11138         instead of IsStatic.
11139
11140         * anonymous.cs (AnonymousMethod.Compatible): Pass the
11141         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
11142         set on the current EmitContext. 
11143
11144         * expression.cs (Cast): Overload DoResolveLValue so we can pass
11145         resolve our casted expression as an LValue.  This triggers the
11146         proper LValue processing that is later required by Assign.
11147
11148         This fixes 72347.
11149
11150         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
11151
11152 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
11153
11154         C# 2.0 Fixed buffer implementation
11155
11156         * anonymous.cs: Update after RegisterHelperClass renaming.
11157
11158         * attribute.cs (AttributeTester.fixed_buffer_cache):
11159         Cache of external fixed buffers.
11160         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
11161         implementation if field is fixed buffer else null.
11162
11163         * class.cs
11164         (TypeContainer.AddField): Accept FieldMember instead of Field.
11165         (FieldBase.IsFieldClsCompliant): Extracted code from
11166         VerifyClsCompliance descendant customization.
11167         (FixedField): New class handles fixed buffer fields.
11168         (FixedFieldExternal): Keeps information about imported fixed
11169         buffer.
11170         (IFixedField): Make access to internal or external fixed buffer
11171         same.
11172
11173         * cs-parser.jay: Add fixed buffer parsing.
11174
11175         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
11176         buffer.
11177
11178         * expression.cs (Indirection): Extended implementation to accept
11179         fixed buffer field.
11180         (PointerArithmetic.Emit): Get element from fixed buffer as well.
11181         (ElementAccess.MakePointerAccess): Get type as parameter.
11182         (DoResolve): Add fixed buffer field expression conversion.
11183         (DoResolveLValue): Ditto.
11184         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
11185         (ArrayPtr): Derives from FixedBufferPtr.
11186         (ArrayPtr.Emit): Add extra emit for array elements.
11187
11188         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
11189
11190         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
11191         for compiler generated types.
11192         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
11193
11194         * statement.cs (Fixed): Refactored to be easier add fixed buffer
11195         and consume less memory.
11196         (Fixed.Resolve): Add fixed buffer case.
11197
11198         * typemanager.cs (compiler_generated_attr_ctor,
11199         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
11200         (HasElementType): Add our own implementation to work on every
11201         runtime.
11202
11203 2005-02-11  Miguel de Icaza  <miguel@novell.com>
11204
11205         * anonymous.cs (CaptureContext): Track whether `this' has been
11206         referenced.   
11207
11208         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
11209         only captured `this' if it was implicitly done (instance
11210         methods/variables were used). 
11211
11212         * codegen.cs (EmitContext.CaptureThis): New method to flag that
11213         `this' must be captured.
11214
11215 2005-01-30  Miguel de Icaza  <miguel@novell.com>
11216  
11217         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
11218         is null it means that there has been no need to capture anything,
11219         so we just create a sibling.
11220
11221         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
11222
11223         Just a partial fix.  The other half is fairly elusive.
11224         
11225 2005-02-10  Raja R Harinath  <rharinath@novell.com>
11226
11227         Fix #52586, cs0121-4.cs.
11228         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
11229         and return a hashtable.
11230         (MemberCache.ClearDeclaredOnly): New.
11231         (MemberCache.MemberCache): Update to change.  Make a deep copy of
11232         the method_hash of a base type too.
11233         (MemberCache.AddMethods): Adapt to having a deep copy of the base
11234         type methods.  Overwrite entries with the same MethodHandle so
11235         that the ReflectedType is correct.  The process leaves in base
11236         virtual functions and their overrides as distinct entries.
11237         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
11238         matters since it was boxed in a ArrayList before.
11239         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
11240         modifier.
11241         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
11242         case of a virtual function and its override (choose the overload
11243         as better).
11244         (Invocation.OverloadResolve): Avoid 'override' members during
11245         'applicable_type' calculation.
11246
11247 2005-02-09  Raja R Harinath  <rharinath@novell.com>
11248
11249         Combine two near-redundant caches.
11250         * typemanager.cs (method_params): Rename from method_internal_params.
11251         (TypeManager.GetParameterData): New.  Replace
11252         Invocation.GetParameterData.
11253         (TypeManager.LookupParametersByBuilder): Remove.
11254         * expression.cs (Invocation.method_parameter_cache): Remove.
11255         (Invocation.GetParameterData): Remove.
11256         Update to changes.
11257         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11258         Update to changes.
11259
11260 2005-02-08  Raja R Harinath  <rharinath@novell.com>
11261
11262         Fix #72015.
11263         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11264         TypeManager.multicast_delegate_type is null, resolve it by looking
11265         up "System.MulticastDelegate".
11266         * rootcontext.cs (RootContext.ResolveCore): Simplify.
11267
11268 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
11269             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
11270             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
11271
11272         Fix cs0164.cs.
11273         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11274         (LabeledStatement.AddReference): New.  Set 'referenced'.
11275         (Goto.Resolve): Use it.
11276
11277 2005-02-05  John Luke  <john.luke@gmail.com>
11278
11279         * driver.cs: remove duplicate -doc line in Usage ()
11280
11281 2005-02-04  Raja R Harinath  <rharinath@novell.com>
11282
11283         * location.cs (Location.AddFile): Fix CS2002 error report.
11284
11285 2005-02-02  Martin Baulig  <martin@ximian.com>
11286
11287         * delegate.cs (Delegate.DefineType): Report an internal error if
11288         TypeManager.multicast_delegate_type is null.  See bug #72015 for
11289         details.        
11290
11291 2005-02-02  Raja R Harinath  <rharinath@novell.com>
11292
11293         Fix a crasher in a variant of #31984.
11294         * const.cs (Constant.CheckBase): New override that defers the
11295         new-or-override check in case the base type hasn't been populated
11296         yet.
11297         (Constant.Define): Ensure the new-or-override check is performed.
11298
11299 2005-02-01  Duncan Mak  <duncan@ximian.com>
11300
11301         * const.cs (LookupConstantValue): Check that `ce' is not null
11302         before calling GetValue ().
11303
11304 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11305
11306         Fix test-334.cs (#69519).
11307         * cs-parser.jay (using_alias_directive): Pass in an expression to
11308         NamespaceEntry.UsingAlias.
11309         (using_namespace_directive): Pass in an expression to
11310         NamespaceEntry.Using.
11311         (namespace_name): Don't flatten to a string.
11312         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11313         (NamespaceEntry.AliasEntry.Resolve): Lookup using
11314         ResolveAsTypeStep.
11315         (NamespaceEntry.UsingEntry): Likewise.
11316         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11317         changes.
11318         (NamespaceEntry.LookupForUsing): Remove.
11319         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11320         names.
11321         (NamespaceEntry.Lookup): Remove support for dotted names.
11322
11323 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11324
11325         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11326         split into two.
11327         (NamespaceEntry.ImplicitParent): Compute on demand.
11328         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11329         parallels the current.
11330         (NamespaceEntry.LookupForUsing): Use it.
11331         (NamespaceEntry.Lookup): If the current namespace-entry is
11332         implicit, don't search aliases and using tables.
11333
11334 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11335
11336         Fix #31984.
11337         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11338         BaseCache here.
11339         (TypeContainer.BaseCache): Compute on demand.
11340         (TypeContainer.FindMembers): Define constants and types if they're
11341         not already created.
11342         (FieldMember.Define): Move resetting of ec.InUnsafe before error
11343         check.
11344         * const.cs (Constant.Define): Make idempotent.
11345
11346 2005-01-29  Miguel de Icaza  <miguel@novell.com>
11347
11348         * pending.cs: Produce better code (no nops produced by using Ldarg
11349         + value).
11350         
11351         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11352         i - 1' it should be arg + 1.
11353
11354         Fixes bug #71819.
11355
11356 2005-01-28  Raja R Harinath  <rharinath@novell.com>
11357
11358         * attribute.cs (Attribute.CheckAttributeType): Make private
11359         non-virtual.
11360         (Attribute.ResolveType): Make virtual.
11361         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11362         handling of RootContext.Tree.Types.
11363
11364 2005-01-27  Raja R Harinath  <rharinath@novell.com>
11365
11366         Update attribute-handling to use the SimpleName/MemberAccess
11367         mechanisms.
11368         * cs-parser.jay (attribute): Pass in an expression to the
11369         constructors of Attribute and GlobalAttribute.
11370         * attribute.cs (Attribute): Take an expression for the name.
11371         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
11372         passed in attribute name expression.
11373         (Attribute.CheckAttributeType): Use it.
11374         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11375         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11376         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
11377         argument to prevent error messages if the lookup fails.
11378
11379 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
11380
11381         * expression.cs (Indirection): Implemented IVariable interface
11382         to support indirection in AddressOf operator.
11383         (PointerArithmetic.Emit): Add optimalization for case where
11384         result can be precomputed.
11385
11386 2005-01-26  Martin Baulig  <martin@ximian.com>
11387
11388         * class.cs (TypeContainer.AttributeTargets): Return the correct
11389         AttributeTargets depending on our `Kind' instead of throwing an
11390         exception; fixes #71632.
11391
11392 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
11393
11394         Fix #71257
11395         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11396         constant members.
11397
11398 2005-01-25  Raja R Harinath  <rharinath@novell.com>
11399
11400         Fix #71602.
11401         * expression.cs (MemberAccess.DoResolve): Don't complain with
11402         cs0572 when the LHS of a member access has identical name and type
11403         name.
11404
11405 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
11406
11407         Fix #71651, #71675
11408         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11409         CreatePermission.
11410         Create custom PermissionSet only for PermissionSetAttribute.
11411
11412 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
11413
11414         Fix #71649
11415         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11416         delegates in static class.
11417
11418 2005-01-24  Martin Baulig  <martin@ximian.com>
11419
11420         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11421         merging an implicit block, just use its reachability.
11422
11423         * statement.cs (Block.Resolve): Make the unreachable code check
11424         work wrt. implicit blocks; see test-337 from #63842.
11425
11426 2005-01-21  Alp Toker  <alp@atoker.com>
11427  
11428         * cs-parser.jay: destructor_declaration's container is PartialContainer
11429         not Class when partial types are used, so use Kind prop instead of
11430         'is'.
11431         
11432 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
11433
11434         * cs-parser.jay: Improve error reporting when an interface
11435         declares new types.
11436
11437 2005-01-20  Dick Porter  <dick@ximian.com>
11438
11439         * support.cs: SeekableStreamReader fix from Sandor Dobos
11440         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11441         chars are read.  Fixes bug 70369.
11442
11443 2005-01-20  Raja R Harinath  <rharinath@novell.com>
11444
11445         * cs-parser.jay (catch_clause): Simplify current_block handling
11446         somewhat.
11447
11448 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
11449
11450         * convert.cs (ImplicitStandardConversionExists): Synchronize the
11451         code with ImplicitStandardConversion to handle the implicit
11452         conversion of method groups into valid delegate invocations. 
11453
11454         The problem is that in parameter handling we were using this code
11455         path.  Fixes bug #64698
11456
11457 2005-01-19  Raja R Harinath  <rharinath@novell.com>
11458
11459         * cs-parser.jay: Fix several infelicities.
11460         - Avoid assigning to the parser value stack.  Code like 
11461           '$3 = null' is unclean.  Synthesize a value for the code block
11462           instead. 
11463         - Avoid using oob_stack for storing location information.  Use ...
11464         (_mark_): ... this.  New (empty) rule.  Saves the current location
11465         in $$.
11466         (foreach_statement): Avoid using oob_stack for current_block
11467         handling.  Use technique used in for_statement and
11468         using_statement.  Synthesize a value for the code block to store
11469         additional intermediate information.
11470
11471 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
11472
11473         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11474         of a different type is only allowed to private fields of a
11475         containing type, not on fields of a base class.
11476
11477         See test-174.cs and error cs0122-9.cs
11478
11479 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11480
11481         Fix test-335.cs (bug #58126).
11482         * cs-parser.jay (argument): Split out non-expression parts of the
11483         rule into 'non_simple_argument'.
11484         (invocation_expression): Support parenthesized invocations with
11485         multiple arguments, and with single non-simple arguments.
11486
11487 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11488
11489         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11490         places.
11491
11492 2005-01-12  Raja R Harinath  <rharinath@novell.com>
11493
11494         Fix cs0038-1.cs, cs1640-6.cs.
11495         * ecore.cs (Expression.Resolve): Remove special-case for
11496         SimpleName in error-handling.
11497         (Expression.almostMatchedMembers): Relax access permission to
11498         protected.
11499         (Expression.MemberLookupFailed): Handle duplicates in
11500         almostMatchedMembers list.
11501         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11502         * expression.cs (New.DoResolve): Report CS1540 for more cases.
11503         * typemanager.cs (GetFullNameSignature): Use the MethodBase
11504         overload if the passed in MemberInfo is a MethodBase.
11505
11506 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
11507
11508         Fix #70749
11509         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11510         for non-CAS & merge permission sets properly.
11511
11512 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11513
11514         Improve standard-compliance of simple name and member access 
11515         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
11516         * ecore.cs (FullNamedExpression): New abstract base class 
11517         for Namespaces and TypeExpressions.
11518         (ResolveFlags.SimpleName): Remove.
11519         (SimpleName): Remove support for dotted names.
11520         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
11521         DeclSpace.FindType and DeclSpace.LookupType.
11522         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11523         (Expression.ExprClassName): Make member function.
11524         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11525         a namespace.  Remove creation of dotted "SimpleName"s.
11526         (MemberAccess.DoResolve): Likewise.
11527         * decl.cs (DeclSpace.Cache): Make private.
11528         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11529         (DeclSpace.FindType): Update.
11530         (DeclSpace.LookupType): Move here from RootContext.  Return a 
11531         FullNamedExpression.
11532         * namespace.cs (Namespace): Derive from FullNamedExpression
11533         so that it can be part of expression resolution.
11534         (Namespace.Lookup): Return an FullNamedExpression.
11535         (NamespaceEntry.LookupAlias): Lookup aliases only in current
11536         namespace.
11537         * rootcontext.cs (NamespaceLookup): Remove.
11538         (LookupType): Move to DeclSpace.
11539         * attribute.cs (CheckAttributeType): Update.
11540         * doc.cs (FindDocumentedType): Remove allowAlias argument.
11541         (FindDocumentedTypeNonArray): Likewise.
11542
11543 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11544
11545         Fix cs0509.cs, cs1632.cs.
11546         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11547         is the same as IsInterface.
11548         (TypeContainer.GetClassBases): Likewise.
11549         * statement.cs (LabeledStatement.ig): New field.
11550         (LabeledStatement.LabelTarget): Save ILGenerator which created the
11551         label.
11552         (LabeledStatement.DoEmit): Check that the label was created with
11553         the same ILGenerator.
11554
11555 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11556
11557         Fix #71058
11558         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11559         accessors to its properties.
11560
11561         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11562         from accessors to property.
11563         
11564 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11565
11566         Fix #70722
11567         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11568         only for overrides.
11569         
11570 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
11571
11572         * attribute.cs: Check for null and empty strings.  
11573
11574         I have lost another battle to Paolo.
11575
11576 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
11577
11578         Fix #70942
11579         * class.cs (PropertyMethod): Set Parent field in ctors.
11580         (SetMethod.InternalParameters): Add unsafe switch hack.
11581         Override MarkForDuplicationCheck where it is appropriate.
11582
11583         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11584         It says whether container allows members with the same name.
11585         Base default is no.
11586         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11587         Removed is_method parameter.
11588
11589 2005-01-06  Duncan Mak  <duncan@ximian.com>
11590
11591         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11592         because the previous change led to incorrect reporting of CS1032
11593         ("Cannot define/undefine preprocessor symbols after first token in
11594         file"). Instead of using `tokens_seen' as the only flag that
11595         triggers CS1040, introduce `comments_seen'. This new flag is used
11596         to signify having seen comments on the current line, so it is
11597         unset after a newline.
11598
11599 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11600
11601         * doc.cs : When searching for a type, find nested type too.
11602           This fixes bug #71040.
11603
11604 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11605
11606         * doc.cs :
11607           - Warn missing member comment on those classes which also does not
11608             have doc comments. Fixed bug #71041.
11609           - Don't warn missing doc comment on default constructor.
11610             Fixed bug #71042.
11611
11612 2005-01-06  Duncan Mak  <duncan@ximian.com>
11613
11614         * cs-tokenizer.cs (xtoken): After handling traditional C-style
11615         comments, set `tokens_seen' to true. This allows us to detect
11616         misplaced preprocessor directives (i.e. not at the beginning of
11617         the a line, nor after whitespaces). In that case, report error
11618         CS1040. This fixes bug #56460.
11619
11620         * cs-parser.jay (interface_member_declaration): Add checks for
11621         IsExplicitImpl, and report CS0541 error if an interface member is
11622         defined as an explicit interface declaration.
11623
11624 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
11625
11626         Fix #70817
11627         * class.cs (PropertyMethod): Set Parent field in ctors.
11628         (SetMethod.InternalParameters): Add unsafe switch hack.
11629         
11630         * decl.cs (MemberCore.Parent): Cannot be readonly.
11631
11632 2005-01-06  Raja R Harinath  <rharinath@novell.com>
11633
11634         * decl.cs (DeclSpace.ResolveType): Remove.
11635         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11636         Merge in code from ...
11637         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
11638         * class.cs, enum.cs: Update to changes.
11639
11640 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
11641
11642         * anonymous.cs: Ensure that we init the scope of our parent if it
11643         has not been initialized yet.
11644
11645 2004-12-30  Duncan Mak  <duncan@ximian.com>
11646
11647         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11648         if field.FieldBuilder is null. Fixes #70758.
11649
11650         * convert.cs: Fixed some typos and updated some of the comments.
11651         (ImplicitStandardConversionExists):
11652         (TryImplicitIntConversion): If `target_type' is an interface and
11653         the type of `ic' implements this interface, return true or a new
11654         BoxedCast instead of null. This fixes #70468.
11655
11656 2004-12-29  Duncan Mak  <duncan@ximian.com>
11657
11658         * expression.cs (Argument.Emit): Check that Expr is
11659         IMemoryLocation before casting to it, and report CS1510 otherwise.
11660
11661         This fixes #70402.
11662
11663 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
11664
11665         * statement.cs (Block.ThisVariable): remove the recursion here, to
11666         make the --profile more sane.
11667
11668 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
11669
11670         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11671         assembly, by JB Evain.
11672
11673 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11674
11675         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
11676           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11677         "parent" refers to enclosing type/class.  "base" refers to superclass.
11678
11679 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11680
11681         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11682         Ensure that we only have GlobalAttributes.
11683         * attribute.cs (Attribute.Emit): Make non-virtual.
11684         (GlobalAttribute.Emit): Remove.
11685         (Attribute.Resolve): Make virtual.
11686         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
11687         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11688         the argument. Don't create one.
11689         (Attribute.GetObsoleteAttribute): Likewise.
11690         (Attribute.GetClsCompliantAttributeValue): Likewise.
11691         * class.cs, decl.cs: Update to changes.
11692
11693 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
11694
11695         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11696         
11697         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11698         
11699         * statement.cs (Foreach.Resolve): Add error 186 report.
11700
11701 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
11702
11703         * expression.cs (Conditional.DoResolve): Add warning 429.
11704         
11705         * statement.cs (If.Resolve): Add warning 665.
11706
11707 2004-12-16  Raja R Harinath  <rharinath@novell.com>
11708
11709         New invariant: RootContext.Tree.Types.NamespaceEntry == null
11710         except when in the parser, and in GlobalAttribute.
11711         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11712         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11713         RootContext.Tree.Types.NamespaceEntry once work is done.
11714         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
11715         and resets RootContext.Tree.Types.NamespaceEntry.
11716
11717 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
11718
11719         * cs-parser.jay: Don't create a block for every variable.
11720
11721 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
11722
11723         * location.cs: Provide extra information.
11724
11725         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11726         variables from the captured environment, it is the ldarg_0.
11727
11728 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11729
11730         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11731         find a conclusion.
11732         
11733         * class.cs: Changed warning level for 169 to avoid developer
11734         displeasure from warning flooding. It will be changed back when they
11735         fix most of current BCL warnings.
11736         
11737         * RootContext.cs: Pushed default WarningLevel to 3.
11738         
11739         * statement.cs: Removed unused variable.
11740
11741 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11742
11743         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11744         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11745         Add error 502 report.
11746         (StaticClass.DefineType): Add error 441 report.
11747         (Class.AllowedModifiersProp): New virtual property as temporary
11748         extension to AllowedModifiers.
11749         (Class.DefineType): Add error 418 report. Moved ModFlags check here
11750         to share implementation with StaticClass and don't call virtual
11751         methods from ctor.
11752         
11753         * driver.cs (MainDriver): Add error 1558 test.
11754
11755         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11756         report. Moved error 36 test here.
11757
11758         * statement.cs (Throw.Resolve): Add error 724 report.
11759
11760         * typemanager.cs: Add out_attribute_type core type.
11761         
11762 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
11763
11764         * class.cs (TypeContainer.VerifyClsCompliance): Add error
11765         3018 report.
11766         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11767
11768         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11769         3017 report.
11770         
11771         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11772
11773         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
11774         Add error 3023 report.
11775         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11776
11777         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11778         implementation.
11779
11780 2004-12-12  John Luke  <john.luke@gmail.com>
11781
11782         * driver.cs (AddArgs): take -- into account when
11783         adding arguments, fixes bug 65710 
11784
11785 2004-12-12  Martin Baulig  <martin@ximian.com>
11786
11787         * expression.cs (Unary.TryReduceNegative): Added support for
11788         SByteConstant and ByteConstant.
11789         (Unary.Reduce): Check error values from TryReduceNegative().
11790
11791 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
11792
11793         * attributes.cs (Attribute.Resolve): Avoid multiple error report
11794         and report exception as error 182.
11795
11796 2004-12-10  Raja R Harinath  <rharinath@novell.com>
11797
11798         * driver.cs (Main): Fix message when there are warnings.
11799
11800 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
11801
11802         * delegate.cs: Fixed my fix from yesterday, sorry about that.
11803
11804 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
11805
11806         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
11807         Reduced number of warnings.
11808         
11809         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11810
11811 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
11812
11813         * driver.cs: Removed message.
11814
11815         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11816
11817 2004-12-08    <vargaz@freemail.hu>
11818
11819         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11820
11821 2004-12-08  Martin Baulig  <martin@ximian.com>
11822
11823         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11824         instead of a CS3002 for properties and indexer.
11825
11826 2004-12-08  Martin Baulig  <martin@ximian.com>
11827
11828         * decl.cs (MemberName.ToString): Make this work again.
11829
11830 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
11831
11832         * attribute.cs (Resolve): Add error 591 detection.
11833
11834         * class.cs (FieldMember.Define): Add error 1547 detection.
11835         (Indexer.Define): Add error 620 detection.
11836         (Operator.Define): Add error 590 detection.
11837
11838         * ecore.cs: Missing argument for error 79.
11839
11840         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11841         detection.
11842
11843 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
11844
11845         Fix #70106
11846         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11847         only.
11848
11849 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
11850
11851         * cs-parser.jay : handle doc comments on implicit/explicit operators.
11852           Some operator comments were suppressed.
11853         * doc.cs : Implicit/explicit operator name in doc comments are like
11854           "op_Explicit(type)~returnType", so added suffix handling.
11855
11856 2004-12-07  Martin Baulig  <martin@ximian.com>
11857
11858         * decl.cs
11859         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11860         (MemberCore.GetClsCompliantAttributeValue): Likewise.
11861         (DeclSpace.ec): New protected field; store the EmitContext here.
11862         (DeclSpace.EmitContext): New public property; moved here from
11863         `TypeContainer'.
11864         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11865         EmitContext.
11866
11867         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11868         (Enum.Emit): Don't create a new EmitContext.
11869
11870         * delegate.cs (Delegate.DefineType): Always create the
11871         EmitContext.
11872
11873         * iterators.cs (Iterators.DefineIterator): Create a new
11874         EmitContext and store it in `ec'.
11875
11876 2004-08-24  Martin Baulig  <martin@ximian.com>
11877
11878         * typemanager.cs
11879         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11880         this for accessibility checks.
11881         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11882         IsNestedFamilyAccessible.
11883         (TypeManager.IsSubclassOf): New method, do what the name actually
11884         says.   
11885
11886 2004-12-06  Raja R Harinath  <rharinath@novell.com>
11887
11888         Fix crash on cs0657-17.cs.
11889         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11890         Use RootContext.Tree.Types, not 'new RootTypes ()'.
11891         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11892         the case where the NamespaceEntry gets overwritten.
11893
11894 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
11895
11896         Fixed #69195, #56821
11897         * ecore.cs (ResolveBoolean): Tiny refactoring.
11898
11899         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11900         of right expression resolving when left is false constant and
11901         operator is LogicalAnd OR true constant and operator is LogicalOr.
11902
11903         * statement.cs (ResolveUnreachable): Always reports warning.
11904
11905 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
11906
11907         * class.cs: Distinguish between 1721 and 1722 (just a little help
11908         for the programmer).
11909
11910 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
11911
11912         * delegate.cs: Only allow this on new versions of the language. 
11913
11914 2004-12-02  Duncan Mak  <duncan@ximian.com>
11915
11916         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11917         Expression class.
11918         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11919         here as a static method. Take an additional bool out parameter
11920         `must_do_cs1540_check' for signaling to InstanceResolve.
11921         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11922         member field from PropertyExpr class and made it an argument of
11923         the method instead.
11924         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11925         check for MarshalByRefObject, and report CS0122 instead of CS1540.
11926         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11927         and `remove_accessor' as well as InstanceResolve: report CS0122
11928         where applicable.
11929
11930         Fixes #70129.
11931
11932 2004-12-03  Raja R Harinath  <rharinath@novell.com>
11933
11934         Fix test-327.cs, test-328.cs, and put in early infrastructure
11935         for eventually fixing #52697.
11936         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
11937         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
11938         from other methods.
11939         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
11940         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
11941         (VerifyUsing, error246): Update.
11942         * rootcontext.cs (RootContext.NamespaceLookup): Just use
11943         'NamespaceEntry.LookupNamespaceOrType'.
11944
11945 2004-12-03  Martin Baulig  <martin@ximian.com>
11946
11947         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11948         method as our child, call AnonymousMethod.Compatible() on it.
11949
11950 2004-12-03  Raja R Harinath  <rharinath@novell.com>
11951
11952         Disable XML documentation support in 'basic' profile.
11953         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
11954         Redirect XmlElement to System.Object.
11955         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
11956         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
11957         * mcs.exe.sources: Add doc-bootstrap.cs.
11958         * doc-bootstrap.cs: New file.  Contains empty stub implementation
11959         of doc.cs.
11960
11961 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
11962
11963         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
11964           comments are allowed.
11965
11966 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11967
11968         * delegate.cs: Add checks for subtypes in paramaters and return values
11969         in VerifyMethod () to add support for Covariance/Contravariance
11970         in delegates.
11971         
11972 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
11973
11974         * report.cs: Remove extra closing parenthesis.
11975
11976         * convert.cs (Error_CannotImplicitConversion): If the name of the
11977         types are the same, provide some extra information.
11978
11979         * class.cs (FieldBase): Use an unused bit field from the field to
11980         encode the `has_offset' property from the FieldMember.  This saves
11981         a couple of Ks on bootstrap compilation.
11982
11983         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11984         method as our child, return the AnonymousMethod resolved
11985         expression.
11986
11987         * expression.cs (New.DoResolve): Allow return values from
11988         NewDelegate to also include AnonymousMethods.
11989
11990         Fixes #70150.
11991
11992 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
11993
11994         Fix bug #70102
11995         * attribute.cs (Resolve): Improved implementation of params
11996         attribute arguments.
11997
11998         * support.cs (ParameterData): Add HasParams to be faster.
11999
12000 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
12001
12002         all things are for /doc support:
12003
12004         * doc.cs: new file that supports XML documentation generation.
12005         * mcs.exe.sources: added doc.cs.
12006         * driver.cs:
12007           Handle /doc command line option.
12008           Report error 2006 instead of 5 for missing file name for /doc.
12009           Generate XML documentation when required, after type resolution.
12010         * cs-tokenizer.cs:
12011           Added support for picking up documentation (/// and /** ... */),
12012           including a new XmlCommentState enumeration.
12013         * cs-parser.jay:
12014           Added lines to fill Documentation element for field, constant,
12015           property, indexer, method, constructor, destructor, operator, event
12016           and class, struct, interface, delegate, enum.
12017           Added lines to warn incorrect comment.
12018         * rootcontext.cs :
12019           Added Documentation field (passed only when /doc was specified).
12020         * decl.cs:
12021           Added DocComment, DocCommentHeader, GenerateDocComment() and
12022           OnGenerateDocComment() and some supporting private members for
12023           /doc feature to MemberCore.
12024         * class.cs:
12025           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
12026         * delegate.cs:
12027           Added overriden DocCommentHeader.
12028         * enum.cs:
12029           Added overriden DocCommentHeader and GenerateDocComment().
12030
12031 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
12032
12033         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
12034         unwrapping the enumeration values, chain to
12035         DoConstantNumericPromotions again, so we can promote things to the
12036         fundamental types (takes care of enums that are bytes, sbytes).
12037
12038         Fixes bug #62054.
12039
12040 2004-12-01  Raja R Harinath  <rharinath@novell.com>
12041
12042         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
12043         Fix long-standing bug in type-lookup.  Use FindType instead of
12044         LookupType when ec.ResolvingTypeTree.
12045         (Attribute.ResolveType, Attribute.Resolve)
12046         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
12047         Update to changes.
12048         (Attributes.Search): Remove internal version.  Update.
12049         (Attributes.SearchMulti): Update.
12050         (Attributes.GetClsCompliantAttribute): Remove.
12051         (Attributes.GetIndexerNameAttribute): Remove.
12052         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
12053         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
12054         * class.cs (Indexer.Define): Likewise.
12055
12056 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
12057
12058         Fix bug #68790
12059         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
12060         MarshallByReference members access.
12061
12062         * expression.cs: Use CheckMarshallByRefAccess;
12063         Better error CS0197 message.
12064
12065         * report.cs: Print whole related error message.
12066
12067 2004-11-30  Raja R Harinath  <rharinath@novell.com>
12068
12069         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
12070         the current directory to help debugging.
12071
12072 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
12073
12074         * class (GetClassBases): Better error 60 report.
12075         (EventProperty): Disabled warning 67 detection.
12076
12077 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
12078
12079         Fix bug #60324
12080         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
12081
12082         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
12083         precise values.
12084
12085 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
12086
12087         Fix bug #49488
12088         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
12089
12090         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
12091
12092 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
12093
12094         * attribute.cs (Attribute.Resolve): Refine error reporting and
12095         report a cs0117 if the identifier does not exist, to distinguish
12096         from 0617 which is a miss-use of the actual identifier.
12097
12098         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
12099         between cs0070 and cs0079.
12100
12101         * class.cs (MemberBase.DoDefine): When reporting a wrong
12102         accessibility level, we use MethodCore to compare instead of
12103         Method (this was a regression in some refactoring effort).
12104
12105         So now we correctly report cs0056 again.
12106
12107         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
12108         testing the target_type (which was known to be object_type) and
12109         not the source type (which is anonymous_method).
12110
12111         Fixed reporting of error cs1660.
12112
12113         * expression.cs (UserCast.Source): Expose the underlying cast.
12114
12115         * statement.cs (Switch.SwitchGoverningType): Sort the list of
12116         allowed types to find a match to int32 first (most common).
12117
12118         In addition, it ignores any ImplicitUserConversions that did an
12119         internal implicit conversion (as the switch statement allows only
12120         one integral conversion to exist).
12121
12122         * class.cs (PartialContainer.Create): rename `name' to
12123         `member_name' for clarity.  Then replace the string calls with a
12124         call to MemberName.GetPartialName, as now using
12125         MemberName.ToString is an error (this is due to the side effects
12126         it had, that were fixed in the past).
12127
12128         This will restore the error reporting on a number of partial class
12129         errors that were missusing this (and getting an exception as a
12130         results, which is now just a plain textual warning, because
12131         yyparse debug output would crash otherwise).
12132
12133 2004-11-26  Raja R Harinath  <rharinath@novell.com>
12134
12135         * Makefile (PROGRAM_INSTALL_DIR): Remove.
12136
12137 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
12138
12139         * rootcontext.cs (LookupType): Make sure to cache lookups that
12140         don't give us a negative result. This saves about 5% of corlib
12141         compilation time.
12142
12143 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
12144
12145         * report.cs (AbstractMessage.Print): messages are sent to stderr
12146
12147         * class.cs (TypeContainer.GetClassBases): It is an error to have a
12148         non-interface in the list of interfaces (at this point, either
12149         parent was properly set, or a base class is being listed in the
12150         interfaces section).
12151
12152         This flags error 1722, and resolves the crash from bug 69259.
12153
12154 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
12155
12156         * statement.cs (Using.EmitExpressionFinally): make this work right
12157         for valuetypes. Fixes 69926.
12158
12159 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
12160
12161         * const.cs (Const.ChangeType): Cope with the "0 literal can be
12162         converted to an enum" here, before we try to change the underlying
12163         type.  This code exists, but it is a different code path than the
12164         one used while encoding constants.
12165
12166         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
12167         old bug: when converting from the null literal to a pointer,
12168         return an EmptyCast, not the NullLiteral.
12169
12170         This fixes #69921, the recent null_type changes probably made this
12171         bug more prominent.
12172
12173         (ImplicitReferenceConversionExists): In addition, resynchronized
12174         the code here, so it matches the same code in
12175         ImplicitReferenceConversionExists for the `from any class-type S
12176         to any interface-type T'.
12177         
12178
12179 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
12180
12181         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
12182
12183 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
12184
12185         * cs-parser.jay: Use verbosity accordingly. 
12186
12187 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
12188
12189         * expression.cs (Unary.ResolveOperator): Do not report warning;
12190         AddressOf reads from variable.
12191         
12192         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
12193
12194 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
12195
12196         Fix bug #69462
12197
12198         * attribute.cs (Attributable): Removed CheckTargets.
12199         (Attributes.Emit): Explicit attribute targets are tested here.
12200
12201         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
12202         not enabled for interfaces.
12203
12204         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
12205         (GetAssemblyName): Ouch next bug there.
12206
12207 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12208
12209         * expression.cs: Error 275 added.
12210         
12211 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
12212
12213         Fix bug #69177 (Implemented decimal constant support)
12214
12215         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
12216         (BinaryFold): Add DecimalConstant.
12217
12218         * const.cs (Define): Decimal constant 
12219         (is not constant.
12220         (ChangeType): Add decimal type handling.
12221         (LookupConstantValue): Don't set value for decimal type but
12222         emit DecimalConstantAttribute. Needed for constant optimization.
12223
12224         * constant.cs (ToDecimal): New method.
12225         (ConvertToDecimal): New method.
12226         (IntConstant): Implemented ConvertToDecimal.
12227         (DecimalConstant.Emit): Emit optimized version for decimals in
12228         int range.
12229
12230         * expression.cs (ResolveOperator): Changed order of constant
12231         reduction to work correctly with native types which have
12232         overloaded operators.
12233         (ResolveMemberAccess): Extract constant value from attribute
12234         for decimal type.
12235
12236         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
12237
12238         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
12239         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
12240         (ChangeType): Decimal is special.
12241         (TypeToCoreType): Add decimal type.
12242
12243 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
12244
12245         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
12246         decimal types.
12247
12248 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
12249
12250         * class.cs (EventField.ApplyAttributeBuilder): Fix error
12251         test cs1667-5.cs.
12252
12253 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
12254
12255         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
12256
12257         * pending.cs (PendingImplementation): Grab only interfaces.
12258
12259 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
12260
12261         * statement.cs (ForeachHelperMethods): Add location member and
12262         error 202 detection.
12263
12264 2004-11-19  Raja R Harinath  <rharinath@novell.com>
12265
12266         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
12267         automatically handled by executable.make.
12268         (PROGRAM): Make profile-specific.
12269
12270 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
12271
12272         * expression.cs (DoResolveBase): Fixed wrong warning for out
12273         variables.
12274
12275 2004-11-18  Martin Baulig  <martin@ximian.com>
12276
12277         Merged latest changes into gmcs.  Please keep this comment in
12278         here, it makes it easier for me to see what changed in MCS since
12279         the last time I merged.
12280
12281 2004-11-17  Raja R Harinath  <rharinath@novell.com>
12282
12283         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12284         (TypeHandle.GetMemberCache): New.
12285         (TypeHandle.TypeHandle): Update.
12286         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12287         (TypeManager.LookupParentInterfacesCache):
12288         Rename from LookupInterfaceCache.  Optimize slightly.
12289         (TypeManager.MemberLookup_FindMembers): Update.
12290         * decl.cs (MemberCache.MemberCache): Set Container to null in the
12291         multi-type variant.
12292         (AddCacheContents): Rename from AddHashtable.
12293         * class.cs (TypeContainer.parent_container): Remove.
12294         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12295         (TypeContainer.DoDefineMembers): Don't initialize it.
12296         Update to name changes.
12297         
12298 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
12299
12300         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12301         that factors the code to check access modifiers on override.  
12302
12303         (PropertyBase): Use the code here.
12304
12305         Patch from Lluis S'anchez, fixes bug #69361.
12306
12307 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
12308
12309         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12310         routine that is used to report the use of a captured variable
12311         whose address has been taken.
12312
12313         There are two checks: one when variables are being captured and
12314         the other check is when the address of a variable is taken. 
12315         
12316         (because an anonymous methods might be resolved before *or* after
12317         the address has been taken) and 
12318
12319         * expression.cs (Conditional.DoResolve): Remove the special
12320         casing that Martin added to trueExpr and falseExpr being both
12321         NullLiteral.  We get the right behavior now just by introducing
12322         the null_type into the compiler. 
12323
12324         * convert.cs (ExplicitConversion): Change the code to use
12325         null_type instead of testing `expr is NullLiteral'.
12326         (ImplicitConversionStandard): use null_type too.
12327         (ImplicitReferenceConversionExists): use null_type too.
12328         (ImplicitReferenceConversion): use null_type too.
12329
12330         * literal.cs: The type of `NullLiteral' is now null_type instead
12331         of object_type. 
12332         (Resolve): Set the type here.
12333
12334         * typemanager.cs: Introduce null_type.
12335
12336 2004-11-17  Martin Baulig  <martin@ximian.com>
12337
12338         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12339         direction, like FindMembers() does.  Fixes #69546, testcase is in
12340         test-315.cs.    
12341
12342 2004-11-16  Martin Baulig  <martin@ximian.com>
12343
12344         This is based on a patch from Marek Safar, see bug #69082.
12345         Fixes bugs #63705 and #67130.
12346
12347         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12348         method; create a MemberCache for an interface type and cache the
12349         result.
12350
12351         * decl.cs (IMemberContainer.ParentContainer): Removed.
12352         (IMemberContainer.ParentCache): New property.
12353         (MemberCache.SetupCacheForInterface): Removed.
12354         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12355         to create a cache for an interface's "parent".
12356
12357         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12358         interfaces too.
12359
12360 2004-11-16  Martin Baulig  <martin@ximian.com>
12361
12362         Merged back from gmcs; these changes already went into gmcs a
12363         couple of weeks ago.
12364
12365         * typemanager.cs
12366         (TypeManager.AddUserType): Removed the `ifaces' argument.
12367         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12368         `TypeExpr []'.
12369         (TypeManager.AddUserInterface): Removed.
12370         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12371         `TypeExpr []'.
12372         (TypeManager.GetInterfaces): Likewise.
12373         (TypeManager.GetExplicitInterfaces): Likewise.
12374
12375         * ecore.cs (TypeExpr.GetInterfaces): Removed.
12376
12377         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12378         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12379
12380 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
12381
12382         * statement.cs: Avoid adding bools to a hashtable.
12383
12384 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
12385
12386         * expression.cs (Invocation.OverloadResolve): Flag error if we are
12387         calling an unsafe method from a safe location.
12388
12389 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
12390
12391         Fix #69167
12392         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12393
12394 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
12395
12396         * namespace.cs (VerifyUsing): use GetPartialName instead of
12397         ToString. 
12398
12399 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
12400
12401         * statement.cs (Return.Resolve): Fix regression in typo: if
12402         `in_exc', we have to request a NeedReturnLabel, this was a typo
12403         introduced in the anonymous method check-in.  Fixes #69131.
12404
12405         * Indexers were using the ShortName when defining themselves,
12406         causing a regression in the compiler bootstrap when applying the
12407         patch from 2004-11-02 (first part), now they use their full name
12408         and the bug is gone.
12409
12410 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
12411
12412         * driver.cs: Strip the path from the names of embedded resources. Fixes
12413         #68519.
12414
12415 2004-11-04  Raja R Harinath  <rharinath@novell.com>
12416
12417         Fix error message regression: cs0104-2.cs.
12418         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12419         (AliasEntry.Resolve): Update.
12420         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
12421         'silent' flag.
12422         (RootContext.LookupType): Update.
12423
12424 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
12425
12426         * cs-parser.jay: Add support for handling accessor modifiers
12427         * class: Add support port accessor modifiers and error checking,
12428         define PropertyMethod.Define as virtual (not abstract anymore)
12429         * ecore.cs: Add checking for proeprties access with access modifiers
12430         * iterators.cs: Modify Accessor constructor call based in the modified
12431         constructor
12432 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
12433
12434         * expression.cs (StringConcat): Handle being called twice,
12435         as when we have a concat in a field init with more than two
12436         ctors in the class
12437
12438 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
12439
12440         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12441         special case explicit implementations, we should always produce
12442         the .property or .event declaration.
12443         
12444         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12445         since it will not return correct data if people use this
12446         unresolved in the presence of using statements (see test-313).
12447
12448         * class.cs (MethodData.Define): If we are an explicit interface
12449         implementation, set the method name to the full name of the
12450         interface plus the name of the method.  
12451
12452         Notice that using the method.MethodName.GetFullName() does not
12453         work, as it will only contain the name as declared on the source
12454         file (it can be a shorthand in the presence of using statements)
12455         and not the fully qualifed type name, for example:
12456
12457         using System;
12458
12459         class D : ICloneable {
12460                 object ICloneable.Clone ()  {
12461                 }
12462         }
12463
12464         Would produce a method called `ICloneable.Clone' instead of
12465         `System.ICloneable.Clone'.
12466
12467         * namespace.cs (Alias.Resolve): Use GetPartialName.
12468         
12469 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12470
12471         * cs-parser.jay: Add error 1055 report.
12472
12473 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
12474
12475         * assign.cs (Assign.DoResolve): Only do the transform of
12476         assignment into a New if the types are compatible, if not, fall
12477         through and let the implicit code deal with the errors and with
12478         the necessary conversions. 
12479
12480 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12481
12482         * cs-parser.jay: Add error 1031 report.
12483
12484         * cs-tokenizer.cs: Add location for error 1038.
12485
12486 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12487
12488         * cs-parser.jay: Add error 1016 report.
12489
12490 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12491
12492         * cs-parser.jay: Add errors 1575,1611 report.
12493
12494 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12495
12496         * cs-parser.jay: Add error 1001 report.
12497
12498 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12499
12500         Fix #68850
12501         * attribute.cs (GetMarshal): Add method argument for
12502         caller identification.
12503
12504         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12505         agument for GetMarshal and RuntimeMissingSupport.
12506
12507 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12508
12509         * attribute.cs (ExtractSecurityPermissionSet): Removed
12510         TypeManager.code_access_permission_type.
12511
12512         * typemanager.cs: Removed TypeManager.code_access_permission_type.
12513
12514 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
12515
12516         * expression.cs (LocalVariableReference.DoResolveLValue): Check
12517         for obsolete use of a variable here.   Fixes regression on errors
12518         cs0619-25 and cs0619-26.
12519
12520 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
12521
12522         Fix #62358, implemented security attribute encoding.
12523
12524         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12525         Tests permitted SecurityAction for assembly or other types.
12526         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12527         data from SecurityPermissionAttribute to PermisionSet class.
12528
12529         * class.cs (ApplyAttributeBuilder): Added special handling
12530         for System.Security.Permissions.SecurityAttribute based types.
12531
12532         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12533         special handling for System.Security.Permissions.SecurityAttribute
12534         based types.
12535
12536         * enum.cs (ApplyAttributeBuilder): Added special handling
12537         for System.Security.Permissions.SecurityAttribute based types.
12538
12539         * parameter.cs (ApplyAttributeBuilder): Added special handling
12540         for System.Security.Permissions.SecurityAttribute based types.
12541
12542         * rootcontext.cs: Next 2 core types.
12543
12544         * typemanager.cs (TypeManager.security_permission_attr_type):
12545         Built in type for the SecurityPermission Attribute.
12546         (code_access_permission_type): Build in type.
12547
12548 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
12549
12550         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12551         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12552         all of this information into
12553         EmitContext.EmitCapturedVariableInstance.
12554         
12555         * codegen.cs (EmitCapturedVariableInstance): move here the
12556         funcionality of emitting an ldarg.0 in the presence of a
12557         remapping.   This centralizes the instance emit code.
12558
12559         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12560         then emit a load of this: it means that we have reached the
12561         topmost ScopeInfo: the one that contains the pointer to the
12562         instance of the class hosting the anonymous method.
12563
12564         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12565         captures to the topmost CaptureContext.
12566
12567 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
12568
12569         * expression.cs (LocalVariableReference): Move the knowledge about
12570         the iterators into codegen's EmitCapturedVariableInstance.
12571
12572 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
12573
12574         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12575         all code paths return a value from an anonymous method (it is the
12576         same as the 161 error, but for anonymous methods).
12577
12578 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
12579
12580         The introduction of anonymous methods in the compiler changed
12581         various ways of doing things in the compiler.  The most
12582         significant one is the hard split between the resolution phase
12583         and the emission phases of the compiler.
12584
12585         For instance, routines that referenced local variables no
12586         longer can safely create temporary variables during the
12587         resolution phase: they must do so from the emission phase,
12588         since the variable might have been "captured", hence access to
12589         it can not be done with the local-variable operations from the runtime.
12590         
12591         * statement.cs 
12592
12593         (Block.Flags): New flag `IsTopLevel' to indicate that this block
12594         is a toplevel block.
12595
12596         (ToplevelBlock): A new kind of Block, these are the blocks that
12597         are created by the parser for all toplevel method bodies.  These
12598         include methods, accessors and anonymous methods.
12599
12600         These contain some extra information not found in regular blocks:
12601         A pointer to an optional CaptureContext (for tracking captured
12602         local variables and parameters).  A pointer to the parent
12603         ToplevelBlock.
12604         
12605         (Return.Resolve): Catch missmatches when returning a value from an
12606         anonymous method (error 1662).
12607         Invoke NeedReturnLabel from the Resolve phase instead of the emit
12608         phase.
12609
12610         (Break.Resolve): ditto.
12611
12612         (SwitchLabel): instead of defining the labels during the
12613         resolution phase, we now turned the public ILLabel and ILLabelCode
12614         labels into methods called GetILLabelCode() and GetILLabel() that
12615         only define the label during the Emit phase.
12616
12617         (GotoCase): Track the SwitchLabel instead of the computed label
12618         (its contained therein).  Emit the code by using
12619         SwitchLabel.GetILLabelCode ().
12620
12621         (LocalInfo.Flags.Captured): A new flag has been introduce to track
12622         whether the Local has been captured or not.
12623
12624         (LocalInfo.IsCaptured): New property, used to tell whether the
12625         local has been captured.
12626         
12627         * anonymous.cs: Vastly updated to contain the anonymous method
12628         support.
12629
12630         The main classes here are: CaptureContext which tracks any
12631         captured information for a toplevel block and ScopeInfo used to
12632         track the activation frames for various local variables.   
12633
12634         Each toplevel block has an optional capture context associated
12635         with it.  When a method contains an anonymous method both the
12636         toplevel method and the anonymous method will create a capture
12637         context.   When variables or parameters are captured, they are
12638         recorded on the CaptureContext that owns them, for example:
12639
12640         void Demo () {
12641              int a;
12642              MyDelegate d = delegate {
12643                  a = 1;
12644              }
12645         }
12646
12647         Here `a' will be recorded as captured on the toplevel
12648         CapturedContext, the inner captured context will not have anything
12649         (it will only have data if local variables or parameters from it
12650         are captured in a nested anonymous method.
12651
12652         The ScopeInfo is used to track the activation frames for local
12653         variables, for example:
12654
12655         for (int i = 0; i < 10; i++)
12656                 for (int j = 0; j < 10; j++){
12657                    MyDelegate d = delegate {
12658                         call (i, j);
12659                    }
12660                 }
12661
12662         At runtime this captures a single captured variable `i', but it
12663         captures 10 different versions of the variable `j'.  The variable
12664         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12665         recorded on a child.  
12666
12667         The toplevel ScopeInfo will also track information like the `this'
12668         pointer if instance variables were referenced (this is necessary
12669         as the anonymous method lives inside a nested class in the host
12670         type of the method). 
12671
12672         (AnonymousMethod): Expanded to track the Toplevel, implement
12673         `AnonymousMethod.Compatible' to tell whether an anonymous method
12674         can be converted to a target delegate type. 
12675
12676         The routine now also produces the anonymous method content
12677
12678         (AnonymousDelegate): A helper class that derives from
12679         DelegateCreation, this is used to generate the code necessary to
12680         produce the delegate for the anonymous method that was created. 
12681
12682         * assign.cs: API adjustments for new changes in
12683         Convert.ImplicitStandardConversionExists.
12684
12685         * class.cs: Adjustments to cope with the fact that now toplevel
12686         blocks are of type `ToplevelBlock'. 
12687
12688         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12689         insteda of standard blocks.
12690
12691         Flag errors if params arguments are passed to anonymous methods.
12692
12693         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12694         `CurrentAnonymousMethod' which points to the current Anonymous
12695         Method.  The variable points to the AnonymousMethod class that
12696         holds the code being compiled.  It is set in the new EmitContext
12697         created for the anonymous method.
12698
12699         (EmitContext.Phase): Introduce a variable and an enumeration to
12700         assist in enforcing some rules about when and where we are allowed
12701         to invoke certain methods (EmitContext.NeedsReturnLabel is the
12702         only one that enfonces this right now).
12703
12704         (EmitContext.HaveCaptureInfo): new helper method that returns
12705         whether we have a CapturedContext initialized.
12706
12707         (EmitContext.CaptureVariable): New method used to register that a
12708         LocalInfo must be flagged for capturing. 
12709
12710         (EmitContext.CapturedParameter): New method used to register that a
12711         parameters must be flagged for capturing. 
12712         
12713         (EmitContext.CapturedField): New method used to register that a
12714         field must be flagged for capturing. 
12715
12716         (EmitContext.HaveCapturedVariables,
12717         EmitContext.HaveCapturedFields): Return whether there are captured
12718         variables or fields. 
12719
12720         (EmitContext.EmitMethodHostInstance): This is used to emit the
12721         instance for the anonymous method.  The instance might be null
12722         (static methods), this (for anonymous methods that capture nothing
12723         and happen to live side-by-side with the current method body) or a
12724         more complicated expression if the method has a CaptureContext.
12725
12726         (EmitContext.EmitTopBlock): Routine that drives the emission of
12727         code: it will first resolve the top block, then emit any metadata
12728         and then emit the code.  The split is done so that we can extract
12729         any anonymous methods and flag any captured variables/parameters.
12730         
12731         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12732         during this phase, the ILGenerator should not be used as labels
12733         and local variables declared here might not be accessible to any
12734         code that is part of an anonymous method.  
12735
12736         Exceptions to this include the temporary variables that are
12737         created by some statements internally for holding temporary
12738         variables. 
12739         
12740         (EmitContext.EmitMeta): New routine, in charge of emitting all the
12741         metadata for a cb
12742
12743         (EmitContext.TemporaryReturn): This method is typically called
12744         from the Emit phase, and its the only place where we allow the
12745         ReturnLabel to be defined other than the EmitMeta.  The reason is
12746         that otherwise we would have to duplicate a lot of logic in the
12747         Resolve phases of various methods that today is on the Emit
12748         phase. 
12749
12750         (EmitContext.NeedReturnLabel): This no longer creates the label,
12751         as the ILGenerator is not valid during the resolve phase.
12752
12753         (EmitContext.EmitThis): Extended the knowledge in this class to
12754         work in anonymous methods in addition to iterators. 
12755
12756         (EmitContext.EmitCapturedVariableInstance): This emits whatever
12757         code is necessary on the stack to access the instance to a local
12758         variable (the variable will be accessed as a field).
12759
12760         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12761         EmitContext.EmitAddressOfParameter): Routines to support
12762         parameters (not completed at this point). 
12763         
12764         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
12765         will also remove the parameters.
12766
12767         * convert.cs (Convert): Define a `ConstantEC' which points to a
12768         null.  This is just to prefity some code that uses
12769         ImplicitStandardConversion code and do not have an EmitContext
12770         handy.
12771
12772         The idea is to flag explicitly that at that point in time, it is
12773         known that the conversion will not trigger the delegate checking
12774         code in implicit conversions (which requires a valid
12775         EmitContext). 
12776
12777         Everywhere: pass new EmitContext parameter since
12778         ImplicitStandardConversionExists now requires it to check for
12779         anonymous method conversions. 
12780
12781         (Convert.ImplicitStandardConversionExists): If the type of an
12782         expression is the anonymous_method_type, and the type is a
12783         delegate, we invoke the AnonymousMethod.Compatible method to check
12784         whether an implicit conversion is possible. 
12785
12786         (Convert.ImplicitConversionStandard): Only do implicit method
12787         group conversions if the language level is not ISO_1.
12788
12789         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12790         MethodInfo for the Invoke method.  used by Delegate and
12791         AnonymousDelegate.
12792
12793         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12794         method conversions if the target type is a delegate.
12795
12796         Removed extra debugging nops.
12797
12798         (LocalVariableReference): Turn the `local_info' into a public
12799         field. 
12800
12801         Add `prepared' field, the same hack used for FieldExprs to cope
12802         with composed assignments, as Local variables do not necessarily
12803         operate purely on the stack as they used to: they can be captured
12804         fields. 
12805
12806         Add `temp' for a temporary result, like fields.
12807
12808         Refactor DoResolve and DoResolveLValue into DoResolveBase.
12809
12810         It now copes with Local variables that are captured and emits the
12811         proper instance variable to load it from a field in the captured
12812         case. 
12813
12814         (ParameterReference.DoResolveBase): During the resolve phase,
12815         capture parameters if we are in an anonymous method.
12816
12817         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12818         anonymous method, use the EmitContext helper routines to emit the
12819         parameter reference.
12820
12821         * iterators.cs: Set RemapToProxy to true/false during the
12822         EmitDispose class.
12823
12824         * parameters.cs (GetParameterByName): New helper method. 
12825
12826         * typemanager.cs (anonymous_method_type) a new type that
12827         represents an anonyous method.  This is always an internal type,
12828         used as a fencepost to test against the anonymous-methodness of an
12829         expression. 
12830         
12831 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
12832
12833         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12834         561 report.
12835         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12836
12837 2004-10-18  Martin Baulig  <martin@ximian.com>
12838
12839         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12840         `Type' directly, but call ResolveType() on it.
12841         (Catch.Resolve): Likewise.
12842         (Foreach.Resolve): Likewise.
12843
12844 2004-10-18  Martin Baulig  <martin@ximian.com>
12845
12846         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12847         `Type' directly, but call ResolveType() on it.
12848         (Probe.DoResolve): Likewise.
12849         (ArrayCreation.LookupType): Likewise.
12850         (TypeOf.DoResolve): Likewise.
12851         (SizeOf.DoResolve): Likewise.
12852
12853 2004-10-18  Martin Baulig  <martin@ximian.com>
12854
12855         * expression.cs (Invocation.BetterFunction): Put back
12856         TypeManager.TypeToCoreType().
12857
12858 2004-10-18  Raja R Harinath  <rharinath@novell.com>
12859
12860         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12861         the ResolveType.
12862
12863 2004-10-18  Martin Baulig  <martin@ximian.com>
12864
12865         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
12866         `Type' directly, but call ResolveType() on it.
12867
12868 2004-10-18  Martin Baulig  <martin@ximian.com>
12869
12870         * class.cs (FieldMember.Define): Don't access the TypeExpr's
12871         `Type' directly, but call ResolveType() on it.
12872         (MemberBase.DoDefine): Likewise.
12873
12874         * expression.cs (New.DoResolve): Don't access the TypeExpr's
12875         `Type' directly, but call ResolveType() on it.
12876         (ComposedCast.DoResolveAsTypeStep): Likewise.
12877
12878         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12879         `Type' directly, but call ResolveType() on it.
12880
12881 2004-10-17  John Luke  <john.luke@gmail.com>
12882
12883         * class.cs (Operator.GetSignatureForError): use CSharpName
12884
12885         * parameter.cs (Parameter.GetSignatureForError): Returns
12886         correct name even if was not defined.
12887
12888 2004-10-13  Raja R Harinath  <rharinath@novell.com>
12889
12890         Fix #65816.
12891         * class.cs (TypeContainer.EmitContext): New property.
12892         (DefineNestedTypes): Create an emitcontext for each part.
12893         (MethodCore.DoDefineParameters): Use container's emitcontext.
12894         Pass type array to InternalParameters.
12895         (MemberBase.DoDefine): Use container's emitcontext.
12896         (FieldMember.Define): Likewise.
12897         (Event.Define): Likewise.
12898         (SetMethod.GetParameterInfo): Change argument to EmitContext.
12899         Pass type array to InternalParameters.
12900         (SetIndexerMethod.GetParameterInfo): Likewise.
12901         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12902         * delegate.cs (Define): Pass emitcontext to
12903         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
12904         array to InternalParameters.
12905         * expression.cs (ParameterReference.DoResolveBase): Pass
12906         emitcontext to GetParameterInfo.
12907         (ComposedCast.DoResolveAsTypeStep): Remove check on
12908         ec.ResolvingTypeTree.
12909         * parameter.cs (Parameter.Resolve): Change argument to
12910         EmitContext.  Use ResolveAsTypeTerminal.
12911         (Parameter.GetSignature): Change argument to EmitContext.
12912         (Parameters.ComputeSignature): Likewise.
12913         (Parameters.ComputeParameterTypes): Likewise.
12914         (Parameters.GetParameterInfo): Likewise.
12915         (Parameters.ComputeAndDefineParameterTypes): Likewise.
12916         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
12917         * support.cs (InternalParameters..ctor): Remove variant that takes
12918         a DeclSpace.
12919         * typemanager.cs (system_intptr_expr): New.
12920         (InitExpressionTypes): Initialize it.
12921
12922 2004-10-12  Chris Toshok  <toshok@ximian.com>
12923
12924         * cs-parser.jay: fix location for try_statement and catch_clause.
12925
12926 2004-10-11  Martin Baulig  <martin@ximian.com>
12927
12928         * report.cs: Don't make --fatal abort on warnings, we have
12929         -warnaserror for that.
12930
12931 2004-10-07  Raja R Harinath  <rharinath@novell.com>
12932
12933         More DeclSpace.ResolveType avoidance.
12934         * decl.cs (MemberCore.InUnsafe): New property.
12935         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
12936         with newly created EmitContext.
12937         (FieldMember.Define): Likewise.
12938         * delegate.cs (Delegate.Define): Likewise.
12939         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
12940         only if normal name-lookup fails.
12941         (TypeExpr.DoResolve): Enable error-checking.
12942         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
12943         (SizeOf.DoResolve): Likewise.
12944         (ComposedCast.DoResolveAsTypeStep): Likewise.
12945         (StackAlloc.DoResolve): Likewise.
12946         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
12947         (Block.Unsafe): New property.
12948         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
12949         (Unsafe): Set 'unsafe' flag of contained block.
12950         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
12951         (Fixed.Resolve): Likewise.
12952         (Catch.Resolve): Likewise.
12953         (Using.ResolveLocalVariableDecls): Likewise.
12954         (Foreach.Resolve): Likewise.
12955
12956 2004-10-05  John Luke <john.luke@gmail.com>
12957
12958         * cs-parser.jay: add location to error CS0175
12959
12960 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
12961
12962         * ecore.cs (Expression.Constantity): Add support for turning null
12963         into a constant.
12964
12965         * const.cs (Const.Define): Allow constants to be reference types
12966         as long as the value is Null.
12967
12968 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
12969
12970         * namespace.cs (NamespaceEntry.Using): No matter which warning
12971         level is set, check if this namespace name has already been added.
12972
12973 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
12974
12975         * expression.cs: reftype [!=]= null should always use br[true,false].
12976         # 67410
12977
12978 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
12979
12980         Fix #67108
12981         * attribute.cs: Enum conversion moved to 
12982         GetAttributeArgumentExpression to be applied to the all
12983         expressions.
12984
12985 2004-10-01  Raja R Harinath  <rharinath@novell.com>
12986
12987         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
12988         * class.c (TypeContainer.DefineType): Flag error if
12989         base types aren't accessible due to access permissions.
12990         * decl.cs (DeclSpace.ResolveType): Move logic to
12991         Expression.ResolveAsTypeTerminal.
12992         (DeclSpace.ResolveTypeExpr): Thin layer over
12993         Expression.ResolveAsTypeTerminal.
12994         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
12995         Refactor code into NestedAccess.  Use it.
12996         (DeclSpace.NestedAccess): New.
12997         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
12998         argument to silence errors.  Check access permissions.
12999         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
13000         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
13001         (Cast.DoResolve): Likewise.
13002         (New.DoResolve): Likewise.
13003         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
13004         (TypeOf.DoResolve): Likewise.
13005
13006         * expression.cs (Invocation.BetterConversion): Return the Type of
13007         the better conversion.  Implement section 14.4.2.3 more faithfully.
13008         (Invocation.BetterFunction): Make boolean.  Make correspondence to
13009         section 14.4.2.2 explicit.
13010         (Invocation.OverloadResolve): Update.
13011         (Invocation): Remove is_base field.
13012         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
13013         (Invocation.Emit): Likewise.
13014
13015 2004-09-27  Raja R Harinath  <rharinath@novell.com>
13016
13017         * README: Update to changes.
13018
13019 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
13020
13021         * cs-parser.jay: Reverted 642 warning fix.
13022
13023 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13024
13025         Fix bug #66615
13026         * decl.cs (FindMemberWithSameName): Indexer can have more than
13027         1 argument.
13028
13029 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13030
13031         * expression.cs (LocalVariableReference.DoResolveLValue):
13032         Do not report warning 219 for out values.
13033         (EmptyExpression.Null): New member to avoid extra allocations.
13034
13035 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13036
13037         * cs-parser.jay: Fix wrong warning 642 report.
13038
13039         * cs-tokenizer.cs (CheckNextToken): New helper;
13040         Inspect next character if is same as expected.
13041
13042 2004-09-23  Martin Baulig  <martin@ximian.com>
13043
13044         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
13045         (Convert.ImplicitReferenceConversionExists): Likewise.
13046
13047 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13048
13049         * class.cs (Operator.Define): Add error 448 and 559 report.
13050
13051 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13052
13053         * class.cs (MemberBase.IsTypePermitted): New protected
13054         method for checking error CS0610.
13055
13056 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13057
13058         * class.cs (TypeContainer.HasExplicitLayout): New property
13059         Returns whether container has StructLayout attribute set Explicit.
13060         (FieldMember): New abstract class for consts and fields.
13061         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
13062         (Field): Reuse FieldMember.
13063
13064         * const.cs (Const): Reuse FieldMember.
13065
13066         * rootcontext.cs: EmitConstants call moved to class.
13067
13068 2004-09-22  Martin Baulig  <martin@ximian.com>
13069
13070         Thanks to Peter Sestoft for this bug report.
13071
13072         * expression.cs (Conditional): If both the `trueExpr' and the
13073         `falseExpr' is a NullLiteral, return a NullLiteral.
13074
13075 2004-09-22  Martin Baulig  <martin@ximian.com>
13076
13077         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
13078         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
13079         for the "get_Current" call.
13080
13081 2004-09-22  Martin Baulig  <martin@ximian.com>
13082
13083         Marek and me just fixed one of our oldest bugs: #28562 :-)
13084
13085         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
13086
13087         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
13088         we're an EnumConstant, just return that.
13089         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
13090         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
13091         to get the value which'll actually be written into the attribute.
13092         However, we have to use GetValue() to access the attribute's value
13093         in the compiler.        
13094
13095 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13096
13097         * constant.cs (Constant.IsNegative): New abstract property
13098         IsNegative.
13099
13100         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
13101         (StackAlloc.DoResolve): Reused IsNegative.
13102
13103 2004-09-21  Martin Baulig  <martin@ximian.com>
13104
13105         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
13106         if we're used in an iterator, we may be called from different
13107         methods.
13108
13109         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
13110         we actually have an exception block.
13111
13112 2004-09-20  John Luke <jluke@cfl.rr.com>
13113
13114         * class.cs, cs-parser.jay: Improve the error report for 1520:
13115         report the actual line where the error happens, not where the
13116         class was declared.
13117
13118         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
13119         Pass location information that was available elsewhere.
13120
13121 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
13122
13123         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
13124         runtime to delay sign assemblies.
13125
13126 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
13127
13128         * cs-parser.jay: Do not report the stack trace, this is barely
13129         used nowadays.
13130
13131 2004-08-22  John Luke  <john.luke@gmail.com>
13132  
13133         * driver.cs : check that a resource id is not already used
13134         before adding it, report CS1508 if it is, bug #63637
13135
13136 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
13137
13138         * ecore.cs: Removed dead code.
13139
13140 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
13141
13142         * class.cs: Do not report warning CS0067 on the interfaces.
13143
13144 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
13145
13146         * cs-parser.jay: Add error 504 report.
13147
13148 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
13149
13150         * rootcontext.cs: WarningLevel is 4 by default now.
13151
13152         * statement.cs (Fixed.Resolve): Do not null
13153         VariableInfo.
13154
13155 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
13156
13157         Fixed bug #55780
13158         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
13159         deep search when property is not virtual.
13160         (PropertyExpr.ResolveAccessors): Make one call for both
13161         accessors.
13162
13163 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13164
13165         Fixed bug #65766
13166         * statement.cs: Error 152 report constains also location.
13167
13168 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13169
13170         Fixed bug #65766
13171         * const.cs: Explicitly set constant as static.
13172
13173 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13174
13175         Fixed bug #64226
13176         * cs-parser.jay: Add error 1017 report.
13177
13178 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13179
13180         Fixed bug #59980, #64224
13181         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
13182
13183         * typemanager.cs (IsSpecialMethod): Simplified
13184
13185 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13186
13187         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
13188         condition with better params.
13189
13190 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13191
13192         Fixed bug #65238
13193         * attribute.cs (Resolve): Property has to have both
13194         accessors.
13195
13196 2004-09-14  Martin Baulig  <martin@ximian.com>
13197
13198         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
13199
13200 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13201
13202         Fixed bug #61902
13203         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
13204         called and is obsolete then this member suppress message
13205         when call is inside next [Obsolete] method or type.
13206
13207         * expression.cs: Use TestObsoleteMethodUsage member.
13208
13209 2004-09-14  Martin Baulig  <martin@ximian.com>
13210
13211         * cs-parser.jay: Sync a bit with the GMCS version.
13212
13213 2004-09-14  Martin Baulig  <martin@ximian.com>
13214
13215         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
13216         (CSharpParser.yacc_verbose_flag): New public field.
13217
13218         * genericparser.cs: Removed.
13219
13220 2004-09-14  Raja R Harinath  <rharinath@novell.com>
13221
13222         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
13223
13224 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
13225
13226         * class.cs (MethodCore.CheckBase): Fix bug #65757.
13227
13228 2004-09-10  Martin Baulig  <martin@ximian.com>
13229
13230         Backported my MemberName changes from GMCS into MCS.
13231
13232         - we are now using a special `MemberName' class instead of using
13233         strings; in GMCS, the `MemberName' also contains the type
13234         arguments.
13235
13236         - changed the grammar rules a bit:
13237           * the old `member_name' is now a `namespace_or_type_name':
13238             The rule is that we use `namespace_or_type_name' everywhere
13239             where we expect either a "member name" (GetEnumerator) or a
13240             "member name" with an explicit interface name
13241             (IEnumerable.GetEnumerator).
13242             In GMCS, the explicit interface name may include type arguments
13243             (IEnumerable<T>.GetEnumerator).
13244           * we use `member_name' instead of just `IDENTIFIER' for
13245             "member names":
13246             The rule is that we use `member_name' wherever a member may
13247             have type parameters in GMCS.       
13248
13249         * decl.cs (MemberName): New public class.
13250         (MemberCore.MemberName): New public readonly field.
13251         (MemberCore.ctor): Take a `MemberName' argument, not a string.
13252         (DeclSpace): Likewise.
13253
13254         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
13255         * enum.cs (Enum.ctor): Likewise.
13256
13257         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13258         MemberName.     
13259         (AliasEntry.ctor): Take a MemberName, not an Expression.
13260         (AliasEntry.UsingAlias): Likewise.
13261
13262         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13263         (IMethodData.MemberName): Changed type from string to MemberName.
13264         (MemberBase.ExplicitInterfaceName): Likewise.
13265         (AbstractPropertyEventMethod.SetupName): Make this private.
13266         (AbstractPropertyEventMethod.ctor): Added `string prefix'
13267         argument; compute the member name here.
13268         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13269         on the `member.MemberName' and the `prefix'.
13270
13271         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13272         not `type_name'.
13273         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13274         thus, we get a `MemberName' instead of a `string'.  These
13275         declarations may have type parameters in GMCS.
13276         (interface_method_declaration, delegate_declaration): Likewise.
13277         (class_declaration, interface_declaration): Likewise.
13278         (method_header): Use `namespace_or_type_name' instead of
13279         `member_name'.  We may be an explicit interface implementation.
13280         (property_declaration, event_declaration): Likewise.
13281         (member_name): This is now just an `IDENTIFIER', not a
13282         `namespace_or_type_name'.
13283         (type_name, interface_type): Removed.
13284         (namespace_or_type_name): Return a MemberName, not an Expression.
13285         (primary_expression): Use `member_name' instead of `IDENTIFIER';
13286         call GetTypeExpression() on the MemberName to get an expression.
13287         (IndexerDeclaration.interface_type): Changed type from string to
13288         MemberName.
13289         (MakeName): Operate on MemberName's instead of string's.
13290
13291 2004-09-13  Raja R Harinath  <rharinath@novell.com>
13292
13293         Fix bug #55770.
13294         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13295         (NamespaceEntry.Lookup): Add new argument to flag if we want the
13296         lookup to avoid symbols introduced by 'using'.
13297         * rootcontext.cs (NamespaceLookup): Update.
13298
13299 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13300
13301         * class.cs (TypeContainer.DoDefineMembers): Do not call
13302         DefineDefaultConstructor for static classes.
13303
13304 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13305
13306         * attribute.cs (Attribute.Resolve): Add error 653 report.
13307
13308         * class.cs (Class.ApplyAttributeBuilder): Add error 641
13309         report.
13310         (Method.ApplyAttributeBuilder): Add error 685 report.
13311         (Operator.Define): Add error 564 report.
13312
13313         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13314
13315         * expression.cs (Invocation.DoResolve): Add error
13316         245 and 250 report.
13317
13318         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13319         error 674 report.
13320
13321 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13322
13323         * class.cs (ConstructorInitializer.Resolve):
13324         Wrong error number (515->516).
13325
13326 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13327
13328         * class.cs (Indexer.Define): Add error 631 report.
13329
13330 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13331
13332         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13333
13334 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13335
13336         * expression.cs (Probe.DoResolve): Add error CS0241 report.
13337
13338 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
13339
13340         * cs-parser.jay: Added error CS0241 report.
13341
13342 2004-09-10  Raja R Harinath  <rharinath@novell.com>
13343
13344         * cs-parser.jay (fixed_statement): Introduce a scope for the
13345         declaration in the 'fixed' statement.
13346
13347 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13348
13349         * cs-parser.jay: Added CS0230 error report.
13350
13351 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13352
13353         * cs-parser.jay: Added errors CS0231 and CS0257 report.
13354
13355 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13356
13357         * expression.cs (Argument.Resolve): Added error CS0192 and
13358         CS0199 report.
13359
13360 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13361
13362         C# 2.0 #pragma warning feature
13363
13364         * cs-tokenizer.cs (PreProcessPragma): New method; 
13365         Handles #pragma directive.
13366
13367         * report.cs (WarningRegions): New class; Support
13368         class for #pragma warning directive. It tests whether
13369         warning is enabled for a given line.
13370
13371 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
13372
13373         * const.cs: Add more descriptive error report, tahnks to
13374         Sebastien. 
13375
13376 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
13377
13378         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13379
13380 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
13381
13382         * expression.cs: Apply patch from Ben: Remove dead code from
13383         ArrayCreation, and remove the TurnintoConstant call in const.cs,
13384         as that code just threw an exception anwyays.
13385
13386         * const.cs: Remove the call to the turnintoconstant, for details
13387         see bug: #63144
13388         
13389         * literal.cs: The type of the null-literal is the null type;  So
13390         we use a placeholder type (literal.cs:System.Null, defined here)
13391         for it.
13392
13393         * expression.cs (Conditional.DoResolve): Remove some old code that
13394         is no longer needed, conversions have been fixed.
13395
13396         (ArrayCreationExpression.DoResolve): Return false if we fail to
13397         resolve the inner expression.
13398
13399 2004-09-07  Raja R Harinath  <rharinath@novell.com>
13400
13401         Fix test-290.cs.
13402         * cs-parser.jay (delegate_declaration): Record a delegate
13403         declaration as a type declaration.
13404         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13405
13406 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
13407
13408         * parameter.cs: Do not crash if the type can not be resolved. 
13409
13410         * expression.cs: Report errors with unsafe pointers, fixes #64896
13411
13412 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
13413
13414         * expression.cs: Pointer arith always needs to do a conv.i
13415         if the operand is a long. fix 65320
13416
13417 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13418
13419         Fixed cs0619-37.cs, cs0619-38.cs
13420
13421         * enum.cs (GetObsoleteAttribute): Removed.
13422
13423         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13424         on Enum member is double staged. The first is tested member
13425         and then enum.
13426
13427 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13428
13429         Fixed #56986, #63631, #65231
13430
13431         * class.cs: (TypeContainer.AddToMemberContainer): New method,
13432         adds member to name container.
13433         (TypeContainer.AddToTypeContainer): New method, adds type to
13434         name container.
13435         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13436         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13437         AddOperator): Simplified by reusing AddToMemberContainer.
13438         (TypeContainer.UserDefinedStaticConstructor): Changed to property
13439         instead of field.
13440         (Method.CheckForDuplications): Fixed implementation to test all
13441         possibilities.
13442         (MemberBase): Detection whether member is explicit interface
13443         implementation is now in constructor.
13444         (MemberBase.UpdateMemberName): Handles IndexerName.
13445         (Accessor): Changed to keep also location information.
13446         (AbstractPropertyEventMethod): Is derived from MemberCore.
13447         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13448         will be emited or not.
13449         (PropertyBase.AreAccessorsDuplicateImplementation):
13450         Tests whether accessors are not in collision with some method.
13451         (Operator): Is derived from MethodCore to simplify common
13452         operations.
13453
13454         * decl.cs (Flags.TestMethodDuplication): Test for duplication
13455         must be performed.
13456         (DeclSpace.AddToContainer): Adds the member to defined_names
13457         table. It tests for duplications and enclosing name conflicts.
13458
13459         * enum.cs (EnumMember): Clean up to reuse the base structures
13460
13461 2004-09-03  Martin Baulig  <martin@ximian.com>
13462
13463         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13464         into TypeContainer, to make partial classes work again.
13465
13466 2004-09-03  Martin Baulig  <martin@ximian.com>
13467
13468         * rootcontext.cs (RootContext.V2): Removed.
13469
13470 2004-03-23  Martin Baulig  <martin@ximian.com>
13471
13472         * expression.cs (Invocation.OverloadResolve): Added `bool
13473         may_fail' argument and use it instead of the Location.IsNull() hack.
13474
13475 2004-09-03  Martin Baulig  <martin@ximian.com>
13476
13477         Merged latest changes into gmcs.  Please keep this comment in
13478         here, it makes it easier for me to see what changed in MCS since
13479         the last time I merged.
13480
13481 2004-09-03  Raja R Harinath  <rharinath@novell.com>
13482
13483         Fix #61128.
13484         * expression.cs (BetterConversion): Don't allow either conversion 
13485         to be null.  Remove redundant implicit conversion test when 'q ==
13486         null' -- when this function is invoked, we already know that the
13487         implicit conversion exists.
13488         (BetterFunction): Assume that 'best' is non-null.  Remove
13489         redundant reimplementation of IsApplicable when 'best' is null.
13490         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13491         number of arguments.
13492         (IsAncestralType): Extract from OverloadResolve.
13493         (OverloadResolve): Make robust to the MethodGroupExpr being
13494         unsorted.  Implement all the logic of Section 14.5.5.1, and
13495         support overloading of methods from multiple applicable types.
13496         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
13497
13498         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13499         (RealError, Warning): Append type of report to related symbol.
13500
13501 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
13502
13503         * enum.cs: Fixed CLS-Compliance checks for enum members.
13504         Error tests cs3008-8.cs, cs3014-8.cs
13505
13506 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13507
13508         Fixed bug #62342, #63102
13509         * class.cs: ImplementIndexer uses member.IsExplicitImpl
13510         like ImplementMethod.
13511
13512 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13513
13514         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13515         Fixed bug #65170.
13516
13517 2004-09-02  Martin Baulig  <martin@ximian.com>
13518
13519         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13520         TypeManager.GetArgumentTypes() rather than calling GetParameters()
13521         on the MethodBase.
13522
13523 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
13524
13525         C# 2.0 Static classes implemented
13526
13527         * class.cs (TypeContainer): instance_constructors,
13528         initialized_fields, initialized_static_fields,
13529         default_constructor, base_inteface_types are protected to be
13530         accessible from StaticClass.
13531         (TypeContainer.DefineDefaultConstructor): New virtual method
13532         for custom default constructor generating
13533         (StaticClass): New class to handle "Static classes" feature.
13534
13535         * cs-parser.jay: Handle static keyword on class like instance
13536         of StaticClass.
13537
13538         * driver.cs: Added "/langversion" command line switch with two
13539         options (iso-1, default).
13540
13541 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
13542
13543         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13544
13545 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
13546
13547         * delegate.cs: Style.
13548
13549 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13550
13551         * delegate.cs: Add seperate instance expr field for miguel.
13552
13553 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13554
13555         * PointerArithmetic (Resolve): make sure we are not doing
13556         pointer arith on void*. Also, make sure we are resolved
13557         by not setting eclass until resolve.
13558
13559         All callers: Make sure that PointerArithmetic gets resolved.
13560
13561 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13562
13563         * ArrayCreation (LookupType): If the type does not resolve 
13564         to an array, give an error.
13565
13566 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
13567
13568         * statement.cs (Try.Resolve): Fixed bug #64222
13569
13570 2004-08-27  Martin Baulig  <martin@ximian.com>
13571
13572         * class.cs
13573         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13574         crash here.     
13575
13576 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13577
13578         * ecore.cs (Constantify): Get underlying type via
13579         System.Enum.GetUnderlyingType to avoid StackOverflow on the
13580         Windows in special cases.
13581
13582 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13583
13584         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13585         for obtaining also private methods.
13586         (GetRemoveMethod): Used GetRemoveMethod (true)
13587         for obtaining also private methods.
13588
13589 2004-08-24  Martin Baulig  <martin@ximian.com>
13590
13591         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13592         MethodAttributes.HideBySig for operators.
13593
13594 2004-08-23  Martin Baulig  <martin@ximian.com>
13595
13596         Back to the old error reporting system :-)
13597
13598         * report.cs (Message): Removed.
13599         (Report.MessageData, ErrorData, WarningData): Removed.
13600         (Report.Error, Warning): Back to the old system.
13601
13602 2004-08-23  Martin Baulig  <martin@ximian.com>
13603
13604         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13605
13606         * class.cs (TypeContainer.ParentContainer): New public virtual
13607         method; replaces the explicit interface implementation.
13608         (ClassPart.ParentContainer): Override.
13609
13610 2004-08-23  Martin Baulig  <martin@ximian.com>
13611
13612         * statement.cs (Switch): Added support for constant switches; see
13613         #59428 or test-285.cs.
13614
13615 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13616
13617         Fixed bug #62740.
13618         * statement.cs (GetEnumeratorFilter): Removed useless
13619         logic because C# specs is strict. GetEnumerator must be
13620         public.
13621
13622 2004-08-22  Martin Baulig  <martin@ximian.com>
13623
13624         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13625         a switch and may break, reset the barrier.  Fixes #59867.
13626
13627 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13628
13629         CLS-Compliance speed up (~5% for corlib)
13630
13631         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13632         New method. Tests container for CLS-Compliant names
13633
13634         * class.cs (TypeContainer.VerifyClsName): New method.
13635         Checks whether container name is CLS Compliant.
13636         (Constructor): Implements IMethodData.
13637
13638         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13639         low-case table for CLS Compliance test.
13640         (MemberCache.VerifyClsParameterConflict): New method.
13641         Checks method parameters for CS3006 error.
13642
13643         * enum.cs (EnumMember): Is derived from MemberCore.
13644         (Enum.VerifyClsName): Optimized for better performance.
13645
13646 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13647
13648         * report.cs: Renamed Error_T to Error and changed all
13649         references.
13650
13651 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13652
13653         * class.cs (TypeContainer.IndexerArrayList): New inner class
13654         container for indexers.
13655         (TypeContainer.DefaultIndexerName): New constant for default
13656         indexer name. Replaced all "Item" with this constant.
13657         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13658
13659         * typemanager.cs (TypeManager.default_member_ctor): Cache here
13660         DefaultMemberAttribute constructor.
13661
13662 2004-08-05  Martin Baulig  <martin@ximian.com>
13663
13664         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13665         Fix bug #59429.
13666
13667 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
13668
13669         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13670         multi platforms problem.
13671
13672         * compiler.csproj: Included shared files.
13673
13674 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13675
13676         Fix bug 60333, 55971 in the more general way
13677         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13678         Added arg_type argument for constant conversion.
13679         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13680
13681 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13682
13683         Fix bug #59760
13684         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
13685         OperatorArrayList, MethodCoreArrayList for typecontainer
13686         containers. Changed class member types to these new types.
13687         (MethodArrayList.DefineMembers): Added test for CS0659.
13688
13689 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
13690
13691         * cfold.cs: Synchronize the folding with the code in expression.cs
13692         Binary.DoNumericPromotions for uint operands.
13693
13694         * attribute.cs: Revert patch from Raja, it introduced a regression
13695         while building Blam-1.2.1 (hard to isolate a test case).
13696
13697 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13698
13699         Fix for #55382
13700         * class.cs:
13701         (TypeContainer.Define): Renamed to DefineContainerMembers because of
13702         name collision.
13703         (MethodCore.parent_method): New member. The method we're overriding
13704         if this is an override method.
13705         (MethodCore.CheckBase): Moved from Method class and made common.
13706         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13707         private.
13708         (MethodCore.CheckForDuplications): New abstract method. For custom
13709         member duplication search in a container
13710         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13711         method and its return type.
13712         (Event.conflict_symbol): New member. Symbol with same name in the
13713         parent class.
13714
13715         * decl.cs:
13716         (MemberCache.FindMemberWithSameName): New method. The method
13717         is looking for conflict with inherited symbols.
13718
13719 2004-08-04  Martin Baulig  <martin@ximian.com>
13720
13721         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13722
13723         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13724
13725 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13726
13727         * report.cs (Message): New enum for better error, warning reference in
13728         the code.
13729         (MessageData): New inner abstract class. It generally handles printing of
13730         error and warning messages.
13731         Removed unused Error, Warning, Message methods.
13732
13733 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13734
13735         Fix for cs0592-8.cs test
13736         * attribute.cs
13737         (Attributable.ValidAttributeTargets): Made public.
13738         (Attribute.ExplicitTarget): New member for explicit target value.
13739         (Attribute.CheckTargets): Now we translate explicit attribute
13740         target to Target here.
13741
13742 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
13743
13744         * ecore.cs (MethodGroupExpr): new IsBase property.
13745
13746         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13747
13748         * delegate.cs (DelegateCreation): store a MethodGroupExpr
13749         rather than an instance expr.
13750
13751         (DelegateCreation.Emit): Use the method group rather than
13752         the instance expression. Also, if you have base.Foo as the
13753         method for a delegate, make sure to emit ldftn, not ldftnvirt.
13754
13755         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
13756
13757         (NewDelegate.DoResolve): Only check for the existance of Invoke
13758         if the method is going to be needed. Use MethodGroupExpr.
13759
13760         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
13761
13762         * expression.cs: For pointer arith., make sure to use
13763         the size of the type, not the size of the pointer to
13764         the type.
13765
13766 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13767
13768         Fix for #60722
13769         * class.cs (Class): Added error CS0502 test.
13770
13771 2004-08-03  John Luke  <jluke@cfl.rr.com>
13772             Raja R Harinath  <rharinath@novell.com>
13773
13774         Fix for #60997.
13775         * attribute.cs (Attribute.complained_before): New flag.
13776         (Attribute.ResolveType, Attribute.Resolve),
13777         (Attribute.DefinePInvokeMethod): Set it.
13778         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13779         
13780 2004-08-03  Martin Baulig  <martin@ximian.com>
13781
13782         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13783         use a user-defined operator; we still need to do numeric
13784         promotions in case one argument is a builtin type and the other
13785         one has an implicit conversion to that type.  Fixes #62322.
13786
13787 2004-08-02  Martin Baulig  <martin@ximian.com>
13788
13789         * statement.cs (LocalInfo.Flags): Added `IsThis'.
13790         (LocalInfo.IsThis): New public property.
13791         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13792
13793 2004-08-01  Martin Baulig  <martin@ximian.com>
13794
13795         * class.cs (TypeContainer.GetClassBases): Don't set the default
13796         here since we may get called from GetPartialBases().
13797         (TypeContainer.DefineType): If GetClassBases() didn't return a
13798         parent, use the default one.
13799
13800 2004-07-30  Duncan Mak  <duncan@ximian.com>
13801
13802         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13803
13804 2004-07-30  Martin Baulig  <martin@ximian.com>
13805
13806         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13807
13808         * class.cs (SourceMethod): New public class, derive from the
13809         symbol writer's ISourceMethod.
13810         (Method): Use the new symbol writer API.
13811
13812         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13813         as argument and use the new symbol writer.
13814
13815         * location.cs
13816         (SourceFile): Implement the symbol writer's ISourceFile.
13817         (Location.SymbolDocument): Removed.
13818         (Location.SourceFile): New public property.
13819
13820         * symbolwriter.cs: Use the new symbol writer API.
13821
13822 2004-07-30  Raja R Harinath  <rharinath@novell.com>
13823
13824         * Makefile (install-local): Remove.  Functionality moved to
13825         executable.make.
13826
13827 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
13828
13829         * Makefile: Install mcs.exe.config file together with mcs.exe.
13830         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13831         correct runtime version.
13832         
13833 2004-07-25  Martin Baulig  <martin@ximian.com>
13834
13835         * class.cs
13836         (TypeContainer.RegisterOrder): Removed, this was unused.
13837         (TypeContainer, interface_order): Removed.
13838         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13839         TypeContainer as argument since we can also be called with a
13840         `PartialContainer' for a partial class/struct/interface.
13841         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13842         of checking whether we're an `Interface' - we could be a
13843         `PartialContainer'.
13844         (PartialContainer.Register): Override; call
13845         AddClass()/AddStruct()/AddInterface() on our parent.
13846
13847         * cs-parser.jay (interface_member_declaration): Add things to the
13848         `current_container', not the `current_class'.
13849
13850         * rootcontext.cs (RegisterOrder): The overloaded version which
13851         takes an `Interface' was unused, removed.
13852
13853         * typemanager.cs (TypeManager.LookupInterface): Return a
13854         `TypeContainer', not an `Interface'.
13855         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13856         contain a `PartialContainer' for an interface, so check it's
13857         `Kind' to figure out what it is.
13858
13859 2004-07-25  Martin Baulig  <martin@ximian.com>
13860
13861         * class.cs (Class.DefaultTypeAttributes): New public constant.
13862         (Struct.DefaultTypeAttributes): Likewise.
13863         (Interface.DefaultTypeAttributes): Likewise.
13864         (PartialContainer.TypeAttr): Override this and add the
13865         DefaultTypeAttributes.
13866
13867 2004-07-25  Martin Baulig  <martin@ximian.com>
13868
13869         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13870         we can just use the `Parent' field instead.
13871
13872 2004-07-25  Martin Baulig  <martin@ximian.com>
13873
13874         * class.cs (TypeContainer.Emit): Renamed to EmitType().
13875
13876 2004-07-25  Martin Baulig  <martin@ximian.com>
13877
13878         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13879         our parts before defining any methods.
13880         (TypeContainer.VerifyImplements): Make this virtual.
13881         (ClassPart.VerifyImplements): Override and call VerifyImplements()
13882         on our PartialContainer.
13883
13884 2004-07-25  Martin Baulig  <martin@ximian.com>
13885
13886         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13887
13888         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13889         argument, we can just use the `Parent' field instead.
13890
13891         * class.cs
13892         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
13893         (MemberBase.DoDefine): Likewise.
13894
13895 2004-07-24  Martin Baulig  <martin@ximian.com>
13896
13897         * decl.cs (MemberCore.Parent): New public field.
13898         (DeclSpace.Parent): Moved to MemberCore.
13899
13900         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13901         (MemberBase.ctor): Added TypeContainer argument, pass it to our
13902         parent's .ctor.
13903         (FieldBase, Field, Operator): Likewise.
13904         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13905         (EventField, Event): Likewise.
13906
13907 2004-07-23  Martin Baulig  <martin@ximian.com>
13908
13909         * class.cs (PartialContainer): New public class.
13910         (ClassPart): New public class.
13911         (TypeContainer): Added support for partial classes.
13912         (TypeContainer.GetClassBases): Splitted some of the functionality
13913         out into GetNormalBases() and GetPartialBases().
13914
13915         * cs-tokenizer.cs (Token.PARTIAL): New token.
13916         (Tokenizer.consume_identifier): Added some hacks to recognize
13917         `partial', but only if it's immediately followed by `class',
13918         `struct' or `interface'.
13919
13920         * cs-parser.jay: Added support for partial clases.
13921
13922 2004-07-23  Martin Baulig  <martin@ximian.com>
13923
13924         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13925         a `DeclSpace' and also made it readonly.
13926         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13927         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
13928         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
13929
13930         * cs-parser.jay: Pass the `current_class', not the
13931         `current_container' (at the moment, this is still the same thing)
13932         to a new Method, Property, Event, Indexer or Constructor.
13933
13934 2004-07-23  Martin Baulig  <martin@ximian.com>
13935
13936         * cs-parser.jay (CSharpParser): Added a new `current_class' field
13937         and removed the `current_interface' one.
13938         (struct_declaration, class_declaration, interface_declaration):
13939         Set `current_class' to the newly created class/struct/interface;
13940         set their `Bases' and call Register() before parsing their body.
13941
13942 2004-07-23  Martin Baulig  <martin@ximian.com>
13943
13944         * class.cs (Kind): New public enum.
13945         (TypeContainer): Made this class abstract.
13946         (TypeContainer.Kind): New public readonly field.
13947         (TypeContainer.CheckDef): New public method; moved here from
13948         cs-parser.jay.
13949         (TypeContainer.Register): New public abstract method.
13950         (TypeContainer.GetPendingImplementations): New public abstract
13951         method.
13952         (TypeContainer.GetClassBases): Removed the `is_class' and
13953         `is_iface' parameters.
13954         (TypeContainer.DefineNestedTypes): Formerly known as
13955         DoDefineType().
13956         (ClassOrStruct): Made this class abstract.
13957
13958         * tree.cs (RootTypes): New public type. 
13959
13960 2004-07-20  Martin Baulig  <martin@ximian.com>
13961
13962         * tree.cs (Tree.RecordNamespace): Removed.
13963         (Tree.Namespaces): Removed.
13964
13965         * rootcontext.cs (RootContext.IsNamespace): Removed.
13966
13967         * cs-parser.jay (namespace_declaration): Just create a new
13968         NamespaceEntry here.
13969
13970 2004-07-20  Martin Baulig  <martin@ximian.com>
13971
13972         * statement.cs (ExceptionStatement): New abstract class.  This is
13973         now used as a base class for everyone who's using `finally'.
13974         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
13975         our local variables before using them.
13976
13977         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
13978         virtual method.  This is used by Yield.Resolve() to "steal" an
13979         outer block's `finally' clauses.
13980         (FlowBranchingException): The .ctor now takes an ExceptionStatement
13981         argument.
13982
13983         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
13984         version which takes an ExceptionStatement.  This version must be
13985         used to create exception branchings.
13986
13987         * iterator.cs
13988         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
13989         (Iterator.EmitMoveNext): Added exception support; protect the
13990         block with a `fault' clause, properly handle 'finally' clauses.
13991         (Iterator.EmitDispose): Run all the `finally' clauses here.
13992
13993 2004-07-20  Martin Baulig  <martin@ximian.com>
13994
13995         * iterator.cs: This is the first of a set of changes in the
13996         iterator code.  Match the spec more closely: if we're an
13997         IEnumerable, then GetEnumerator() must be called.  The first time
13998         GetEnumerator() is called, it returns the current instance; all
13999         subsequent invocations (if any) must create a copy.
14000
14001 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
14002
14003         * expression.cs: Resolve the constant expression before returning
14004         it. 
14005
14006 2004-07-19  Martin Baulig  <martin@ximian.com>
14007
14008         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
14009         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
14010         the return type of the new EmitContext.
14011
14012 2004-07-18  Martin Baulig  <martin@ximian.com>
14013
14014         * class.cs (Property.Define): Fix iterators.
14015
14016         * iterators.cs (Iterator.Define): Moved the
14017         `container.AddInterator (this)' call here from the .ctor; only do
14018         it if we resolved successfully.
14019
14020 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
14021
14022         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
14023         `true' for preprocessing directives that we parse.  The return
14024         value indicates whether we should return to regular tokenizing or
14025         not, not whether it was parsed successfully.
14026
14027         In the past if we were in: #if false ... #line #endif, we would
14028         resume parsing after `#line'.  See bug 61604.
14029
14030         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
14031         building: IsEnumType should return true only for enums, not for
14032         enums or System.Enum itself.  This fixes #61593.
14033
14034         Likely what happened is that corlib was wrong: mcs depended on
14035         this bug in some places.  The bug got fixed, we had to add the
14036         hack, which caused bug 61593.
14037
14038         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
14039         that was a workaround for the older conditions.
14040
14041 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
14042
14043         * assign.cs: IAssignMethod has a new interface, as documented
14044         inline. All assignment code now uses this new api.
14045
14046         * ecore.cs, expression.cs: All classes which implement
14047         IAssignMethod now use the new interface.
14048
14049         * expression.cs (Invocation): add a hack to EmitCall so that
14050         IndexerAccess can be the target of a compound assignment without
14051         evaluating its arguments twice.
14052
14053         * statement.cs: Handle changes in Invocation api.
14054
14055 2004-07-16  Martin Baulig  <martin@ximian.com>
14056
14057         * iterators.cs: Rewrote this.  We're now using one single Proxy
14058         class for both the IEnumerable and the IEnumerator interface and
14059         `Iterator' derives from Class so we can use the high-level API.
14060
14061         * class.cs (TypeContainer.AddIterator): New method.
14062         (TypeContainer.DoDefineType): New protected virtual method, which
14063         is called from DefineType().
14064         (TypeContainer.DoDefineMembers): Call DefineType() and
14065         DefineMembers() on all our iterators.
14066         (TypeContainer.Emit): Call Emit() on all our iterators.
14067         (TypeContainer.CloseType): Call CloseType() on all our iterators.
14068
14069         * codegen.cs (EmitContext.CurrentIterator): New public field.
14070
14071 2004-07-15  Martin Baulig  <martin@ximian.com>
14072
14073         * typemanager.cs
14074         (TypeManager.not_supported_exception_type): New type.   
14075
14076 2004-07-14  Martin Baulig  <martin@ximian.com>
14077
14078         * iterators.cs: Use real error numbers.
14079
14080 2004-07-14  Martin Baulig  <martin@ximian.com>
14081
14082         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
14083         requires this to be a System.Collection.IEnumerable and not a
14084         class implementing that interface.
14085         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
14086
14087 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
14088
14089         * class.cs: Fixed previous fix, it broke some error tests.
14090
14091 2004-07-12  Martin Baulig  <martin@ximian.com>
14092
14093         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
14094         Fixes #61293.
14095
14096 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
14097
14098         * assign.cs (LocalTemporary): Add new argument: is_address,If
14099         `is_address' is true, then the value that we store is the address
14100         to the real value, and not the value itself.
14101         
14102         * ecore.cs (PropertyExpr): use the new local temporary
14103         stuff to allow us to handle X.Y += z (where X is a struct)
14104
14105 2004-07-08  Martin Baulig  <martin@ximian.com>
14106
14107         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
14108         not always return, just like we're doing in Using.Resolve().
14109
14110 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
14111
14112         * cs-parser.jay (fixed_statement): flag this as Pinned.
14113
14114 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
14115
14116         * typemanager.cs (TypeManager): Removed MakePinned method, this
14117         mechanism is replaced with the .NET 2.x compatible mechanism of
14118         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
14119
14120         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
14121         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
14122         `IsFixed' property which has a different meaning.
14123
14124 2004-07-02  Raja R Harinath  <rharinath@novell.com>
14125
14126         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
14127         visible from inside a nested class, not just the names of the
14128         immediately enclosing class.
14129         Fix for bug #60730.
14130
14131 2004-06-24  Raja R Harinath  <rharinath@novell.com>
14132
14133         * expression.cs (BetterConversion): Remove buggy special-case
14134         handling of "implicit constant expression conversions".  At this
14135         point, we already know that the conversion is possible -- we're
14136         only checking to see which is better.
14137
14138 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14139
14140         * cs-parser.jay: Added error CS0210 test.
14141
14142 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14143
14144         * cs-parser.jay: Added error CS0134 test.
14145
14146 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14147
14148         Fix bug #52507
14149         * cs-parser.jay: Added error CS0145 test.
14150
14151 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14152
14153         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
14154
14155 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
14156         
14157         * expression.cs (StackAlloc.Resolve): The argument may not
14158         be a constant; deal with this case.
14159         
14160 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
14161
14162         * attribute.cs (IndexerName_GetIndexerName): Renamed to
14163         GetIndexerAttributeValue.
14164         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
14165
14166         * class.cs (Indexer.Define): Added error tests for CS0415,
14167         CS0609.
14168
14169 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
14170
14171         * attribute.cs (Attribute.Resolve): Keep field code in sync with
14172         property code.
14173
14174 2004-06-23  Martin Baulig  <martin@ximian.com>
14175
14176         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
14177         neither return nor throw, reset the barrier as well.  Fixes #60457.
14178
14179 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
14180
14181         * class.cs : EventAttributes is now set to None by default.
14182           This fixes bug #60459.
14183
14184 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
14185
14186         Fix bug #60219
14187         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14188         Don't throw exception but return null (it's sufficient now).
14189
14190 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
14191
14192         * typemanager.cs (GetArgumentTypes): Faster implementation.
14193
14194 2004-06-18  Martin Baulig  <martin@ximian.com>
14195
14196         * attribute.cs (Attribute.Resolve): Check whether we're an
14197         EmptyCast which a Constant child.  Fixes #60333.
14198
14199 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
14200
14201         * statement.cs (EmitCollectionForeach): Account for the fact that
14202         not all valuetypes are in areas which we can take the address of.
14203         For these variables, we store to a temporary variable. Also, make
14204         sure that we dont emit a `callvirt' on a valuetype method.
14205
14206 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14207
14208         * expression.cs (StackAlloc.DoReSolve): Added test for
14209         negative parameter (CS0247).
14210
14211 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14212
14213         Fix bug #59792
14214         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
14215
14216 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14217
14218         Fix bug #59781
14219         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
14220         ulong.
14221
14222 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
14223
14224         Fix bug #58254 & cs1555.cs, cs1556.cs
14225         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
14226
14227 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
14228
14229         * cs-parser.jay: Added error CS1669 test for indexers.
14230
14231 2004-06-11  Martin Baulig  <martin@ximian.com>
14232
14233         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
14234         call this twice: for params and varargs methods.
14235
14236 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14237
14238         * class.cs:
14239         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
14240
14241 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14242
14243         * attribute.cs (Attribute.GetValidTargets): Made public.
14244
14245         * class.cs: 
14246         (AbstractPropertyEventMethod): New class for better code sharing.
14247         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
14248         CS1667 report.
14249         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
14250
14251 2004-06-11  Raja R Harinath  <rharinath@novell.com>
14252
14253         Fix bug #59477.
14254         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
14255         that the call to Resolve is part of a MemberAccess.
14256         (Expression.Resolve): Use it for SimpleName resolution.
14257         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14258         Add 'intermediate' boolean argument.
14259         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
14260         error message when the SimpleName can be resolved ambiguously
14261         between an expression and a type.
14262         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14263         public.
14264         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14265         call on the left-side.
14266
14267 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14268
14269         * class.cs:
14270         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14271
14272 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14273
14274         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14275
14276 2004-06-11  Martin Baulig  <martin@ximian.com>
14277
14278         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14279         varargs methods if applicable.
14280
14281 2004-06-11  Martin Baulig  <martin@ximian.com>
14282
14283         * expression.cs (Invocation.EmitCall): Don't use
14284         `method.CallingConvention == CallingConventions.VarArgs' since the
14285         method could also have `CallingConventions.HasThis'.
14286
14287 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14288
14289         * class.cs (Event.GetSignatureForError): Implemented.
14290         Fixed crash in error test cs3010.cs
14291
14292 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
14293
14294         * cs-tokenizer.cs: Change the way we track __arglist to be
14295         consistent with the other keywords.
14296
14297 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
14298
14299         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14300         tomorrow.
14301
14302 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
14303
14304         * codegen.cs: Check that all referenced assemblies have a strongname
14305         before strongnaming the compiled assembly. If not report error CS1577.
14306         Fix bug #56563. Patch by Jackson Harper.
14307         * typemanager.cs: Added a method to return all referenced assemblies.
14308         Fix bug #56563. Patch by Jackson Harper.
14309
14310 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14311
14312         * class.cs:
14313         (Method.ApplyAttributeBuilder): Moved and added conditional
14314         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14315
14316         * delegate.cs:
14317         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14318
14319 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14320
14321         Fixed #59640
14322         * class.cs: (EventField.attribute_targets): Changed default target.
14323
14324 2004-06-08  Martin Baulig  <martin@ximian.com>
14325
14326         * expression.cs (Invocation.EmitCall): Enable varargs methods.
14327
14328 2004-06-08  Martin Baulig  <martin@ximian.com>
14329
14330         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14331
14332 2004-06-07  Martin Baulig  <martin@ximian.com>
14333
14334         Added support for varargs methods.
14335
14336         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14337         keyword.
14338
14339         * cs-parser.jay: Added support for `__arglist'.
14340
14341         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14342
14343         * expression.cs (Argument.AType): Added `ArgList'.
14344         (Invocation): Added support for varargs methods.
14345         (ArglistAccess): New public class.
14346         (Arglist): New public class.
14347
14348         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14349
14350         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
14351         a method's top-level block if the method has varargs.
14352
14353         * support.cs (ReflectionParameters, InternalParameters): Added
14354         support for varargs methods.    
14355
14356 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
14357
14358         * class.cs: Provide location in indexer error report.
14359
14360         * driver.cs: Use standard names.
14361
14362         * namespace.cs: Catch the use of using after a namespace has been
14363         declared also on using aliases.
14364
14365 2004-06-03  Raja R Harinath  <rharinath@novell.com>
14366
14367         Bug #50820.
14368         * typemanager.cs (closure_private_ok, closure_invocation_type)
14369         (closure_qualifier_type, closure_invocation_assembly)
14370         (FilterWithClosure): Move to ...
14371         (Closure): New internal nested class.
14372         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14373         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14374         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14375         (MemberLookup, MemberLookupFailed): Use it.
14376         * expression.cs (New.DoResolve): Treat the lookup for the
14377         constructor as being qualified by the 'new'ed type.
14378         (Indexers.GetIndexersForTypeOrInterface): Update.
14379
14380 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
14381
14382         * attribute.cs
14383         (GetConditionalAttributeValue): New method. Returns
14384         condition of ConditionalAttribute.
14385         (SearchMulti): New method.  Returns all attributes of type 't'.
14386         Use it when attribute is AllowMultiple = true.
14387         (IsConditionalMethodExcluded): New method.
14388
14389         * class.cs
14390         (Method.IsExcluded): Implemented. Returns true if method has conditional
14391         attribute and the conditions is not defined (method is excluded).
14392         (IMethodData): Extended interface for ConditionalAttribute support.
14393         (PropertyMethod.IsExcluded): Implemented.
14394
14395         * decl.cs
14396         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14397
14398         * expression.cs
14399         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14400         on the method.
14401
14402 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
14403
14404         * expression.cs (ArrayCreationExpression): Make this just an
14405         `expression'. It can't be a statement, so the code here was
14406         dead.
14407
14408 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14409
14410         Fixed #59072
14411         * typemanager.cs (GetFullNameSignature): New method for
14412         MethodBase types.
14413
14414 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14415
14416         Fixed #56452
14417         * class.cs (MemberBase.GetSignatureForError): New virtual method.
14418         Use this method when MethodBuilder is null.
14419         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14420         Added test for error CS0626 (MONO reports error for this situation).
14421         (IMethodData.GetSignatureForError): Extended interface.
14422
14423 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14424
14425         * attribute.cs
14426         (AttributeTester.GetObsoleteAttribute): Returns instance of
14427         ObsoleteAttribute when type is obsolete.
14428
14429         * class.cs
14430         (TypeContainer.VerifyObsoleteAttribute): Override.
14431         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14432         (MethodCode.VerifyObsoleteAttribute): Override.
14433         (MemberBase.VerifyObsoleteAttribute): Override.
14434
14435         * decl.cs
14436         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14437         and report proper error.
14438
14439         *delegate.cs
14440         Delegate.VerifyObsoleteAttribute): Override.
14441
14442         * ecore.cs
14443         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14444         and report proper error.
14445         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14446
14447         * enum.cs
14448         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14449         and enum member.
14450
14451         * expression.cs
14452         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14453         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14454         Added test for ObsoleteAttribute.
14455
14456         * statement.cs
14457         (Catch): Derived from Statement.
14458
14459 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14460  
14461         Fixed bug #59071 & cs0160.cs
14462  
14463         * statement.cs (Try.Resolve): Check here whether order of catch
14464         clauses matches their dependencies.
14465
14466 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
14467
14468         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
14469         caused a regression: #59343.  Referencing nested classes from an
14470         assembly stopped working.
14471
14472 2004-05-31  Martin Baulig  <martin@ximian.com>
14473
14474         MCS is now frozen for beta 2.
14475
14476 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14477
14478         * convert.cs: add a trivial cache for overload operator resolution.
14479
14480 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14481
14482         * decl.cs: If possible, use lookuptypedirect here. We can only do
14483         this if there is no `.' after the namespace. Avoids using
14484         LookupType, which does lots of slow processing.
14485         (FindNestedType) New method, does what it says :-).
14486         * namespace.cs: use LookupTypeDirect.
14487         * rootcontext.cs: use membercache, if possible.
14488         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14489
14490 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14491
14492         * expression.cs:
14493         According to the spec, 
14494
14495         In a member access of the form E.I, if E is a single identifier,
14496         and if the meaning of E as a simple-name (§7.5.2) is a constant,
14497         field, property, localvariable, or parameter with the same type as
14498         the meaning of E as a type-name (§3.8), then both possible
14499         meanings of E are permitted.
14500
14501         We did not check that E as a simple-name had the same type as E as
14502         a type name.
14503
14504         This trivial check gives us 5-7% on bootstrap time.
14505
14506 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14507
14508         * expression.cs (Invocation.OverloadResolve): Avoid the
14509         use of hashtables and boxing here by allocating on demand.
14510
14511 2004-05-30  Martin Baulig  <martin@ximian.com>
14512
14513         * rootcontext.cs (RootContext.LookupType): Don't cache things if
14514         we're doing a silent lookup.  Don't try to lookup nested types in
14515         TypeManager.object_type (thanks to Ben Maurer).
14516
14517 2004-05-30  Martin Baulig  <martin@ximian.com>
14518
14519         Committing a patch from Ben Maurer.
14520
14521         * rootcontext.cs (RootContext.LookupType): Cache negative results.
14522
14523 2004-05-29  Martin Baulig  <martin@ximian.com>
14524
14525         * class.cs (IMethodData.ShouldIgnore): New method.
14526
14527         * typemanager.cs (TypeManager.MethodFlags): Don't take a
14528         `Location' argument, we don't need it anywhere.  Use
14529         `IMethodData.ShouldIgnore ()' instead of
14530         `MethodData.GetMethodFlags ()'.
14531         (TypeManager.AddMethod): Removed.
14532         (TypeManager.AddMethod2): Renamed to AddMethod.
14533
14534 2004-05-29  Martin Baulig  <martin@ximian.com>
14535
14536         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14537
14538         * convert.cs (Convert.ImplicitReferenceConversion): If we're
14539         converting from a class type S to an interface type and we already
14540         have an object on the stack, don't box it again.  Fixes #52578.
14541
14542 2004-05-29  Martin Baulig  <martin@ximian.com>
14543
14544         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14545         Added support for `params' parameters.  Fixes #59267.
14546
14547 2004-05-29  Martin Baulig  <martin@ximian.com>
14548
14549         * literal.cs (NullPointer): Provide a private .ctor which sets
14550         `type' to TypeManager.object_type.  Fixes #59048.
14551
14552 2004-05-29  Martin Baulig  <martin@ximian.com>
14553
14554         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14555         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
14556
14557         * ecore.cs (EventExpr.instance_expr): Make the field private.
14558
14559 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
14560
14561         Fixed bug #50080 & cs0214-2.cs
14562         * expression.cs (Cast.DoResolve): Check unsafe context here.
14563         
14564         * statement.cs (Resolve.DoResolve): Likewise.
14565
14566 2004-05-26  Martin Baulig  <martin@ximian.com>
14567
14568         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14569
14570         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14571         (RootContext.LookupType): Pass down the `silent' flag.
14572
14573 2004-05-25  Martin Baulig  <martin@ximian.com>
14574
14575         * expression.cs
14576         (MethodGroupExpr.IdenticalTypeName): New public property.
14577         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14578         expression actually refers to a type.
14579
14580 2004-05-25  Martin Baulig  <martin@ximian.com>
14581
14582         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14583         for #56176 and made it actually work.
14584
14585 2004-05-25  Martin Baulig  <martin@ximian.com>
14586
14587         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14588         (FieldExpr, PropertyExpr): Override and implement
14589         CacheTemporaries.  Fixes #52279.
14590
14591 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
14592
14593         * location.cs: In the new compiler listing a file twice is a
14594         warning, not an error.
14595
14596 2004-05-24  Martin Baulig  <martin@ximian.com>
14597
14598         * enum.cs (Enum.DefineType): For the `BaseType' to be a
14599         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
14600
14601 2004-05-24  Martin Baulig  <martin@ximian.com>
14602
14603         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14604         walking the `using' list.  Fixes #53921.
14605
14606 2004-05-24  Martin Baulig  <martin@ximian.com>
14607
14608         * const.cs (Const.LookupConstantValue): Added support for
14609         EmptyCast's; fixes #55251.
14610
14611 2004-05-24  Martin Baulig  <martin@ximian.com>
14612
14613         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14614         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14615         which does the CS0135 check.  The reason is that we first need to
14616         check whether the variable actually exists.
14617
14618 2004-05-24  Martin Baulig  <martin@ximian.com>
14619
14620         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14621         than RootContext.LookupType() to find the explicit interface
14622         type.  Fixes #58584.
14623
14624 2004-05-24  Raja R Harinath  <rharinath@novell.com>
14625
14626         * Makefile: Simplify.  Use executable.make.
14627         * mcs.exe.sources: New file.  List of sources of mcs.exe.
14628
14629 2004-05-24  Anders Carlsson  <andersca@gnome.org>
14630
14631         * decl.cs:
14632         * enum.cs:
14633         Use the invariant culture when doing String.Compare for CLS case
14634         sensitivity.
14635         
14636 2004-05-23  Martin Baulig  <martin@ximian.com>
14637
14638         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14639         don't have any dots.  Fixes #52622, added cs0246-8.cs.
14640
14641         * namespace.cs (NamespaceEntry.Lookup): Likewise.
14642         
14643 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14644
14645         * class.cs (MemberBase.Define): Reuse MemberType member for 
14646         resolved type. Other methods can use it too.
14647
14648 2004-05-23  Martin Baulig  <martin@ximian.com>
14649
14650         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14651         the variable also exists in the current block (otherwise, we need
14652         to report a CS0103).  Fixes #58670.
14653
14654 2004-05-23  Martin Baulig  <martin@ximian.com>
14655
14656         * flowanalysis.cs (Reachability.Reachable): Compute this
14657         on-the-fly rather than storing it as a field.
14658
14659 2004-05-23  Martin Baulig  <martin@ximian.com>
14660
14661         * flowanalysis.cs (Reachability.And): Manually compute the
14662         resulting `barrier' from the reachability.      
14663        
14664 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14665
14666         Fix bug #57835
14667         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14668         instance of ObsoleteAttribute when symbol is obsolete.
14669
14670         * class.cs
14671         (IMethodData): Extended interface for ObsoleteAttribute support.
14672
14673 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14674
14675         * attribute.cs: Fix bug #55970
14676
14677 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14678
14679         Fix bug #52705
14680         * attribute.cs
14681         (GetObsoleteAttribute): New method. Creates the instance of
14682         ObsoleteAttribute.
14683         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14684         ObsoleteAttribute when member is obsolete.
14685         (AttributeTester.Report_ObsoleteMessage): Common method for
14686         Obsolete error/warning reporting.
14687
14688         * class.cs
14689         (TypeContainer.base_classs_type): New member for storing parent type.
14690
14691         * decl.cs
14692         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14693         for this MemberCore.
14694
14695 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14696
14697         * attribute.cs, const.cs: Fix bug #58590
14698
14699 2004-05-21  Martin Baulig  <martin@ximian.com>
14700
14701         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14702         out parameters if the end of the method is unreachable.  Fixes
14703         #58098. 
14704
14705 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14706
14707         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14708         Hari was right, why extra method.
14709
14710 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14711
14712         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14713
14714 2004-05-20  Martin Baulig  <martin@ximian.com>
14715
14716         Merged this back from gmcs to keep the differences to a minumum.
14717
14718         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14719         instead of a Declspace.
14720         (Attribute.ResolveType): Likewise.
14721         (Attributes.Search): Likewise.
14722         (Attributes.Contains): Likewise.
14723         (Attributes.GetClsCompliantAttribute): Likewise.
14724
14725         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14726         argument.
14727         (MethodData.ApplyAttributes): Take an EmitContext instead of a
14728         DeclSpace.
14729
14730 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
14731
14732         Fix bug #58688 (MCS does not report error when the same attribute
14733         is assigned twice)
14734
14735         * attribute.cs (Attribute.Emit): Distinction between null and default.
14736
14737 2004-05-19  Raja R Harinath  <rharinath@novell.com>
14738
14739         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14740         of a top-level attribute without an attribute target.
14741         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
14742         Make non-static.
14743         (Attribute.Conditional_GetConditionName), 
14744         (Attribute.Obsolete_GetObsoleteMessage): Update.
14745         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
14746         part of ScanForIndexerName.
14747         (Attribute.CanIgnoreInvalidAttribute): New function.
14748         (Attribute.ScanForIndexerName): Move to ...
14749         (Attributes.ScanForIndexerName): ... here.
14750         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14751         (Attributes.Search): New internal variant that can choose not to
14752         complain if types aren't resolved.  The original signature now
14753         complains.
14754         (Attributes.GetClsCompliantAttribute): Use internal variant, with
14755         complaints suppressed.
14756         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14757         only if it not useful.
14758         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14759         top-level for attributes that are shared between the assembly
14760         and a top-level class.
14761         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14762         * class.cs: Update to reflect changes.
14763         (DefineIndexers): Fuse loops.
14764         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
14765         a couple more variants of attribute names.
14766
14767 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
14768
14769         Fix bug #52585 (Implemented explicit attribute declaration)
14770
14771         * attribute.cs:
14772         (Attributable.ValidAttributeTargets): New abstract method. It gets
14773         list of valid attribute targets for explicit target declaration.
14774         (Attribute.Target): It holds target itself.
14775         (AttributeSection): Removed.
14776         (Attribute.CheckTargets): New method. It checks whether attribute
14777         target is valid for the current element.
14778
14779         * class.cs:
14780         (EventProperty): New class. For events that are declared like
14781         property (with add and remove accessors).
14782         (EventField): New class. For events that are declared like field.
14783         class.cs
14784
14785         * cs-parser.jay: Implemented explicit attribute target declaration.
14786
14787         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
14788         Override ValidAttributeTargets.
14789
14790         * parameter.cs:
14791         (ReturnParameter): Class for applying custom attributes on 
14792         the return type.
14793         (ParameterAtribute): New class. Class for applying custom
14794         attributes on the parameter type.
14795
14796 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
14797
14798         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14799         definitions. 
14800
14801         (Method): Allow UNSAFE here.
14802
14803         * modifiers.cs: Support unsafe reporting.
14804
14805 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
14806
14807         * decl.cs: Fix bug #58478.
14808
14809 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14810
14811         * statement.cs: When checking for unreachable code on an EmptyStatement,
14812         set the location. Fixes bug #58488.
14813
14814 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
14815
14816         * driver.cs: Add -pkg handling.
14817
14818         From Gonzalo: UseShelLExecute=false
14819
14820 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
14821
14822         * attribute.cs:
14823         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14824         for attribute.
14825         (Attribute.IsClsCompliaceRequired): Moved to base for better
14826         accesibility.
14827         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14828         when attribute is AttributeUsageAttribute.
14829         (Attribute.GetValidTargets): Simplified.
14830         (Attribute.GetAttributeUsage): New method returns AttributeUsage
14831         attribute for this type.
14832         (Attribute.ApplyAttributes): Method renamed to Emit and make
14833         non-static.
14834         (GlobalAttributeSection): New class for special handling of global
14835         attributes (assembly, module).
14836         (AttributeSection.Emit): New method.
14837
14838         * class.cs: Implemented Attributable abstract methods.
14839         (MethodCore.LabelParameters): Moved to Parameter class.
14840         (Accessor): Is back simple class.
14841         (PropertyMethod): Implemented Attributable abstract class.
14842         (DelegateMethod): Implemented Attributable abstract class.
14843         (Event): New constructor for disctintion between normal Event
14844         and Event with accessors.
14845
14846         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14847
14848         * codegen.cs, const.cs, decl.cs, delegate.cs:
14849         (CommonAssemblyModulClass): Implemented Attributable abstract class
14850         and simplified.
14851
14852         * enum.cs: Implement IAttributeSupport interface.
14853         (EnumMember): New class for emum members. Implemented Attributable
14854         abstract class
14855
14856         * parameter.cs:
14857         (ParameterBase): Is abstract.
14858         (ReturnParameter): New class for easier [return:] attribute handling.
14859
14860         * typemanager.cs: Removed builder_to_attr.
14861
14862 2004-05-11  Raja R Harinath  <rharinath@novell.com>
14863
14864         Fix bug #57151.
14865         * attribute.cs (Attribute.GetPositionalValue): New function.
14866         * class.cs (TypeContainer.VerifyMembers): New function.
14867         (TypeContainer.Emit): Use it.
14868         (ClassOrStruct): New base class for Class and Struct.
14869         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
14870         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14871         class.
14872         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14873         then each non-static field should have a FieldOffset attribute.
14874         Otherwise, none of the fields should have a FieldOffset attribute.
14875         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
14876         and FieldOffset attributes.
14877         * typemanager.cs (TypeManager.struct_layout_attribute_type)
14878         (TypeManager.field_offset_attribute_type): New core types.
14879         (TypeManager.InitCoreTypes): Initialize them.
14880
14881 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
14882
14883         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14884         Return correct type.
14885         From bug #58270.
14886
14887 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
14888
14889         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14890         be implicitly converted to ulong.
14891         
14892         * expression.cs: The logic for allowing operator &, | and ^ worked
14893         was wrong, it worked before because we did not report an error in
14894         an else branch.  Fixes 57895.
14895
14896         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14897         allow volatile fields to be reference types.
14898
14899 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
14900
14901         * driver.cs: Add support for /debug-
14902
14903 2004-05-07  Raja R Harinath  <rharinath@novell.com>
14904
14905         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
14906         Add a 'complain' parameter to silence errors.
14907         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
14908         silently overlooked type-resolutions.
14909         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14910         to reflect changes.
14911         (Attributes.Search): New function.
14912         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14913         (Attributes.GetAttributeFullName): Remove hack.
14914         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
14915         Update to reflect changes.
14916         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14917         Use Attributes.Search instead of nested loops.
14918
14919 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
14920
14921         * decl.cs:
14922         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14923         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14924         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14925
14926         * report.cs: (Report.Warning): Renamed to Warning_T because of
14927         parameter collision.
14928
14929 2004-05-05  Raja R Harinath  <rharinath@novell.com>
14930
14931         * expression.cs (MemberAccess.ResolveMemberAccess):
14932         Exit with non-zero status after Report.Error.
14933         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
14934         Likewise.
14935         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
14936
14937 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
14938
14939         * support.cs: Don't hang when the file is empty.
14940
14941 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
14942
14943         * support.cs: In SeekableStreamReader, compute the preamble size of the
14944           underlying stream. Position changes should take into account that initial
14945           count of bytes.
14946
14947 2004-05-03  Todd Berman  <tberman@sevenl.net>
14948
14949         * driver.cs: remove unused GetSysVersion function.
14950
14951 2004-05-03  Todd Berman  <tberman@sevenl.net>
14952
14953         * driver.cs: Remove the hack from saturday, as well as the hack
14954         from jackson (LoadAssemblyFromGac), also adds the CWD to the
14955         link_paths to get that bit proper.
14956
14957 2004-05-01  Todd Berman  <tberman@sevenl.net>
14958
14959         * driver.cs: Try a LoadFrom before a Load, this checks the current
14960         path. This is currently a bug in mono that is be fixed, however, this
14961         provides a workaround for now. This will be removed when the bug
14962         is fixed.
14963
14964 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
14965
14966         * CryptoConvert.cs: Updated to latest version. Fix issue with 
14967         incomplete key pairs (#57941).
14968
14969 2004-05-01  Todd Berman  <tberman@sevenl.net>
14970
14971         * driver.cs: Remove '.' from path_chars, now System.* loads properly
14972         from the GAC
14973
14974 2004-04-30  Jackson Harper  <jackson@ximian.com>
14975
14976         * codegen.cs: Open keys readonly.
14977         
14978 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14979
14980         * typemanager.cs: don't report cyclic struct layout when a struct
14981         contains 2 or more fields of the same type. Failed for Pango.AttrShape
14982         which has 2 Pango.Rectangle fields.
14983
14984 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14985
14986         * expression.cs: Handle IntPtr comparisons with IL code
14987         rather than a method call.
14988
14989 2004-04-29  Martin Baulig  <martin@ximian.com>
14990
14991         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
14992         the list of PropertyInfo's in class hierarchy and find the
14993         accessor.  Fixes #56013.
14994
14995 2004-04-29  Martin Baulig  <martin@ximian.com>
14996
14997         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
14998
14999 2004-04-29  Martin Baulig  <martin@ximian.com>
15000
15001         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15002
15003         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
15004
15005 2004-04-29  Martin Baulig  <martin@ximian.com>
15006
15007         * class.cs (ConstructorInitializer.Resolve): Check whether the
15008         parent .ctor is accessible.  Fixes #52146.
15009
15010 2004-04-29  Martin Baulig  <martin@ximian.com>
15011
15012         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15013
15014         * statement.cs (Using.EmitLocalVariableDecls): Use
15015         TypeManager.idisposable_type, not typeof (IDisposable).
15016         (Foreach.EmitCollectionForeach): Added support for valuetypes.
15017
15018 2004-04-29  Martin Baulig  <martin@ximian.com>
15019
15020         * class.cs (Event.Define): Don't emit the field and don't set
15021         RTSpecialName and SpecialName for events on interfaces.  Fixes
15022         #57703. 
15023
15024 2004-04-29  Raja R Harinath  <rharinath@novell.com>
15025
15026         Refactor Attribute.ApplyAttributes.
15027         * attribute.cs (Attributable): New base class for objects that can
15028         have Attributes applied on them.
15029         (Attribute): Make AttributeUsage fields public.
15030         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
15031         (Attribute.IsInternalCall): New property.
15032         (Attribute.UsageAttr): Convert to a public read-only property.
15033         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
15034         (Attribute.ResolveType, Attribute.Resolve)
15035         (Attribute.ScanForIndexerName): Update to reflect changes.
15036         (Attribute.CheckAttributeTarget): Re-format.
15037         (Attribute.ApplyAttributes): Refactor, to various
15038         Attributable.ApplyAttributeBuilder methods.
15039         * decl.cs (MemberCore): Make Attributable.
15040         * class.cs (Accessor): Make Attributable.
15041         (MethodData.ApplyAttributes): Use proper attribute types, not
15042         attribute names.
15043         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
15044         (TypeContainer.ApplyAttributeBuilder)
15045         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
15046         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
15047         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
15048         (Operator.ApplyAttributeBuilder): New factored-out methods.
15049         * const.cs (Const.ApplyAttributeBuilder): Likewise.
15050         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
15051         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
15052         * parameter.cs (ParameterBase): New Attributable base class
15053         that can also represent Return types.
15054         (Parameter): Update to the changes.
15055
15056 2004-04-29  Jackson Harper  <jackson@ximian.com>
15057
15058         * driver.cs: Prefer the corlib system version when looking for
15059         assemblies in the GAC. This is still a hack, but its a better hack
15060         now.
15061         
15062 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
15063
15064         * decl.cs, enum.cs: Improved error 3005 reporting.
15065   
15066         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
15067         (related_symbols): New private member for list of symbols
15068         related to reported error/warning.
15069         
15070         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
15071
15072 2004-04-29  Martin Baulig  <martin@ximian.com>
15073
15074         * ecore.cs (Expression.Constantify): If we're an enum and
15075         TypeManager.TypeToCoreType() doesn't give us another type, use
15076         t.UnderlyingSystemType.  Fixes #56178.  
15077
15078 2004-04-29  Martin Baulig  <martin@ximian.com>
15079
15080         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
15081         interfaces and for each interface, only add members directly
15082         declared in that interface.  Fixes #53255.
15083
15084 2004-04-28  Martin Baulig  <martin@ximian.com>
15085
15086         * expression.cs (ConditionalLogicalOperator): Use a temporary
15087         variable for `left' to avoid that we evaluate it more than once;
15088         bug #52588.
15089
15090 2004-04-28  Martin Baulig  <martin@ximian.com>
15091
15092         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
15093         `void[]' (CS1547).
15094
15095 2004-04-28  Martin Baulig  <martin@ximian.com>
15096
15097         * statement.cs (LocalInfo.Resolve): Check whether the type is not
15098         void (CS1547).
15099
15100         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
15101         whether the type is not void (CS1547).
15102
15103 2004-04-28  Martin Baulig  <martin@ximian.com>
15104
15105         * expression.cs (Unary.DoResolveLValue): Override this and report
15106         CS0131 for anything but Operator.Indirection.
15107
15108 2004-04-28  Martin Baulig  <martin@ximian.com>
15109
15110         Committing a patch from Ben Maurer; see bug #50820.
15111
15112         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15113         check for classes.
15114
15115         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15116         classes.        
15117
15118 2004-04-28  Martin Baulig  <martin@ximian.com>
15119
15120         Committing a patch from Ben Maurer; see bug #50820.
15121
15122         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15123         check for classes.
15124
15125         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15126         classes.        
15127
15128 2004-04-28  Martin Baulig  <martin@ximian.com>
15129
15130         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
15131         (Block.AddLabel): Call DoLookupLabel() to only search in the
15132         current block.
15133
15134 2004-04-28  Martin Baulig  <martin@ximian.com>
15135
15136         * cfold.cs (ConstantFold.BinaryFold): Added special support for
15137         comparing StringConstants and NullLiterals in Equality and Inequality.
15138
15139 2004-04-28  Jackson Harper  <jackson@ximian.com>
15140
15141         * driver.cs: Attempt to load referenced assemblies from the
15142         GAC. This is the quick and dirty version of this method that
15143         doesnt take into account versions and just takes the first
15144         canidate found. Will be good enough for now as we will not have more
15145         then one version installed into the GAC until I update this method.
15146
15147 2004-04-28  Martin Baulig  <martin@ximian.com>
15148
15149         * typemanager.cs (TypeManager.CheckStructCycles): New public
15150         static method to check for cycles in the struct layout.
15151
15152         * rootcontext.cs (RootContext.PopulateTypes): Call
15153         TypeManager.CheckStructCycles() for each TypeContainer.
15154         [Note: We only need to visit each type once.]
15155
15156 2004-04-28  Martin Baulig  <martin@ximian.com>
15157
15158         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
15159
15160         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
15161         success and added `out object value'.  Use a `bool resolved' field
15162         to check whether we've already been called rather than
15163         `ConstantValue != null' since this breaks for NullLiterals.
15164
15165 2004-04-28  Raja R Harinath  <rharinath@novell.com>
15166
15167         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
15168         setting of this flag, since the 'set' method may be non-public.
15169
15170 2004-04-28  Raja R Harinath  <rharinath@novell.com>
15171
15172         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
15173         check on current_vector.Block.
15174
15175 2004-04-27  Martin Baulig  <martin@ximian.com>
15176
15177         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
15178         a field initializer.  Fixes #56459.
15179
15180 2004-04-27  Martin Baulig  <martin@ximian.com>
15181
15182         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
15183         we're not attempting to use an indexer.  Fixes #52154.
15184
15185 2004-04-27  Martin Baulig  <martin@ximian.com>
15186
15187         * statement.cs (Return): Don't create a return label if we don't
15188         need it; reverts my change from January 20th.  Thanks to Ben
15189         Maurer for this.
15190
15191 2004-04-27  Martin Baulig  <martin@ximian.com>
15192
15193         According to the spec, `goto' can only leave a nested scope, but
15194         never enter it.
15195
15196         * statement.cs (Block.LookupLabel): Only lookup in the current
15197         block, don't recurse into parent or child blocks.
15198         (Block.AddLabel): Check in parent and child blocks, report
15199         CS0140/CS0158 if we find a duplicate.
15200         (Block): Removed this indexer for label lookups.
15201         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
15202         this already does the error reporting for us.
15203
15204         * flowanalysis.cs
15205         (FlowBranching.UsageVector.Block): New public variable; may be null.
15206         (FlowBranching.CreateSibling): Added `Block' argument.
15207         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
15208         label for the target of a `goto' and check whether we're not
15209         leaving a `finally'.
15210
15211 2004-04-27  Martin Baulig  <martin@ximian.com>
15212
15213         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15214         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
15215         just for returns).
15216
15217 2004-04-27  Martin Baulig  <martin@ximian.com>
15218
15219         * statement.cs (Block.AddLabel): Also check for implicit blocks
15220         and added a CS0158 check.
15221
15222 2004-04-27  Martin Baulig  <martin@ximian.com>
15223
15224         * flowanalysis.cs (FlowBranchingLoop): New class.
15225         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
15226         UsageVector's instead of an ArrayList.
15227         (FlowBranching.Label): Likewise.
15228         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
15229         (FlowBranching.AddBreakVector): New method.
15230
15231 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
15232
15233         * attribute.cs: Small regression fix: only convert the type if we
15234         the type is different, fixes System.Drawing build.
15235
15236 2004-04-27  Martin Baulig  <martin@ximian.com>
15237
15238         * attribute.cs (Attribute.Resolve): If we have a constant value
15239         for a named field or property, implicity convert it to the correct
15240         type.
15241
15242 2004-04-27  Raja R Harinath  <rharinath@novell.com>
15243
15244         * statement.cs (Block.Block): Implicit blocks share
15245         'child_variable_names' fields with parent blocks.
15246         (Block.AddChildVariableNames): Remove.
15247         (Block.AddVariable): Mark variable as "used by a child block" in
15248         every surrounding block.
15249         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
15250         been used in a child block, complain about violation of "Invariant
15251         meaning in blocks" rule.
15252         * cs-parser.jay (declare_local_variables): Don't use
15253         AddChildVariableNames.
15254         (foreach_statement): Don't create an implicit block: 'foreach'
15255         introduces a scope.
15256
15257 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
15258
15259         * convert.cs (ImplicitNumericConversion): 0 is also positive when
15260         converting from 0L to ulong.  Fixes 57522.
15261
15262 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15263
15264         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15265         derived class hides via 'new' keyword field from base class (test-242.cs).
15266         TODO: Handle this in the more general way.
15267         
15268         * class.cs (CheckBase): Ditto.
15269
15270 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15271
15272         * decl.cs (caching_flags): New member for storing cached values
15273         as bit flags.
15274         (MemberCore.Flags): New enum where bit flags for caching_flags
15275         are defined.
15276         (MemberCore.cls_compliance): Moved to caching_flags.
15277         (DeclSpace.Created): Moved to caching_flags.
15278
15279         * class.cs: Use caching_flags instead of DeclSpace.Created
15280         
15281 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
15282
15283         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15284         if we are only a derived class, not a nested class.
15285
15286         * typemanager.cs: Same as above, but do this at the MemberLookup
15287         level (used by field and methods, properties are handled in
15288         PropertyExpr).   Allow for the qualified access if we are a nested
15289         method. 
15290
15291 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
15292
15293         * class.cs: Refactoring.
15294         (IMethodData): New inteface; Holds links to parent members
15295         to avoid member duplication (reduced memory allocation).
15296         (Method): Implemented IMethodData interface.
15297         (PropertyBase): New inner classes for get/set methods.
15298         (PropertyBase.PropertyMethod): Implemented IMethodData interface
15299         (Event): New inner classes for add/remove methods.
15300         (Event.DelegateMethod): Implemented IMethodData interface.
15301
15302         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15303         EmitContext (related to class.cs refactoring).
15304
15305 2004-04-21  Raja R Harinath  <rharinath@novell.com>
15306
15307         * delegate.cs (Delegate.VerifyApplicability): If the number of
15308         arguments are the same as the number of parameters, first try to
15309         verify applicability ignoring  any 'params' modifier on the last
15310         parameter.
15311         Fixes #56442.
15312
15313 2004-04-16  Raja R Harinath  <rharinath@novell.com>
15314
15315         * class.cs (TypeContainer.AddIndexer): Use
15316         'ExplicitInterfaceName' to determine if interface name was
15317         explicitly specified.  'InterfaceType' is not initialized at this time.
15318         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
15319         Indexers array is already in the required order.  Initialize
15320         'IndexerName' only if there are normal indexers.
15321         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15322         (TypeContainer.Emit): Emit DefaultMember attribute only if
15323         IndexerName is initialized.
15324         Fixes #56300.
15325
15326 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
15327
15328         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15329         Fixes #57007
15330
15331 2004-04-15  Raja R Harinath  <rharinath@novell.com>
15332
15333         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15334         attributes.
15335         Fix for #56456.
15336
15337         * attribute.cs (Attribute.Resolve): Check for duplicate named
15338         attributes.
15339         Fix for #56463.
15340
15341 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
15342
15343         * iterators.cs (MarkYield): track whether we are in an exception,
15344         and generate code accordingly.  Use a temporary value to store the
15345         result for our state.
15346
15347         I had ignored a bit the interaction of try/catch with iterators
15348         since their behavior was not entirely obvious, but now it is
15349         possible to verify that our behavior is the same as MS .NET 2.0
15350
15351         Fixes 54814
15352
15353 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
15354
15355         * iterators.cs: Avoid creating temporaries if there is no work to
15356         do. 
15357
15358         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15359         Enumerations, use TypeManager.EnumToUnderlying and call
15360         recursively. 
15361
15362         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15363         bug #57013
15364
15365         (This.Emit): Use EmitContext.EmitThis to emit our
15366         instance variable.
15367
15368         (This.EmitAssign): Ditto.
15369
15370         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15371         codepaths, we will move all the functionality into
15372         Mono.CSharp.This 
15373
15374         (FieldExpr.EmitAssign): Ditto.
15375
15376         This fixes several hidden bugs that I uncovered while doing a code
15377         review of this today.
15378
15379         * codegen.cs (EmitThis): reworked so the semantics are more clear
15380         and also support value types "this" instances.
15381
15382         * iterators.cs: Changed so that for iterators in value types, we
15383         do not pass the value type as a parameter.  
15384
15385         Initialization of the enumerator helpers is now done in the caller
15386         instead of passing the parameters to the constructors and having
15387         the constructor set the fields.
15388
15389         The fields have now `assembly' visibility instead of private.
15390
15391 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
15392
15393         * expression.cs (Argument.Resolve): Check if fields passed as ref
15394         or out are contained in a MarshalByRefObject.
15395
15396         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15397         another compiler type.
15398
15399 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15400
15401         * class.cs (Indexer.Define): use the new name checking method.
15402         Also, return false on an error.
15403         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15404         (is_identifier_[start/part]_character): make static.
15405
15406 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
15407
15408         * expression.cs (Binary.ResolveOperator): Do no append strings
15409         twice: since we can be invoked more than once (array evaluation)
15410         on the same concatenation, take care of this here.  Based on a fix
15411         from Ben (bug #56454)
15412
15413 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
15414
15415         * codegen.cs: Fix another case where CS1548 must be reported (when 
15416         delay-sign isn't specified and no private is available #56564). Fix
15417         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
15418         error when MCS is used on the MS runtime and we need to delay-sign 
15419         (which seems unsupported by AssemblyBuilder - see #56621).
15420
15421 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
15422
15423         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15424         (TypeManager.ComputeNamespaces): Faster implementation for
15425         Microsoft runtime.
15426
15427         * compiler.csproj: Updated AssemblyName to mcs.
15428
15429 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
15430
15431         * rootcontext.cs: Add new types to the boot resolution.
15432
15433         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15434         MulticastDelegate is not allowed.
15435
15436         * typemanager.cs: Add new types to lookup: System.TypedReference
15437         and ArgIterator.
15438
15439         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15440         check for TypedReference or ArgIterator, they are not allowed. 
15441
15442         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15443         makes us properly catch 1510 in some conditions (see bug 56016 for
15444         details). 
15445
15446 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
15447
15448         * CryptoConvert.cs: update from corlib version
15449         with endian fixes.
15450
15451 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
15452
15453         * class.cs (Indexer.Define): Check indexername declaration
15454
15455 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
15456
15457         * attribute.cs (IsClsCompliant): Fixed problem with handling
15458         all three states (compliant, not-compliant, undetected).
15459
15460 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
15461
15462         * attribute.cs (Attribute): Location is now public.
15463         (Resolve): Store resolved arguments (pos_values) in attribute class.
15464         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15465         (GetClsCompliantAttributeValue): New method that gets
15466         CLSCompliantAttribute value.
15467         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15468         if exists else null.
15469         (AttributeTester): New class for CLS-Compliant verification routines.
15470
15471         * class.cs (Emit): Add CLS-Compliant verification.
15472         (Method.GetSignatureForError): Implemented.
15473         (Constructor.GetSignatureForError): Implemented
15474         (Constructor.HasCompliantArgs): Returns if constructor has
15475         CLS-Compliant arguments.
15476         (Constructor.Emit): Override.
15477         (Construcor.IsIdentifierClsCompliant): New method; For constructors
15478         is needed to test only parameters.
15479         (FieldBase.GetSignatureForError): Implemented.
15480         (TypeContainer): New member for storing base interfaces.
15481         (TypeContainer.FindMembers): Search in base interfaces too.
15482
15483         * codegen.cs (GetClsComplianceAttribute): New method that gets
15484         assembly or module CLSCompliantAttribute value.
15485         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15486         for assembly.
15487         (ModuleClass.Emit): Add error 3012 test.
15488
15489         * const.cs (Emit): Override and call base for CLS-Compliant tests.
15490
15491         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15492         state for all decl types.
15493         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15494         if CLS-Compliant tests are required.
15495         (IsClsCompliaceRequired): New method. Analyze whether code
15496         must be CLS-Compliant.
15497         (IsExposedFromAssembly): New method. Returns true when MemberCore
15498         is exposed from assembly.
15499         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15500         value or gets cached value.
15501         (HasClsCompliantAttribute): New method. Returns true if MemberCore
15502         is explicitly marked with CLSCompliantAttribute.
15503         (IsIdentifierClsCompliant): New abstract method. This method is
15504         used to testing error 3005.
15505         (IsIdentifierAndParamClsCompliant): New method. Common helper method
15506         for identifier and parameters CLS-Compliant testing.
15507         (VerifyClsCompliance): New method. The main virtual method for
15508         CLS-Compliant verifications.
15509         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15510         null. I don't know why is null (too many public members !).
15511         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15512         and get value of first CLSCompliantAttribute that found.
15513
15514         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15515         (VerifyClsCompliance): Override and add extra tests.
15516
15517         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15518         clscheck- disable CLS-Compliant verification event if assembly is has
15519         CLSCompliantAttribute(true).
15520
15521         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15522         ApllyAttribute is now called in emit section as in the other cases.
15523         Possible future Emit integration.
15524         (IsIdentifierClsCompliant): New override.
15525         (VerifyClsCompliance): New override.
15526         (GetEnumeratorName): Returns full enum name.
15527
15528         * parameter.cs (GetSignatureForError): Implemented.
15529
15530         * report.cs (WarningData): New struct for Warning message information.
15531         (LocationOfPreviousError): New method.
15532         (Warning): New method. Reports warning based on the warning table.
15533         (Error_T): New method. Reports error based on the error table.
15534
15535         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15536         verifications are done here.
15537
15538         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15539
15540         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15541         CLSCompliantAttribute.
15542         (all_imported_types): New member holds all imported types from other
15543         assemblies.
15544         (LoadAllImportedTypes): New method fills static table with exported types
15545         from all referenced assemblies.
15546         (Modules): New property returns all assembly modules.
15547
15548 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
15549
15550         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15551         throwing a parser error.
15552
15553         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15554         which removes the hardcoded get_/set_ prefixes for properties, as
15555         IL allows for the properties to be named something else.  
15556
15557         Bug #56013
15558
15559         * expression.cs: Do not override operand before we know if it is
15560         non-null.  Fix 56207
15561
15562 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15563
15564         * typemanager.cs: support for pinned variables.
15565
15566 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15567
15568         * decl.cs, typemanager.cs: Avoid using an arraylist
15569         as a buffer if there is only one result set.
15570
15571 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15572
15573         * expression.cs: Make sure you cant call a static method
15574         with an instance expression, bug #56174.
15575
15576 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
15577
15578         * class.cs (IsDuplicateImplementation): Improve error reporting to
15579         flag 663 (method only differs in parameter modifier).
15580
15581         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15582         in preprocessor directives.
15583
15584         * location.cs (LookupFile): Allow for the empty path.
15585
15586         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
15587         better approach for some of that patch, but its failing with the
15588         CharSet enumeration.  For now try/catch will do.
15589
15590         * typemanager.cs: Do not crash if a struct does not have fields.
15591         Fixes 56150.
15592
15593 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15594
15595         * expression.cs: cs0213, cant fix a fixed expression.
15596         fixes 50231.
15597
15598 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15599
15600         * cs-parser.jay: detect invalid embeded statements gracefully.
15601         bug #51113.
15602
15603 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15604
15605         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15606         As a regex:
15607         s/
15608         the invocation type may not be a subclass of the tye of the item/
15609         The type of the item must be a subclass of the invocation item.
15610         /g
15611
15612         Fixes bug #50820.
15613
15614 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
15615
15616         * attribute.cs: Added methods to get a string and a bool from an
15617         attribute. Required to information from AssemblyKeyFileAttribute,
15618         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15619         * codegen.cs: Modified AssemblyName creation to include support for
15620         strongnames. Catch additional exceptions to report them as CS1548.
15621         * compiler.csproj: Updated include CryptoConvert.cs.
15622         * compiler.csproj.user: Removed file - user specific configuration.
15623         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
15624         Mono.Security assembly. The original class is maintained and tested in
15625         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15626         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15627         like CSC 8.0 (C# v2) supports.
15628         * Makefile: Added CryptoConvert.cs to mcs sources.
15629         * rootcontext.cs: Added new options for strongnames.
15630
15631 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
15632
15633         * driver.cs: For --expect-error, report error code `2'
15634         if the program compiled with no errors, error code `1' if
15635         it compiled with an error other than the one expected.
15636
15637 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
15638
15639         * compiler.csproj: Updated for Visual Studio .NET 2003.
15640         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15641         * compiler.sln: Updated for Visual Studio .NET 2003.
15642
15643 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
15644
15645         * expression.cs: Fix bug #47234. We basically need to apply the
15646         rule that we prefer the conversion of null to a reference type
15647         when faced with a conversion to 'object' (csc behaviour).
15648
15649 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15650
15651         * statement.cs: Shorter form for foreach, eliminates
15652         a local variable. r=Martin.
15653
15654 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15655
15656         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15657         checks if we can use brtrue/brfalse to test for 0.
15658         * expression.cs: use the above in the test for using brtrue/brfalse.
15659         cleanup code a bit.
15660
15661 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15662
15663         * expression.cs: Rewrite string concat stuff. Benefits:
15664
15665         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15666         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15667         rather than a concat chain.
15668
15669         * typemanager.cs: Add lookups for more concat overloads.
15670
15671 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15672
15673         * expression.cs: Emit shorter il code for array init.
15674
15675         newarr
15676         dup
15677         // set 1
15678
15679         // set 2
15680
15681         newarr
15682         stloc.x
15683
15684         ldloc.x
15685         // set 1
15686
15687         ldloc.x
15688         // set 2
15689
15690 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
15691
15692         * statement.cs: Before, two switch blocks would be merged if the
15693         total size of the blocks (end_item - begin_item + 1) was less than
15694         two times the combined sizes of the blocks.
15695
15696         Now, it will only merge if after the merge at least half of the
15697         slots are filled.
15698
15699         fixes 55885.
15700
15701 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
15702
15703         * class.cs : csc build fix for GetMethods(). See bug #52503.
15704
15705 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
15706
15707         * expression.cs: Make sure fp comparisons work with NaN.
15708         This fixes bug #54303. Mig approved this patch a long
15709         time ago, but we were not able to test b/c the runtime
15710         had a related bug.
15711
15712 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
15713
15714         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
15715
15716 2004-03-19  Martin Baulig  <martin@ximian.com>
15717
15718         * class.cs (MemberCore.IsDuplicateImplementation): Report the
15719         error here and not in our caller.
15720
15721 2004-03-19  Martin Baulig  <martin@ximian.com>
15722
15723         * interface.cs: Completely killed this file.
15724         (Interface): We're now a TypeContainer and live in class.cs.
15725
15726         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15727         argument; we're now also called for interfaces.
15728         (TypeContainer.DefineMembers): Allow this method being called
15729         multiple times.
15730         (TypeContainer.GetMethods): New public method; formerly known as
15731         Interface.GetMethod().  This is used by PendingImplementation.
15732         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15733         it's now private and non-static.
15734         (Interface): Moved this here; it's now implemented similar to
15735         Class and Struct.
15736         (Method, Property, Event, Indexer): Added `bool is_interface'
15737         argument to their .ctor's.
15738         (MemberBase.IsInterface): New public field.
15739
15740         * cs-parser.jay: Create normal Method, Property, Event, Indexer
15741         instances instead of InterfaceMethod, InterfaceProperty, etc.
15742         (opt_interface_base): Removed; we now use `opt_class_base' instead.
15743         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15744
15745 2004-03-19  Martin Baulig  <martin@ximian.com>
15746
15747         * class.cs (MethodCore.IsDuplicateImplementation): New private
15748         method which does the CS0111 checking.
15749         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15750         Use IsDuplicateImplementation().
15751
15752 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
15753
15754         * decl.cs (FindMemberToOverride): New method to find the correct
15755         method or property to override in the base class.
15756         * class.cs
15757             - Make Method/Property use the above method to find the
15758               version in the base class.
15759             - Remove the InheritableMemberSignatureCompare as it is now
15760               dead code.
15761
15762         This patch makes large code bases much faster to compile, as it is
15763         O(n) rather than O(n^2) to do this validation.
15764
15765         Also, it fixes bug 52458 which is that nested classes are not
15766         taken into account when finding the base class member.
15767
15768         Reviewed/Approved by Martin.
15769
15770 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
15771
15772         * interface.cs: In all interface classes removed redundant
15773         member initialization.
15774
15775 2004-03-16  Martin Baulig  <martin@ximian.com>
15776
15777         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15778
15779 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
15780
15781         * decl.cs (DefineTypeAndParents): New helper method to define a
15782         type's containers before the type itself is defined;  This is a
15783         bug exposed by the recent changes to Windows.Forms when an
15784         implemented interface was defined inside a class that had not been
15785         built yet.   
15786
15787         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15788
15789         (Check): Loop correctly to report errors modifiers
15790         (UNSAFE was not in the loop, since it was the same as TOP).
15791
15792         * interface.cs: Every interface member now takes a ModFlags,
15793         instead of a "is_new" bool, which we set on the base MemberCore. 
15794
15795         Every place where we called "UnsafeOk" in the interface, now we
15796         call the proper member (InterfaceMethod.UnsafeOK) instead to get
15797         the unsafe settings from the member declaration instead of the
15798         container interface. 
15799
15800         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
15801
15802         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15803         `set_indexer_name' to the pending bits (one per type).
15804
15805         We fixed a bug today that was picking the wrong method to
15806         override, since for properties the existing InterfaceMethod code
15807         basically ignored the method name.  Now we make sure that the
15808         method name is one of the valid indexer names.
15809
15810 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
15811  
15812         * support.cs (SeekableStreamReader): Keep track of stream byte
15813         positions and don't mix them with character offsets to the buffer.
15814
15815         Patch from Gustavo Giráldez
15816
15817 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
15818
15819         * interface.cs (InterfaceSetGetBase): Removed double member
15820         initialization, base class does it as well.
15821
15822 2004-03-13  Martin Baulig  <martin@ximian.com>
15823
15824         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15825         when compiling corlib.
15826
15827 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
15828
15829         * convert.cs (ExplicitConversion): We were reporting an error on
15830         certain conversions (object_type source to a value type, when the
15831         expression was `null') before we had a chance to pass it through
15832         the user defined conversions.
15833
15834         * driver.cs: Replace / and \ in resource specifications to dots.
15835         Fixes 50752
15836
15837         * class.cs: Add check for duplicate operators.  Fixes 52477
15838
15839 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
15840
15841         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15842         that are in the middle of the statements, not only at the end.
15843         Fixes #54987
15844
15845         * class.cs (TypeContainer.AddField): No longer set the
15846         `HaveStaticConstructor' flag, now we call it
15847         `UserDefineStaticConstructor' to diferentiate the slightly
15848         semantic difference.
15849
15850         The situation is that we were not adding BeforeFieldInit (from
15851         Modifiers.TypeAttr) to classes that could have it.
15852         BeforeFieldInit should be set to classes that have no static
15853         constructor. 
15854
15855         See:
15856
15857         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15858
15859         And most importantly Zoltan's comment:
15860
15861         http://bugzilla.ximian.com/show_bug.cgi?id=44229
15862
15863         "I think beforefieldinit means 'it's ok to initialize the type sometime 
15864          before its static fields are used', i.e. initialization does not need
15865          to be triggered by the first access to the type. Setting this flag
15866          helps the JIT to compile better code, since it can run the static
15867          constructor at JIT time, and does not need to generate code to call it
15868          (possibly lots of times) at runtime. Unfortunately, mcs does not set
15869          this flag for lots of classes like String. 
15870          
15871          csc sets this flag if the type does not have an explicit static 
15872          constructor. The reasoning seems to be that if there are only static
15873          initalizers for a type, and no static constructor, then the programmer
15874          does not care when this initialization happens, so beforefieldinit
15875          can be used.
15876          
15877          This bug prevents the AOT compiler from being usable, since it 
15878          generates so many calls to mono_runtime_class_init that the AOT code
15879          is much slower than the JITted code. The JITted code is faster, 
15880          because it does not generate these calls if the vtable is type is
15881          already initialized, which is true in the majority of cases. But the
15882          AOT compiler can't do this."
15883
15884 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
15885
15886         * class.cs (MethodData.Emit): Refactor the code so symbolic
15887         information is generated for destructors;  For some reasons we
15888         were taking a code path that did not generate symbolic information
15889         before. 
15890
15891 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15892
15893         * class.cs: Create a Constructor.CheckBase method that
15894         takes care of all validation type code. The method
15895         contains some code that was moved from Define.
15896
15897         It also includes new code that checks for duplicate ctors.
15898         This fixes bug #55148.
15899
15900 2004-03-09  Joshua Tauberer <tauberer@for.net>
15901
15902         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15903         a { ... }-style array creation invokes EmitStaticInitializers
15904         which is not good for reference-type arrays.  String, decimal
15905         and now null constants (NullCast) are not counted toward
15906         static initializers.
15907
15908 2004-03-05  Martin Baulig  <martin@ximian.com>
15909
15910         * location.cs (SourceFile.HasLineDirective): New public field;
15911         specifies whether the file contains or is referenced by a "#line"
15912         directive.
15913         (Location.DefineSymbolDocuments): Ignore source files which
15914         either contain or are referenced by a "#line" directive.        
15915
15916 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
15917
15918         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15919         direct access to our parent, so check the method inline there.
15920
15921 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15922
15923         * expression.cs (Invocation.EmitCall): Miguel's last commit
15924         caused a regression. If you had:
15925
15926             T t = null;
15927             t.Foo ();
15928
15929         In Foo the implict this would be null.
15930
15931 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
15932
15933         * expression.cs (Invocation.EmitCall): If the method is not
15934         virtual, do not emit a CallVirt to it, use Call.
15935
15936         * typemanager.cs (GetFullNameSignature): Improve the method to
15937         cope with ".ctor" and replace it with the type name.
15938
15939         * class.cs (ConstructorInitializer.Resolve): Now the method takes
15940         as an argument the ConstructorBuilder where it is being defined,
15941         to catch the recursive constructor invocations.
15942
15943 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
15944
15945         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
15946         routines to check if a type is an enumerable/enumerator allow
15947         classes that implement the IEnumerable or IEnumerator interfaces.
15948
15949         * class.cs (Property, Operator): Implement IIteratorContainer, and
15950         implement SetYields.
15951
15952         (Property.Define): Do the block swapping for get_methods in the
15953         context of iterators.   We need to check if Properties also
15954         include indexers or not.
15955
15956         (Operator): Assign the Block before invoking the
15957         OperatorMethod.Define, so we can trigger the Iterator code
15958         replacement. 
15959
15960         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
15961         Property and Operator classes are not created when we parse the
15962         declarator but until we have the block completed, so we use a
15963         singleton SimpleIteratorContainer.Simple to flag whether the
15964         SetYields has been invoked.
15965
15966         We propagate this setting then to the Property or the Operator to
15967         allow the `yield' to function.
15968
15969 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
15970
15971         * codegen.cs: Implemented attribute support for modules.
15972         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
15973         Assembly/Module functionality.
15974
15975         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
15976         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
15977         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
15978
15979 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
15980
15981         * interface.cs (FindMembers): The operation is performed on all base
15982         interfaces and not only on the first. It is required for future CLS Compliance patch.
15983
15984 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
15985
15986         * statement.cs, codegen.cs:
15987         This patch deals with patterns such as:
15988
15989         public class List : IEnumerable {
15990
15991                 public MyEnumerator GetEnumerator () {
15992                         return new MyEnumerator(this);
15993                 }
15994
15995                 IEnumerator IEnumerable.GetEnumerator () {
15996                         ...
15997                 }
15998                 
15999                 public struct MyEnumerator : IEnumerator {
16000                         ...
16001                 }
16002         }
16003
16004         Before, there were a few things we did wrong:
16005         1) we would emit callvirt on a struct, which is illegal
16006         2) we emited ldarg when we needed to emit ldarga
16007         3) we would mistakenly call the interface methods on an enumerator
16008         type that derived from IEnumerator and was in another assembly. For example:
16009
16010         public class MyEnumerator : IEnumerator
16011
16012         Would have the interface methods called, even if there were public impls of the
16013         method. In a struct, this lead to invalid IL code.
16014
16015 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
16016
16017         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
16018           renamed to Emit.
16019
16020         * delegate.cs (Define): Fixed crash when delegate type is undefined.
16021
16022 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
16023
16024         * cs-parser.jay: Fix small regression: we were not testing V2
16025         compiler features correctly.
16026
16027         * interface.cs: If the emit context is null, then create one
16028
16029 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
16030
16031         * decl.cs (GetSignatureForError): New virtual method to get full name
16032           for error messages.
16033
16034         * attribute.cs (IAttributeSupport): New interface for attribute setting.
16035           Now it is possible to rewrite ApplyAttributes method to be less if/else.
16036
16037         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
16038           Duplicated members and code in these classes has been removed.
16039           Better encapsulation in these classes.
16040
16041 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
16042
16043         * assign.cs (Assign.DoResolve): When dealing with compound
16044         assignments, there is a new rule in ECMA C# 2.4 (might have been
16045         there before, but it is documented here) that states that in:
16046
16047         a op= b;
16048
16049         If b is of type int, and the `op' is a shift-operator, then the
16050         above is evaluated as:
16051
16052         a = (int) a op b 
16053
16054         * expression.cs (Binary.ResolveOperator): Instead of testing for
16055         int/uint/long/ulong, try to implicitly convert to any of those
16056         types and use that in pointer arithmetic.
16057
16058         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
16059         method to print information for from the type, not from the
16060         null-method we were given.
16061
16062 2004-02-01  Duncan Mak  <duncan@ximian.com>
16063
16064         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
16065         parsing for cmd, fixes bug #53694.
16066
16067 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
16068
16069         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
16070         in the member name duplication tests. Property and operator name duplication
16071         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
16072
16073 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
16074
16075         * interface.cs (PopulateMethod): Fixed crash when interface method
16076         returns not existing type (error test cs0246-3.cs).
16077
16078 2004-02-02  Ravi Pratap M <ravi@ximian.com>
16079
16080         * cs-parser.jay (interface_accessors): Re-write actions to also
16081         store attributes attached to get and set methods. Fix spelling
16082         while at it.
16083
16084         (inteface_property_declaration): Modify accordingly.
16085
16086         (InterfaceAccessorInfo): New helper class to store information to pass
16087         around between rules that use interface_accessors.
16088
16089         * interface.cs (Emit): Apply attributes on the get and set
16090         accessors of properties and indexers too.
16091
16092         * attribute.cs (ApplyAttributes): Modify accordingly to use the
16093         right MethodBuilder when applying attributes to the get and set accessors.
16094
16095 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
16096
16097         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
16098
16099 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
16100
16101         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
16102
16103 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
16104
16105         * cs-parser.jay: Remove YIELD token, instead use the new grammar
16106         changes that treat `yield' specially when present before `break'
16107         or `return' tokens.
16108
16109         * cs-tokenizer.cs: yield is no longer a keyword.
16110
16111 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
16112
16113         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
16114         setting for default constructors.
16115         For default constructors are almost every time set wrong Modifier. The
16116         generated IL code has been alright. But inside mcs this values was
16117         wrong and this was reason why several of my CLS Compliance tests
16118         failed.
16119
16120 2004-01-22  Martin Baulig  <martin@ximian.com>
16121
16122         * cs-parser.jay (namespace_or_type_name): Return an Expression,
16123         not a QualifiedIdentifier.  This is what `type_name_expression'
16124         was previously doing.
16125         (type_name_expression): Removed; the code is now in
16126         `namespace_or_type_name'.
16127         (qualified_identifier): Removed, use `namespace_or_type_name'
16128         instead.
16129         (QualifiedIdentifier): Removed this class.      
16130
16131 2004-01-22  Martin Baulig  <martin@ximian.com>
16132
16133         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
16134         not a string as alias name.
16135
16136 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
16137
16138         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
16139         #52730 bug, and instead compute correctly the need to use a
16140         temporary variable when requesting an address based on the
16141         static/instace modified of the field and the constructor.
16142  
16143 2004-01-21  Martin Baulig  <martin@ximian.com>
16144
16145         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
16146         class and namespace before looking up aliases.  Fixes #52517.
16147
16148 2004-01-21  Martin Baulig  <martin@ximian.com>
16149
16150         * flowanalysis.cs (UsageVector.Merge): Allow variables being
16151         assinged in a 'try'; fixes exception4.cs.
16152
16153 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16154         * class.cs : Implemented parameter-less constructor for TypeContainer
16155
16156         * decl.cs: Attributes are now stored here. New property OptAttributes
16157
16158         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
16159
16160         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
16161
16162 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16163
16164         * typemanager.cs (CSharpSignature): Now reports also inner class name.
16165           (CSharpSignature): New method for indexer and property signature.
16166
16167 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16168
16169         * pending.cs (IsVirtualFilter): Faster implementation.
16170
16171 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16172
16173         * typemanager.cs: Avoid inclusion of same assembly more than once.
16174
16175 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16176
16177         * cs-parser.jay: Fixed problem where the last assembly attribute
16178           has been applied also to following declaration (class, struct, etc.)
16179           
16180 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16181
16182         * class.cs: Added error CS0538, CS0539 reporting.
16183         Fixed crash on Microsoft runtime when field type is void.
16184
16185         * cs-parser.jay: Added error CS0537 reporting.
16186
16187         * pending.cs: Added error CS0535 reporting.
16188         Improved error report for errors CS0536, CS0534.
16189
16190 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
16191
16192         Merge a few bits from the Anonymous Method MCS tree.
16193
16194         * statement.cs (ToplevelBlock): New class for toplevel methods,
16195         will hold anonymous methods, lifted variables.
16196
16197         * cs-parser.jay: Create toplevel blocks for delegates and for
16198         regular blocks of code. 
16199
16200 2004-01-20  Martin Baulig  <martin@ximian.com>
16201
16202         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
16203         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
16204         and `NeedExplicitReturn'; added `IsLastStatement'.
16205         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
16206         have a `ReturnLabel' or we're not unreachable.
16207
16208         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
16209         child's reachability; don't just override ours with it.  Fixes
16210         #58058 (lluis's example).
16211         (FlowBranching): Added public InTryOrCatch(), InCatch(),
16212         InFinally(), InLoop(), InSwitch() and
16213         BreakCrossesTryCatchBoundary() methods.
16214
16215         * statement.cs (Return): Do all error checking in Resolve().
16216         Unless we are the last statement in a top-level block, always
16217         create a return label and jump to it.
16218         (Break, Continue): Do all error checking in Resolve(); also make
16219         sure we aren't leaving a `finally'.
16220         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
16221         statement in a top-level block.
16222         (Block.Flags): Added `IsDestructor'.
16223         (Block.IsDestructor): New public property.
16224
16225 2004-01-20  Martin Baulig  <martin@ximian.com>
16226
16227         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
16228
16229 2004-01-20  Martin Baulig  <martin@ximian.com>
16230
16231         * statement.cs (Statement.ResolveUnreachable): New public method.
16232         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
16233         (Block.Resolve): Resolve unreachable statements.
16234
16235 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
16236
16237         * expression.cs: We need to fix the case where we do
16238         not have a temp variable here.
16239
16240         * assign.cs: Only expression compound assignments need
16241         temporary variables.
16242
16243 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
16244
16245         * flowanalysis.cs: Reduce memory allocation in a few ways:
16246           - A block with no variables should not allocate a bit
16247             vector for itself.
16248           - A method with no out parameters does not need any tracking
16249             for assignment of the parameters, so we need not allocate
16250             any data for it.
16251           - The arrays:
16252                 public readonly Type[] VariableTypes;
16253                 public readonly string[] VariableNames;
16254             Are redundant. The data is already stored in the variable
16255             map, so we need not allocate another array for it.
16256           - We need to add alot of checks for if (params | locals) == null
16257             due to the first two changes.
16258
16259 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
16260
16261         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16262         implement IMemoryLocation, we store a copy on a local variable and
16263         take the address of it.  Patch from Benjamin Jemlich
16264
16265         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16266         to use a special "type_name_expression" rule which reduces the
16267         number of "QualifiedIdentifier" classes created, and instead
16268         directly creates MemberAccess expressions.
16269
16270 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
16271
16272         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16273         that fixes #52853.  Null literal assignment to ValueType
16274
16275         * class.cs (MethodData.Emit): Instead of checking the name of the
16276         method to determine if its a destructor, create a new derived
16277         class from Method called Destructor, and test for that.  
16278
16279         * cs-parser.jay: Create a Destructor object instead of a Method.  
16280
16281         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16282
16283         Fixes: 52933
16284
16285 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
16286
16287         * expression.cs (Binary.ResolveOperator): Perform an implicit
16288         conversion from MethodGroups to their delegate types on the
16289         Addition operation.
16290
16291         * delegate.cs: Introduce a new class DelegateCreation that is the
16292         base class for `NewDelegate' and `ImplicitDelegateCreation',
16293         factor some code in here.
16294
16295         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16296         conversion from MethodGroups to compatible delegate types. 
16297
16298         * ecore.cs (Expression.Resolve): Do not flag error 654
16299         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16300         we allow conversions from MethodGroups to delegate types now.
16301
16302         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16303         assignments in v2 either.
16304
16305 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
16306
16307         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16308         static read-only fields in ctors.
16309
16310         Applied patch from Benjamin Jemlich 
16311
16312         * expression.cs (UnaryMutator): Avoid leaking local variables. 
16313
16314 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
16315
16316         * cs-tokenizer.cs (IsCastToken): Allow the various native types
16317         here to return true, as they can be used like this:
16318
16319                 (XXX) int.MEMBER ()
16320
16321         Fixed 49836 and all the other dups
16322
16323 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
16324
16325         * driver.cs: Implement /win32res and /win32icon.
16326
16327 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
16328
16329         * cs-parser.jay: Add a rule to improve error handling for the
16330         common mistake of placing modifiers after the type.
16331
16332 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
16333
16334         * cs-parser.jay (interface_event_declaration): Catch
16335         initialization of events on interfaces, and report cs0068
16336
16337         * cs-parser.jay (interface_event_declaration): Catch
16338         initialization of events. 
16339
16340         * ecore.cs: Better report missing constructors.
16341
16342         * expression.cs (Binary.ResolveOperator): My previous bug fix had
16343         the error reporting done in the wrong place.  Fix.
16344
16345         * expression.cs (Binary.ResolveOperator): Catch the 
16346         operator + (E x, E y) error earlier, and later allow for implicit
16347         conversions in operator +/- (E e, U x) from U to the underlying
16348         type of E.
16349
16350         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16351         52596, if the container class is abstract, the default constructor
16352         is protected otherwise its public (before, we were always public).
16353
16354         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16355         fixed statement.
16356
16357         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16358         Jemlich that fixes bug #52597, MCS was generating invalid code for
16359         idisposable structs.   Thanks to Ben for following up with this
16360         bug as well.
16361
16362 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
16363
16364         * driver.cs: Allow assemblies without code to be generated, fixes
16365         52230.
16366
16367 2004-01-07  Nick Drochak <ndrochak@gol.com>
16368
16369         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16370
16371 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
16372
16373         * cs-parser.jay: Add rules to improve error reporting if fields or
16374         methods are declared at the namespace level (error 116)
16375
16376         * Add rules to catch event add/remove
16377
16378 2004-01-04  David Sheldon <dave-mono@earth.li>
16379
16380   * expression.cs: Added matching ")" to error message for 
16381   CS0077
16382
16383 2004-01-03 Todd Berman <tberman@gentoo.org>
16384
16385         * ecore.cs, attribute.cs:
16386         Applying fix from #52429.
16387
16388 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16389
16390         * ecore.cs, expression.cs, statement.cs:
16391         Total rewrite of how we handle branching. We
16392         now handle complex boolean expressions with fewer
16393         jumps. As well if (x == 0) no longer emits a ceq.
16394
16395         if (x is Foo) is much faster now, because we generate
16396         better code.
16397
16398         Overall, we get a pretty big improvement on our benchmark
16399         tests. The code we generate is smaller and more readable.
16400
16401         I did a full two-stage bootstrap. The patch was reviewed
16402         by Martin and Miguel.
16403
16404 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16405
16406         * cs-parser.jay: Make primary_expression not take a QI.
16407         we dont need this because the member_access rule covers
16408         us here. So we replace the rule with just IDENTIFIER.
16409
16410         This has two good effects. First, we remove a s/r conflict.
16411         Second, we allocate many fewer QualifiedIdentifier objects.
16412
16413 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16414
16415         * attribute.cs: Handle MarshalAs attributes as pseudo, and
16416         set the correct information via SRE. This prevents
16417         hanging on the MS runtime. Fixes #29374.
16418
16419 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16420
16421         * convert.cs: correctly handle conversions to value types
16422         from Enum and ValueType as unboxing conversions.
16423
16424         Fixes bug #52569. Patch by Benjamin Jemlich.
16425
16426 2004-01-02  Ravi Pratap  <ravi@ximian.com>
16427
16428         * expression.cs (BetterConversion): Prefer int -> uint
16429         over int -> ulong (csc's behaviour). This fixed bug #52046.
16430
16431 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16432
16433         * decl.cs (MemberCache.FindMembers): now returns a
16434         MemberInfo [].
16435
16436         * typemanager.cs: In general, go with with ^^.
16437         (CopyNewMethods): take an IList.
16438         (RealMemberLookup): Only allocate an arraylist
16439         if we copy from two sets of methods.
16440
16441         This change basically does two things:
16442         1) Fewer array lists allocated due to CopyNewMethods.
16443         2) the explicit cast in MemberList costed ALOT.
16444
16445 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
16446
16447         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16448         a hashtable to avoid needless string allocations when an identifier is
16449         used more than once (the common case).
16450
16451 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16452
16453         * pending.cs: MS's TypeBuilder.GetInterfaces ()
16454         is broken, it will not return anything. So, we
16455         have to use the information we have in mcs to
16456         do the task.
16457
16458         * typemanager.cs: Add a cache for GetInterfaces,
16459         since this will now be used more often (due to ^^)
16460
16461         (GetExplicitInterfaces) New method that gets the
16462         declared, not effective, interfaces on a type
16463         builder (eg, if you have interface IFoo, interface
16464         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16465         { IBar }.
16466
16467         This patch makes MCS able to bootstrap itself on
16468         Windows again.
16469
16470 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16471
16472         * expression.cs: Remove the Nop's that Miguel put
16473         in by mistake.
16474
16475 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16476
16477         * report.cs, codegen.cs: Give the real stack trace to
16478         the error when an exception is thrown.
16479
16480 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16481
16482         * decl.cs: only allocate hashtables for ifaces if 
16483         it is an iface!
16484
16485 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16486
16487         * expression.cs: fix the error from cs0121-2.cs
16488         (a parent interface has two child interfaces that
16489         have a function with the same name and 0 params
16490         and the function is called through the parent).
16491
16492 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16493
16494         * class.cs, rootcontext.cs, typmanager.cs: do not
16495         leak pointers.
16496
16497 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16498
16499         * codegen.cs: remove stack for the ec flow branching.
16500         It is already a linked list, so no need.
16501
16502 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
16503
16504         * Makefile: Allow custom profiler here.
16505
16506 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16507
16508         * typemanager.cs (LookupType):
16509           - Use a static char [], because split takes
16510             a param array for args, so it was allocating
16511             every time.
16512           - Do not store true in a hashtable, it boxes.
16513
16514 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16515
16516         * flowanalysis.cs: bytify common enums.
16517
16518 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16519
16520         * modifiers.cs: Add a new set of flags for the
16521         flags allowed on explicit interface impls.
16522         * cs-parser.jay: catch the use of modifiers in
16523         interfaces correctly.
16524         * class.cs: catch private void IFoo.Blah ().
16525
16526         All related to bug #50572.
16527
16528 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16529
16530         * decl.cs: Rewrite the consistant accessability checking.
16531         Accessability is not linear, it must be implemented in
16532         a tableish way. Fixes #49704.
16533
16534 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16535
16536         * expression.cs: Handle negation in a checked context.
16537         We must use subtraction from zero. Fixes #38674.
16538
16539 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16540
16541         * class.cs: Ignore static void main in DLLs.
16542         * rootcontext.cs: Handle the target type here,
16543         since we are have to access it from class.cs
16544         * driver.cs: account for the above.
16545
16546 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16547
16548         * report.cs: Give line numbers and files if available.
16549
16550 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
16551
16552         * driver.cs: Implement /addmodule.
16553
16554         * typemanager.cs:  Change 'modules' field so it now contains Modules not
16555         ModuleBuilders.
16556
16557 2003-12-20  Martin Baulig  <martin@ximian.com>
16558
16559         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16560         (FieldBase.IsAssigned): Removed this field.
16561         (FieldBase.SetAssigned): New public method.
16562         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16563
16564 2003-12-20  Martin Baulig  <martin@ximian.com>
16565
16566         * expression.cs (LocalVariableReference.DoResolve): Don't set
16567         `vi.Used' if we're called from DoResolveLValue().
16568
16569         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16570         returns the usage vector it just merged into the current one -
16571         pass this one to UsageWarning().
16572         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16573         of the `EmitContext', don't call this recursively on our children.
16574
16575 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
16576
16577         * driver.cs: Implement /target:module.
16578
16579 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
16580
16581         * support.cs (CharArrayHashtable): New helper class.
16582
16583         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
16584         char arrays, not strings, so we can avoid creating a string in
16585         consume_identifier if the identifier is a keyword.
16586
16587 2003-12-16  Martin Baulig  <martin@ximian.com>
16588
16589         * statement.cs (LocalInfo.Assigned): Removed this property.
16590         (LocalInfo.Flags): Removed `Assigned'.
16591         (LocalInfo.IsAssigned): New public method; takes the EmitContext
16592         and uses flow analysis.
16593         (Block.UsageWarning): Made this method private.
16594         (Block.Resolve): Call UsageWarning() if appropriate.
16595
16596         * expression.cs (LocalVariableReference.DoResolve): Always set
16597         LocalInfo.Used here.
16598
16599 2003-12-13  Martin Baulig  <martin@ximian.com>
16600
16601         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16602         any value here; we're now using flow analysis to figure out
16603         whether a statement/block returns a value.
16604
16605 2003-12-13  Martin Baulig  <martin@ximian.com>
16606
16607         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16608         working again.
16609         (FlowBranching.MergeFinally): Don't call
16610         `branching.CheckOutParameters()' here, this is called in
16611         MergeTopBlock().
16612         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16613         when adding the `finally' vector.       
16614
16615 2003-12-13  Martin Baulig  <martin@ximian.com>
16616
16617         * flowanalysis.cs
16618         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16619         actually work and also fix #48962.
16620
16621 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
16622
16623         * decl.cs: Do not check System.Object for nested types,
16624         since we know it does not have any. Big bang for buck:
16625
16626         BEFORE:
16627            Run 1:   8.35 seconds
16628            Run 2:   8.32 seconds
16629            corlib:  17.99 seconds
16630         AFTER:
16631            Run 1:   8.17 seconds
16632            Run 2:   8.17 seconds
16633            corlib:  17.39 seconds
16634
16635 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
16636
16637         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16638         time we are returning 0 members, so we save alot here.
16639
16640 2003-12-11  Martin Baulig  <martin@ximian.com>
16641
16642         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16643         `MergeChild()', also just take the `FlowBranching' as argument;
16644         call Merge() on it and return the result.
16645         (FlowBranching.Merge): We don't need to do anything if we just
16646         have one sibling.
16647
16648 2003-12-11  Martin Baulig  <martin@ximian.com>
16649
16650         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16651         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
16652         Maurer for this idea.
16653
16654 2003-12-11  Martin Baulig  <martin@ximian.com>
16655
16656         * flowanalysis.cs (MergeResult): This class is now gone; we now
16657         use the `UsageVector' for this.  The reason for this is that if a
16658         branching just has one sibling, we don't need to "merge" them at
16659         all - that's the next step to do.
16660         (FlowBranching.Merge): We now return a `UsageVector' instead of a
16661         `MergeResult'.
16662
16663 2003-12-11  Martin Baulig  <martin@ximian.com>
16664
16665         Reworked flow analyis and made it more precise and bug-free.  The
16666         most important change is that we're now using a special `Reachability'
16667         class instead of having "magic" meanings of `FlowReturns'.  I'll
16668         do some more cleanups and optimizations and also add some more
16669         documentation this week.
16670
16671         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16672         largely reworked this class.
16673         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16674         the new `Reachability' class instead of having "magic" values here.
16675         (FlowBranching): We're now using an instance of `Reachability'
16676         instead of having separate `Returns', `Breaks' etc. fields.
16677
16678         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16679         based on flow analysis; ignore the return value of block.Emit ().
16680
16681 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
16682
16683         * driver.cs typemanager.cs: Find the mono extensions to corlib even
16684         if they are private.
16685
16686 2003-12-09  Martin Baulig  <martin@ximian.com>
16687
16688         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16689         call them directly on the UsageVector.
16690
16691 2003-12-09  Martin Baulig  <martin@ximian.com>
16692
16693         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16694         Changed return type from `FlowReturns' to `Reachability'.
16695
16696 2003-12-09  Martin Baulig  <martin@ximian.com>
16697
16698         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16699         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16700         `Reachable' fields with a single `Reachability' one.
16701
16702 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16703
16704         * class.cs (FindMembers): Remove foreach's.
16705
16706         Bootstrap times:
16707
16708         BEFORE
16709                 Run 1:   8.74 seconds
16710                 Run 2:   8.71 seconds
16711
16712         AFTER
16713                 Run 1:   8.64 seconds
16714                 Run 2:   8.58 seconds
16715
16716
16717 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16718
16719         * cs-parser.jay:
16720         * gen-treedump.cs:
16721         * statement.cs:
16722         This patch does a few things:
16723                 1. EmptyStatement is now a singleton, so it is never reallocated.
16724                 2. All blah is EmptyStatement constructs have been changed to
16725                    blah == EmptyStatement.Value, which is much faster and valid
16726                    now that EmptyStatement is a singleton.
16727                 3. When resolving a block, rather than allocating a new array for
16728                    the non-empty statements, empty statements are replaced with
16729                    EmptyStatement.Value
16730                 4. Some recursive functions have been made non-recursive.
16731         Mainly the performance impact is from (3), however (1) and (2) are needed for
16732         this to work. (4) does not make a big difference in normal situations, however
16733         it makes the profile look saner.
16734
16735         Bootstrap times:
16736
16737         BEFORE
16738         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16739         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16740         Total memory allocated: 56397 KB
16741
16742         AFTER
16743         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16744         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16745         Total memory allocated: 55666 KB
16746
16747 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16748
16749         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16750         than the hashtable in a hashtable version
16751
16752         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16753         we always end up concating a string. This results in a huge perf
16754         loss, because many strings have to be tracked by the GC. In this
16755         patch, we first use a hashtable that works with two keys, so that
16756         the strings do not need to be concat'ed.
16757
16758         Bootstrap times:
16759         BEFORE
16760                 Run 1:   8.74 seconds
16761                 Run 2:   8.71 seconds
16762
16763         AFTER
16764                 Run 1:   8.65 seconds
16765                 Run 2:   8.56 seconds
16766
16767 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16768
16769         * Makefile: Add a new target `do-time' that does a quick and simple
16770         profile, leaving easy to parse output.
16771
16772 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
16773
16774         * codegen.cs (Init): Create the dynamic assembly with 
16775         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16776
16777 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16778
16779         * support.cs: Make the PtrHashtable use only one
16780         instance of its comparer.
16781
16782 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
16783
16784         * typemanager.cs: Fix lookup of GetNamespaces.
16785
16786 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
16787
16788         * expression.cs: Removed redundant line.
16789
16790         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16791         ArrayLists, use for loops with bounds.  
16792
16793         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16794         arraylist.
16795
16796         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16797         arraylists, use for loop with bounds.
16798
16799         The above three changes give us a 0.071 second performance
16800         improvement out of 3.294 seconds down to 3.223.  On my machine
16801         the above changes reduced the memory usage by 1,387 KB during
16802         compiler bootstrap.
16803
16804         * cs-parser.jay (QualifiedIdentifier): New class used to represent
16805         QualifiedIdentifiers.  Before we created a new string through
16806         concatenation, and mostly later on, the result would be
16807         manipulated by DecomposeQI through string manipulation.
16808
16809         This reduced the compiler memory usage for bootstrapping from
16810         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16811         compile times in 0.05 seconds.
16812
16813 2003-11-28  Dick Porter  <dick@ximian.com>
16814
16815         * support.cs: Do string compares with the Invariant culture.
16816
16817         * rootcontext.cs: 
16818         * gen-treedump.cs: 
16819         * expression.cs: 
16820         * driver.cs: 
16821         * decl.cs: 
16822         * codegen.cs: 
16823         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16824         the comparison is done with the Invariant culture.
16825
16826 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
16827
16828         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16829         GetEnumerator method.
16830
16831         (ProbeCollectionType): Iterate starting at the most specific type
16832         upwards looking for a GetEnumerator
16833
16834         * expression.cs: Shift count can be up to 31 for int/uint and 63
16835         for long/ulong.
16836
16837 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
16838
16839         * statement.cs (Block.LookupLabel): Also look for the label on the
16840         children blocks.  Use a hash table to keep track of visited
16841         nodes. 
16842
16843         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16844         we actually did transform the other operand, otherwise fall back
16845         to the common codepath that casts to long.
16846
16847         * cs-tokenizer.cs: Use the same code pattern as the int case.
16848         Maybe I should do the parsing myself, and avoid depending on the
16849         Parse routines to get this done.
16850
16851 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
16852
16853         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16854         which fixes bug 51347.  This time test it.
16855
16856         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16857         attributes for example can not tell the difference between these.
16858         The difference was only a syntax feature of the language. 
16859
16860         * attribute.cs: Apply attributes to delegates.
16861
16862         * delegate.cs: Call the apply attributes method.
16863
16864 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
16865
16866         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16867         comparing 0 vs Byte.MinValue, not the value
16868
16869         (ImplicitConversionRequired): When reporting a conversion error,
16870         use error 31 to print out the constant error instead of the
16871         simpler 29.
16872
16873         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16874         which fixes bug 51347.
16875
16876 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
16877
16878         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
16879         which fixes the -warnaserror command line option.
16880
16881 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
16882
16883         * cfold.cs (DoNumericPromotions): During constant folding of
16884         additions on UIntConstant, special case intconstants with
16885         IntConstants like we do on the expression binary operator. 
16886
16887 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
16888
16889         * convert.cs (ImplicitReferenceConversion): We were missing a case
16890         (System.Enum are not value types or class types, so we need to
16891         classify them separatedly).
16892
16893         * driver.cs: We do not support error 2007.
16894
16895 2003-11-12 Jackson Harper <jackson@ximian.com>
16896
16897         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16898         system directory. Also use the full file name so users can
16899         libraries names mscorlib-o-tron.dll in a non system dir.
16900
16901 2003-11-10  Martin Baulig  <martin@ximian.com>
16902
16903         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16904         (TypeManager.InitCoreTypes): Initialize them here, but instead of
16905         calling `ResolveType()' on them, directly assign their `Type'.
16906
16907 2003-11-08  Martin Baulig  <martin@ximian.com>
16908
16909         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16910         return value and the `out parent' parameter.
16911         (TypeContainer.DefineType): Moved the CS0644 check into
16912         GetClassBases().  Don't pass the interface types to the
16913         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16914         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16915
16916         * ecore.cs (TypeExpr.IsAttribute): New property.
16917         (TypeExpr.GetInterfaces): New method.
16918
16919         * interface.cs (Interface.GetInterfaceTypeByName): Return a
16920         TypeExpr instead of a Type.
16921         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16922         (Interface.DefineType): Don't pass the interface types to the
16923         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16924         them later and then call `TypeBulider.AddInterfaceImplementation()'.
16925
16926         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16927         instead of a `Type[]'.
16928         (TypeManager.RegisterBuilder): Likewise.
16929         (TypeManager.AddUserInterface): Likewise.
16930         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
16931         `Type[]' and also return a `TypeExpr[]'.
16932         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
16933
16934 2003-11-08  Martin Baulig  <martin@ximian.com>
16935
16936         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
16937         Expression.     
16938
16939 2003-11-08  Martin Baulig  <martin@ximian.com>
16940
16941         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
16942         TypeManager.ResolveExpressionTypes().
16943
16944         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
16945         instead of an Expression.
16946         (TypeExpr): This is now an abstract base class for `TypeExpression'.
16947         (TypeExpression): New public class; formerly known as `TypeExpr'.
16948
16949         * expression.cs (ComposedCast): Derive from TypeExpr.
16950
16951         * typemanager.cs (TypeManager.system_*_expr): These are now
16952         TypExpr's instead of Expression's.
16953         (TypeManager.ResolveExpressionTypes): New public static function;
16954         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
16955         of them.        
16956
16957 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
16958
16959         * expression.cs (New.DoResolve): Do not dereference value that
16960         might be a null return.
16961
16962         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
16963         sure that the constant value has the right type.  Fixes an
16964         unreported bug, similar to 50425.
16965
16966         * const.cs (Const.LookupConstantValue): Call
16967         ImplicitStandardConversionExists before doing a conversion to
16968         avoid havng the TypeManager.ChangeType do conversions.
16969
16970         Reduced the number of casts used
16971
16972         (Const.ChangeType): New routine to enable reuse of the constant
16973         type changing code from statement.
16974
16975         * typemanager.cs (ChangeType): Move common initialization to
16976         static global variables.
16977
16978         Fixes #50425.
16979
16980         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
16981         every value type to go through, even if it was void.  Fix that. 
16982
16983         * cs-tokenizer.cs: Use is_identifier_start_character on the start
16984         character of the define, and the is_identifier_part_character for
16985         the rest of the string.
16986
16987 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
16988
16989         * expression.cs (UnaryMutator.EmitCode): When I updated
16990         LocalVariableReference.DoResolve, I overdid it, and dropped an
16991         optimization done on local variable references.
16992
16993 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
16994
16995         * ecore.cs: Convert the return from Ldlen into an int.
16996
16997 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
16998
16999         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
17000         the accessibility, this is a special case for toplevel non-public
17001         classes (internal for instance).
17002
17003 2003-10-20  Nick Drochak <ndrochak@gol.com>
17004
17005         * ecore.cs: Fix typo and build.  Needed another right paren.
17006
17007 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
17008
17009         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
17010         `internal' case regular and protected, but not allowing protected
17011         to be evaluated later.  Bug 49840
17012
17013 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
17014
17015         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
17016         to kb.Nlast, and not the kb.nFirst to isolate the switch
17017         statement.
17018
17019         Extract the underlying type, so enumerations of long/ulong are
17020         treated like long/ulong.
17021
17022 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
17023
17024         * expression.cs (New): Overload the meaning of RequestedType to
17025         track the possible creation of the NewDelegate type, since
17026         DoResolve is invoked more than once for new constructors on field
17027         initialization.
17028
17029         See bugs: #48800 and #37014
17030
17031         * cs-parser.jay (declare_local_constants): Take an arraylist
17032         instead of a single constant.
17033
17034         (local_constant_declaration): It should take a
17035         constant_declarators, not a constant_declarator.  Fixes 49487
17036
17037         * convert.cs: Fix error report.
17038
17039 2003-10-13 Jackson Harper <jackson@ximian.com>
17040
17041         * typemanager.cs (TypeToCoreType): Add float and double this fixes
17042         bug #49611
17043
17044 2003-10-09  Martin Baulig  <martin@ximian.com>
17045
17046         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
17047         to the .ctor.
17048         (MethodCore.DoDefineParameters): Removed the TypeContainer
17049         argument; use the DeclSpace which was passed to the .ctor instead.
17050         (MethodCore.CheckParameter): Take a DeclSpace instead of a
17051         TypeContainer; we only need a DeclSpace here.
17052
17053 2003-10-09  Martin Baulig  <martin@ximian.com>
17054
17055         * class.cs (MethodData): Added additional `DeclSpace ds' argument
17056         to the .ctor.
17057         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
17058         EmitContext's .ctor.    
17059
17060 2003-10-09  Martin Baulig  <martin@ximian.com>
17061
17062         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
17063         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
17064         AsAccessible(), moved them as well.
17065
17066         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
17067
17068 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
17069
17070         * cs-parser.jay : Renamed yyName to yyNames related to jay.
17071
17072 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
17073
17074         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
17075         generation for >=, as spotted by Paolo, bug 48679.  
17076         Patch from David Waite.
17077
17078         * cs-tokenizer.cs: Add handling for #pragma.
17079
17080         * cs-parser.jay: Allow for both yield and yield return in the
17081         syntax.  The anti-cobolization of C# fight will go on!
17082
17083         * class.cs (TypeBuilder.DefineType): Catch error condition here
17084         (Parent.DefineType erroring out and returning null).
17085
17086         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17087         coping with enumerations variables, we were mistakenly processing
17088         them as a regular value type instead of built-in types.  Fixes the
17089         bug #48063
17090
17091         * typemanager.cs (IsBuiltinOrEnum): New method.
17092
17093 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
17094
17095         * cs-parser.jay: Upgrade: yield now needs the return clause.
17096
17097 2003-09-19  Martin Baulig  <martin@ximian.com>
17098
17099         * decl.cs (MemberCache.SetupCacheForInterface): Take a
17100         `MemberCache parent' argument.  Normally, an interface doesn't
17101         have a parent type except System.Object, but we use this in gmcs
17102         for generic type parameters.
17103
17104 2003-09-18  Martin Baulig  <martin@ximian.com>
17105
17106         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
17107         on `type.IsInterface'; don't check whether the type has a parent
17108         to determine whether it's an interface.
17109
17110 2003-09-15  Martin Baulig  <martin@ximian.com>
17111
17112         * class.cs (TypeContainer.DefineType): Added an error flag to
17113         avoid reporting duplicate CS0146's ("class definition is
17114         circular.").
17115
17116         * driver.cs (Driver.MainDriver): Abort if
17117         RootContext.ResolveTree() reported any errors.
17118
17119 2003-09-07  Martin Baulig  <martin@ximian.com>
17120
17121         * report.cs (Error, Warning): Added overloaded versions which take
17122         a `params object[] args' and call String.Format().
17123
17124 2003-09-07  Martin Baulig  <martin@ximian.com>
17125
17126         * decl.cs (DeclSpace..ctor): Don't call
17127         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
17128         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
17129         (DeclSpace.RecordDecl): New method.
17130
17131         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
17132
17133 2003-09-02  Ravi Pratap  <ravi@ximian.com>
17134
17135         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
17136         value attributes to be applied to ParameterBuilders.
17137
17138         * class.cs (MethodCore.LabelParameters): Make static and more
17139         generic so that it can be used from other places - like interface
17140         methods, for instance.
17141
17142         * interface.cs (Interface.Emit): Call LabelParameters before
17143         emitting attributes on the InterfaceMethod.
17144
17145 2003-08-26  Martin Baulig  <martin@ximian.com>
17146
17147         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
17148         resolving aliases; fixes #47927.
17149
17150 2003-08-26  Martin Baulig  <martin@ximian.com>
17151
17152         * statement.cs (Using.DoResolve): This is internally emitting a
17153         try/finally clause, so we need to set ec.NeedExplicitReturn if we
17154         do not always return.  Fixes #47681.
17155
17156 2003-08-26  Martin Baulig  <martin@ximian.com>
17157
17158         * decl.cs (MemberCore): Moved WarningNotHiding(),
17159         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
17160         into MemberBase.
17161         (AdditionResult): Make this nested in DeclSpace.
17162         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
17163         argument; call NamespaceEntry.Define() unless we're nested in a
17164         class or struct.
17165
17166         * namespace.cs (Namespace.DefineName): New public function.  This
17167         is called from DeclSpace's .ctor to add 
17168         (Namespace.Lookup): Include DeclSpaces in the lookup.
17169
17170         * class.cs (Operator): Derive from MemberBase, not MemberCore.
17171
17172         * const.cs (Const): Derive from MemberBase, not MemberCore.     
17173
17174 2003-08-25  Martin Baulig  <martin@ximian.com>
17175
17176         * convert.cs (Convert.ExplicitReferenceConversion): When
17177         converting from an interface type to a class, unbox if the target
17178         type is a struct type.  Fixes #47822.
17179
17180 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17181
17182         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
17183         #47854.
17184
17185 2003-08-22  Martin Baulig  <martin@ximian.com>
17186
17187         * class.cs (TypeManager.DefineType): When defining a nested type,
17188         call DefineType() on our parent; fixes #47801.
17189
17190 2003-08-22  Martin Baulig  <martin@ximian.com>
17191
17192         * class.cs (MethodData.Define): While checking if a method is an
17193         interface implementation, improve the test a bit more to fix #47654.
17194
17195 2003-08-22  Martin Baulig  <martin@ximian.com>
17196
17197         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
17198         correctly; fixes #47722.
17199
17200 2003-08-22  Martin Baulig  <martin@ximian.com>
17201
17202         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
17203         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
17204
17205         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
17206
17207 2003-08-22  Martin Baulig  <martin@ximian.com>
17208
17209         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
17210         can only be assigned in static constructors.  Fixes #47161.
17211
17212 2003-08-22  Martin Baulig  <martin@ximian.com>
17213
17214         Rewrote and improved the flow analysis code.
17215
17216         * flowbranching.cs (FlowBranching): Make this class abstract.
17217         (FlowBranching.CreateBranching): New static function to create a
17218         new flow branching.
17219         (FlowBranchingBlock, FlowBranchingException): New classes.
17220         (FlowBranching.UsageVector.Type): New public readonly field.
17221         (FlowBranching.UsageVector.Breaks): Removed the setter.
17222         (FlowBranching.UsageVector.Returns): Removed the setter.
17223         (FlowBranching.UsageVector): Added Break(), Return(),
17224         NeverReachable() and Throw() methods to modify the reachability.
17225         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
17226         done by FlowBranching.Merge().
17227         (FlowBranching.UsageVector.MergeChild): New method; merges the
17228         merge result into the current vector.
17229         (FlowBranching.Merge): New abstract method to merge a branching.
17230
17231 2003-08-12  Martin Baulig  <martin@ximian.com>
17232
17233         * expression.cs (Indirection.CacheTemporaries): Create the
17234         LocalTemporary with the pointer type, not its element type.
17235
17236 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
17237
17238         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
17239         token was a keyword or not.
17240
17241         Add `error' options where an IDENTIFIER was expected;  Provide
17242         CheckToken and CheckIdentifierToken convenience error reporting
17243         functions. 
17244
17245         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
17246
17247         * decl.cs: Rename `NamespaceEntry Namespace' public field into
17248         NameSpaceEntry NameSpaceEntry.
17249
17250         (LookupInterfaceOrClass): Avoid creating a full qualified name
17251         from namespace and name: avoid doing lookups when we know the
17252         namespace is non-existant.   Use new Tree.LookupByNamespace which
17253         looks up DeclSpaces based on their namespace, name pair.
17254
17255         * driver.cs: Provide a new `parser verbose' to display the
17256         exception thrown during parsing.  This is turned off by default
17257         now, so the output of a failure from mcs is more graceful.
17258
17259         * namespace.cs: Track all the namespaces defined in a hashtable
17260         for quick lookup.
17261
17262         (IsNamespace): New method
17263
17264 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
17265
17266         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
17267         we know that we need to concatenate (full typename can never be
17268         null). 
17269
17270         * class.cs: ditto.
17271
17272         * statement.cs: Use a bitfield;  Do not initialize to null things
17273         which are done by the constructor by default.
17274
17275         * cs-parser.jay: bug fix, parameter was 4, not 3.
17276
17277         * expression.cs: Just use the property;
17278
17279         * statement.cs: No need for GetVariableInfo method.
17280
17281 2003-08-08  Martin Baulig  <martin@ximian.com>
17282
17283         * flowanalysis.cs (FlowReturns): This is now nested in the
17284         `FlowBranching' class.
17285         (MyBitVector): Moved this here from statement.cs.
17286         (FlowBranching.SiblingType): New enum type.
17287         (FlowBranching.CreateSibling): Added `SiblingType' argument.
17288
17289 2003-08-07  Martin Baulig  <martin@ximian.com>
17290
17291         * flowanalysis.cs (FlowBranchingType): This is now nested in the
17292         `FlowBranching' class and called `BranchingType'.
17293
17294 2003-08-07  Martin Baulig  <martin@ximian.com>
17295
17296         * flowanalysis.cs: Moved all the control flow analysis code into
17297         its own file.
17298
17299 2003-08-07  Martin Baulig  <martin@ximian.com>
17300
17301         * assign.cs (Assign.DoResolve): `target' must either be an
17302         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
17303         #37319.
17304
17305 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
17306
17307         * expression.cs (BinaryMethod): This kind of expression is created by the
17308         Binary class if it determines that the operator has to be handled
17309         by a method.
17310
17311         (BinaryDelegate): This kind of expression is created if we are
17312         dealing with a + or - operator on delegates.
17313
17314         (Binary): remove method, argumetns, and DelegateOperator: when
17315         dealing with methods, 
17316
17317         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17318
17319         * statement.cs (Block): use bitfields for the three extra booleans
17320         we had in use.   Remove unused topblock parameter.
17321
17322         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17323
17324         * assign.cs: Drop extra unneeded tests.
17325
17326 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
17327
17328         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17329
17330         * statement.cs (Foreach): Use VariableStorage instead of
17331         LocalBuilders.   
17332
17333         * codegen.cs (VariableStorage): New class used by clients that
17334         require a variable stored: locals or fields for variables that
17335         need to live across yield.
17336
17337         Maybe provide a convenience api for EmitThis+EmitLoad?
17338
17339         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17340         these bad boys.
17341
17342 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
17343
17344         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17345         RemapParameterLValue): New methods that are used to turn a
17346         precomputed FieldInfo into an expression like this:
17347
17348                 instance.FieldInfo
17349
17350         The idea is to use this instead of making LocalVariableReference
17351         have more than one meaning.
17352
17353         * cs-parser.jay: Add error production to BASE.
17354
17355         * ecore.cs: Deal with TypeManager.GetField returning null, which
17356         is now a valid return value.
17357
17358         (FieldExprNoAddress): New expression for Fields whose address can
17359         not be taken.
17360
17361         * expression.cs (LocalVariableReference): During the resolve
17362         phases, create new expressions if we are in a remapping context.
17363         Remove code that dealt with remapping here.
17364
17365         (ParameterReference): same.
17366
17367         (ProxyInstance): New expression, like the `This' expression, but
17368         it is born fully resolved.  We know what we are doing, so remove
17369         the errors that are targeted to user-provided uses of `this'.
17370
17371         * statement.cs (Foreach): our variable is now stored as an
17372         Expression;  During resolution, follow the protocol, dont just
17373         assume it will return this.
17374
17375 2003-08-06  Martin Baulig  <martin@ximian.com>
17376
17377         * support.cs (SeekableStreamReader.cs): New public class.
17378
17379         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17380         SeekableStreamReader instead of the normal StreamReader.
17381
17382 2003-08-04  Martin Baulig  <martin@ximian.com>
17383
17384         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17385         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17386         deambiguate casts and delegate invocations.
17387         (parenthesized_expression): Use the new tokens to ensure this is
17388         not a cast of method invocation.
17389
17390         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17391         when reading a `)' and Deambiguate_CloseParens () was previously
17392         called.
17393
17394         * expression.cs (ParenthesizedExpression): New class.  This is
17395         just used for the CS0075 test.
17396         (Binary.DoResolve): Check for CS0075.   
17397
17398 2003-07-29  Ravi Pratap  <ravi@ximian.com>
17399
17400         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17401         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17402         reference comparison.
17403
17404         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17405         examine the ReturnType for equality - this is necessary in the
17406         cases of implicit and explicit operators whose signature also
17407         includes the return type.
17408
17409 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
17410
17411         * namespace.cs: Cache the result of the namespace computation,
17412         instead of computing it every time.
17413
17414 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
17415
17416         * decl.cs: Use a global arraylist that we reuse over invocations
17417         to avoid excesive memory consumption.  Reduces memory usage on an
17418         mcs compile by one meg (45 average).
17419
17420         * typemanager.cs (LookupTypeReflection): In .NET pointers are
17421         private, work around that.
17422
17423 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
17424
17425         * literal.cs (IntLiteral): Define Zero and One static literals. 
17426
17427         * cs-parser.jay (integer_literal): use static literals to reduce
17428         memory usage for the most used literals (0, 1 and -1).  211kb
17429         reduced in memory usage.
17430
17431         Replace all calls to `new ArrayList' with `new
17432         ArrayList(4)' which is a good average number for most allocations,
17433         and also requires only 16 bytes of memory for its buffer by
17434         default. 
17435
17436         This reduced MCS memory usage in seven megabytes for the RSS after
17437         bootstrapping.
17438
17439 2003-07-28  Ravi Pratap  <ravi@ximian.com>
17440
17441         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17442         handle params methods the correct way by forming only one
17443         applicable set with params and normal methods in them. Earlier we
17444         were looking at params methods only if we found no normal methods
17445         which was not the correct thing to do.
17446
17447         (Invocation.BetterFunction): Take separate arguments indicating
17448         when candidate and the best method are params methods in their
17449         expanded form.
17450
17451         This fixes bugs #43367 and #46199.
17452
17453         * attribute.cs: Documentation updates.
17454
17455         (CheckAttribute): Rename to CheckAttributeTarget.
17456         (GetValidPlaces): Rename to GetValidTargets.
17457
17458         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17459         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17460
17461         Fixes bug #44468.
17462
17463 2003-07-28  Martin Baulig  <martin@ximian.com>
17464
17465         * class.cs (TypeContainer.DefineMembers): Use the base type's full
17466         name when looking up the base class of a nested class.  Fixes #46977.
17467
17468 2003-07-26  Martin Baulig  <martin@ximian.com>
17469
17470         * expression.cs (Indexers.Indexer): New nested struct; contains
17471         getter, setter and the indexer's type.
17472         (Indexers.Properties): This is now an ArrayList of
17473         Indexers.Indexer's.
17474         (IndexerAccess.DoResolveLValue): Correctly set the type if the
17475         indexer doesn't have any getters.
17476
17477         * assign.cs (Assign.DoResolve): Also do the implicit conversions
17478         for embedded property and indexer assignments.
17479
17480 2003-07-26  Martin Baulig  <martin@ximian.com>
17481
17482         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17483         preprocessor directive is not the first non-whitespace character
17484         on a line.
17485
17486 2003-07-26  Martin Baulig  <martin@ximian.com>
17487
17488         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17489         namespace parsing, follow the spec more closely.
17490
17491         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17492         NamespaceEntry.Lookup().
17493
17494 2003-07-25  Martin Baulig  <martin@ximian.com>
17495
17496         * MethodCore.cs (OverridesSomething): New public field; it's set
17497         from TypeContainer.DefineMembers if this method overrides
17498         something (which doesn't need to be a method).  Fix #39462.
17499
17500 2003-07-25  Ravi Pratap  <ravi@ximian.com>
17501
17502         * typemanager.cs (GetMembers): Ensure that the list of members is
17503         reversed. This keeps things in sync.
17504
17505         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17506         find an AttributeUsage attribute.
17507
17508         * expression.cs (Invocation.OverloadResolve): Perform the check
17509         which disallows Invoke to be directly called on a Delegate.
17510
17511         (Error_InvokeOnDelegate): Report error cs1533.
17512
17513 2003-07-25  Martin Baulig  <martin@ximian.com>
17514
17515         * expression.cs (Indexers.GetIndexersForType): Only look in the
17516         interface hierarchy if the requested type is already an
17517         interface.  Fixes #46788 while keeping #46502 fixed.
17518
17519 2003-07-25  Martin Baulig  <martin@ximian.com>
17520
17521         * class.cs (TypeContainer.DefineMembers): Check whether all
17522         readonly fields have been assigned and report warning CS0649 if
17523         not.
17524
17525         * statement.cs (LocalInfo.IsFixed): Always return true if this is
17526         a valuetype.
17527
17528 2003-07-24  Ravi Pratap  <ravi@ximian.com>
17529
17530         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17531         returned from GetMethods to make things consistent with the
17532         assumptions MCS makes about ordering of methods.
17533
17534         This should comprehensively fix bug #45127 and it does :-)
17535
17536         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17537         ordering is actually reverse.
17538
17539         * Clean up some debug messages I left lying around.
17540
17541         * interface.cs (Populate*): Get rid of code which emits attributes
17542         since the stage in which we emit attributes is the 'Emit' stage,
17543         not the define stage.
17544
17545         (Emit): Move attribute emission for interface members here.
17546
17547 2003-07-22  Ravi Pratap  <ravi@ximian.com>
17548
17549         * expression.cs (Invocation.OverloadResolve): Follow the spec more
17550         closely: we eliminate methods in base types when we have an
17551         applicable method in a top-level type.
17552
17553         Please see section 14.5.5.1 for an exact description of what goes
17554         on. 
17555
17556         This fixes bug #45127 and a host of other related to corlib compilation.
17557
17558         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17559         array is the method corresponding to the top-level type (this is
17560         because of the changes made to icall.c) so we change this
17561         accordingly.
17562
17563         (MethodGroupExpr.Name): This too.
17564
17565         * typemanager.cs (GetElementType): New method which does the right
17566         thing when compiling corlib. 
17567
17568         * everywhere: Make use of the above in the relevant places.
17569
17570 2003-07-22  Martin Baulig  <martin@ximian.com>
17571
17572         * cs-parser.jay (invocation_expression): Moved
17573         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17574         `cast_expression', but create a InvocationOrCast which later
17575         resolves to either an Invocation or a Cast.
17576
17577         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17578         method; call this before EmitStatement() to make sure that this
17579         expression can be used as a statement.
17580
17581         * expression.cs (InvocationOrCast): New class; resolves to either
17582         an Invocation or a Cast.
17583
17584         * statement.cs (StatementExpression): Call ResolveStatement() on
17585         the ExpressionStatement before emitting it.
17586
17587 2003-07-21  Martin Baulig  <martin@ximian.com>
17588
17589         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17590         `ref' and `out' attributes match; fixes #46220.
17591         (MemberAccess.ResolveMemberAccess): You can't reference a type
17592         through an expression; fixes #33180.
17593         (Indexers.GetIndexersForType): Don't return the indexers from
17594         interfaces the class implements; fixes #46502.
17595
17596 2003-07-21  Martin Baulig  <martin@ximian.com>
17597
17598         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17599         CS0661 checks; fixes bug #30442.
17600
17601 2003-07-21  Martin Baulig  <martin@ximian.com>
17602
17603         * decl.cs (AdditionResult): Added `Error'.
17604
17605         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17606
17607         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17608         makes cs0031.cs actually work.
17609
17610 2003-07-20  Martin Baulig  <martin@ximian.com>
17611
17612         * namespace.cs: Fixed that bug which caused a crash when compiling
17613         the debugger's GUI.
17614
17615 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
17616
17617         * typemanager.cs (LookupTypeReflection): Never expose types which
17618         are NotPublic, NestedPrivate, NestedAssembly, or
17619         NestedFamANDAssem.  We used to return these, and later do a check
17620         that would report a meaningful error, but the problem is that we
17621         would not get the real match, if there was a name override.
17622
17623 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
17624
17625         * namespace.cs (Namespace, Name): Do not compute the namespace
17626         name dynamically, compute it in the constructor.  This reduced
17627         memory usage by 1697 KB.
17628
17629         * driver.cs: Use --pause to pause at the end.
17630
17631 2003-07-17  Peter Williams  <peter@newton.cx>
17632
17633         * Makefile: Change the name of the test target so that it doesn't
17634         conflict with the recursive test target.
17635
17636 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
17637
17638         * expression.cs (LocalVariableReference.Emit, EmitAssign,
17639         AddressOf): Do not use EmitThis, that was wrong, use the actual
17640         this pointer.
17641
17642 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
17643
17644         * class.cs (MethodData.Define): While checking if a method is an
17645         interface implementation, improve the test: If we are not public
17646         (use new test here: use the computed MethodAttributes directly,
17647         instead of the parsed modifier flags) check if the `implementing'
17648         method comes from an interface or not.
17649
17650         * pending.cs (VerifyPendingMethods): Slightly better error
17651         message.
17652
17653         * makefile: add test target that does the mcs bootstrap.
17654
17655 2003-07-16  Ravi Pratap  <ravi@ximian.com>
17656
17657         * interface.cs (Define): Do nothing here since there are no
17658         members to populate etc. Move the attribute emission out of here
17659         since this was just totally the wrong place to put it. Attribute
17660         application happens during the 'Emit' phase, not in the 'Define'
17661         phase.
17662
17663         (Emit): Add this method and move the attribute emission here
17664
17665         * rootcontext.cs (EmitCode): Call the Emit method on interface
17666         types too.
17667
17668 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17669
17670         * expression.cs (OverloadResolve): Report error only if Location
17671         is not 'Null' which means that there was a probe going on.
17672
17673 2003-07-14  Martin Baulig  <martin@ximian.com>
17674
17675         * expression.cs (ConditionalLogicalOperator): New public class to
17676         implement user defined conditional logical operators.
17677         This is section 14.11.2 in the spec and bug #40505.
17678
17679 2003-07-14  Martin Baulig  <martin@ximian.com>
17680
17681         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17682
17683 2003-07-14  Martin Baulig  <martin@ximian.com>
17684
17685         * codegen.cs (EmitContext.InFixedInitializer): New public field.
17686
17687         * ecore.cs (IVariable.VerifyFixed): New interface method.
17688
17689         * expression.cs (Unary.ResolveOperator): When resolving the `&'
17690         operator, check whether the variable is actually fixed.  Fixes bug
17691         #36055.  Set a variable definitely assigned when taking its
17692         address as required by the spec.
17693
17694         * statement.cs (LocalInfo.IsFixed): New field.
17695         (LocalInfo.MakePinned): Set `IsFixed' to true.
17696
17697 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17698
17699         * attribute.cs (Attribute.Resolve): While doing a Member lookup
17700         for .ctors, ensure that we only ask for members declared in the
17701         attribute type (BindingFlags.DeclaredOnly).
17702
17703         Fixes bug #43632.
17704
17705         * expression.cs (Error_WrongNumArguments): Report error 1501
17706         correctly the way CSC does.
17707
17708 2003-07-13  Martin Baulig  <martin@ximian.com>
17709
17710         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17711         lookup on the fully qualified name, to make things like "X.X" work
17712         where "X.X" is a fully qualified type name, but we also have a
17713         namespace "X" in the using list.  Fixes #41975.
17714
17715 2003-07-13  Martin Baulig  <martin@ximian.com>
17716
17717         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17718         function. If we're a CompoundAssign, we need to create an embedded
17719         CompoundAssign, not an embedded Assign.
17720         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17721         Fixes #45854.
17722
17723 2003-07-13  Martin Baulig  <martin@ximian.com>
17724
17725         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17726         work to fix bug #46088.
17727
17728 2003-07-13  Ravi Pratap <ravi@ximian.com>
17729
17730         * class.cs (Operator.Emit): Do not emit attributes here - it is
17731         taken care of by the Method class that we delegate too. This takes
17732         care of bug #45876.
17733
17734 2003-07-10  Martin Baulig  <martin@ximian.com>
17735
17736         * expression.cs (TypeOfVoid): New class.
17737         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
17738
17739 2003-07-10  Martin Baulig  <martin@ximian.com>
17740
17741         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17742         bug #35957.
17743
17744 2003-07-10  Martin Baulig  <martin@ximian.com>
17745
17746         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17747         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17748
17749         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17750
17751         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17752
17753 2003-07-10  Martin Baulig  <martin@ximian.com>
17754
17755         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17756         of decimal.  Fixes #42850.
17757
17758         NOTE: I also fixed the created byte blob, but this doesn't work on
17759         the MS runtime and csc never produces any byte blobs for decimal
17760         arrays.
17761
17762 2003-07-10  Martin Baulig  <martin@ximian.com>
17763
17764         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17765         structs; fixes #32068.
17766         (Block.AddChildVariableNames): Fixed #44302.
17767
17768 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17769
17770         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17771
17772 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17773
17774         * attribute.cs: And this test is onger needed.
17775
17776 2003-07-08  Martin Baulig  <martin@ximian.com>
17777
17778         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17779         inaccessible types.  Fixes #36313.
17780
17781         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17782
17783         * namespace.cs (NamespaceEntry): Create implicit entries for all
17784         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17785         implicit entries for N1.N2 and N1.
17786
17787 2003-07-08  Martin Baulig  <martin@ximian.com>
17788
17789         Rewrote the handling of namespaces to fix a lot of the issues
17790         wrt. `using' aliases etc.
17791
17792         * namespace.cs (Namespace): Splitted this class into a
17793         per-assembly `Namespace' and a per-file `NamespaceEntry'.
17794
17795         * typemanager.cs (TypeManager.IsNamespace): Removed.
17796         (TypeManager.ComputeNamespaces): Only compute namespaces from
17797         loaded assemblies here, not the namespaces from the assembly we're
17798         currently compiling.
17799
17800 2003-07-08  Martin Baulig  <martin@ximian.com>
17801
17802         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17803
17804 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17805
17806         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17807         already fixed it.  
17808
17809         I thought about the memory savings here, but LookupTypeReflection
17810         is used under already very constrained scenarios.  Compiling
17811         corlib or mcs only exposes one hit, so it would not really reduce
17812         any memory consumption.
17813
17814 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17815
17816         * typemanager.cs: fixes bug #45889 by only adding public types from
17817         other assemblies to the list of known types.
17818
17819 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17820
17821         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17822         on the type we resolved.
17823
17824 2003-07-05  Martin Baulig  <martin@ximian.com>
17825
17826         * pending.cs (PendingImplementation.ParentImplements): Don't
17827         create the proxy if the parent is abstract.
17828
17829         * class.cs (TypeContainer.DefineIndexers): Process explicit
17830         interface implementations first.  Fixes #37714.
17831
17832 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
17833
17834         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17835         defined recursively;  but since we modify the input parameters
17836         (left is set to `this' temporarily), we reset this value if the
17837         left_is_explicit is false, which gives the original semantics to
17838         the code.  
17839
17840         * literal.cs (NullPointer): new class used to represent a null
17841         literal in a pointer context.
17842
17843         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17844         type is a pointer, use a NullPointer object instead of a
17845         NullLiteral.   Closes 43687
17846
17847         (ExplicitConversion): Convert pointer values using
17848         the conv opcode to the proper type.
17849
17850         * ecore.cs (New): change ValueTypeVariable property into a method,
17851         that returns whether the valuetype is suitable for being used.
17852
17853         * expression.cs (Binary.DoNumericPromotions): Only return if we
17854         the int constant was a valid uint, and we can return both left and
17855         right as uints.  If not, we continue processing, to trigger the
17856         type conversion.  This fixes 39018.
17857
17858         * statement.cs (Block.EmitMeta): During constant resolution, set
17859         the CurrentBlock property on the emitcontext, so that we resolve
17860         constants propertly.
17861
17862 2003-07-02  Martin Baulig  <martin@ximian.com>
17863
17864         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17865         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17866
17867         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17868         than emitting it here.
17869
17870         * statement.cs: Fixed some more flow analysis bugs.
17871
17872 2003-07-02  Martin Baulig  <martin@ximian.com>
17873
17874         * class.cs (MethodData.Define): When implementing interface
17875         methods, set Final unless we're Virtual.
17876
17877         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17878         check work for interface methods.
17879
17880 2003-07-01  Martin Baulig  <martin@ximian.com>
17881
17882         * ecore.cs (EmitContext.This): Replaced this property with a
17883         GetThis() method which takes a Location argument.  This ensures
17884         that we get the correct error location for a CS0188.
17885
17886 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
17887
17888         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17889         ImplicitStandardConversion.
17890
17891         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17892
17893 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
17894
17895         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17896         optimization.
17897
17898 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
17899
17900         * class.cs (Constructor.Define): Turn off initlocals for unsafe
17901         constructors.
17902
17903         (MethodData.Define): Turn off initlocals for unsafe methods.
17904
17905 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
17906
17907         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17908         complete;  Fixes #37521.
17909
17910         * delegate.cs: Use Modifiers.TypeAttr to compute the
17911         TypeAttributes, instead of rolling our own.  This makes the flags
17912         correct for the delegates.
17913
17914 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
17915
17916         * class.cs (Constructor.Define): Set the private flag for static
17917         constructors as well.
17918
17919         * cs-parser.jay (statement_expression): Set the return value to
17920         null, to avoid a crash when we catch an error.
17921
17922 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
17923
17924         * cs-parser.jay: Applied patch from Jackson that adds support for
17925         extern and unsafe modifiers to destructor declarations.
17926
17927         * expression.cs: Report error 21 if the user is trying to index a
17928         System.Array.
17929
17930         * driver.cs: Add an error message, suggested by the bug report.
17931
17932         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
17933         if we do not have a ": this ()" constructor initializer.  Fixes 45149
17934
17935 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
17936
17937         * namespace.cs: Add some information to reduce FAQs.
17938
17939 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
17940
17941         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
17942         underlying enumeration types.  Fixes #43915.
17943
17944         * expression.cs: Treat ushort/short as legal values to be used in
17945         bitwise operations.
17946
17947 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
17948
17949         * delegate.cs: transfer custom attributes for paramenters from
17950         the delegate declaration to Invoke and BeginInvoke.
17951
17952 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
17953
17954         * attribute.cs: handle custom marshalers and emit marshal info
17955         for fields, too.
17956
17957 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
17958
17959         * makefile.gnu: Added anonymous.cs to the compiler sources.
17960
17961 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
17962
17963         * iterators.cs: Change the name of the proxy class to include two
17964         underscores.
17965
17966         * cs-parser.jay: Update grammar to include anonymous methods.
17967
17968         * anonymous.cs: new file.
17969
17970 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
17971
17972         * class.cs (Field.Define): Add missing test for pointers and
17973         safety. 
17974
17975 2003-05-27  Ravi Pratap  <ravi@ximian.com>
17976
17977         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
17978         we use the stobj opcode.
17979
17980         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
17981         since it wasn't the correct fix. 
17982
17983         It still is puzzling that we are required to use stobj for IntPtr
17984         which seems to be a ValueType.
17985
17986 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
17987
17988         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
17989         during regular simple name resolution.   Now, the trick is that
17990         instead of returning for processing the simplename, we do a
17991         TypeManager.LookupType (ie, a rooted lookup as opposed to a
17992         contextual lookup type).   If a match is found, return that, if
17993         not, return for further composition.
17994
17995         This fixes long-standing 30485.
17996
17997         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17998         using the address to initialize an object, do an Stobj instead of
17999         using the regular Stelem.
18000
18001         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
18002         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
18003         Because if we are a BaseIndexerAccess that value will be true.
18004         Fixes 43643.
18005
18006         * statement.cs (GotoCase.Resolve): Return after reporting an
18007         error, do not attempt to continue. 
18008
18009         * expression.cs (PointerArithmetic.Emit): If our operand is a
18010         long, convert our constants to match the operand before
18011         multiplying.  Convert to I type before adding.   Fixes 43670.
18012
18013 2003-05-14  Ravi Pratap  <ravi@ximian.com>
18014
18015         * enum.cs (ImplicitConversionExists) : Rename to
18016         ImplicitEnumConversionExists to remove ambiguity. 
18017
18018         * ecore.cs (NullCast): New type of cast expression class which
18019         basically is very similar to EmptyCast with the difference being
18020         it still is a constant since it is used only to cast a null to
18021         something else
18022         (eg. (string) null)
18023
18024         * convert.cs (ImplicitReferenceConversion): When casting a null
18025         literal, we return a NullCast.
18026
18027         * literal.cs (NullLiteralTyped): Remove - I don't see why this
18028         should be around anymore.
18029
18030         The renaming (reported was slightly wrong). Corrections:
18031
18032         ConvertImplicitStandard -> ImplicitConversionStandard
18033         ConvertExplicitStandard -> ExplicitConversionStandard
18034
18035         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
18036         before passing them in !
18037
18038         * convert.cs (ImplicitConversionStandard): When comparing for
18039         equal expr and target types, ensure that expr is not a
18040         NullLiteral.
18041
18042         In general, we must not be checking (expr_type ==
18043         target_type) in the top level conversion methods
18044         (ImplicitConversion, ExplicitConversion etc). This checking is
18045         done in the methods that they delegate to.
18046
18047 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
18048
18049         * convert.cs: Move Error_CannotConvertType,
18050         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
18051         ImplicitNumericConversion, ImplicitConversionExists,
18052         ImplicitUserConversionExists, StandardConversionExists,
18053         FindMostEncompassedType, FindMostSpecificSource,
18054         FindMostSpecificTarget, ImplicitUserConversion,
18055         ExplicitUserConversion, GetConversionOperators,
18056         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
18057         TryImplicitIntConversion, Error_CannotConvertImplicit,
18058         ConvertImplicitRequired, ConvertNumericExplicit,
18059         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
18060         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
18061         its own file.
18062
18063         Perform the following renames:
18064
18065         StandardConversionExists -> ImplicitStandardConversionExists
18066         ConvertImplicit -> ImplicitConversion
18067         ConvertImplicitStandard -> ImplicitStandardConversion
18068         TryImplicitIntConversion -> ImplicitIntConversion
18069         ConvertImplicitRequired -> ImplicitConversionRequired
18070         ConvertNumericExplicit -> ExplicitNumericConversion
18071         ConvertReferenceExplicit -> ExplicitReferenceConversion
18072         ConvertExplicit -> ExplicitConversion
18073         ConvertExplicitStandard -> ExplicitStandardConversion
18074
18075 2003-05-19  Martin Baulig  <martin@ximian.com>
18076
18077         * statement.cs (TypeInfo.StructInfo): Made this type protected.
18078         (TypeInfo): Added support for structs having structs as fields.
18079
18080         * ecore.cs (FieldExpr): Implement IVariable.
18081         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
18082         VariableInfo for the field.
18083
18084 2003-05-18  Martin Baulig  <martin@ximian.com>
18085
18086         * expression.cs (This.DoResolve): Report a CS0027 if we're
18087         emitting a field initializer.
18088
18089 2003-05-18  Martin Baulig  <martin@ximian.com>
18090
18091         * expression.cs (This.ResolveBase): New public function.
18092         (This.DoResolve): Check for CS0188.
18093
18094         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
18095         This.Resolve().
18096
18097         * ecore.cs (MethodGroupExpr.DoResolve): Set the
18098         `instance_expression' to null if we don't have any non-static
18099         methods.
18100
18101 2003-05-18  Martin Baulig  <martin@ximian.com>
18102
18103         Reworked the way how local variables and parameters are handled by
18104         the flow analysis code.
18105
18106         * statement.cs (TypeInfo, VariableMap): New public classes.
18107         (VariableInfo): New public class.  This is now responsible for
18108         checking whether a variable has been assigned.  It is used for
18109         parameters and local variables.
18110         (Block.EmitMeta): Take the InternalParameters as argument; compute
18111         the layout of the flow vectors here.
18112         (Block.LocalMap, Block.ParameterMap): New public properties.
18113         (FlowBranching): The .ctor doesn't get the InternalParameters
18114         anymore since Block.EmitMeta() now computes the layout of the flow
18115         vector.
18116         (MyStructInfo): This class is now known as `StructInfo' and nested
18117         in `TypeInfo'; we don't access this directly anymore.
18118
18119         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
18120         property and removed IsAssigned(), IsFieldAssigned(),
18121         SetAssigned() and SetFieldAssigned(); we now call them on the
18122         VariableInfo so we don't need to duplicate this code everywhere.
18123
18124         * expression.cs (ParameterReference): Added `Block block' argument
18125         to the .ctor.
18126         (LocalVariableReference, ParameterReference, This): The new
18127         VariableInfo class is now responsible for all the definite
18128         assignment stuff.
18129
18130         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
18131         IsParameterAssigned, SetParameterAssigned): Removed.
18132
18133 2003-05-18  Martin Baulig  <martin@ximian.com>
18134
18135         * typemanager.cs (InitCoreTypes): Try calling
18136         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
18137         the 3-args-version.  Corlib now also needs our `void_type'.
18138         (GetMethod): Added overloaded version which takes an optional
18139         `bool report_errors' to allow lookups of optional methods.
18140
18141 2003-05-12  Martin Baulig  <martin@ximian.com>
18142
18143         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
18144         only used for locals and not for parameters.
18145
18146 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
18147
18148         * support.cs (InternalParameters.ParameterType): Return the
18149         ExternalType of the parameter.
18150
18151         * parameter.cs (Parameter.ExternalType): drop the two arguments,
18152         they were unused.
18153
18154 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
18155
18156         * class.cs (MethodData.Define): Do not set the `newslot' on
18157         interface members, if they are also flagged as "override".
18158
18159         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
18160         better code for ++i and i++.  This only works for static fields
18161         and local variables.
18162
18163         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
18164         want to pull the DeclSpace out of the builder_to_declspace instead
18165         of the TypeBuilder (like in TypeContainer.FindMembers).
18166
18167         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
18168         instead of LookupTypeContainer.  Fixes the crash on .NET for
18169         looking up interface members.
18170
18171         * const.cs: Create our own emit context during the Definition
18172         stage, so that constants are evaluated in the proper context, when
18173         a recursive definition happens.
18174
18175 2003-05-11  Martin Baulig  <martin@ximian.com>
18176
18177         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
18178         new block for a switch section.
18179         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
18180         the adding/lookup in the switch block.  Fixes #39828.
18181
18182 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
18183
18184         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
18185         functionality: I needed to convert the data after I had performed
18186         the add/sub operation into the operands type size.
18187
18188         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
18189         pass the type for the box operation, otherwise the resulting
18190         object would have been of type object.
18191
18192         (BoxedCast): Add constructor to specify the type to box as.
18193
18194 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
18195
18196         * iterators.cs: I was reusing the `count' variable inadvertently,
18197         take steps to not allow this to happen.
18198
18199 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
18200
18201         * attribute.cs (Attribute.Resolve): Params attributes are encoded
18202         by creating an array at the point where the params starts and
18203         putting all those arguments there, then adjusting the size of the
18204         array.
18205
18206 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
18207
18208         * expression.cs (New.AddressOf): Implement interface
18209         IMemoryLocation.  This is used when the `new' operator is used in
18210         the context of an invocation to a method on a value type.
18211
18212         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
18213         example. 
18214
18215         * namespace.cs: Also check the using aliases here.
18216
18217         * driver.cs: Move the test for using validity after the types have
18218         been entered, so we do a single pass that also includes the using
18219         aliases. 
18220
18221         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
18222         in the regular case.   CreateSiblingForFinally is doing extra
18223         error checking.
18224
18225         * attribute.cs (GetAttributeArgumentExpression): Store the result
18226         on an out value, and use the return value to indicate failure
18227         instead of using null (which is a valid return for Constant.GetValue).
18228
18229         * statement.cs: Perform the analysis flow for the increment
18230         portion after the statement, because this will be the real flow of
18231         execution.  Fixes #42385
18232
18233         * codegen.cs (EmitContext.EmitArgument,
18234         EmitContext.EmitStoreArgument): New helper functions when the
18235         RemapToProxy flag is set.
18236
18237         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
18238         function.
18239
18240         Add support for remapping parameters. 
18241
18242         * iterators.cs: Propagate parameter values;  Store parameter
18243         values in the proxy classes.
18244
18245 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
18246
18247         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
18248         need a proxy reference;  I do not know what I was thinking
18249
18250         * cs-parser.jay (constructor_initializer): catch another error,
18251         and display nice message.
18252
18253         (field_declaration): catch void field declaration
18254         to flag a better error. 
18255
18256         * class.cs (MemberBase.CheckBase): Report an error instead of a
18257         warning if a new protected member is declared in a struct. 
18258         (Field.Define): catch the error of readonly/volatile.
18259
18260         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18261
18262         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
18263         volatile variable is taken
18264
18265 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
18266
18267         * statement.cs (Fixed.Resolve): Report an error if we are not in
18268         an unsafe context.
18269
18270 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
18271
18272         * typemanager.cs: reuse the code that handles type clashes for
18273         delegates and enumerations.
18274
18275         * class.cs (Report28): Always report.
18276
18277         * expression.cs (EncodeAsAttribute): Allow nulls here.
18278
18279 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
18280
18281         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18282         the functionality for testing whether an expression is valid for
18283         an attribute here.  Also handle the case of arrays of elements
18284         being stored. 
18285
18286         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18287         encoding a linear array into an array of objects that are suitable
18288         to be passed to an CustomAttributeBuilder.
18289
18290         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18291
18292         * ecore.cs: (FieldExpr): Handle field remapping here.
18293
18294         * iteratators.cs: Pass the instance variable (if the method is an
18295         instance method) to the constructors, so we can access the field
18296         variables on the class.
18297
18298         TODO: Test this with structs.  I think the THIS variable on
18299         structs might have to be a pointer, and not a refenrece
18300
18301 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
18302
18303         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18304         local variables to fields in a proxy class.
18305
18306         * iterators.cs (PopulateProxy): Rename our internal fields to
18307         <XXX>.  
18308         Create a <THIS> field if we are an instance method, so we can
18309         reference our parent container variables.
18310         (MapVariable): Called back from the EmitContext code to enter a
18311         new variable to field mapping into the proxy class (we just create
18312         a FieldBuilder).
18313
18314         * expression.cs
18315         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18316         for using the remapped locals to fields.
18317
18318         I placed the code here, because that gives the same semantics to
18319         local variables, and only changes the Emit code.
18320
18321         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18322         statements inside iterators.
18323         (VariableInfo): Add a FieldBuilder for the cases when we are
18324         remapping local variables to fields in a proxy class
18325
18326         * ecore.cs (SimpleNameResolve): Avoid testing two times for
18327         current_block != null.
18328
18329         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18330         not cope with strings, as it has been moved to the
18331         TableSwitchEmit.  Fixed bug in switch generation.
18332
18333         * expression.cs (New.DoResolve): Provide more context for the user
18334         when reporting an error.
18335
18336         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18337         pointers. 
18338
18339         * expression.cs (MemberAccess.DoResolve): When we get a type back,
18340         check the permissions for it.  Note than in a type-resolution
18341         context the check was already present in DeclSpace.ResolveType,
18342         but was missing from the MemberAccess.
18343
18344         (ArrayCreation.CheckIndices): warn if the user has
18345         more nested levels of expressions, but there are no more
18346         dimensions specified.  Avoids crash on bug 41906.
18347
18348 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
18349
18350         * statement.cs (Block): replace Implicit bool, for a generic
18351         flags.   
18352         New flag: `Unchecked'.  This is used during the EmitMeta phase
18353         (which is out-of-line with the regular Resolve/Emit process for a
18354         statement, as this is done ahead of time, but still gets a chance
18355         to call constant resolve).
18356
18357         (Block.Flags): new enum for adding a new flag.
18358
18359         (Block.EmitMeta): track the state of unchecked.
18360
18361         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18362         to enable constant resolution to work there as well.
18363
18364 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
18365
18366         * typemanager.cs (ienumerable_type): Also look up
18367         System.Collections.IEnumerable. 
18368
18369 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
18370
18371         TODO: Test more than one conditional per method.
18372
18373         * class.cs (Indexer.Define): Report the location where the user is
18374         referencing the unsupported feature.
18375
18376         (MethodData): Overload the use of `conditionals' to
18377         minimize the creation of needless ArrayLists.   This saves roughly
18378         212kb on my machine.
18379
18380         (Method): Implement the new IIteratorContainer interface.
18381         (Method.SetYields): Implement the method by setting the ModFlags
18382         to contain METHOD_YIELDS.
18383
18384         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18385         which just got set to null.
18386
18387         * iterators.cs: New file.
18388
18389         (Yield, YieldBreak): New statements.
18390
18391         * statement.cs (Return.Resolve): Flag an error if we are used in
18392         an iterator method.
18393
18394         * codegen.cs (InIterator): New flag set if the code is being
18395         compiled in an iterator method.
18396
18397         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
18398         internal modifier, and we just use it to avoid adding extra
18399         fields, as this is seldom used.  
18400
18401         * cs-parser.jay: Add yield_statement (yield and yield break).
18402
18403         * driver.cs: New flag -v2 to turn on version 2 features. 
18404
18405         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18406         hashtable when v2 is enabled.
18407
18408 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
18409
18410         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18411         there is already a namespace defined with this name.
18412
18413         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18414         people upgraded their corlibs.
18415
18416         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18417         always use fully qualified types, no need to use the compiler
18418         front end.
18419
18420         (TypeManager.IsNamespace): Use binarysearch.
18421
18422         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18423         AddDelegate): I did not quite use the new IsValid API properly: I
18424         have to pass the short-name and the fullname.  I was passing only
18425         the basename instead of the fullname sometimes. 
18426
18427         (TypeContainer.DefineType): call NamespaceClash.
18428
18429         * interface.cs (Interface.DefineType): use NamespaceClash before
18430         defining the type.
18431
18432         * delegate.cs (Delegate.DefineType): use NamespaceClash before
18433         defining the type.
18434
18435         * enum.cs: (Enum.DefineType): use NamespaceClash before
18436         defining the type.
18437
18438         * typemanager.cs (: 3-line patch that gives us some tasty 11%
18439         speed increase.  First, use the negative_hits cache when we get a
18440         negative.  Second, add the type with its full original name
18441         instead of the new . and + encoded name (reflection uses + to
18442         separate type from a nested type).  Use LookupTypeReflection
18443         directly which bypasses the type->name hashtable (that we already
18444         know does not contain the type.
18445
18446         * decl.cs (DeclSpace.ResolveTypeExpr): track the
18447         location/container type. 
18448
18449         * driver.cs: When passing utf8, use directly the UTF8Encoding.
18450
18451 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
18452
18453         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18454
18455         * delegate.cs (NewDelegate.Resolve): Test whether an instance
18456         method is being referenced in the method group from a static
18457         context, and report error 120 if so.
18458
18459         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18460         Error118. 
18461
18462         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18463         is created, we create the A namespace).
18464
18465         * cs-parser.jay: A namespace also introduces a DeclarationFound.
18466         Fixes #41591
18467
18468 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
18469
18470         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18471         invocation to ModuleBuilder.GetType with the same values will
18472         return a new type instance, so we need to cache its return
18473         values. 
18474
18475         * expression.cs (Binary.ResolveOperator): Only allow the compare
18476         operators on enums if they are of the same type.
18477
18478         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18479         types of ValueType on their own case.  Before we were giving them
18480         the same treatment as objects.
18481
18482         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18483         fullname.  Short name is used to compare against container name.
18484         Fullname is used to check against defined namespace names.
18485
18486         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18487         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18488
18489         (Method.CheckBase): Call parent.
18490         (MemberBase.CheckBase): Check for protected members on sealed
18491         classes.
18492         (PropertyBase.CheckBase): Call parent.
18493         (Field.Define): Call parent.
18494
18495         * report.cs: Negative error codes are now mapped to 8000 - code,
18496         so that the display is render more nicely.
18497
18498         * typemanager.cs: Do not use try/catch, instead report a regular
18499         error. 
18500
18501         (GetPointerType, GetReferenceType): These methods provide
18502         mechanisms to obtain the T* and T& from a T.  We had the code
18503         previously scattered around the code base, and it also used
18504         TypeManager.LookupType that would go through plenty of caches.
18505         This one goes directly to the type source.
18506
18507         In some places we did the Type.GetType followed by
18508         ModuleBuilder.GetType, but not in others, so this unifies the
18509         processing as well.
18510
18511         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18512         statements now that we have namespace information.
18513
18514         * typemanager.cs (IsNamespace): New method, returns whether the
18515         string presented is a namespace or not.
18516
18517         (ComputeNamespaces): New public entry point, computes the list of
18518         available namespaces, using the GetNamespaces API call in Mono, or
18519         the slower version in MS.NET.   
18520
18521         Now before we start the semantic analysis phase, we have a
18522         complete list of namespaces including everything that the user has
18523         provided.
18524
18525         Deleted old code to cache namespaces in .nsc files.
18526
18527 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
18528
18529         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18530         class/struct location definition Location for the implicit
18531         constructor location.
18532
18533         (Operator.Define): Use the location of the operator for the
18534         implicit Method definition.
18535
18536         (Constructor.Emit): use the constructor location for the implicit
18537         base initializer constructor.
18538
18539         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
18540         and the Expression class now contains two new methods:
18541
18542         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
18543         isolate type lookup from the rest of the resolution process.
18544
18545         Since we use Expressions to hold type definitions due to the way
18546         we parse the input we have historically overloaded Resolve to
18547         perform the Type lookups if a special flag is passed.  Now this is
18548         eliminated and two methods take their place. 
18549
18550         The differences in the two methods between xStep and xTerminal is
18551         that xStep is involved in our current lookup system that uses
18552         SimpleNames to compose a name, while xTerminal is used just to
18553         catch the case where the simplename lookup failed.
18554
18555 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
18556
18557         * expression.cs (ResolveMemberAccess): Remove redundant code.
18558         TypeExpr expressions are always born fully resolved.
18559
18560         * interface.cs (PopulateMethod): Do not lookup the types twice.
18561         We were doing it once during SemanticAnalysis and once during
18562         PopulateMethod.
18563
18564         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18565         in local variable type definitions, were being returned as a
18566         SimpleName (we decomposed everything into a string), that is
18567         because primary_expression was being used instead of a type in the
18568         grammar (reduce/reduce conflicts).
18569
18570         The part that was wrong is that we converted the expression into a
18571         string (an oversimplification in one hand, compounded with primary
18572         expressions doing string concatenation).
18573
18574         So things like:
18575
18576         A.B.C [] x;
18577
18578         Would return "A.B.C[]" as a SimpleName.  This stopped things like
18579         using clauses from working on this particular context.  And a type
18580         was being matched directly against "A.B.C[]".
18581
18582         We now use the correct approach, and allow for ComposedCast to be
18583         part of the unary expression.  So the "A.B.C []" become a composed
18584         cast of "A.B.C" (as a nested group of MemberAccess with a
18585         SimpleName at the end) plus the rank composition "[]". 
18586
18587         Also fixes 35567
18588
18589 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
18590
18591         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18592         for the access level checking.
18593
18594         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
18595         `TypeContainer container', because I kept getting confused when I
18596         was debugging this code.
18597
18598         * expression.cs (Indexers): Instead of tracking getters/setters,
18599         we now track them in parallel.  We create one arraylist less, but
18600         most importantly it is possible now for the LValue code to find a
18601         matching get for a set.
18602
18603         (IndexerAccess.DoResolveLValue): Update the code.
18604         GetIndexersForType has been modified already to extract all the
18605         indexers from a type.  The code assumed it did not.
18606
18607         Also make the code set the correct return type for the indexer.
18608         This was fixed a long time ago for properties, but was missing for
18609         indexers.  It used to be void_type.
18610
18611         (Binary.Emit): Test first for doubles instead of
18612         floats, as they are more common.
18613
18614         (Binary.EmitBranchable): Use the .un version of the branch opcodes
18615         when dealing with floats and the <=, >= operators.  This fixes bug
18616         #39314 
18617
18618         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18619         to load the array value by emitting a load on the foreach variable
18620         type.  This was incorrect.  
18621
18622         We now emit the code to load an element using the the array
18623         variable type, and then we emit the conversion operator.
18624
18625         Fixed #40176
18626
18627 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
18628
18629         * attribute.cs: Avoid allocation of ArrayLists in the common case.
18630
18631 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
18632
18633         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18634         test for protection before we test for signatures. 
18635
18636         (MethodSignature.ToString): implement.
18637
18638         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18639         to the case where we reduced into a LongConstant.
18640
18641         * decl.cs (CheckAccessLevel): If the type is an array, we can not
18642         depend on whether the information is acurrate, because the
18643         Microsoft runtime will always claim that the array type is public,
18644         regardless of the real state.
18645
18646         If the type is a pointer, another problem happens: the type is
18647         reported as non-public in Microsoft.  
18648
18649         In both cases we have to call CheckAccessLevel recursively with
18650         the underlying type as the argument to be tested.
18651
18652 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
18653
18654         * assign.cs (Assign.Emit): If we are dealing with a compound
18655         assignment expression, we should use the code path that stores the
18656         intermediate result in a temporary value.  This fixes #40903.
18657
18658         *expression.cs (Indirection.ToString): Provide ToString method for
18659         debugging. 
18660
18661 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
18662
18663         * class.cs: Null out fields holding references to Block objects so
18664         they can be garbage collected.
18665
18666         * expression.cs (OverloadResolve): Remove unused local.
18667
18668 2003-04-07  Martin Baulig  <martin@ximian.com>
18669
18670         * codegen.cs (EmitContext.CurrentFile): New public field.
18671         (EmitContext.Mark): Use the CurrentFile to check whether the
18672         location is in the correct file.
18673         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18674
18675 2003-04-07  Martin Baulig  <martin@ximian.com>
18676
18677         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18678
18679         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18680         location.  [FIXME: The location argument which gets passed to this
18681         method is sometimes wrong!]
18682
18683 2003-04-07  Nick Drochak <ndrochak@gol.com>
18684
18685         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18686
18687 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
18688
18689         * expression.cs (Indirection.EmitAssign): We were using the
18690         temporary, but returning immediately instead of continuing the
18691         EmitAssing flow.
18692
18693 2003-04-06  Martin Baulig  <martin@ximian.com>
18694
18695         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18696         if it's a nested child, but also deriving from the outer class.
18697         See test 190.cs.
18698
18699         * typemanager.cs (IsNestedChildOf): Make this work if it's a
18700         nested child, but also deriving from the outer class.  See
18701         test-190.cs.
18702         (FilterWithClosure): We may access private members of the outer
18703         class if we're a nested child and deriving from the outer class.
18704         (RealMemberLookup): Only set `closure_private_ok' if the
18705         `original_bf' contained BindingFlags.NonPublic.
18706
18707 2003-04-05  Martin Baulig  <martin@ximian.com>
18708
18709         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18710
18711 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
18712
18713         * class.cs (Event.Define): Do not allow abstract events to have
18714         initializers. 
18715
18716 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
18717
18718         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18719         block in event declarations.
18720
18721         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18722         value type, get its address.
18723
18724         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18725         leaving a class on the stack instead of a boolean value (int
18726         0/1).  Change the code so we compare against null, and then the
18727         result against zero.
18728
18729         * class.cs (TypeContainer.GetClassBases): We were checking for the
18730         parent class being sealed too late.
18731
18732         * expression.cs (Binary.Emit): For <= and >= when dealing with
18733         floating point values, use cgt.un and clt.un instead of cgt and
18734         clt alone.
18735
18736 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
18737
18738         * statement.cs: Apply the same optimization as MS: skip the 
18739         GetEnumerator returning an IEnumerator, and use the one returning a 
18740         CharEnumerator instead. This allows us to avoid the try-finally block 
18741         and the boxing.
18742
18743 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
18744
18745         * cs-parser.jay: Attributes cannot be applied to
18746                          namespaces. Fixes #40473
18747
18748 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18749
18750         * class.cs:
18751         (Add*): check if the name is valid using the full name for constants,
18752         fields, properties and events.
18753
18754 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
18755
18756         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18757         char constants to be part of the enumeration.
18758
18759         * expression.cs (Conditional.DoResolve): Add support for operator
18760         true. Implements the missing functionality from 14.12
18761
18762         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18763         operator true/false as required by the spec.
18764
18765         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18766         implicit conversion to boolean.
18767
18768         * statement.cs (Statement.ResolveBoolean): A boolean expression is
18769         also one where the type implements `operator true'. 
18770
18771         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18772         get an expression that will invoke operator true based on an
18773         expression.  
18774
18775         (GetConversionOperators): Removed the hack that called op_True
18776         here.  
18777
18778         (Expression.ResolveBoolean): Move this from Statement.
18779
18780 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
18781
18782         * ecore.cs (FieldExpr): do not allow initialization of initonly
18783         fields on derived classes
18784
18785 2003-03-13  Martin Baulig  <martin@ximian.com>
18786
18787         * statement.cs (Block.Emit): Call ig.BeginScope() and
18788         ig.EndScope() when compiling with debugging info; call
18789         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18790
18791 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
18792
18793         * expression.cs (Indexers): Do not construct immediately, allow
18794         for new members to be appended as we go.  Fixes 38143
18795
18796 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18797
18798         * expression.cs: save/restore context when resolving an unchecked
18799         expression.
18800
18801 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
18802
18803         * cfold.cs: Catch division by zero in modulus operator during
18804         constant folding.
18805
18806 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
18807
18808         * interface.cs (Interface.DefineMembers): Avoid defining members
18809         twice. 
18810
18811 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
18812
18813         * driver.cs: handle the +/- options for -noconfig
18814
18815         * statement.cs (Unckeched.Resolve): Also track the state of
18816         unchecked in the Resolve phase.
18817
18818 2003-02-27  Martin Baulig  <martin@ximian.com>
18819
18820         * ecore.cs (Expression.MemberLookup): Don't create a
18821         MethodGroupExpr for something which is not a method.  Fixes #38291.
18822
18823 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
18824
18825         * class.cs (MemberBase.CheckParameters): Also check that the type
18826         is unmanaged if it is a pointer.
18827
18828         * expression.cs (SizeOf.Resolve): Add location information.
18829
18830         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18831         a managed type is declared.
18832
18833         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18834         parameter modifiers as well.  Fixes bug 38606
18835
18836         * class.cs: Very sad.  Am backing out the speed up changes
18837         introduced by the ArrayList -> Array in the TypeContainer, as they
18838         were not actually that much faster, and introduced a bug (no error
18839         reports on duplicated methods).
18840
18841         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18842         source first, this will guarantee that we have a valid expression
18843         before calling in lower levels functions that will require a
18844         resolved object.  Then use this original_source in the
18845         target.ResolveLValue instead of the original source that was
18846         passed to us.
18847
18848         Another change.  Use target.Resolve instead of LValueResolve.
18849         Although we are resolving for LValues, we will let the Assign code
18850         take care of that (it will be called again from Resolve).  This
18851         basically allows code like this:
18852
18853         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18854         class Y { void A (X x) { x [0] += o; }
18855
18856         The problem was that the indexer was trying to resolve for
18857         set_Item (idx, object o) and never finding one.  The real set_Item
18858         was set_Item (idx, X).  By delaying the process we get the right
18859         semantics. 
18860
18861         Fixes bug 36505
18862
18863 2003-02-23  Martin Baulig  <martin@ximian.com>
18864
18865         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18866         while calling DoEmit ().
18867
18868         * codegen.cs (EmitContext.Mark): Don't mark locations in other
18869         source files; if you use the #line directive inside a method, the
18870         compiler stops emitting line numbers for the debugger until it
18871         reaches the end of the method or another #line directive which
18872         restores the original file.
18873
18874 2003-02-23  Martin Baulig  <martin@ximian.com>
18875
18876         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18877
18878 2003-02-23  Martin Baulig  <martin@ximian.com>
18879
18880         * statement.cs (Block.AddChildVariableNames): We need to call this
18881         recursively, not just for our immediate children.
18882
18883 2003-02-23  Martin Baulig  <martin@ximian.com>
18884
18885         * class.cs (Event.Define): Always make the field private, like csc does.
18886
18887         * typemanager.cs (TypeManager.RealMemberLookup): Make events
18888         actually work, fixes bug #37521.
18889
18890 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
18891
18892         * delegate.cs: When creating the various temporary "Parameters"
18893         classes, make sure that we call the ComputeAndDefineParameterTypes
18894         on those new parameters (just like we do with the formal ones), to
18895         allow them to be resolved in the context of the DeclSpace.
18896
18897         This fixes the bug that Dick observed in Bugzilla #38530.
18898
18899 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
18900
18901         * expression.cs (ResolveMemberAccess): When resolving a constant,
18902         do not attempt to pull a constant if the value was not able to
18903         generate a valid constant.
18904
18905         * const.cs (LookupConstantValue): Do not report more errors than required.
18906
18907 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18908
18909         * expression.cs: fixes bug #38328.
18910
18911 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
18912
18913         * class.cs: Changed all the various members that can be part of a
18914         class from being an ArrayList to be an Array of the right type.
18915         During the DefineType type_list, interface_list, delegate_list and
18916         enum_list are turned into types, interfaces, delegates and enums
18917         arrays.  
18918
18919         And during the member population, indexer_list, event_list,
18920         constant_list, field_list, instance_constructor_list, method_list,
18921         operator_list and property_list are turned into their real arrays.
18922
18923         Although we could probably perform this operation earlier, for
18924         good error reporting we need to keep the lists and remove the
18925         lists for longer than required.
18926
18927         This optimization was triggered by Paolo profiling the compiler
18928         speed on the output of `gen-sample-program.pl' perl script. 
18929
18930         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
18931         not crash in methods like MemberLookupFailed that use this field.  
18932
18933         This problem arises when the compiler fails to resolve a type
18934         during interface type definition for example.
18935
18936 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
18937
18938         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
18939         inherit from System.Object, so we have to stop at null, not only
18940         when reaching System.Object.
18941
18942 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
18943
18944         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
18945         DeclaredOnly because the parent indexer might have had a different
18946         name, but did not loop until the top of the hierarchy was reached.
18947
18948         The problem this one fixes is 35492: when a class implemented an
18949         indexer from an interface, we were getting the interface method
18950         (which was abstract) and we were flagging an error (can not invoke
18951         abstract method).
18952
18953         This also keeps bug 33089 functioning, and test-148 functioning.
18954
18955         * typemanager.cs (IsSpecialMethod): The correct way of figuring
18956         out if a method is special is to see if it is declared in a
18957         property or event, or whether it is one of the predefined operator
18958         names.   This should fix correctly #36804.
18959
18960 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
18961
18962         The goal here is to remove the dependency on EmptyCast.Peel ().
18963         Killing it completely.
18964
18965         The problem is that currently in a number of places where
18966         constants are expected, we have to "probe" for an EmptyCast, and
18967         Peel, which is not the correct thing to do, as this will be
18968         repetitive and will likely lead to errors. 
18969
18970         The idea is to remove any EmptyCasts that are used in casts that
18971         can be reduced to constants, so we only have to cope with
18972         constants. 
18973
18974         This bug hunt was triggered by Bug 37363 and the desire to remove
18975         the duplicate pattern where we were "peeling" emptycasts to check
18976         whether they were constants.  Now constants will always be
18977         constants.
18978
18979         * ecore.cs: Use an enumconstant here instead of wrapping with
18980         EmptyCast.  
18981
18982         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
18983         throwing me off.  By handling this we can get rid of a few hacks.
18984
18985         * statement.cs (Switch): Removed Peel() code.
18986
18987 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
18988
18989         * class.cs: Location information for error 508
18990
18991         * expression.cs (New.DoResolve): Add a guard against double
18992         resolution of an expression.  
18993
18994         The New DoResolve might be called twice when initializing field
18995         expressions (see EmitFieldInitializers, the call to
18996         GetInitializerExpression will perform a resolve on the expression,
18997         and later the assign will trigger another resolution
18998
18999         This leads to bugs (#37014)
19000
19001         * delegate.cs: The signature for EndInvoke should contain any ref
19002         or out parameters as well.  We were not doing this in the past. 
19003
19004         * class.cs (Field.Define): Do not overwrite the type definition
19005         inside the `volatile' group.  Turns out that volatile enumerations
19006         were changing the type here to perform a validity test, which
19007         broke conversions. 
19008
19009 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
19010
19011         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
19012         and structs, we do not want to load the instance variable
19013
19014         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
19015         enum_type has to be handled like an object reference (implicit
19016         conversions exists from this to object), but the regular IsClass
19017         and IsValueType tests will never return true for this one.
19018
19019         Also we use TypeManager.IsValueType instead of type.IsValueType,
19020         just for consistency with the rest of the code (this is only
19021         needed if we ever use the construct exposed by test-180.cs inside
19022         corlib, which we dont today).
19023
19024 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
19025
19026         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
19027         just InternalCall.
19028
19029 2003-02-09  Martin Baulig  <martin@ximian.com>
19030
19031         * namespace.cs (Namespace..ctor): Added SourceFile argument.
19032         (Namespace.DefineNamespaces): New static public method; this is
19033         called when we're compiling with debugging to add all namespaces
19034         to the symbol file.
19035
19036         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
19037         pass it to the Namespace's .ctor.
19038
19039         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
19040         and MethodBase arguments; pass the namespace ID to the symwriter;
19041         pass the MethodBase instead of the token to the symwriter.
19042         (SymbolWriter.DefineNamespace): New method to add a namespace to
19043         the symbol file.
19044
19045 2003-02-09  Martin Baulig  <martin@ximian.com>
19046
19047         * symbolwriter.cs: New file.  This is a wrapper around
19048         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
19049         methods here in near future.
19050
19051 2003-02-09  Martin Baulig  <martin@ximian.com>
19052
19053         * codegen.cs (EmitContext.Mark): Just pass the arguments to
19054         ILGenerator.MarkSequencePoint() which are actually used by the
19055         symbol writer.
19056
19057 2003-02-09  Martin Baulig  <martin@ximian.com>
19058
19059         * location.cs (SourceFile): New public sealed class.  This
19060         contains the name and an index which is used in the location's token.
19061         (Location): Reserve an appropriate number of bits in the token for
19062         the source file instead of walking over that list, this gives us a
19063         really huge performance improvement when compiling with debugging.
19064
19065         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
19066         `SourceFile' argument instead of a string.
19067         (Driver.ProcessFile): Add all the files via Location.AddFile(),
19068         but don't parse/tokenize here, we need to generate the list of all
19069         source files before we do that.
19070         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
19071         the files.
19072
19073         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
19074         instead of a string.
19075
19076         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
19077         of a string.
19078
19079 2003-02-09  Martin Baulig  <martin@ximian.com>
19080
19081         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
19082         filename on `#line default'.
19083
19084 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
19085
19086         * statement.cs: don't clear the pinned var when the fixed statement
19087         returns from the method (fixes bug#37752).
19088
19089 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
19090
19091         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
19092         to IsValueType.
19093
19094 2003-02-07  Martin Baulig  <martin@ximian.com>
19095
19096         * driver.cs: Removed the `--debug-args' command line argument.
19097
19098         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
19099         automatically by the AsssemblyBuilder.
19100         (CodeGen.InitializeSymbolWriter): We don't need to call any
19101         initialization function on the symbol writer anymore.  This method
19102         doesn't take any arguments.
19103
19104 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
19105
19106         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
19107         from referenced assemblies as well.
19108
19109 2003-02-02  Martin Baulig  <martin@ximian.com>
19110
19111         * class.cs (MethodData.Emit): Generate debugging info for external methods.
19112
19113 2003-02-02  Martin Baulig  <martin@ximian.com>
19114
19115         * class.cs (Constructor.Emit): Open the symbol writer before
19116         emitting the constructor initializer.
19117         (ConstructorInitializer.Emit): Call ec.Mark() to allow
19118         single-stepping through constructor initializers.
19119
19120 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
19121
19122         * class.cs: Handle error 549: do not allow virtual methods in
19123         sealed classes. 
19124
19125 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
19126
19127         * decl.cs: Check access levels when resolving types
19128
19129 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
19130
19131         * statement.cs: Add parameters and locals set in catch blocks that might 
19132         return to set vector
19133
19134 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
19135
19136         * class.cs (Operator): Set the SpecialName flags for operators.
19137
19138         * expression.cs (Invocation.DoResolve): Only block calls to
19139         accessors and operators on SpecialName methods.
19140
19141         (Cast.TryReduce): Handle conversions from char constants.
19142
19143
19144 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
19145
19146         * statement.cs: small memory and time optimization in FlowBranching.
19147
19148 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
19149
19150         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
19151         problem that the last fix but in the other sid (Set).
19152
19153         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
19154         access when there is no indexer in the hierarchy.
19155
19156 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
19157
19158         * class.cs: Combine some if statements.
19159
19160 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19161
19162         * driver.cs: fixed bug #37187.
19163
19164 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
19165
19166         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
19167         any indexer, it's needed to build a list with all the indexers in the
19168         hierarchy (AllGetters), else we have problems. Fixes #35653.
19169
19170 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
19171
19172         * class.cs (MethodData.Define): It is wrong for an interface
19173         implementation to be static in both cases: explicit and implicit.
19174         We were only handling this in one case.
19175
19176         Improve the if situation there to not have negations.
19177
19178         * class.cs (Field.Define): Turns out that we do not need to check
19179         the unsafe bit on field definition, only on usage.  Remove the test.
19180
19181 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19182
19183         * driver.cs: use assembly.Location instead of Codebase (the latest
19184         patch made mcs fail when using MS assemblies).
19185
19186 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
19187
19188         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
19189         get the path to *corlib.dll.
19190
19191 2003-01-21  Nick Drochak <ndrochak@gol.com>
19192
19193         * cs-tokenizer.cs:
19194         * pending.cs:
19195         * typemanager.cs: Remove compiler warnings
19196
19197 2003-01-20  Duncan Mak  <duncan@ximian.com>
19198
19199         * AssemblyInfo.cs: Bump the version number to 0.19.
19200
19201 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19202
19203         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
19204
19205 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
19206
19207         * class.cs (Constructor::Emit): Emit debugging info for constructors.
19208
19209 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
19210
19211         * cs-parser.jay: Small fix: we were not comparing the constructor
19212         name correctly.   Thanks to Zoltan for the initial pointer.
19213
19214 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
19215
19216         * cs-tokenizer.cs: Set file name when specified with #line
19217
19218 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
19219
19220         * cs-parser.jay: Only perform the constructor checks here if we
19221         are named like the class;  This will help provider a better
19222         error.  The constructor path is taken when a type definition is
19223         not found, but most likely the user forgot to add the type, so
19224         report that rather than the constructor error.
19225
19226 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
19227
19228         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
19229         allocations.
19230
19231 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19232
19233         * cs-parser.jay: Add cleanup call.
19234
19235 2003-01-13  Duncan Mak  <duncan@ximian.com>
19236
19237         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
19238         consistent with other methods.
19239
19240 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19241
19242         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
19243
19244 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
19245
19246         * attribute.cs: only set GuidAttr to true when we have a
19247         GuidAttribute.
19248
19249 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19250
19251         * ecore.cs:
19252         * expression.cs:
19253         * typemanager.cs: fixes to allow mcs compile corlib with the new
19254         Type.IsSubclassOf fix.
19255
19256 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
19257
19258         * expression.cs (LocalVariableReference.DoResolve): Classify a
19259         constant as a value, not as a variable.   Also, set the type for
19260         the variable.
19261
19262         * cs-parser.jay (fixed_statement): take a type instead of a
19263         pointer_type, so we can produce a better error message later.
19264
19265         * statement.cs (Fixed.Resolve): Flag types that are not pointers
19266         as an error.  
19267
19268         (For.DoEmit): Make inifinite loops have a
19269         non-conditional branch back.
19270
19271         (Fixed.DoEmit): First populate the pinned variables, then emit the
19272         statement, then clear the variables.  Before I was emitting the
19273         code once for each fixed piece.
19274
19275
19276 2003-01-08  Martin Baulig  <martin@ximian.com>
19277
19278         * statement.cs (FlowBranching.MergeChild): A break in a
19279         SWITCH_SECTION does not leave a loop.  Fixes #36155.
19280
19281 2003-01-08  Martin Baulig  <martin@ximian.com>
19282
19283         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19284         lives in the same number space than `param_map'.  Fixes #36154.
19285
19286 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
19287
19288         * cs-parser.jay (constructor_declaration): Set the
19289         Constructor.ModFlags before probing for it.  This makes the
19290         compiler report 514, 515 and 132 (the code was there, but got
19291         broken). 
19292
19293         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19294         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19295         (GotoCase.Resolve): Set `Returns' to ALWAYS.
19296
19297 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19298
19299         * enum.cs: create the enum static fields using the enum type.
19300
19301 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19302
19303         * class.cs: don't try to create the ParamBuilder for the return
19304         type if it's not needed (and handle it breaking for the ms runtime
19305         anyway).
19306
19307 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19308
19309         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19310
19311 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
19312
19313         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19314         the command.   This showed up while compiling the JANET source
19315         code, which used \r as its only newline separator.
19316
19317 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
19318
19319         * class.cs (Method.Define): If we are an operator (because it
19320         reuses our code), then set the SpecialName and HideBySig.  #36128
19321
19322 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
19323
19324         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19325         exception, report error 120 `object reference required'.
19326
19327         * driver.cs: Add --pause option, used during to measure the size
19328         of the process as it goes with --timestamp.
19329
19330         * expression.cs (Invocation.DoResolve): Do not allow methods with
19331         SpecialName to be invoked.
19332
19333 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
19334
19335         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19336         number before adding it.
19337
19338 2002-12-21  Ravi Pratap  <ravi@ximian.com>
19339
19340         * ecore.cs (StandardImplicitConversion): When in an unsafe
19341         context, we allow conversion between void * to any other pointer
19342         type. This fixes bug #35973.
19343
19344 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19345
19346         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19347         is not thrown when extensionless outputs are used 
19348
19349 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19350
19351         * rootcontext.cs: fixed compilation of corlib.
19352
19353 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
19354
19355         * attribute.cs (Attributes.Contains): Add new method.
19356
19357         * class.cs (MethodCore.LabelParameters): if the parameter is an
19358         `out' parameter, check that no attribute `[In]' has been passed.
19359
19360         * enum.cs: Handle the `value__' name in an enumeration.
19361
19362 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
19363
19364         * decl.cs: Added special case to allow overrides on "protected
19365         internal" methods
19366
19367 2002-12-18  Ravi Pratap  <ravi@ximian.com>
19368
19369         * attribute.cs (Attributes.AddAttributeSection): Rename to this
19370         since it makes much more sense.
19371
19372         (Attributes.ctor): Don't require a Location parameter.
19373
19374         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19375
19376         * attribute.cs (ApplyAttributes): Remove extra Location parameters
19377         since we already have that information per attribute.
19378
19379         * everywhere : make appropriate changes.
19380
19381         * class.cs (LabelParameters): Write the code which actually
19382         applies attributes to the return type. We can't do this on the MS
19383         .NET runtime so we flag a warning in the case an exception is
19384         thrown.
19385
19386 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
19387
19388         * const.cs: Handle implicit null conversions here too.
19389
19390 2002-12-17  Ravi Pratap  <ravi@ximian.com>
19391
19392         * class.cs (MethodCore.LabelParameters): Remove the extra
19393         Type [] parameter since it is completely unnecessary. Instead
19394         pass in the method's attributes so that we can extract
19395         the "return" attribute.
19396
19397 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
19398
19399         * cs-parser.jay (parse): Use Report.Error to flag errors instead
19400         of ignoring it and letting the compile continue.
19401
19402         * typemanager.cs (ChangeType): use an extra argument to return an
19403         error condition instead of throwing an exception.
19404
19405 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
19406
19407         * expression.cs (Unary.TryReduce): mimic the code for the regular
19408         code path.  Perform an implicit cast in the cases where we can
19409         implicitly convert to one of the integral types, and then reduce
19410         based on that constant.   This fixes bug #35483.
19411
19412 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19413
19414         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19415
19416 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19417
19418         * namespace.cs: fixed bug #35489.
19419
19420 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
19421
19422         * class.cs: Remove some dead code.
19423
19424         * cs-parser.jay: Estimate the number of methods needed
19425         (RootContext.MethodCount);
19426
19427         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19428         numbers instead of StringBuilders.
19429
19430         * support.cs (PtrHashtable): Add constructor with initial size;
19431         We can now reduce reallocations of the method table.
19432
19433 2002-12-10  Ravi Pratap  <ravi@ximian.com>
19434
19435         * attribute.cs (ApplyAttributes): Keep track of the emitted
19436         attributes on a per-target basis. This fixes bug #35413.
19437
19438 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
19439
19440         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19441         default to the Windows 1252 encoding.
19442
19443         (UnixParseOption): Support version, thanks to Alp for the missing
19444         pointer. 
19445
19446         * AssemblyInfo.cs: Add nice assembly information.
19447
19448         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19449         (bug 35169).
19450
19451         * cs-parser.jay: Allow a trailing comma before the close bracked
19452         in the attribute_section production.
19453
19454         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19455         address of the instance was being taken, I will take this out,
19456         because we take the address of the object immediately here.
19457
19458 2002-12-09  Ravi Pratap  <ravi@ximian.com>
19459
19460         * typemanager.cs (AreMultipleAllowed): Take care of the most
19461         obvious case where attribute type is not in the current assembly -
19462         stupid me ;-)
19463
19464 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
19465
19466         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19467         definitions, instead of doing that afterwards.  
19468
19469         Also we use a nice little hack, depending on the constructor, we
19470         know if we are a "composed" name or a simple name.  Hence, we
19471         avoid the IndexOf test, and we avoid 
19472
19473         * codegen.cs: Add code to assist in a bug reporter to track down
19474         the source of a compiler crash. 
19475
19476 2002-12-07  Ravi Pratap  <ravi@ximian.com>
19477
19478         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19479         types have been emitted for a given element and flag an error
19480         if something which does not have AllowMultiple set is used more
19481         than once.
19482
19483         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19484         attribute types and their corresponding AllowMultiple properties
19485
19486         (AreMultipleAllowed): Check the property for a given type.
19487
19488         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19489         property in the case we have a TypeContainer.
19490
19491         (Attributes.AddAttribute): Detect duplicates and just skip on
19492         adding them. This trivial fix catches a pretty gross error in our
19493         attribute emission - global attributes were being emitted twice!
19494
19495         Bugzilla bug #33187 is now fixed.
19496
19497 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
19498
19499         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19500         instead of pp_and).
19501
19502         * expression.cs (Binary.ResolveOperator): I can only use the
19503         Concat (string, string, string) and Concat (string, string,
19504         string, string) if the child is actually a concatenation of
19505         strings. 
19506
19507 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
19508
19509         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19510         context where we need a 2-character lookahead.
19511
19512         * pending.cs (PendingImplementation): Rework so we can keep track
19513         of interface types all the time, and flag those which were
19514         implemented by parents as optional.
19515
19516 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
19517
19518         * expression.cs (Binary.ResolveOperator): Use
19519         String.Concat(string,string,string) or
19520         String.Concat(string,string,string,string) when possible. 
19521
19522         * typemanager: More helper methods.
19523
19524
19525 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19526
19527         * pending.cs: remove the bogus return from GetMissingInterfaces()
19528         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19529
19530 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19531
19532         * namespace.cs: avoid duplicated 'using xxx' being added to
19533         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19534         when we get more than one 'using' statement for the same namespace.
19535         Report a CS0105 warning for it.
19536
19537 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
19538
19539         * cs-tokenizer.cs (consume_identifier): use read directly, instead
19540         of calling getChar/putback, uses internal knowledge of it.    
19541
19542         (xtoken): Reorder tokenizer so most common patterns are checked
19543         first.  This reduces the compilation time in another 5% (from 8.11s
19544         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19545
19546         The parsing time is 22% of the compilation in mcs, and from that
19547         64% is spent on the tokenization process.  
19548
19549         I tried using a binary search for keywords, but this is slower
19550         than the hashtable.  Another option would be to do a couple of
19551         things:
19552
19553                 * Not use a StringBuilder, instead use an array of chars,
19554                   with a set value.  Notice that this way we could catch
19555                   the 645 error without having to do it *afterwards*.
19556
19557                 * We could write a hand-parser to avoid the hashtable
19558                   compares altogether.
19559
19560         The identifier consumption process takes 37% of the tokenization
19561         time.  Another 15% is spent on is_number.  56% of the time spent
19562         on is_number is spent on Int64.Parse:
19563
19564                 * We could probably choose based on the string length to
19565                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
19566                   computations. 
19567
19568         Another 3% is spend on wrapping `xtoken' in the `token' function.
19569
19570         Handle 0xa0 as whitespace (#34752)
19571
19572 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
19573
19574         * typemanager.cs (IsCLRType): New routine to tell whether a type
19575         is one of the builtin types.  
19576
19577         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
19578         typecode in more places instead of doing pointer comparissions.
19579         We could leverage some knowledge about the way the typecodes are
19580         laid out.
19581
19582         New code to cache namespaces in assemblies, it is currently not
19583         invoked, to be used soon.
19584
19585         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19586
19587         * expression.cs (Binary.ResolveOperator): specially handle
19588         strings, and do not perform user-defined operator overloading for
19589         built-in types.
19590
19591 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
19592
19593         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19594         internalcall as it is a pretty simple operation;  Avoid whenever
19595         possible to call Char.IsLetter.
19596
19597         (consume_identifier): Cut by half the number of
19598         hashtable calls by merging the is_keyword and GetKeyword behavior.
19599
19600         Do not short-circuit, because if we do, we
19601         report errors (ie, #if false && true would produce an invalid
19602         directive error);
19603
19604
19605 2002-11-24  Martin Baulig  <martin@ximian.com>
19606
19607         * expression.cs (Cast.TryReduce): If we're in checked syntax,
19608         check constant ranges and report a CS0221.  Fixes #33186.
19609
19610 2002-11-24  Martin Baulig  <martin@ximian.com>
19611
19612         * cs-parser.jay: Make this work for uninitialized variable
19613         declarations in the `for' initializer.  Fixes #32416.
19614
19615 2002-11-24  Martin Baulig  <martin@ximian.com>
19616
19617         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19618         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
19619
19620 2002-11-24  Martin Baulig  <martin@ximian.com>
19621
19622         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19623         argument; if true, we also check for user-defined conversions.
19624         This is only needed if both arguments are of a user-defined type.
19625         Fixes #30443, added test-175.cs.
19626         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19627
19628         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19629
19630 2002-11-24  Martin Baulig  <martin@ximian.com>
19631
19632         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19633         function to get the store opcode.
19634         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19635         only emit the Ldelema if the store opcode is Stobj.  You must run
19636         both test-34 and test-167 to test this.  Fixes #34529.
19637
19638 2002-11-23  Martin Baulig  <martin@ximian.com>
19639
19640         * ecore.cs (Expression.MemberLookup): Added additional
19641         `qualifier_type' argument which is used when we're being called
19642         from MemberAccess.DoResolve() and null if we're called from a
19643         SimpleName lookup.
19644         (Expression.MemberLookupFailed): New method to report errors; this
19645         does the CS1540 check and reports the correct error message.
19646
19647         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19648         argument for the CS1540 check and redone the way how we're dealing
19649         with private members.  See the comment in the source code for details.
19650         (FilterWithClosure): Reverted this back to revision 1.197; renamed
19651         `closure_start_type' to `closure_qualifier_type' and check whether
19652         it's not null.  It was not this filter being broken, it was just
19653         being called with the wrong arguments.
19654
19655         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19656         and pass it the correct `qualifier_type'; this also does the error
19657         handling for us.
19658
19659 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
19660
19661         * expression.cs (Invocation.EmitParams): If the we are dealing
19662         with a non-built-in value type, load its address as well.
19663
19664         (ArrayCreation): Use a a pretty constant instead
19665         of the hardcoded value 2.   Use 6 instead of 2 for the number of
19666         static initializers.  
19667
19668         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19669         because they are not really value types, just glorified integers. 
19670
19671         * driver.cs: Do not append .exe, the CSC compiler does not do it.
19672
19673         * ecore.cs: Remove redundant code for enumerations, make them use
19674         the same code path as everything else, fixes the casting issue
19675         with enumerations in Windows.Forms.
19676
19677         * attribute.cs: Do only cast to string if it is a string, the
19678         validation happens later.
19679
19680         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19681         people upgrade their corlibs.
19682
19683         * ecore.cs: Oops, enumerations were not following the entire code path
19684
19685 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
19686
19687         * typemanager.cs (FilterWithClosure): Commented out the test for
19688         1540 in typemanager.cs, as it has problems when accessing
19689         protected methods from a parent class (see test-174.cs). 
19690
19691         * attribute.cs (Attribute.ValidateGuid): new method.
19692         (Attribute.Resolve): Use above.
19693
19694 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
19695
19696         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19697
19698         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19699         handling for enumerations, as we only needed the TypeContainer
19700         functionality to begin with (this is required for the fix below to
19701         work for enums that reference constants in a container class for
19702         example). 
19703
19704         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19705
19706         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19707         a valid TypeBuilder to perform lookups on.o
19708
19709         * class.cs (InheritableMemberSignatureCompare): Use true in the
19710         call to GetGetMethod and GetSetMethod, because we are comparing
19711         the signature, and we need to get the methods *even* if they are
19712         private. 
19713
19714         (PropertyBase.CheckBase): ditto.
19715
19716         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19717         GotoCase.Resolve): Use Peel on EmpytCasts.
19718
19719         * ecore.cs (EmptyCast): drop child, add Peel method.
19720
19721 2002-11-17  Martin Baulig  <martin@ximian.com>
19722
19723         * ecore.cs (EmptyCast.Child): New public property.
19724
19725         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19726         label resolved to an EmptyCast.  Fixes #34162.
19727         (GotoCase.Resolve): Likewise.
19728         (Block.EmitMeta): Likewise.
19729
19730 2002-11-17  Martin Baulig  <martin@ximian.com>
19731
19732         * expression.cs (Invocation.BetterConversion): Prefer int over
19733         uint; short over ushort; long over ulong for integer literals.
19734         Use ImplicitConversionExists instead of StandardConversionExists
19735         since we also need to check for user-defined implicit conversions.
19736         Fixes #34165.  Added test-173.cs.
19737
19738 2002-11-16  Martin Baulig  <martin@ximian.com>
19739
19740         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19741         with the `true' and `false' literals.  Fixes #33151.
19742
19743 2002-11-16  Martin Baulig  <martin@ximian.com>
19744
19745         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19746         October 22nd; don't do the cs1540 check for static members.
19747
19748         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19749         now using our own filter here and doing the cs1540 check again.
19750
19751 2002-11-16  Martin Baulig  <martin@ximian.com>
19752
19753         * support.cs (InternalParameters): Don't crash if we don't have
19754         any fixed parameters.  Fixes #33532.
19755
19756 2002-11-16  Martin Baulig  <martin@ximian.com>
19757
19758         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19759         when looking up static methods to make this work on Windows.
19760         Fixes #33773.
19761
19762 2002-11-16  Martin Baulig  <martin@ximian.com>
19763
19764         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19765         a setter rather than using PropertyInfo.CanWrite.
19766
19767 2002-11-15  Nick Drochak  <ndrochak@gol.com>
19768
19769         * class.cs: Allow acces to block member by subclasses. Fixes build
19770         breaker.
19771
19772 2002-11-14  Martin Baulig  <martin@ximian.com>
19773
19774         * class.cs (Constructor.Emit): Added the extern/block check.
19775         Fixes bug #33678.
19776
19777 2002-11-14  Martin Baulig  <martin@ximian.com>
19778
19779         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19780         iteration while looking for indexers, this is needed because the
19781         indexer may have a different name in our base classes.  Fixed the
19782         error reporting (no indexers at all, not get accessor, no
19783         overloaded match).  Fixes bug #33089.
19784         (IndexerAccess.DoResolveLValue): Likewise.
19785
19786 2002-11-14  Martin Baulig  <martin@ximian.com>
19787
19788         * class.cs (PropertyBase.CheckBase): Make this work for multiple
19789         indexers.  Fixes the first part of bug #33089.
19790         (MethodSignature.InheritableMemberSignatureCompare): Added support
19791         for properties.
19792
19793 2002-11-13  Ravi Pratap  <ravi@ximian.com>
19794
19795         * attribute.cs (Attribute.Resolve): Catch the
19796         NullReferenceException and report it since it isn't supposed to
19797         happen. 
19798
19799 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
19800
19801         * expression.cs (Binary.EmitBranchable): Also handle the cases for
19802         LogicalOr and LogicalAnd that can benefit from recursively
19803         handling EmitBranchable.  The code now should be nice for Paolo.
19804
19805 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
19806
19807         * typemanager.cs (LookupType): Added a negative-hit hashtable for
19808         the Type lookups, as we perform quite a number of lookups on
19809         non-Types.  This can be removed once we can deterministically tell
19810         whether we have a type or a namespace in advance.
19811
19812         But this might require special hacks from our corlib.
19813
19814         * TODO: updated.
19815
19816         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19817         and double which avoids a conversion from an integer to a double.
19818
19819         * expression.cs: tiny optimization, avoid calling IsConstant,
19820         because it effectively performs the lookup twice.
19821
19822 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
19823
19824         But a bogus return here to keep the semantics of the old code
19825         until the Mono runtime is fixed.
19826
19827         * pending.cs (GetMissingInterfaces): New method used to remove all
19828         the interfaces that are already implemented by our parent
19829         classes from the list of pending methods. 
19830
19831         * interface.cs: Add checks for calls after ResolveTypeExpr.
19832
19833 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
19834
19835         * class.cs (Class.Emit): Report warning 67: event not used if the
19836         warning level is beyond 3.
19837
19838         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19839         being a NullLiteral.
19840
19841         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19842         specifiers. 
19843
19844         * class.cs (TypeContainer.GetClassBases): Cover a missing code
19845         path that might fail if a type can not be resolved.
19846
19847         * expression.cs (Binary.Emit): Emit unsigned versions of the
19848         operators. 
19849
19850         * driver.cs: use error 5.
19851
19852 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19853
19854         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19855
19856 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
19857
19858         * cs-parser.jay (switch_section): A beautiful patch from Martin
19859         Baulig that fixed 33094.
19860
19861 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
19862
19863         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19864         Check whether the base is abstract and report an error if so.
19865
19866         * expression.cs (IndexerAccess.DoResolveLValue,
19867         IndexerAccess.DoResolve): ditto. 
19868
19869         (Invocation.DoResolve): ditto.
19870
19871         (Invocation.FullMethodDesc): Improve the report string.
19872
19873         * statement.cs (Block): Eliminate IsVariableDefined as it is
19874         basically just a wrapper for GetVariableInfo.
19875
19876         * ecore.cs (SimpleName): Use new 
19877
19878         * support.cs (ReflectionParamter.ParameterType): We unwrap the
19879         type, as we return the actual parameter ref/unref state on a
19880         different call.
19881
19882 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
19883
19884         * support.cs: Return proper flags REF/OUT fixing the previous
19885         commit.  
19886
19887         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
19888         not used to mean `ref' but `ref or out' in ParameterReference
19889
19890         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19891         full type signature instead of calling TypeManger.CSharpName
19892         ourselves. 
19893
19894         * support.cs (InternalParameters.ParameterDesc): Do not compare
19895         directly to the modflags, because REF/OUT will actually be bitsets
19896         if set. 
19897
19898         * delegate.cs (VerifyMethod): Check also the modifiers.
19899
19900         * cs-tokenizer.cs: Fix bug where floating point values with an
19901         exponent where a sign was missing was ignored.
19902
19903         * driver.cs: Allow multiple assemblies to be specified in a single
19904         /r: argument
19905
19906 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
19907
19908         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
19909         because identifiers after a parenthesis would end up in this kind
19910         of production, and we needed to desamiguate it for having casts
19911         like:
19912
19913                 (UserDefinedType *) xxx
19914
19915 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
19916
19917         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19918         we should set on the Bindingflags.NonPublic, but not turn on
19919         private_ok.  private_ok controls whether a Private member is
19920         returned (this is chekced on the filter routine), while the
19921         BindingFlags.NonPublic just controls whether private/protected
19922         will be allowed.   This fixes the problem part of the problem of
19923         private properties being allowed to be used in derived classes.
19924
19925         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19926         so we can call the children DoResolveLValue method (this will
19927         properly signal errors on lvalue assignments to base properties)
19928
19929         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
19930         getter are null, and we have a property info, we know that this
19931         happened because the lookup failed, so we report an error 122 for
19932         protection level violation.
19933
19934         We also silently return if setter and getter are null in the
19935         resolve functions, this condition only happens if we have flagged
19936         the error before.  This is the other half of the problem. 
19937
19938         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
19939         not have accessibility information, that is why we were returning
19940         true in the filter function in typemanager.cs.
19941
19942         To properly report 122 (property is inaccessible because of its
19943         protection level) correctly, we report this error in ResolveAccess
19944         by failing if both the setter and the getter are lacking (ie, the
19945         lookup failed). 
19946
19947         DoResolve and DoLResolve have been modified to check for both
19948         setter/getter being null and returning silently, the reason being
19949         that I did not want to put the knowledge about this error in upper
19950         layers, like:
19951
19952         int old = Report.Errors;
19953         x = new PropertyExpr (...);
19954         if (old != Report.Errors)
19955                 return null;
19956         else
19957                 return x;
19958
19959         So the property expr is returned, but it is invalid, so the error
19960         will be flagged during the resolve process. 
19961
19962         * class.cs: Remove InheritablePropertySignatureCompare from the
19963         class, as we no longer depend on the property signature to compute
19964         whether it is possible to implement a method or not.
19965
19966         The reason is that calling PropertyInfo.GetGetMethod will return
19967         null (in .NET, in Mono it works, and we should change this), in
19968         cases where the Get Method does not exist in that particular
19969         class.
19970
19971         So this code:
19972
19973         class X { public virtual int A { get { return 1; } } }
19974         class Y : X { }
19975         class Z : Y { public override int A { get { return 2; } } }
19976
19977         Would fail in Z because the parent (Y) would not have the property
19978         defined.  So we avoid this completely now (because the alternative
19979         fix was ugly and slow), and we now depend exclusively on the
19980         method names.
19981
19982         (PropertyBase.CheckBase): Use a method-base mechanism to find our
19983         reference method, instead of using the property.
19984
19985         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
19986         routines are gone now.
19987
19988         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
19989         names, they were incorrectly named.
19990
19991         * cs-tokenizer.cs: Return are more gentle token on failure. 
19992
19993         * pending.cs (PendingImplementation.InterfaceMethod): This routine
19994         had an out-of-sync index variable, which caused it to remove from
19995         the list of pending methods the wrong method sometimes.
19996
19997 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
19998
19999         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
20000         CanWrite, because those refer to this particular instance of the
20001         property, and do not take into account the fact that we can
20002         override single members of a property.
20003
20004         Constructor requires an EmitContext.  The resolution process does
20005         not happen here, but we need to compute the accessors before,
20006         because the resolution does not always happen for properties.
20007
20008         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
20009         subclass, before we did not update this flag, but we did update
20010         bindingflags. 
20011
20012         (GetAccessors): Drop this routine, as it did not work in the
20013         presence of partially overwritten set/get methods. 
20014
20015         Notice that this broke the cs1540 detection, but that will require
20016         more thinking. 
20017
20018 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20019
20020         * class.cs:
20021         * codegen.cs:
20022         * driver.cs: issue a warning instead of an error if we don't support
20023         debugging for the platform. Also ignore a couple of errors that may
20024         arise when trying to write the symbols. Undo my previous patch.
20025
20026 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20027
20028         * driver.cs: ignore /debug switch except for Unix platforms.
20029
20030 2002-10-23  Nick Drochak  <ndrochak@gol.com>
20031
20032         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
20033
20034 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
20035
20036         * driver.cs: Do not make mcs-debug conditional, so we do not break
20037         builds that use it.
20038
20039         * statement.cs (UsageVector.MergeChildren): I would like Martin to
20040         review this patch.  But basically after all the children variables
20041         have been merged, the value of "Breaks" was not being set to
20042         new_breaks for Switch blocks.  I think that it should be set after
20043         it has executed.  Currently I set this to the value of new_breaks,
20044         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
20045         conservative, but I do not understand this code very well.
20046
20047         I did not break anything in the build, so that is good ;-)
20048
20049         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
20050
20051 2002-10-20  Mark Crichton  <crichton@gimp.org>
20052
20053         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
20054
20055 2002-10-20  Nick Drochak  <ndrochak@gol.com>
20056
20057         * cfold.cs: Fixed compile blocker.
20058
20059 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
20060
20061         * driver.cs: I was chekcing the key, not the file.
20062
20063 2002-10-19  Ravi Pratap  <ravi@ximian.com>
20064
20065         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
20066         message that we were generating - we just need to silently return
20067         a null.
20068
20069 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
20070
20071         * class.cs (Event.Define): Change my previous commit, as this
20072         breaks the debugger.  This is a temporary hack, as it seems like
20073         the compiler is generating events incorrectly to begin with.
20074
20075         * expression.cs (Binary.ResolveOperator): Added support for 
20076         "U operator - (E x, E y)"
20077
20078         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
20079         y)".
20080
20081         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
20082         init-only variables, but this path did not take into account that
20083         there might be also instance readonly variables.  Correct this
20084         problem. 
20085
20086         This fixes bug 32253
20087
20088         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
20089         delegates as well.
20090
20091         * driver.cs: Change the extension for modules to `netmodule'
20092
20093         * cs-parser.jay: Improved slightly the location tracking for
20094         the debugger symbols.
20095
20096         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
20097         modifiers that were specified instead of the hardcoded value
20098         (FamAndAssem).  This was basically ignoring the static modifier,
20099         and others.  Fixes 32429.
20100
20101         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
20102         fixed a bug in the process (32476)
20103
20104         * expression.cs (ArrayAccess.EmitAssign): Patch from
20105         hwang_rob@yahoo.ca that fixes bug 31834.3
20106
20107 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
20108
20109         * driver.cs: Make the module extension .netmodule.
20110
20111 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
20112
20113         * driver.cs: Report an error if the resource file is not found
20114         instead of crashing.
20115
20116         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
20117         false, like Emit does.
20118
20119 2002-10-16  Nick Drochak  <ndrochak@gol.com>
20120
20121         * typemanager.cs: Remove unused private member.  Also reported mcs
20122         bug to report this as a warning like csc.
20123
20124 2002-10-15  Martin Baulig  <martin@gnome.org>
20125
20126         * statement.cs (Statement.Emit): Made this a virtual method; emits
20127         the line number info and calls DoEmit().
20128         (Statement.DoEmit): New protected abstract method, formerly knows
20129         as Statement.Emit().
20130
20131         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
20132
20133 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
20134
20135         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
20136         have fixed a remaining problem: not every AddXXXX was adding a
20137         fully qualified name.  
20138
20139         Now everyone registers a fully qualified name in the DeclSpace as
20140         being defined instead of the partial name.  
20141
20142         Downsides: we are slower than we need to be due to the excess
20143         copies and the names being registered this way.  
20144
20145         The reason for this is that we currently depend (on the corlib
20146         bootstrap for instance) that types are fully qualified, because
20147         we dump all the types in the namespace, and we should really have
20148         types inserted into the proper namespace, so we can only store the
20149         basenames in the defined_names array.
20150
20151 2002-10-10  Martin Baulig  <martin@gnome.org>
20152
20153         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
20154         from bug #31834, see the bug report for a testcase which is
20155         miscompiled.
20156
20157 2002-10-10  Martin Baulig  <martin@gnome.org>
20158
20159         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
20160         flow analysis code for this.
20161
20162         * statement.cs (Do, While, For): Tell the flow analysis code about
20163         infinite loops.
20164         (FlowBranching.UsageVector): Added support for infinite loops.
20165         (Block.Resolve): Moved the dead code elimination here and use flow
20166         analysis to do it.
20167
20168 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
20169
20170         * class.cs (Field.Define): Catch cycles on struct type
20171         definitions. 
20172
20173         * typemanager.cs (IsUnmanagedtype): Do not recursively check
20174         fields if the fields are static.  We only need to check instance
20175         fields. 
20176
20177         * expression.cs (As.DoResolve): Test for reference type.
20178
20179         * statement.cs (Using.ResolveExpression): Use
20180         ConvertImplicitRequired, not ConvertImplicit which reports an
20181         error on failture
20182         (Using.ResolveLocalVariableDecls): ditto.
20183
20184         * expression.cs (Binary.ResolveOperator): Report errors in a few
20185         places where we had to.
20186
20187         * typemanager.cs (IsUnmanagedtype): Finish implementation.
20188
20189 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
20190
20191         * expression.cs: Use StoreFromPtr instead of extracting the type
20192         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
20193
20194         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
20195         an enumeration value to a System.Enum, but System.Enum is not a
20196         value type, but an class type, so we need to box.
20197
20198         (Expression.ConvertExplicit): One codepath could return
20199         errors but not flag them.  Fix this.  Fixes #31853
20200
20201         * parameter.cs (Resolve): Do not allow void as a parameter type.
20202
20203 2002-10-06  Martin Baulig  <martin@gnome.org>
20204
20205         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
20206         if it's a class type and not a struct.  Fixes #31815.
20207
20208 2002-10-06  Martin Baulig  <martin@gnome.org>
20209
20210         * statement.cs: Reworked the flow analysis code a bit to make it
20211         usable for dead code elimination.
20212
20213 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20214
20215         * cs-parser.jay: allow empty source files. Fixes bug #31781.
20216
20217 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
20218
20219         * expression.cs (ComposedCast.DoResolveType): A quick workaround
20220         to fix the test 165, will investigate deeper.
20221
20222 2002-10-04  Martin Baulig  <martin@gnome.org>
20223
20224         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
20225         finally blocks actually work.
20226         (Try.Resolve): We don't need to create a sibling for `finally' if
20227         there is no finally block.
20228
20229 2002-10-04  Martin Baulig  <martin@gnome.org>
20230
20231         * class.cs (Constructor.Define): The default accessibility for a
20232         non-default constructor is private, not public.
20233
20234 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
20235
20236         * class.cs (Constructor): Make AllowedModifiers public, add
20237         EXTERN.
20238
20239         * cs-parser.jay: Perform the modifiers test here, as the
20240         constructor for the Constructor class usually receives a zero
20241         because of the way we create it (first we create, later we
20242         customize, and we were never checking the modifiers).
20243
20244         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
20245         is a version of LookupTypeReflection that includes the type-name
20246         cache.  This can be used as a fast path for functions that know
20247         the fully qualified name and are only calling into *.GetType() to
20248         obtain a composed type.
20249
20250         This is also used by TypeManager.LookupType during its type
20251         composition.
20252
20253         (LookupType): We now also track the real type name, as sometimes
20254         we can get a quey for the real type name from things like
20255         ComposedCast.  This fixes bug 31422.
20256
20257         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20258         complete type fullname, it does not have to go through the type
20259         resolution system to obtain the composed version of the type (for
20260         obtaining arrays or pointers).
20261
20262         (Conditional.Emit): Use the EmitBoolExpression to
20263         generate nicer code, as requested by Paolo.
20264
20265         (ArrayCreation.CheckIndices): Use the patch from
20266         hwang_rob@yahoo.ca to validate the array initializers. 
20267
20268 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
20269
20270         * class.cs (ConstructorInitializer.Emit): simplify code by using
20271         Invocation.EmitCall, and at the same time, fix the bugs in calling
20272         parent constructors that took variable arguments. 
20273
20274         * ecore.cs (Expression.ConvertNumericExplicit,
20275         Expression.ImplicitNumericConversion): Remove the code that
20276         manually wrapped decimal (InternalTypeConstructor call is now gone
20277         as well).
20278
20279         * expression.cs (Cast.TryReduce): Also handle decimal types when
20280         trying to perform a constant fold on the type.
20281
20282         * typemanager.cs (IsUnmanagedtype): Partially implemented.
20283
20284         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20285         that only turned off an error report, and did nothing else. 
20286
20287 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
20288
20289         * driver.cs: Handle and ignore /fullpaths
20290
20291 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
20292
20293         * expression.cs (Binary.ResolveOperator): Catch the case where
20294         DoNumericPromotions returns true, 
20295
20296         (Binary.DoNumericPromotions): Simplify the code, and the tests.
20297
20298 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
20299
20300         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20301         report error 70.
20302
20303 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
20304
20305         * ecore.cs (ConvertNumericExplicit): It is not enough that the
20306         conversion exists, but it is also required that the conversion be
20307         performed.  This manifested in "(Type64Enum) 2".  
20308
20309         * class.cs (TypeManager.AddMethod): The fix is not to change
20310         AddEnum, because that one was using a fully qualified name (every
20311         DeclSpace derivative does), but to change the AddMethod routine
20312         that was using an un-namespaced name.  This now correctly reports
20313         the duplicated name.
20314
20315         Revert patch until I can properly fix it.  The issue
20316         is that we have a shared Type space across all namespaces
20317         currently, which is wrong.
20318
20319         Options include making the Namespace a DeclSpace, and merge
20320         current_namespace/current_container in the parser.
20321
20322 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
20323
20324         * cs-parser.jay: Improve error reporting when we get a different
20325         kind of expression in local_variable_type and
20326         local_variable_pointer_type. 
20327
20328         Propagate this to avoid missleading errors being reported.
20329
20330         * ecore.cs (ImplicitReferenceConversion): treat
20331         TypeManager.value_type as a target just like object_type.   As
20332         code like this:
20333
20334         ValueType v = 1;
20335
20336         Is valid, and needs to result in the int 1 being boxed before it
20337         is assigned to the value type v.
20338
20339         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20340         to validate the enumeration name.
20341
20342         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20343         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
20344         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20345
20346         * ecore.cs (TryImplicitIntConversion): When doing an
20347         implicit-enumeration-conversion, check if the type is 64-bits and
20348         perform a conversion before passing to EnumConstant.
20349
20350 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
20351
20352         * decl.cs (Error_AmbiguousTypeReference); New routine used to
20353         report ambiguous type references.  Unlike the MS version, we
20354         report what the ambiguity is.   Innovation at work ;-)
20355
20356         (DeclSpace.FindType): Require a location argument to
20357         display when we display an ambiguous error.
20358
20359         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20360
20361         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20362
20363         * expression.cs (EmitDynamicInitializers): Apply patch from
20364         hwang_rob@yahoo.ca that fixes the order in which we emit our
20365         initializers. 
20366
20367 2002-09-21  Martin Baulig  <martin@gnome.org>
20368
20369         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20370         delegate takes no arguments.
20371
20372 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
20373
20374         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20375         from integers.
20376
20377         * expression.cs: Extract the underlying type.
20378
20379         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20380
20381         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20382
20383 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
20384
20385         * class.cs (TypeContainer.DefineType): We can not use the nice
20386         PackingSize with the size set to 1 DefineType method, because it
20387         will not allow us to define the interfaces that the struct
20388         implements.
20389
20390         This completes the fixing of bug 27287
20391
20392         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20393         means also structs.  This fixes part of the problem. 
20394         (Expresion.ImplicitReferenceConversionExists): ditto.
20395
20396         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20397         error if there were no errors reported during the type lookup
20398         process, to avoid duplicates or redundant errors.  Without this
20399         you would get an ambiguous errors plus a type not found.  We have
20400         beaten the user enough with the first error.  
20401
20402         (DeclSparce.FindType): Emit a warning if we have an ambiguous
20403         reference. 
20404
20405         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20406         during the resolution process, stop the lookup, this avoids
20407         repeated error reports (same error twice).
20408
20409         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20410
20411         * typemanager.cs (LookupType): Redo the type lookup code to match
20412         the needs of System.Reflection.  
20413
20414         The issue is that System.Reflection requires references to nested
20415         types to begin with a "+" sign instead of a dot.  So toplevel
20416         types look like: "NameSpace.TopLevelClass", and nested ones look
20417         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20418         levels. 
20419
20420 2002-09-19  Martin Baulig  <martin@gnome.org>
20421
20422         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20423         says that a method always returns or always throws an exception,
20424         don't report the CS0161.
20425
20426         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20427         set `Returns = new_returns'.
20428
20429 2002-09-19  Martin Baulig  <martin@gnome.org>
20430
20431         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20432         to an enum constant, check for a CS0176.
20433
20434 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
20435
20436         * class.cs (TypeContainer.CheckPairedOperators): Now we check
20437         for operators that must be in pairs and report errors.
20438
20439         * ecore.cs (SimpleName.DoResolveType): During the initial type
20440         resolution process, when we define types recursively, we must
20441         check first for types in our current scope before we perform
20442         lookups in the enclosing scopes.
20443
20444         * expression.cs (MakeByteBlob): Handle Decimal blobs.
20445
20446         (Invocation.VerifyArgumentsCompat): Call
20447         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20448         I thought we were supposed to always call this, but there are a
20449         few places in the code where we dont do it.
20450
20451 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
20452
20453         * driver.cs: Add support in -linkres and -resource to specify the
20454         name of the identifier.
20455
20456 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20457
20458         * ecore.cs (StandardConversionExists): Sync with the conversion
20459         code: allow anything-* to void* conversions.
20460
20461         (FindMostSpecificSource): Use an Expression argument
20462         instead of a Type, because we might be handed over a Literal which
20463         gets a few more implicit conversions that plain types do not.  So
20464         this information was being lost.
20465
20466         Also, we drop the temporary type-holder expression when not
20467         required.
20468
20469 2002-09-17  Martin Baulig  <martin@gnome.org>
20470
20471         * class.cs (PropertyBase.CheckBase): Don't check the base class if
20472         this is an explicit interface implementation.
20473
20474 2002-09-17  Martin Baulig  <martin@gnome.org>
20475
20476         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20477         different `IndexerName' attributes.
20478
20479         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20480         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20481         virtual CommonResolve().
20482
20483 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20484
20485         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20486         and convert that to the UnderlyingType.
20487
20488         * statement.cs (Foreach.Resolve): Indexers are just like variables
20489         or PropertyAccesses.
20490
20491         * cs-tokenizer.cs (consume_string): Track line numbers and columns
20492         inside quoted strings, we were not doing this before.
20493
20494 2002-09-16  Martin Baulig  <martin@gnome.org>
20495
20496         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20497         resolve it.  This is needed for the definite assignment check of the
20498         instance expression, fixes bug #29846.
20499         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20500
20501 2002-09-16  Nick Drochak  <ndrochak@gol.com>
20502
20503         * parameter.cs: Fix compile error.  Cannot reference static member
20504         from an instance object.  Is this an mcs bug?
20505
20506 2002-09-14  Martin Baulig  <martin@gnome.org>
20507
20508         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20509         multiple times.  Fixes bug #30295, added test-166.cs.
20510
20511 2002-09-14  Martin Baulig  <martin@gnome.org>
20512
20513         * statement.cs (Block.Emit): Don't emit unreachable code.
20514         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20515         `break' statements.
20516         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20517
20518 2002-09-14  Martin Baulig  <martin@gnome.org>
20519
20520         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20521         is set.
20522
20523 2002-09-14  Martin Baulig  <martin@gnome.org>
20524
20525         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20526         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20527         be false on the ms runtime.
20528
20529 2002-09-13  Martin Baulig  <martin@gnome.org>
20530
20531         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20532         the CS0038 error message.
20533
20534 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
20535
20536         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20537         constant inside, return it.
20538
20539 2002-09-12  Martin Baulig  <martin@gnome.org>
20540
20541         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20542         implicit conversion can be done between enum types.
20543
20544         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20545         check whether an implicit conversion to the current enum's UnderlyingType
20546         exists and report an error if not.
20547
20548         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20549         without debugging support.
20550
20551         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20552         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
20553
20554 2002-09-12  Martin Baulig  <martin@gnome.org>
20555
20556         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20557
20558         * ecore.cs (IMemberExpr.DeclaringType): New property.
20559         (SimpleName.SimpleNameResolve): Check whether we're accessing a
20560         nonstatic member of an outer type (CS0038).
20561
20562 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
20563
20564         * driver.cs: Activate the using-error detector at warning level
20565         4 (at least for MS-compatible APIs).
20566
20567         * namespace.cs (VerifyUsing): Small buglett fix.
20568
20569         * pending.cs (PendingImplementation): pass the container pointer. 
20570
20571         * interface.cs (GetMethods): Allow for recursive definition.  Long
20572         term, I would like to move every type to support recursive
20573         definitions, not the current ordering mechanism that we have right
20574         now.
20575
20576         The situation is this: Attributes are handled before interfaces,
20577         so we can apply attributes to interfaces.  But some attributes
20578         implement interfaces, we will now handle the simple cases
20579         (recursive definitions will just get an error).  
20580
20581         * parameter.cs: Only invalidate types at the end if we fail to
20582         lookup all types.  
20583
20584 2002-09-09  Martin Baulig  <martin@gnome.org>
20585
20586         * ecore.cs (PropertyExpr.Emit): Also check for
20587         TypeManager.system_int_array_get_length so this'll also work when
20588         compiling corlib.  Fixes #30003.
20589
20590 2002-09-09  Martin Baulig  <martin@gnome.org>
20591
20592         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20593         and throw an exception if we can't get the type's size.  Fixed #30040,
20594         added test-165.cs.
20595
20596 2002-09-09  Martin Baulig  <martin@gnome.org>
20597
20598         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20599
20600         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20601         context.  Fixes bug #30027.
20602
20603         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20604         virtual functions.  Fixes bug #30043, added test-164.cs.
20605
20606 2002-09-08  Ravi Pratap  <ravi@ximian.com>
20607
20608         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20609
20610 2002-09-08  Nick Drochak  <ndrochak@gol.com>
20611
20612         * driver.cs: Use an object to get the windows codepage since it's not a
20613         static property.
20614
20615 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
20616
20617         * statement.cs (For.Emit): for infinite loops (test == null)
20618         return whether there is a break inside, not always "true".
20619
20620         * namespace.cs (UsingEntry): New struct to hold the name of the
20621         using definition, the location where it is defined, and whether it
20622         has been used in a successful type lookup.
20623
20624         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20625         strings.
20626
20627         * decl.cs: ditto.
20628
20629 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20630
20631         * attribute.cs : Fix incorrect code which relied on catching
20632         a NullReferenceException to detect a null being passed in
20633         where an object was expected.
20634
20635 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
20636
20637         * statement.cs (Try): flag the catch variable as assigned
20638
20639         * expression.cs (Cast): Simplified by using ResolveType instead of
20640         manually resolving.
20641
20642         * statement.cs (Catch): Fix bug by using ResolveType.
20643
20644 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20645
20646         * expression.cs (BetterConversion): Special case for when we have
20647         a NullLiteral as the argument and we have to choose between string
20648         and object types - we choose string the way csc does.
20649
20650         * attribute.cs (Attribute.Resolve): Catch the
20651         NullReferenceException and report error #182 since the Mono
20652         runtime no more has the bug and having this exception raised means
20653         we tried to select a constructor which takes an object and is
20654         passed a null.
20655
20656 2002-09-05  Ravi Pratap  <ravi@ximian.com>
20657
20658         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20659         message (1502, 1503) when we can't locate a method after overload
20660         resolution. This is much more informative and closes the bug
20661         Miguel reported.
20662
20663         * interface.cs (PopulateMethod): Return if there are no argument
20664         types. Fixes a NullReferenceException bug.
20665
20666         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20667         expressions too. Previously we were checking only in one place for
20668         positional arguments leaving out named arguments.
20669
20670         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20671         type to the enum type is not allowed. Remove code corresponding to
20672         that.
20673
20674         (ConvertNumericExplicit): Allow explicit conversions from
20675         the underlying type to enum type. This precisely follows the spec
20676         and closes a bug filed by Gonzalo.
20677
20678 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20679
20680         * compiler.csproj:
20681         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20682
20683 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
20684
20685         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20686         it was important that we stored the right value after the
20687         reduction in `converted'.
20688
20689 2002-09-04  Martin Baulig  <martin@gnome.org>
20690
20691         * location.cs (Location.SymbolDocument): Use full pathnames for the
20692         source files.
20693
20694 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
20695
20696         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20697         of the expression resolve mechanism, because that will catch the
20698         SimpleName error failures.
20699
20700         (Conditional): If we can not resolve the
20701         expression, return, do not crash.
20702
20703 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20704
20705         * cs-tokenizer.cs:
20706         (location): display token name instead of its number.
20707
20708 2002-08-28  Martin Baulig  <martin@gnome.org>
20709
20710         * expression.cs (Binary.ResolveOperator): Don't silently return
20711         but return an error if an operator cannot be applied between two
20712         enum types.
20713
20714 2002-08-28  Martin Baulig  <martin@gnome.org>
20715
20716         * class.cs (Constructor.Define): Set the permission attributes
20717         correctly instead of making all constructors public.
20718
20719 2002-08-28  Martin Baulig  <martin@gnome.org>
20720
20721         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20722         for private members before reporting a CS0103; if we find anything,
20723         it's a CS0122.
20724
20725 2002-08-28  Martin Baulig  <martin@gnome.org>
20726
20727         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20728         to check whether `closure_start_type == closure_invocation_type',
20729         we also need to check whether `m.DeclaringType == closure_invocation_type'
20730         before bypassing the permission checks.  We might be accessing
20731         protected/private members from the base class.
20732         (TypeManager.RealMemberLookup): Only set private_ok if private
20733         members were requested via BindingFlags.NonPublic.
20734
20735         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20736
20737         * expression.cs (MemberAccess.ResolveMemberAccess): Set
20738         MethodGroupExpr.IsExplicitImpl if appropriate.
20739         (Invocation.DoResolve): Don't report the CS0120 for explicit
20740         interface implementations.
20741
20742 2002-08-27  Martin Baulig  <martin@gnome.org>
20743
20744         * expression.cs (Invocation.DoResolve): If this is a static
20745         method and we don't have an InstanceExpression, we must report
20746         a CS0120.
20747
20748 2002-08-25  Martin Baulig  <martin@gnome.org>
20749
20750         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20751         `==' between a valuetype and an object.
20752
20753 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
20754
20755         * ecore.cs (TypeExpr): Provide a ToString method.
20756
20757 2002-08-24  Martin Baulig  <martin@gnome.org>
20758
20759         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20760         now called proggie.dbg and it's a binary file.
20761
20762 2002-08-23  Martin Baulig  <martin@gnome.org>
20763
20764         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20765
20766 2002-08-23  Martin Baulig  <martin@gnome.org>
20767
20768         * struct.cs (MyStructInfo.ctor): Make this work with empty
20769         structs; it's not allowed to use foreach() on null.
20770
20771 2002-08-23  Martin Baulig  <martin@gnome.org>
20772
20773         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20774         writer the full pathname of the generated assembly.
20775
20776 2002-08-23  Martin Baulig  <martin@gnome.org>
20777
20778         * statements.cs (FlowBranching.UsageVector.MergeChildren):
20779         A `finally' block never returns or breaks; improved handling of
20780         unreachable code.
20781
20782 2002-08-23  Martin Baulig  <martin@gnome.org>
20783
20784         * statement.cs (Throw.Resolve): Allow `throw null'.
20785
20786 2002-08-23  Martin Baulig  <martin@gnome.org>
20787
20788         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20789         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20790         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
20791         MemberLookup would return a wrong event if this is an explicit
20792         interface implementation and the class has an event with the same
20793         name.
20794
20795 2002-08-23  Martin Baulig  <martin@gnome.org>
20796
20797         * statement.cs (Block.AddChildVariableNames): New public method.
20798         (Block.AddChildVariableName): Likewise.
20799         (Block.IsVariableNameUsedInChildBlock): Likewise.
20800         (Block.AddVariable): Check whether a variable name has already
20801         been used in a child block.
20802
20803         * cs-parser.jay (declare_local_variables): Mark all variable names
20804         from the current block as being used in a child block in the
20805         implicit block.
20806
20807 2002-08-23  Martin Baulig  <martin@gnome.org>
20808
20809         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20810         find the symbol writer.
20811
20812         * driver.cs: csc also allows the arguments to /define being
20813         separated by commas, not only by semicolons.
20814
20815 2002-08-23  Martin Baulig  <martin@gnome.org>
20816
20817         * interface.cs (Interface.GetMembers): Added static check for events.
20818
20819 2002-08-15  Martin Baulig  <martin@gnome.org>
20820
20821         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20822         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20823
20824         * ecore.cs (Expression.MemberLookup): Added documentation and explained
20825         why the MethodData.EmitDestructor() change was necessary.
20826
20827 2002-08-20  Martin Baulig  <martin@gnome.org>
20828
20829         * class.cs (TypeContainer.FindMembers): Added static check for events.
20830
20831         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20832
20833         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20834         use Type.GetEvents(), not Type.FindMembers().
20835
20836 2002-08-20  Martin Baulig  <martin@gnome.org>
20837
20838         * decl.cs (MemberCache): Added a special method cache which will
20839         be used for method-only searched.  This ensures that a method
20840         search will return a MethodInfo with the correct ReflectedType for
20841         inherited methods.      
20842
20843 2002-08-20  Martin Baulig  <martin@gnome.org>
20844
20845         * decl.cs (DeclSpace.FindMembers): Made this public.
20846
20847 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20848
20849         * delegate.cs: fixed build on windows.
20850         [FIXME:  Filed as bug #29150: MCS must report these errors.]
20851
20852 2002-08-19  Ravi Pratap  <ravi@ximian.com>
20853
20854         * ecore.cs (StandardConversionExists): Return a false
20855         if we are trying to convert the void type to anything else
20856         since that is not allowed.
20857
20858         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20859         we flag error 70 in the event an event is trying to be accessed
20860         directly from outside the declaring type.
20861
20862 2002-08-20  Martin Baulig  <martin@gnome.org>
20863
20864         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20865         MemberCache from typemanager.cs to decl.cs.
20866
20867 2002-08-19  Martin Baulig  <martin@gnome.org>
20868
20869         * class.cs (TypeContainer): Implement IMemberContainer.
20870         (TypeContainer.DefineMembers): Create the MemberCache.
20871         (TypeContainer.FindMembers): Do better BindingFlags checking; only
20872         return public members if BindingFlags.Public was given, check
20873         whether members are static.
20874
20875 2002-08-16  Martin Baulig  <martin@gnome.org>
20876
20877         * decl.cs (DeclSpace.Define): Splitted this in Define and
20878         DefineMembers.  DefineMembers is called first and initializes the
20879         MemberCache.
20880
20881         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
20882         DefineMembers() on all our DeclSpaces.
20883
20884         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20885         but call DefineMembers() on all nested interfaces.  We call their
20886         Define() in our new Define() function.
20887
20888         * interface.cs (Interface): Implement IMemberContainer.
20889         (Interface.Define): Moved all code except the attribute stuf to
20890         DefineMembers().
20891         (Interface.DefineMembers): Initialize the member cache.
20892
20893         * typemanager.cs (IMemberFinder): Removed this interface, we don't
20894         need this anymore since we can use MemberCache.FindMembers directly.
20895
20896 2002-08-19  Martin Baulig  <martin@gnome.org>
20897
20898         * typemanager.cs (MemberCache): When creating the cache for an
20899         interface type, add all inherited members.
20900         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20901         to `out bool used_cache' and documented it.
20902         (TypeManager.MemberLookup): If we already used the cache in the first
20903         iteration, we don't need to do the interfaces check.
20904
20905 2002-08-19  Martin Baulig  <martin@gnome.org>
20906
20907         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
20908         here from IMemberFinder and don't implement this interface anymore.
20909         (DeclSpace.MemberCache): Moved here from IMemberFinder.
20910
20911         * typemanager.cs (IMemberFinder): This interface is now only used by
20912         classes which actually support the member cache.
20913         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20914         since we only put DeclSpaces into this Hashtable.
20915         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20916         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20917
20918 2002-08-16  Martin Baulig  <martin@gnome.org>
20919
20920         * typemanager.cs (ICachingMemberFinder): Removed.
20921         (IMemberFinder.MemberCache): New property.
20922         (TypeManager.FindMembers): Merged this with RealFindMembers().
20923         This function will never be called from TypeManager.MemberLookup()
20924         so we can't use the cache here, just the IMemberFinder.
20925         (TypeManager.MemberLookup_FindMembers): Check whether the
20926         IMemberFinder has a MemberCache and call the cache's FindMembers
20927         function.
20928         (MemberCache): Rewrote larger parts of this yet another time and
20929         cleaned it up a bit.
20930
20931 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
20932
20933         * driver.cs (LoadArgs): Support quoting.
20934
20935         (Usage): Show the CSC-like command line arguments.
20936
20937         Improved a few error messages.
20938
20939 2002-08-15  Martin Baulig  <martin@gnome.org>
20940
20941         * typemanager.cs (IMemberContainer.Type): New property.
20942         (IMemberContainer.IsInterface): New property.
20943
20944         The following changes are conditional to BROKEN_RUNTIME, which is
20945         defined at the top of the file.
20946
20947         * typemanager.cs (MemberCache.MemberCache): Don't add the base
20948         class'es members, but add all members from TypeHandle.ObjectType
20949         if we're an interface.
20950         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
20951         is the current type.
20952         (MemberCache.CacheEntry.Container): Removed this field.
20953         (TypeHandle.GetMembers): Include inherited members.
20954
20955 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20956
20957         * typemanager.cs: fixed compilation and added a comment on a field that
20958         is never used.
20959
20960 2002-08-15  Martin Baulig  <martin@gnome.org>
20961
20962         * class.cs (ConstructorInitializer.Resolve): In the
20963         Expression.MemberLookup call, use the queried_type as
20964         invocation_type.
20965
20966         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
20967         declared' attribute, it's always true.
20968         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
20969         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
20970         temporary wrapper for FindMembers which tells MemberLookup whether
20971         members from the base classes are included in the return value.
20972         This will go away soon.
20973         (TypeManager.MemberLookup): Use this temporary hack here; once the
20974         new MemberCache is completed, we don't need to do the DeclaredOnly
20975         looping here anymore since the MemberCache will take care of this.
20976         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
20977         (MemberCache): When creating the MemberCache for a class, get
20978         members from the current class and all its base classes.
20979         (MemberCache.CacheEntry.Container): New field.  This is a
20980         temporary hack until the Mono runtime is fixed to distinguish
20981         between ReflectedType and DeclaringType.  It allows us to use MCS
20982         with both the MS runtime and the unfixed Mono runtime without
20983         problems and without accecting performance.
20984         (MemberCache.SearchMembers): The DeclaredOnly looping from
20985         TypeManager.MemberLookup is now done here.      
20986
20987 2002-08-14  Martin Baulig  <martin@gnome.org>
20988
20989         * statement.cs (MyStructInfo.MyStructInfo): Don't call
20990         Type.GetFields on dynamic types but get the fields from the
20991         corresponding TypeContainer.
20992         (MyStructInfo.GetStructInfo): Added check for enum types.
20993
20994         * typemanager.cs (MemberList.IsSynchronized): Implemented.
20995         (MemberList.SyncRoot): Implemented.
20996         (TypeManager.FilterWithClosure): No need to check permissions if
20997         closure_start_type == closure_invocation_type, don't crash if
20998         closure_invocation_type is null.
20999
21000 2002-08-13  Martin Baulig  <martin@gnome.org>
21001
21002         Rewrote TypeContainer.FindMembers to use a member cache.  This
21003         gives us a speed increase of about 35% for the self-hosting MCS
21004         build and of about 15-20% for the class libs (both on GNU/Linux).
21005
21006         * report.cs (Timer): New class to get enhanced profiling.  This
21007         whole class is "TIMER" conditional since it remarkably slows down
21008         compilation speed.
21009
21010         * class.cs (MemberList): New class.  This is an IList wrapper
21011         which we're now using instead of passing MemberInfo[]'s around to
21012         avoid copying this array unnecessarily.
21013         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
21014         (ICachingMemberFinder, IMemberContainer): New interface.
21015         (TypeManager.FilterWithClosure): If `criteria' is null, the name
21016         has already been checked, otherwise use it for the name comparision.
21017         (TypeManager.FindMembers): Renamed to RealMemberFinder and
21018         provided wrapper which tries to use ICachingMemberFinder.FindMembers
21019         if possible.  Returns a MemberList, not a MemberInfo [].
21020         (TypeHandle): New class, implements IMemberContainer.  We create
21021         one instance of this class per type, it contains a MemberCache
21022         which is used to do the member lookups.
21023         (MemberCache): New class.  Each instance of this class contains
21024         all members of a type and a name-based hash table.
21025         (MemberCache.FindMembers): This is our new member lookup
21026         function.  First, it looks up all members of the requested name in
21027         the hash table.  Then, it walks this list and sorts out all
21028         applicable members and returns them.
21029
21030 2002-08-13  Martin Baulig  <martin@gnome.org>
21031
21032         In addition to a nice code cleanup, this gives us a performance
21033         increase of about 1.4% on GNU/Linux - not much, but it's already
21034         half a second for the self-hosting MCS compilation.
21035
21036         * typemanager.cs (IMemberFinder): New interface.  It is used by
21037         TypeManager.FindMembers to call FindMembers on a TypeContainer,
21038         Enum, Delegate or Interface.
21039         (TypeManager.finder_to_member_finder): New PtrHashtable.
21040         (TypeManager.finder_to_container): Removed.
21041         (TypeManager.finder_to_delegate): Removed.
21042         (TypeManager.finder_to_interface): Removed.
21043         (TypeManager.finder_to_enum): Removed.
21044
21045         * interface.cs (Interface): Implement IMemberFinder.
21046
21047         * delegate.cs (Delegate): Implement IMemberFinder.
21048
21049         * enum.cs (Enum): Implement IMemberFinder.
21050
21051         * class.cs (TypeContainer): Implement IMemberFinder.
21052
21053 2002-08-12  Martin Baulig  <martin@gnome.org>
21054
21055         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
21056
21057 2002-08-12  Martin Baulig  <martin@gnome.org>
21058
21059         * ecore.cs (ITypeExpression): New interface for expressions which
21060         resolve to a type.
21061         (TypeExpression): Renamed to TypeLookupExpression.
21062         (Expression.DoResolve): If we're doing a types-only lookup, the
21063         expression must implement the ITypeExpression interface and we
21064         call DoResolveType() on it.
21065         (SimpleName): Implement the new ITypeExpression interface.
21066         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
21067         hack, the situation that we're only looking up types can't happen
21068         anymore when this method is called.  Moved the type lookup code to
21069         DoResolveType() and call it.
21070         (SimpleName.DoResolveType): This ITypeExpression interface method
21071         is now doing the types-only lookup.
21072         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
21073         (ResolveFlags): Added MaskExprClass.
21074
21075         * expression.cs (MemberAccess): Implement the ITypeExpression
21076         interface.
21077         (MemberAccess.DoResolve): Added support for a types-only lookup
21078         when we're called via ITypeExpression.DoResolveType().
21079         (ComposedCast): Implement the ITypeExpression interface.
21080
21081         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
21082         Expression.Resolve() with ResolveFlags.Type instead.
21083
21084 2002-08-12  Martin Baulig  <martin@gnome.org>
21085
21086         * interface.cs (Interface.Define): Apply attributes.
21087
21088         * attribute.cs (Attribute.ApplyAttributes): Added support for
21089         interface attributes.
21090
21091 2002-08-11  Martin Baulig  <martin@gnome.org>
21092
21093         * statement.cs (Block.Emit): Only check the "this" variable if we
21094         do not always throw an exception.
21095
21096         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
21097         whether the property has a set accessor.
21098
21099 2002-08-11  Martin Baulig  <martin@gnome.org>
21100
21101         Added control flow analysis support for structs.
21102
21103         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
21104         with control flow analysis turned off.
21105         (IVariable): New interface.
21106         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
21107         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
21108         (FieldExpr.DoResolve): Resolve the instance expression with flow
21109         analysis turned off and do the definite assignment check after the
21110         resolving when we know what the expression will resolve to.
21111
21112         * expression.cs (LocalVariableReference, ParameterReference):
21113         Implement the new IVariable interface, only call the flow analysis
21114         code if ec.DoFlowAnalysis is true.
21115         (This): Added constructor which takes a Block argument.  Implement
21116         the new IVariable interface.
21117         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
21118         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
21119         This does the definite assignment checks for struct members.
21120
21121         * class.cs (Constructor.Emit): If this is a non-static `struct'
21122         constructor which doesn't have any initializer, call
21123         Block.AddThisVariable() to tell the flow analysis code that all
21124         struct elements must be initialized before control returns from
21125         the constructor.
21126
21127         * statement.cs (MyStructInfo): New public class.
21128         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
21129         argument to this indexer.  If non-zero, check an individual struct
21130         member, not the whole struct.
21131         (FlowBranching.CheckOutParameters): Check struct members.
21132         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
21133         overloaded versions of these methods which take an additional
21134         `int field_idx' argument to check struct members.
21135         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
21136         overloaded versions of these methods which take an additional
21137         `string field_name' argument to check struct member.s
21138         (VariableInfo): Implement the IVariable interface.
21139         (VariableInfo.StructInfo): New public property.  Returns the
21140         MyStructInfo instance of the variable if it's a struct or null.
21141         (Block.AddThisVariable): New public method.  This is called from
21142         Constructor.Emit() for non-static `struct' constructor which do
21143         not have any initializer.  It creates a special variable for the
21144         "this" instance variable which will be checked by the flow
21145         analysis code to ensure that all of the struct's fields are
21146         initialized before control returns from the constructor.
21147         (UsageVector): Added support for struct members.  If a
21148         variable/parameter is a struct with N members, we reserve a slot
21149         in the usage vector for each member.  A struct is considered fully
21150         initialized if either the struct itself (slot 0) or all its
21151         members are initialized.
21152
21153 2002-08-08  Martin Baulig  <martin@gnome.org>
21154
21155         * driver.cs (Driver.MainDriver): Only report an error CS5001
21156         if there were no compilation errors.
21157
21158         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
21159         `UnsafeContext' property to determine whether the parent is in
21160         unsafe context rather than checking the parent's ModFlags:
21161         classes nested in an unsafe class are unsafe as well.
21162
21163 2002-08-08  Martin Baulig  <martin@gnome.org>
21164
21165         * statement.cs (UsageVector.MergeChildren): Distinguish between
21166         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
21167         we return.  Added test17() and test18() to test-154.cs.
21168
21169 2002-08-08  Martin Baulig  <martin@gnome.org>
21170
21171         * typemanager.cs (TypeManager.FilterWithClosure): If we have
21172         Family access, make sure the invoking type isn't a subclass of the
21173         queried type (that'd be a CS1540).
21174
21175         * ecore.cs (Expression.MemberLookup): Added overloaded version of
21176         this method which takes an additional `Type invocation_type'.
21177
21178         * expression.cs (BaseAccess.DoResolve): Use the base type as
21179         invocation and query type.
21180         (MemberAccess.DoResolve): If the lookup failed and we're about to
21181         report a CS0122, try a lookup with the ec.ContainerType - if this
21182         succeeds, we must report a CS1540.
21183
21184 2002-08-08  Martin Baulig  <martin@gnome.org>
21185
21186         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
21187         (MethodGroupExpr): Implement the IMemberExpr interface.
21188
21189         * expression (MemberAccess.ResolveMemberAccess): No need to have
21190         any special code for MethodGroupExprs anymore, they're now
21191         IMemberExprs.   
21192
21193 2002-08-08  Martin Baulig  <martin@gnome.org>
21194
21195         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
21196         Family, FamANDAssem and FamORAssem permissions.
21197         (TypeManager.IsSubclassOrNestedChildOf): New public method.
21198
21199 2002-08-08  Martin Baulig  <martin@gnome.org>
21200
21201         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
21202         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
21203         or loop block.
21204
21205 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
21206
21207         * driver.cs: implemented /resource option to embed managed resources.
21208
21209 2002-08-07  Martin Baulig  <martin@gnome.org>
21210
21211         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
21212         (FieldBase.HasFieldInitializer): New public property.
21213         (FieldBase.GetInitializerExpression): New public method.  Resolves and
21214         returns the field initializer and makes sure it is only resolved once.
21215         (TypeContainer.EmitFieldInitializers): Call
21216         FieldBase.GetInitializerExpression to get the initializer, this ensures
21217         that it isn't resolved multiple times.
21218
21219         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
21220         the resolving process (SimpleName/MemberLookup) that we're currently
21221         emitting a field initializer (which must not access any instance members,
21222         this is an error CS0236).
21223
21224         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
21225         argument, if the `IsFieldInitializer' flag is set, we must report and
21226         error CS0236 and not an error CS0120.   
21227
21228 2002-08-07  Martin Baulig  <martin@gnome.org>
21229
21230         * ecore.cs (IMemberExpr): New public interface.
21231         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
21232         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
21233         if the expression is an IMemberExpr.
21234
21235         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
21236         to be null, implicitly default to `this' if we're non-static in
21237         this case.  Simplified the code a lot by using the new IMemberExpr
21238         interface.  Also fixed bug #28176 here.
21239
21240 2002-08-06  Martin Baulig  <martin@gnome.org>
21241
21242         * cs-parser.jay (SimpleLookup): Removed.  We need to create
21243         ParameterReferences during semantic analysis so that we can do a
21244         type-only search when resolving Cast, TypeOf and SizeOf.
21245         (block): Pass the `current_local_parameters' to the Block's
21246         constructor.
21247
21248         * class.cs (ConstructorInitializer): Added `Parameters parameters'
21249         argument to the constructor.
21250         (ConstructorInitializer.Resolve): Create a temporary implicit
21251         block with the parameters.
21252
21253         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
21254         references here if we aren't doing a type-only search.
21255
21256         * statement.cs (Block): Added constructor which takes a
21257         `Parameters parameters' argument.
21258         (Block.Parameters): New public property.
21259
21260         * support.cs (InternalParameters.Parameters): Renamed `parameters'
21261         to `Parameters' and made it public readonly.
21262
21263 2002-08-06  Martin Baulig  <martin@gnome.org>
21264
21265         * ecore.cs (Expression.Warning): Made this public as well.
21266
21267         * report.cs (Report.Debug): Print the contents of collections.
21268
21269 2002-08-06  Martin Baulig  <martin@gnome.org>
21270
21271         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
21272         used to tell Resolve() which kinds of expressions it may return.
21273         (Expression.Resolve): Added overloaded version of this method which
21274         takes a `ResolveFlags flags' argument.  This can be used to tell
21275         Resolve() which kinds of expressions it may return.  Reports a
21276         CS0118 on error.
21277         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21278         ResolveFlags.SimpleName.
21279         (Expression.Error118): Added overloaded version of this method which
21280         takes a `ResolveFlags flags' argument.  It uses the flags to determine
21281         which kinds of expressions are allowed.
21282
21283         * expression.cs (Argument.ResolveMethodGroup): New public method.
21284         Resolves an argument, but allows a MethodGroup to be returned.
21285         This is used when invoking a delegate.
21286
21287         * TODO: Updated a bit.
21288
21289 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21290
21291         Fixed compilation with csc.
21292
21293         * ecore.cs: Expression.Error made public. Is this correct? Should
21294         Warning be made public too?
21295
21296         * expression.cs: use ea.Location instead of ea.loc.
21297         [FIXME:  Filed as bug #28607: MCS must report these errors.]
21298
21299 2002-08-06  Martin Baulig  <martin@gnome.org>
21300
21301         * ecore.cs (Expression.loc): Moved the location here instead of
21302         duplicating it in all derived classes.
21303         (Expression.Location): New public property.
21304         (Expression.Error, Expression.Warning): Made them non-static and
21305         removed the location argument.
21306         (Expression.Warning): Added overloaded version which takes an
21307         `int level' argument.
21308         (Expression.Error118): Make this non-static and removed the
21309         expression and location arguments.
21310         (TypeExpr): Added location argument to the constructor.
21311
21312         * expression.cs (StaticCallExpr): Added location argument to
21313         the constructor.
21314         (Indirection, PointerArithmetic): Likewise.
21315         (CheckedExpr, UnCheckedExpr): Likewise.
21316         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21317         (StringPtr): Likewise.
21318
21319
21320 2002-08-05  Martin Baulig  <martin@gnome.org>
21321
21322         * expression.cs (BaseAccess.DoResolve): Actually report errors.
21323
21324         * assign.cs (Assign.DoResolve): Check whether the source
21325         expression is a value or variable.
21326
21327         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21328         while resolving the corresponding blocks.
21329
21330         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21331         an error, don't silently return null.
21332
21333         * statement.cs (Block.AddVariable): Do the error reporting here
21334         and distinguish between CS0128 and CS0136.
21335         (Block.DoResolve): Report all unused labels (warning CS0164).
21336         (LabeledStatement): Pass the location to the constructor.
21337         (LabeledStatement.HasBeenReferenced): New property.
21338         (LabeledStatement.Resolve): Set it to true here.
21339
21340         * statement.cs (Return.Emit): Return success even after reporting
21341         a type mismatch error (CS0126 or CS0127), this is what csc does and
21342         it avoids confusing the users with any consecutive errors.
21343
21344 2002-08-05  Martin Baulig  <martin@gnome.org>
21345
21346         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21347
21348         * const.cs (Const.LookupConstantValue): Catch circular definitions.
21349
21350         * expression.cs (MemberAccess.DoResolve): Silently return if an
21351         error has already been reported.
21352
21353         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21354         error has already been reported.
21355
21356 2002-08-05  Martin Baulig  <martin@gnome.org>
21357
21358         * statement.cs (UsageVector): Only initialize the `parameters'
21359         vector if we actually have any "out" parameters.
21360
21361 2002-08-05  Martin Baulig  <martin@gnome.org>
21362
21363         * expression.cs (Binary.ResolveOperator): When combining delegates,
21364         they must have the same type.
21365
21366 2002-08-05  Martin Baulig  <martin@gnome.org>
21367
21368         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21369         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21370         work with the ms runtime and we also don't need it: if we're a
21371         PropertyBuilder and not in the `indexer_arguments' hash, then we
21372         are a property and not an indexer.
21373
21374         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21375         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21376         since the latter one doesn't work with the ms runtime.
21377
21378 2002-08-03  Martin Baulig  <martin@gnome.org>
21379
21380         Fixed bugs #27998 and #22735.
21381
21382         * class.cs (Method.IsOperator): New public field.
21383         (Method.CheckBase): Report CS0111 if there's already a method
21384         with the same parameters in the current class.  Report CS0508 when
21385         attempting to change the return type of an inherited method.
21386         (MethodData.Emit): Report CS0179 if a method doesn't have a body
21387         and it's not marked abstract or extern.
21388         (PropertyBase): New abstract base class for Property and Indexer.
21389         (PropertyBase.CheckBase): Moved here from Property and made it work
21390         for indexers.
21391         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21392         the same so we can reuse it there.
21393         (Property, Indexer): Derive from PropertyBase.
21394         (MethodSignature.inheritable_property_signature_filter): New delegate
21395         to find properties and indexers.
21396
21397         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21398         argument and improved error reporting.
21399
21400         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21401         EmptyReadOnlyParameters and made it a property.
21402
21403         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21404         version of this method which takes a `PropertyInfo indexer'.
21405         (TypeManager.RegisterIndexer): New method.
21406
21407         * class.cs: Added myself as author of this file :-)
21408
21409 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21410
21411         * class.cs: fixed compilation on windoze.
21412
21413 2002-08-03  Martin Baulig  <martin@gnome.org>
21414
21415         * interface.cs (Interface.GetInterfaceBases): Check whether all
21416         base interfaces are at least as accessible than the current one.
21417
21418         * class.cs (TypeContainer.GetClassBases): Check whether base types
21419         are at least as accessible than the current type.
21420         (TypeContainer.AsAccessible): Implemented and made non-static.
21421         (MemberBase.CheckParameters): Report errors if the accessibility
21422         checks fail.
21423
21424         * delegate.cs (Delegate.Delegate): The default visibility is
21425         internal for top-level types and private for nested types.
21426         (Delegate.Define): Report errors if the accessibility checks fail.
21427
21428         * enum.cs (Enum.Enum): The default visibility is internal for
21429         top-level types and private for nested types.
21430         (Enum.DefineType): Compute the correct visibility.
21431
21432         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21433         function which takes a `bool is_toplevel' instead of a TypeContainer.
21434
21435         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21436         builtin type.
21437
21438 2002-08-02  Martin Baulig  <martin@gnome.org>
21439
21440         * expression.cs (LocalVariableReferenc): Added constructor which
21441         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21442         (LocalVariableReference.IsReadOnly): New property.
21443         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21444         variable is readonly, use our own readonly flag to do this; you can
21445         use the new constructor to get a writable reference to a read-only
21446         variable.
21447
21448         * cs-parser.jay (foreach_statement, using_statement): Get a writable
21449         reference to the local variable.
21450
21451 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
21452
21453         * rootcontext.cs (ResolveCore): Also include System.Exception
21454
21455         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21456         we reach an EmptyStatement.
21457
21458         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21459         is also fine.
21460
21461         * expression.cs (Binary.ResolveOperator): Check error result in
21462         two places.
21463
21464         use brtrue/brfalse directly and avoid compares to null.
21465
21466 2002-08-02  Martin Baulig  <martin@gnome.org>
21467
21468         * class.cs (TypeContainer.Define): Define all nested interfaces here.
21469         Fixes bug #28407, added test-155.cs.
21470
21471 2002-08-01  Martin Baulig  <martin@gnome.org>
21472
21473         * class.cs (Event.EmitDefaultMethod): Make this work with static
21474         events.  Fixes #28311, added verify-3.cs.
21475
21476 2002-08-01  Martin Baulig  <martin@gnome.org>
21477
21478         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21479         `is_disposable' fields.
21480         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21481         `hm.is_disposable' if we're using the collection pattern.
21482         (Foreach.EmitCollectionForeach): Use the correct type for the
21483         enumerator's local variable, only emit the try/finally block if
21484         necessary (fixes #27713).
21485
21486 2002-08-01  Martin Baulig  <martin@gnome.org>
21487
21488         * ecore.cs (Expression.report118): Renamed to Error118 and made
21489         it public static.
21490
21491         * statement.cs (Throw.Resolve): Check whether the expression is of
21492         the correct type (CS0118) and whether the type derives from
21493         System.Exception (CS0155).
21494         (Catch.Resolve): New method.  Do the type lookup here and check
21495         whether it derives from System.Exception (CS0155).
21496         (Catch.CatchType, Catch.IsGeneral): New public properties.
21497
21498         * typemanager.cs (TypeManager.exception_type): Added.
21499
21500 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
21501
21502         * driver.cs: Updated About function.
21503
21504 2002-07-31  Martin Baulig  <martin@gnome.org>
21505
21506         Implemented Control Flow Analysis.
21507
21508         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21509         (EmitContext.CurrentBranching): Added.
21510         (EmitContext.StartFlowBranching): Added.
21511         (EmitContext.EndFlowBranching): Added.
21512         (EmitContext.KillFlowBranching): Added.
21513         (EmitContext.IsVariableAssigned): Added.
21514         (EmitContext.SetVariableAssigned): Added.
21515         (EmitContext.IsParameterAssigned): Added.
21516         (EmitContext.SetParameterAssigned): Added.
21517         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21518         Added control flow analysis stuff here.
21519
21520         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21521         resolve the expression as lvalue.
21522         (LocalVariableReference.DoResolve): Check whether the variable has
21523         already been assigned.
21524         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21525         the parameter as assigned here.
21526         (ParameterReference.DoResolve): Check whether the parameter has already
21527         been assigned.
21528         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21529         expression as lvalue.
21530
21531         * statement.cs (FlowBranching): New class for the flow analysis code.
21532         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21533         (LabeledStatement.IsDefined): New public property.
21534         (LabeledStatement.AddUsageVector): New public method to tell flow
21535         analyis that the label may be reached via a forward jump.
21536         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21537         flow analysis.
21538         (VariableInfo.Number): New public field.  This is used by flow analysis
21539         to number all locals of a block.
21540         (Block.CountVariables): New public property.  This is the number of
21541         local variables in this block (including the locals from all parent
21542         blocks).
21543         (Block.EmitMeta): Number all the variables.
21544
21545         * statement.cs: Added flow analysis support to all classes.
21546
21547 2002-07-31  Martin Baulig  <martin@gnome.org>
21548
21549         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21550         To get debugging messages, compile mcs with /define:MCS_DEBUG and
21551         then use this argument.
21552
21553         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21554
21555         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21556         use this to specify /define options.
21557
21558 2002-07-29  Martin Baulig  <martin@gnome.org>
21559
21560         * statement.cs (Fixed): Moved all code that does variable lookups
21561         and resolvings from Emit to Resolve.
21562
21563         * statement.cs (For): Moved all code that does variable lookups
21564         and resolvings from Emit to Resolve.
21565
21566         * statement.cs (Using): Moved all code that does variable lookups
21567         and resolvings from Emit to Resolve.
21568
21569 2002-07-29  Martin Baulig  <martin@gnome.org>
21570
21571         * attribute.cs (Attribute.Resolve): Explicitly catch a
21572         System.NullReferenceException when creating the
21573         CustromAttributeBuilder and report a different warning message.
21574
21575 2002-07-29  Martin Baulig  <martin@gnome.org>
21576
21577         * support.cs (ParameterData.ParameterName): Added method to
21578         get the name of a parameter.
21579
21580         * typemanager.cs (TypeManager.IsValueType): New public method.
21581
21582 2002-07-29  Martin Baulig  <martin@gnome.org>
21583
21584         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
21585         is a flag which specifies that it's either ref or out.
21586         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21587         the out parameter to `out Parameter.Modifier mod', also set the
21588         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21589
21590         * support.cs (InternalParameters.ParameterModifier): Distinguish
21591         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21592         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21593
21594         * expression.cs (Argument.GetParameterModifier): Distinguish
21595         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21596         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21597
21598 2002-07-29  Martin Baulig  <martin@gnome.org>
21599
21600         * expression.cs (ParameterReference.ParameterReference): Added
21601         `Location loc' argument to the constructor.
21602
21603         * cs-parser.jay: Pass location to ParameterReference.
21604
21605 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
21606
21607         * statement.cs (Try): Initialize the location.
21608
21609         * cs-parser.jay: pass location to Try.
21610
21611         * expression.cs (Unary.Reduce): Change the prototype to return
21612         whether a constant fold could be performed or not.  The result is
21613         returned in an out parameters.  In the case of Indirection and
21614         AddressOf, we want to perform the full tests.
21615
21616 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
21617
21618         * statement.cs (Statement.Emit): Flag dead code.
21619
21620 2002-07-27  Andrew Birkett  <andy@nobugs.org>
21621
21622         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21623
21624 2002-07-27  Martin Baulig  <martin@gnome.org>
21625
21626         * class.cs (MethodData.Define): Put back call to
21627         TypeManager.AddMethod(), accidentally commented this out.
21628
21629         * report.cs (Debug): New public method to print debugging information,
21630         this is `[Conditional ("DEBUG")]'.
21631
21632 2002-07-26  Martin Baulig  <martin@gnome.org>
21633
21634         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21635         (switch_statement): Push the current_block to the switch_stack and
21636         pop it again when we're done with the switch.
21637         (switch_section): The new block is a child of the current_block.
21638         Fixes bug #24007, added test-152.cs.
21639
21640 2002-07-27  Martin Baulig  <martin@gnome.org>
21641
21642         * expression.cs (Invocation.EmitArguments): When calling a varargs
21643         function with only its fixed arguments, we need to pass an empty
21644         array.
21645
21646 2002-07-27  Martin Baulig  <martin@gnome.org>
21647
21648         Mono 0.13 has been released.
21649
21650 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
21651
21652         * driver.cs: Rename --resource to --linkres, because that is what
21653         we do currently, we dont support --resource yet.
21654
21655         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21656
21657 2002-07-25  Martin Baulig  <martin@gnome.org>
21658
21659         * class.cs (MethodData): New public class.  This is a `method builder'
21660         class for a method or one accessor of a Property/Indexer/Event.
21661         (MethodData.GetMethodFlags): Moved here from MemberBase.
21662         (MethodData.ApplyAttributes): Likewise.
21663         (MethodData.ApplyObsoleteAttribute): Likewise.
21664         (MethodData.ApplyConditionalAttribute): Likewise.
21665         (MethodData.ApplyDllImportAttribute): Likewise.
21666         (MethodData.CheckAbstractAndExternal): Likewise.
21667         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21668         (MethodData.Emit): Formerly known as Method.Emit().
21669         (MemberBase): Moved everything which was specific to a single
21670         accessor/method to MethodData.
21671         (Method): Create a new MethodData and call Define() and Emit() on it.
21672         (Property, Indexer, Event): Create a new MethodData objects for each
21673         accessor and call Define() and Emit() on them.
21674
21675 2002-07-25  Martin Baulig  <martin@gnome.org>
21676
21677         Made MethodCore derive from MemberBase to reuse the code from there.
21678         MemberBase now also checks for attributes.
21679
21680         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21681         (MemberBase.GetMethodFlags): Moved here from class Method and marked
21682         as virtual.
21683         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21684         `CallingConventions cc' and `Attributes opt_attrs' arguments.
21685         (MemberBase.ApplyAttributes): New virtual method; applies the
21686         attributes to a method or accessor.
21687         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21688         (MemberBase.ApplyConditionalAttribute): Likewise.
21689         (MemberBase.ApplyDllImportAttribute): Likewise.
21690         (MemberBase.CheckAbstractAndExternal): Likewise.
21691         (MethodCore.ParameterTypes): This is now a property instead of a
21692         method, it's initialized from DoDefineParameters().
21693         (MethodCore.ParameterInfo): Removed the set accessor.
21694         (MethodCore.DoDefineParameters): New protected virtual method to
21695         initialize ParameterTypes and ParameterInfo.
21696         (Method.GetReturnType): We can now simply return the MemberType.
21697         (Method.GetMethodFlags): Override the MemberBase version and add
21698         the conditional flags.
21699         (Method.CheckBase): Moved some code from Define() here, call
21700         DoDefineParameters() here.
21701         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21702         here to avoid some larger code duplication.
21703         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21704         ensure that abstract and external accessors don't declare a body.
21705
21706         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21707         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21708         lookup in the attribute's parent classes, so we need to abort as soon
21709         as we found the first match.
21710         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21711         the attribute has no arguments.
21712
21713         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21714         of a Method.
21715
21716 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21717
21718         * cs-parser.jay: reverted previous patch.
21719
21720 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21721
21722         * cs-parser.jay: fixed bug #22119.
21723
21724 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21725
21726         * attribute.cs: fixed compilation. The error was:
21727         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
21728         be assigned to before control leaves the current method."
21729         [FIXME:  Filed as bug #28186: MCS must report this error.]
21730
21731 2002-07-25  Martin Baulig  <martin@gnome.org>
21732
21733         * attribute.cs (Attribute.Conditional_GetConditionName): New static
21734         method to pull the condition name ouf of a Conditional attribute.
21735         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21736         the obsolete message and error flag out of an Obsolete attribute.
21737
21738         * class.cs (Method.GetMethodFlags): New public method to get the
21739         TypeManager.MethodFlags for this method.
21740         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21741         private methods.
21742         (Method.Define): Get and apply the Obsolete and Conditional attributes;
21743         if we're overriding a virtual function, set the new private variable
21744         `parent_method'; call the new TypeManager.AddMethod().
21745
21746         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
21747         the MethodBuilder and the Method in a PtrHashtable.
21748         (TypeManager.builder_to_method): Added for this purpose.
21749         (TypeManager.MethodFlags): Added IsObsoleteError.
21750         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
21751         Obsolete and Conditional arguments in MethodBuilders.  If we discover
21752         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21753         the message from the attribute.
21754
21755 2002-07-24  Martin Baulig  <martin@gnome.org>
21756
21757         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21758         preprocessor directives, ensure that the argument to #define/#undef is
21759         exactly one identifier and that it's actually an identifier.
21760
21761         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21762         did not work ....
21763
21764 2002-07-24  Martin Baulig  <martin@gnome.org>
21765
21766         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21767         initialize it to TypeManager.object_type in the constructor.
21768         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21769         of the `hm.get_current' method if we're using the collection pattern.
21770         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21771         for the explicit conversion to make it work when we're using the collection
21772         pattern and the `Current' property has a different return type than `object'.
21773         Fixes #27713.
21774
21775 2002-07-24  Martin Baulig  <martin@gnome.org>
21776
21777         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21778         does not match, but don't report any errors.  This method is called in
21779         order for all methods in a MethodGroupExpr until a matching method is
21780         found, so we don't want to bail out if the first method doesn't match.
21781         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21782         matches, report the 123.  Fixes #28070.
21783
21784 2002-07-24  Martin Baulig  <martin@gnome.org>
21785
21786         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21787         TypeManager.TypeToCoreType() to the top of the method so the
21788         following equality checks will work.  Fixes #28107.
21789
21790 2002-07-24  Martin Baulig  <martin@gnome.org>
21791
21792         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21793         operand is of type uint, and the other operand is of type sbyte,
21794         short or int, the operands are converted to type long." -
21795         Actually do what this comment already told us.  Fixes bug #28106,
21796         added test-150.cs.
21797
21798 2002-07-24  Martin Baulig  <martin@gnome.org>
21799
21800         * class.cs (MethodBase): New abstract class.  This is now a base
21801         class for Property, Indexer and Event to avoid some code duplication
21802         in their Define() and DefineMethods() methods.
21803         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21804         generic methods for Define() and DefineMethods().
21805         (FieldBase): Derive from MemberBase, not MemberCore.
21806         (Property): Derive from MemberBase, not MemberCore.
21807         (Property.DefineMethod): Moved all the code from this method to the
21808         new MethodBase.DefineAccessor(), just call it with appropriate
21809         argumetnts.
21810         (Property.Define): Call the new Property.DoDefine(), this does some
21811         sanity checks and we don't need to duplicate the code everywhere.
21812         (Event): Derive from MemberBase, not MemberCore.
21813         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21814         accessors, this will also make them work with interface events.
21815         (Indexer): Derive from MemberBase, not MemberCore.
21816         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21817         (Indexer.Define): Use the new MethodBase functions.
21818
21819         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21820         argument to the constructor.
21821         (Interface.FindMembers): Added support for interface events.
21822         (Interface.PopluateEvent): Implemented.
21823
21824         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
21825
21826 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
21827
21828         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21829         but this is required to check for a method name being the same as
21830         the containing class.  
21831
21832         Handle this now.
21833
21834 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21835
21836         * interface.cs: initialize variable.
21837
21838 2002-07-23  Martin Baulig  <martin@gnome.org>
21839
21840         Implemented the IndexerName attribute in interfaces.
21841
21842         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21843         name if this is an explicit interface implementation.
21844         (Indexer.InterfaceIndexerName): New public variable.  If we're
21845         implementing an interface indexer, this is the IndexerName in that
21846         interface.  Otherwise, it's the IndexerName.
21847         (Indexer.DefineMethod): If we're implementing interface indexer,
21848         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
21849         and Pending.ImplementIndexer methods.
21850         (Indexer.Define): Also define the PropertyBuilder if we're
21851         implementing an interface indexer and this is neither an explicit
21852         interface implementation nor do the IndexerName match the one in
21853         the interface.
21854
21855         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21856         If a method is defined here, then we always need to create a proxy
21857         for it.  This is used when implementing interface indexers.
21858         (Pending.IsInterfaceIndexer): New public method.
21859         (Pending.ImplementIndexer): New public method.
21860         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21861         This is used when implementing interface indexers to define a proxy
21862         if necessary.
21863         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21864         define a proxy if necessary.
21865
21866         * interface.cs (Interface.IndexerName): New public variable.
21867         (Interface.PopulateIndexer): Set the IndexerName.
21868         (Interface.DefineIndexers): New private method.  Populate all the
21869         indexers and make sure their IndexerNames match.
21870
21871         * typemanager.cs (IndexerPropertyName): Added support for interface
21872         indexers.
21873
21874 2002-07-22  Martin Baulig  <martin@gnome.org>
21875
21876         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21877         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21878         ret if HasReturnLabel.
21879         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21880         variables.
21881
21882         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21883         and set the ec.LoopBeginTryCatchLevel.
21884         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21885         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21886         the current ec.TryCatchLevel, the branch goes out of an exception
21887         block.  In this case, we need to use Leave and not Br.
21888
21889 2002-07-22  Martin Baulig  <martin@gnome.org>
21890
21891         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21892         block unless the block does not always return or it is contained in
21893         another try { ... } catch { ... } block.  Fixes bug #26506.
21894         Added verify-1.cs to the test suite.
21895
21896 2002-07-22  Martin Baulig  <martin@gnome.org>
21897
21898         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21899         then we do not always return.  Fixes bug #24985.
21900
21901 2002-07-22  Martin Baulig  <martin@gnome.org>
21902
21903         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21904         lookup on a per-class level; ie. walk up the class hierarchy until we
21905         found at least one applicable method, then choose the best among them.
21906         Fixes bug #24463 and test-29.cs.
21907
21908 2002-07-22  Martin Baulig  <martin@gnome.org>
21909
21910         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21911         return types of the methods.  The return type is not part of the
21912         signature and we must not check it to make the `new' modifier work.
21913         Fixes bug #27999, also added test-147.cs.
21914         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21915
21916         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21917         on the method's return type.
21918
21919 2002-07-21  Martin Baulig  <martin@gnome.org>
21920
21921         * assign.cs: Make this work if the rightmost source is a constant and
21922         we need to do an implicit type conversion.  Also adding a few more tests
21923         to test-38.cs which should have caught this.
21924
21925         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21926         target in the makefile for this.  The makefile.gnu is primarily intended
21927         for end-users who don't want to debug the compiler.
21928
21929 2002-07-21  Martin Baulig  <martin@gnome.org>
21930
21931         * assign.cs: Improved the Assign class so it can now handle embedded
21932         assignments (X = Y = Z = something).  As a side-effect this'll now also
21933         consume less local variables.  test-38.cs now passes with MCS, added
21934         a few new test cases to that test.
21935
21936 2002-07-20  Martin Baulig  <martin@gnome.org>
21937
21938         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
21939         instructions.  Fixes bug #27977, also added test-146.cs.
21940
21941 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21942
21943         * cs-tokenizer.cs: fixed getHex ().
21944
21945 2002-07-19  Martin Baulig  <martin@gnome.org>
21946
21947         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
21948         not Type.GetType() to lookup the array type.  This is needed when
21949         we're constructing an array of a user-defined type.
21950         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
21951         single-dimensional arrays, but also for single-dimensial arrays of
21952         type decimal.
21953
21954 2002-07-19  Martin Baulig  <martin@gnome.org>
21955
21956         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
21957         this function is called, it's not allowed to share LocalBuilders
21958         among ILGenerators.
21959
21960 2002-07-19  Martin Baulig  <martin@gnome.org>
21961
21962         * expression.cs (Argument.Resolve): Report an error 118 when trying
21963         to pass a type as argument.
21964
21965 2002-07-18  Martin Baulig  <martin@gnome.org>
21966
21967         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
21968         Conv_R_Un for the signed `long' type.
21969
21970 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
21971
21972         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
21973         `expr' for the temporary result, as that will fail if we do
21974         multiple resolves on the same expression.
21975
21976 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
21977
21978         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
21979         ec.TypeContainer for looking up aliases. 
21980
21981         * class.cs (TypeContainer): Remove LookupAlias from here.
21982
21983         * decl.cs (DeclSpace); Move here.
21984
21985 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
21986
21987         * class.cs (FindMembers): Only call filter if the constructor
21988         bulider is not null.
21989
21990         Also handle delegates in `NestedTypes' now.  Now we will perform
21991         type lookups using the standard resolution process.  This also
21992         fixes a bug.
21993
21994         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
21995         This uses Expressions (the limited kind that can be parsed by the
21996         tree) instead of strings.
21997
21998         * expression.cs (ComposedCast.ToString): Implement, used to flag
21999         errors since now we have to render expressions.
22000
22001         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
22002         FormArrayType. 
22003
22004         * ecore.cs (SimpleName.ToString): ditto.
22005
22006         * cs-parser.jay: Instead of using strings to assemble types, use
22007         Expressions to assemble the type (using SimpleName, ComposedCast,
22008         MemberAccess).  This should fix the type lookups in declarations,
22009         because we were using a different code path for this.
22010
22011         * statement.cs (Block.Resolve): Continue processing statements
22012         even when there is an error.
22013
22014 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
22015
22016         * class.cs (Event.Define): Also remove the `remove' method from
22017         the list of pending items.
22018
22019         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
22020         generate more compact code. 
22021
22022 2002-07-17  Martin Baulig  <martin@gnome.org>
22023
22024         * const.cs (Const.LookupConstantValue): Add support for constant
22025         `unchecked' and `checked' expressions.
22026         Also adding test case test-140.cs for this.
22027
22028 2002-07-17  Martin Baulig  <martin@gnome.org>
22029
22030         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
22031         check whether mi.ReturnType implements the IEnumerator interface; the
22032         `==' and the IsAssignableFrom() will fail in this situation.
22033
22034 2002-07-16  Ravi Pratap  <ravi@ximian.com>
22035
22036         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
22037         here too.
22038
22039 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22040
22041         * expression.cs: fixed bug #27811.
22042
22043 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
22044
22045         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
22046         Molaro: when we are a ref, the value already contains a pointer
22047         value, do not take the address of it.
22048
22049 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22050         * removed mb-parser.jay and mb-tokenizer.cs
22051
22052 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22053
22054         * expression.cs: check against the building corlib void type.
22055
22056 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
22057
22058         * ecore.cs: fix for valuetype static readonly fields: when 
22059         initializing them, we need their address, not the address of a copy.
22060
22061 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
22062
22063         * typemanager.cs: register also enum_type in corlib.
22064
22065 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22066
22067         * class.cs: allow calling this (but not base) initializers in structs.
22068
22069 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
22070
22071         * ecore.cs: make sure we compare against the building base types
22072         in GetTypeSize ().
22073
22074 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
22075
22076         * typemanager.cs: fix TypeToCoreType() to handle void and object
22077         (corlib gets no more typerefs after this change).
22078
22079 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
22080
22081         * expression.cs (ArrayCreation.EmitArrayArguments): use
22082         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
22083
22084         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
22085         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
22086         array indexes, the runtime actually forbids them.
22087
22088         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
22089         for array arguments here.
22090
22091         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
22092         instead of the default for ValueTypes.
22093
22094         (New.DoEmit): Use IsValueType instead of
22095         IsSubclassOf (value_type)
22096         (New.DoResolve): ditto.
22097         (Invocation.EmitCall): ditto.
22098
22099         * assign.cs (Assign): ditto.
22100
22101         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
22102         Statements *are* currently doing part of their resolution during
22103         Emit.  
22104
22105         Expressions do always resolve during resolve, but statements are
22106         only required to propagate resolution to their children.
22107
22108 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
22109
22110         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
22111
22112         (LoadAssembly): Do not add the dll if it is already specified
22113
22114         (MainDriver): Add the System directory to the link path at the end,
22115         after all the other -L arguments. 
22116
22117         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
22118         wrong opcode for loading bytes and bools (ldelem.i1 instead of
22119         ldelem.u1) and using the opposite for sbytes.
22120
22121         This fixes Digger, and we can finally run it.
22122
22123         * driver.cs (UnixParseOption): Move the option parsing here.  
22124         (CSCParseOption): Implement CSC-like parsing of options.
22125
22126         We now support both modes of operation, the old Unix way, and the
22127         new CSC-like way.  This should help those who wanted to make cross
22128         platform makefiles.
22129
22130         The only thing broken is that /r:, /reference: and /lib: are not
22131         implemented, because I want to make those have the same semantics
22132         as the CSC compiler has, and kill once and for all the confussion
22133         around this.   Will be doing this tomorrow.
22134
22135         * statement.cs (Unsafe.Resolve): The state is checked during
22136         resolve, not emit, so we have to set the flags for IsUnsfe here.
22137
22138 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
22139
22140         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
22141         not catch the Error_ObjectRefRequired in SimpleName (as it is
22142         possible to have a class/instance variable name that later gets
22143         deambiguated), we have to check this here.      
22144
22145 2002-07-10  Ravi Pratap  <ravi@ximian.com>
22146
22147         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
22148         make static and put into Expression.
22149
22150         (Event.Define): Register the private field of the event with the 
22151         TypeManager so that GetFieldFromEvent can get at it.
22152
22153         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
22154         keep track of the private field associated with an event which
22155         has no accessors.
22156
22157         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
22158         private field.
22159
22160         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
22161
22162 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
22163
22164         * expression.cs (Binary.EmitBranchable): this routine emits the
22165         Binary expression in a branchable context.  This basically means:
22166         we need to branch somewhere, not just get the value on the stack.
22167
22168         This works together with Statement.EmitBoolExpression.
22169
22170         * statement.cs (Statement.EmitBoolExpression): Use
22171         EmitBranchable. 
22172
22173 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
22174
22175         * statement.cs (For): Reduce the number of jumps in loops.
22176
22177         (For): Implement loop inversion for the For statement.
22178
22179         (Break): We can be breaking out of a Try/Catch controlled section
22180         (foreach might have an implicit try/catch clause), so we need to
22181         use Leave instead of Br.
22182
22183         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
22184         now).  If the instace expression supports IMemoryLocation, we use
22185         the AddressOf method from the IMemoryLocation to extract the
22186         address instead of emitting the instance.
22187
22188         This showed up with `This', as we were emitting the instance
22189         always (Emit) instead of the Address of This.  Particularly
22190         interesting when This is a value type, as we dont want the Emit
22191         effect (which was to load the object).
22192
22193 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
22194
22195         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
22196
22197         * statement.cs (Checked): Set the CheckedState during the resolve
22198         process too, as the ConvCast operations track the checked state on
22199         the resolve process, and not emit.
22200
22201         * cs-parser.jay (namespace_member_declaration): Flag that we have
22202         found a declaration when we do.  This is used to flag error 1529
22203
22204         * driver.cs: Report ok when we display the help only.
22205
22206 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
22207
22208         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
22209
22210 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
22211
22212         * cs-tokenizer.cs (define): We also have to track locally the
22213         defines.  AllDefines is just used for the Conditional Attribute,
22214         but we also need the local defines for the current source code. 
22215
22216 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
22217
22218         * statement.cs (While, For, Do): These loops can exit through a
22219         Break statement, use this information to tell whether the
22220         statement is the last piece of code.
22221
22222         (Break): Flag that we break.
22223
22224         * codegen.cs (EmitContexts): New `Breaks' state variable.
22225
22226 2002-07-03  Martin Baulig  <martin@gnome.org>
22227
22228         * class.cs (TypeContainer.MethodModifiersValid): Allow override
22229         modifiers in method declarations in structs.  Otherwise, you won't
22230         be able to override things like Object.Equals().
22231
22232 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
22233
22234         * class.cs (Method, Property, Indexer): Do not allow the public
22235         modifier to be used in explicit interface implementations.
22236
22237         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
22238         override modifiers in method declarations in structs
22239
22240 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
22241
22242         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
22243         integer or real overflow, report an error
22244
22245 2002-07-02  Martin Baulig  <martin@gnome.org>
22246
22247         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
22248         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
22249         to tell the runtime about our newly created System.Object and
22250         System.ValueType types.
22251
22252 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
22253
22254         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
22255         struct instead of Ldarg/Starg.
22256
22257 2002-07-02  Martin Baulig  <martin@gnome.org>
22258
22259         * expression.cs (Indirection.Indirection): Call
22260         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22261
22262 2002-07-02  Martin Baulig  <martin@gnome.org>
22263
22264         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22265         ValueType, call TypeManager.TypeToCoreType() on it.
22266         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22267         the OpCodes.Newarr argument.
22268
22269 2002-07-02  Martin Baulig  <martin@gnome.org>
22270
22271         * expression.cs (Invocation.EmitCall): When compiling corlib,
22272         replace all calls to the system's System.Array type to calls to
22273         the newly created one.
22274
22275         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22276         System.Array methods.
22277         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22278         from the system's System.Array type which must be replaced.
22279
22280 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22281
22282         * typemanager.cs: load unverifiable_code_ctor so we can build
22283         corlib using the correct type. Avoid using GetTypeCode() with
22284         TypeBuilders.
22285         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22286         TypeManager.object_type to allow building corlib.
22287
22288 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22289
22290         * ecore.cs: handle System.Enum separately in LoadFromPtr().
22291
22292 2002-07-01  Martin Baulig  <martin@gnome.org>
22293
22294         * class.cs: Make the last change actually work, we need to check
22295         whether `ifaces != null' to avoid a crash.
22296
22297 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22298
22299         * class.cs: when we build structs without fields that implement
22300         interfaces, we need to add the interfaces separately, since there is
22301         no API to both set the size and add the interfaces at type creation
22302         time.
22303
22304 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22305
22306         * expression.cs: the dimension arguments to the array constructors
22307         need to be converted if they are a long.
22308
22309 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22310
22311         * class.cs: don't emit ldarg.0 if there is no parent constructor
22312         (fixes showstopper for corlib).
22313
22314 2002-06-29  Martin Baulig  <martin@gnome.org>
22315
22316         MCS now compiles corlib on GNU/Linux :-)
22317
22318         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22319         ie. check for MethodImplOptions.InternalCall.
22320
22321         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22322         and TypeManager.attribute_type are null, so we must explicitly check
22323         whether parent is not null to find out whether it's an attribute type.
22324         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22325         and SetBuilder, not only if the property is neither abstract nor external.
22326         This is necessary to set the MethodImplOptions on the accessor methods.
22327         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22328         SetBuilder, see Property.Emit().
22329
22330         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22331         populate "System.Object", "System.ValueType" and "System.Attribute" since
22332         they've already been populated from BootCorlib_PopulateCoreTypes().
22333
22334 2002-06-29  Martin Baulig  <martin@gnome.org>
22335
22336         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22337         is the NullLiteral, we also need to make sure that target_type is not
22338         an enum type.   
22339
22340 2002-06-29  Martin Baulig  <martin@gnome.org>
22341
22342         * rootcontext.cs (RootContext.ResolveCore): We must initialize
22343         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22344         before calling BootstrapCorlib_ResolveDelegate ().
22345
22346 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22347
22348         * statement.cs: fixed build-breaker. All tests passed ok.
22349
22350 2002-06-27  Martin Baulig  <martin@gnome.org>
22351
22352         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22353         for System.Decimal when compiling corlib.
22354
22355 2002-06-27  Martin Baulig  <martin@gnome.org>
22356
22357         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22358         switch blocks which contain nothing but a default clause.
22359
22360 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
22361
22362        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22363
22364 2002-06-27  Martin Baulig  <martin@gnome.org>
22365
22366         * ecore.cs (PropertyExpr.PropertyExpr): Call
22367         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22368
22369         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22370         is already a TypeBuilder.
22371
22372 2002-06-27  Martin Baulig  <martin@gnome.org>
22373
22374         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22375         `target_type == TypeManager.array_type', not IsAssignableFrom() in
22376         the "from an array-type to System.Array" case.  This makes it work
22377         when compiling corlib.
22378
22379 2002-06-27  Martin Baulig  <martin@gnome.org>
22380
22381         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22382         non-static PropertyExpr, set its InstanceExpression.  This makes
22383         the `ICollection.Count' property work in System/Array.cs.
22384
22385 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
22386
22387         * driver.cs: Made error handling more consistent.  Errors now
22388         tracked by Report class, so many methods which used to return int
22389         now return void.  Main() now prints success/failure and 
22390         errors/warnings message.
22391
22392         Renamed '--probe' compiler argument to '--expect-error'.  Removed
22393         the magic number return values (123 and 124).  Now, if the
22394         expected error occurs, the compiler exits with success (exit value
22395         0).  If the compilation completes without seeing that particular
22396         error, the compiler exits with failure (exit value 1).  The
22397         makefile in mcs/errors has been changed to handle the new behaviour.
22398
22399         * report.cs: Made 'expected error' number a property and renamed
22400         it from 'Probe' to 'ExpectedError'.
22401
22402         * genericparser.cs: Removed error handling support, since it is
22403         now all done by Report class.
22404
22405         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22406         class, so parse() no longer returns an int.
22407
22408         * namespace.cs: Use Report.Error instead of GenericParser.error
22409
22410 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
22411
22412         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22413         TypeContainer.AddOperator): At the front of the list put the
22414         explicit implementations, so they get resolved/defined first. 
22415
22416 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
22417
22418         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22419         interface type is implemented by this TypeContainer.  Used during
22420         explicit interface implementation.
22421
22422         (Property.Define, Indexer.Define, Method.Define): Validate that
22423         the given interface in the explicit implementation is one of the
22424         base classes for the containing type.
22425
22426         Also if we are explicitly implementing an interface, but there is
22427         no match in the pending implementation table, report an error.
22428
22429         (Property.Define): Only define the property if we are
22430         not explicitly implementing a property from an interface.  Use the
22431         correct name also for those properties (the same CSC uses,
22432         although that is really not needed).
22433
22434         (Property.Emit): Do not emit attributes for explicitly implemented
22435         properties, as there is no TypeBuilder.
22436
22437         (Indexer.Emit): ditto.
22438
22439         Hiding then means that we do not really *implement* a pending
22440         implementation, which makes code fail.
22441
22442 2002-06-22  Martin Baulig  <martin@gnome.org>
22443
22444         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22445         the return value of Object.GetType().  [FIXME: we need to do this whenever
22446         we get a type back from the reflection library].
22447
22448 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22449
22450         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22451
22452 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
22453
22454         * attribute.cs: Return null if we can not look up the type.
22455
22456         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22457         the interface types found.
22458
22459         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22460         interface types found.
22461
22462         * typemanager.cs (GetInterfaces): Make this routine returns alll
22463         the interfaces and work around the lame differences between
22464         System.Type and System.Reflection.Emit.TypeBuilder in the results
22465         result for GetInterfaces.
22466
22467         (ExpandInterfaces): Given an array of interface types, expand and
22468         eliminate repeated ocurrences of an interface.  This expands in
22469         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22470         be IA, IB, IC.
22471
22472 2002-06-21  Martin Baulig  <martin@gnome.org>
22473
22474         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22475         on System.Enum.
22476
22477 2002-06-21  Martin Baulig  <martin@gnome.org>
22478
22479         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
22480         and called with one of the core types, return the corresponding typebuilder for
22481         that type.
22482
22483         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22484         element type.
22485
22486 2002-06-21  Martin Baulig  <martin@gnome.org>
22487
22488         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22489         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22490         (Expression.ConvertReferenceExplicit): Likewise.
22491
22492         * expression.cs (ElementAccess.DoResolve): Likewise.
22493         (ElementAccess.DoResolveLValue): Likewise.
22494
22495 2002-06-10  Martin Baulig  <martin@gnome.org>
22496
22497         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22498         add the "value" parameter to the parameter list.
22499
22500         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22501         to our caller.
22502
22503 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
22504
22505         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22506         the argument to an int, uint, long or ulong, per the spec.  Also
22507         catch negative constants in array creation.
22508
22509 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22510
22511         * class.cs: do not allow the same interface to appear twice in
22512         the definition list.
22513
22514 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22515
22516         * ecore.cs: don't use ldlen with System.Array.
22517
22518 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22519
22520         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22521
22522 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22523
22524         * modifiers.cs: produce correct field attributes for protected
22525         internal. Easy fix so miguel can work on ther harder stuff:-)
22526
22527 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
22528
22529         * pending.cs: New file.  Move the code from class.cs here.
22530         Support clearning the pending flag for all methods (when not doing
22531         explicit interface implementation).
22532
22533 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22534
22535         * rootcontext.cs: added a couple more types needed to bootstrap.
22536
22537 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
22538
22539         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22540         constructor in the type, instead of any constructor in the type
22541         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
22542         a bug in the Mono runtime when applying the params attribute). 
22543
22544 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
22545         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22546
22547 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
22548
22549         * expression.cs (Unary.ResolveOperator): Use TypeManager
22550         to resolve the type.
22551
22552 2002-06-13  Ravi Pratap  <ravi@ximian.com>
22553
22554         * cs-parser.jay (enum_member_declaration): Pass in the attributes
22555         attached.
22556
22557         * enum.cs (AddEnumMember): Add support to store the attributes associated 
22558         with each member too.
22559
22560         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22561         field builders too - this takes care of the enum member case.
22562
22563 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
22564
22565         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22566         address-of operator on both value types and pointers.
22567
22568 2002-06-10  Martin Baulig  <martin@gnome.org>
22569
22570         * interface.cs (Interface.PopulateIndexer): Add the indexer's
22571         PropertyBuilder to the `property_builders' list.
22572
22573         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22574         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22575         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
22576         find any indexers which are inherited from an interface.
22577
22578 2002-06-09  Martin Baulig  <martin@gnome.org>
22579
22580         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22581         the same type as the constant if necessary.  There's also a test-130.cs
22582         for this.
22583
22584         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22585
22586         * typemanager.cs (TypeManager.ChangeType): Previously known as
22587         Enum.ChangeEnumType().
22588
22589 2002-06-09  Martin Baulig  <martin@gnome.org>
22590
22591         * expression.cs (Cast.TryReduce): Added support for consts.
22592
22593 2002-06-08  Ravi Pratap  <ravi@ximian.com>
22594
22595         * class.cs (Accessor): Hold attributes information so we can pass
22596         it along.
22597
22598         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22599         Modify to pass in attributes attached to the methods.
22600
22601         (add_accessor_declaration, remove_accessor_declaration): Ditto.
22602
22603         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22604         to handle the Accessor kind :-)
22605
22606         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22607
22608 2002-06-08  Martin Baulig  <martin@gnome.org>
22609
22610         * expression.cs (Unary.TryReduceNegative): Added support for
22611         ULongConstants.
22612
22613 2002-06-08  Martin Baulig  <martin@gnome.org>
22614
22615         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22616         name can't be found in the `defined_names' - the caller will do a
22617         MemberLookup in this case and thus find methods in System.Enum
22618         such as Enum.IsDefined().
22619
22620 2002-06-08  Martin Baulig  <martin@gnome.org>
22621
22622         * enum.cs (Enum.ChangeEnumType): This is a custom version of
22623         Convert.ChangeType() which works with TypeBuilder created types.
22624         (Enum.LookupEnumValue, Enum.Define): Use it here.
22625
22626         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22627         `TypeBuilder.BaseType != null' check.
22628         (TypeContainer.FindMembers): Only lookup parent members if we
22629         actually have a parent.
22630         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22631         (ConstructorInitializer.Resolve): Likewise.
22632
22633         * interface.cs (Interface.FindMembers): Added
22634         `TypeBuilder.BaseType != null' check.
22635
22636         * rootcontext.cs (RootContext.ResolveCore): Added
22637         "System.Runtime.CompilerServices.IndexerNameAttribute" to
22638         classes_second_stage.
22639
22640         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22641         debug_type and trace_type when compiling with --nostdlib.       
22642
22643 2002-06-07  Martin Baulig  <martin@gnome.org>
22644
22645         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22646         (AddField): Set it to true when adding a non-static field.
22647         (DefineType): Use `have_nonstatic_fields' to find out whether we
22648         have non-static fields, not `Fields != null'.
22649
22650 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
22651
22652         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22653         dereferencing a null on the static-field code path)
22654
22655 2002-05-30  Martin Baulig  <martin@gnome.org>
22656
22657         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22658         to take command line arguments.  Use reflection to call the new
22659         custom `Initialize' function on the symbol writer and pass it the
22660         command line arguments.
22661
22662         * driver.cs (--debug-args): New command line argument to pass command
22663         line arguments to the symbol writer.
22664
22665 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
22666
22667         * assign.cs (DoResolve): Forgot to do the implicit conversion to
22668         the target type for indexers and properties.  Thanks to Joe for
22669         catching this.
22670
22671 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
22672
22673         * typemanager.cs (MethodFlags): returns the method flags
22674         (Obsolete/ShouldIgnore) that control warning emission and whether
22675         the invocation should be made, or ignored. 
22676
22677         * expression.cs (Invocation.Emit): Remove previous hack, we should
22678         not do this on matching a base type, we should do this based on an attribute
22679
22680         Only emit calls to System.Diagnostics.Debug and
22681         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22682         on the command line.
22683
22684         * rootcontext.cs: Global settings for tracing and debugging.
22685
22686         * cs-tokenizer.cs (define): New utility function to track
22687         defines.   Set the global settings for TRACE and DEBUG if found.
22688
22689 2002-05-25  Ravi Pratap  <ravi@ximian.com>
22690
22691         * interface.cs (Populate*): Pass in the TypeContainer as well as
22692         the DeclSpace as parameters so that we can create EmitContexts and
22693         then use that to apply attributes etc.
22694
22695         (PopulateMethod, PopulateEvent, PopulateProperty)
22696         (PopulateIndexer): Apply attributes everywhere.
22697
22698         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22699         etc.
22700
22701         (ApplyAttributes): Update accordingly.
22702
22703         We now apply interface attributes for all members too.
22704
22705 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
22706
22707         * class.cs (Indexer.Define); Correctly check if we are explicit
22708         implementation (instead of checking the Name for a ".", we
22709         directly look up if the InterfaceType was specified).
22710
22711         Delay the creation of the PropertyBuilder.
22712
22713         Only create the PropertyBuilder if we are not an explicit
22714         interface implementation.   This means that explicit interface
22715         implementation members do not participate in regular function
22716         lookups, and hence fixes another major ambiguity problem in
22717         overload resolution (that was the visible effect).
22718
22719         (DefineMethod): Return whether we are doing an interface
22720         implementation. 
22721
22722         * typemanager.cs: Temporary hack until we get attributes in
22723         interfaces (Ravi is working on that) and we get IndexerName
22724         support in interfaces.
22725
22726         * interface.cs: Register the indexers as properties.
22727
22728         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22729         warning, I have verified that this is a bug in the .NET runtime
22730         (JavaScript suffers of the same problem).
22731
22732         * typemanager.cs (MemberLookup): When looking up members for
22733         interfaces, the parent of an interface is the implicit
22734         System.Object (so we succeed in searches of Object methods in an
22735         interface method invocation.  Example:  IEnumerable x;  x.ToString
22736         ()) 
22737
22738 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
22739
22740         * class.cs (Event): Events should also register if they do
22741         implement the methods that an interface requires.
22742
22743         * typemanager.cs (MemberLookup); use the new GetInterfaces
22744         method. 
22745
22746         (GetInterfaces): The code used to lookup interfaces for a type is
22747         used in more than one place, factor it here. 
22748
22749         * driver.cs: Track the errors at the bottom of the file, we kept
22750         on going.
22751
22752         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22753         instance if the method we are calling is static!
22754
22755 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
22756
22757         * attribute.cs (ApplyAttributes): Make this function filter out
22758         the IndexerName attribute (as that attribute in reality is never
22759         applied) and return the string constant for the IndexerName
22760         attribute. 
22761
22762         * class.cs (TypeContainer.Emit): Validate that all the indexers
22763         have the same IndexerName attribute, and if so, set the
22764         DefaultName attribute on the class. 
22765
22766         * typemanager.cs: The return value might contain other stuff (not
22767         only methods).  For instance, consider a method with an "Item"
22768         property and an Item method.
22769
22770         * class.cs: If there is a problem with the parameter types,
22771         return. 
22772
22773 2002-05-24  Ravi Pratap  <ravi@ximian.com>
22774
22775         * ecore.cs (ImplicitConversionExists): Wrapper function which also
22776         looks at user defined conversion after making a call to 
22777         StandardConversionExists - we need this for overload resolution.
22778
22779         * expression.cs : Update accordingly the various method calls.
22780
22781         This fixes 2 bugs filed against implicit user defined conversions 
22782
22783 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
22784
22785         * statement.cs: Track the result of the assignment.
22786
22787 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
22788
22789         * expression.cs (MemberAccess): Improved error reporting for
22790         inaccessible members.
22791
22792 2002-05-22  Martin Baulig  <martin@gnome.org>
22793
22794         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
22795         itself with debugging support.
22796
22797 2002-05-22  Martin Baulig  <martin@gnome.org>
22798
22799         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22800         Removed, this isn't needed anymore.
22801
22802 2002-05-20  Martin Baulig  <martin@gnome.org>
22803
22804         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22805         be underlying type for an enum.
22806
22807 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
22808
22809         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22810         that splits out the loading of just the core types.
22811
22812         * rootcontext.cs (ResolveCore): Split the struct resolution in
22813         two, so we can load the enumeration underlying types before any
22814         enums are used.
22815
22816         * expression.cs (Is): Bandaid until we fix properly Switch (see
22817         bug #24985 for details).
22818
22819         * typemanager.cs (ImplementsInterface): The hashtable will contain
22820         a null if there are no interfaces implemented.
22821
22822 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
22823
22824         * cs-parser.jay (indexer_declarator): It is fine to have array
22825         parameters
22826
22827 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22828
22829         * typemanager.cs: (RegisterBuilder): New function used to register
22830         TypeBuilders that implement interfaces.  Since
22831         TypeBuilder.GetInterfaces (as usual) does not work with lame
22832         Reflection.Emit. 
22833         (AddUserType): register interfaces.
22834
22835         (ImplementsInterface): Use the builder_to_ifaces hash if we are
22836         dealing with TypeBuilder.  Also, arrays are showing up as
22837         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22838         methods can not be invoked on them!
22839
22840         * ecore.cs (ExplicitReferenceConversionExists): Made public.
22841         (ImplicitReferenceConversionExists): Split out from
22842         StandardConversionExists. 
22843
22844         * expression.cs (As): We were only implementing one of the three
22845         cases for the as operator.  We now implement them all.
22846         (Is): Implement the various other cases for Is as well.
22847
22848         * typemanager.cs (CACHE): New define used to control if we want or
22849         not the FindMembers cache.  Seems to have a negative impact on
22850         performance currently
22851
22852         (MemberLookup): Nested types have full acess to
22853         enclosing type members
22854
22855         Remove code that coped with instance/static returns for events, we
22856         now catch this in RealFindMembers.
22857
22858         (RealFindMembers): only perform static lookup if the instance
22859         lookup did not return a type or an event.  
22860
22861 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22862
22863         * assign.cs (CompoundAssign): We pass more semantic information
22864         now to Compound Assignments than we did before: now we have all
22865         the information at hand, and now we resolve the target *before* we
22866         do the expression expansion, which allows the "CacheValue" method
22867         to have the effect we intended (before, a [x] += 1 would generate
22868         two differen ArrayAccess expressions from the ElementAccess,
22869         during the resolution process).
22870
22871         (CompoundAssign.DoResolve): Resolve target and original_source here.
22872
22873 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
22874
22875         * expression.cs (ArrayAccess): dropped debugging information. 
22876
22877         * typemanager.cs: Small bug fix: I was always returning i_members,
22878         instead of one of i_members or s_members (depending on which had
22879         the content).
22880
22881         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
22882         method is invoked before any code generation takes place, and it
22883         is a mechanism to inform that the expression will be invoked more
22884         than once, and that the method should use temporary values to
22885         avoid having side effects
22886
22887         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22888
22889         * ecore.cs (Expression.CacheTemporaries): Provide empty default
22890         implementation.
22891
22892         * expression.cs (Indirection, ArrayAccess): Add support for
22893         CacheTemporaries in these two bad boys. 
22894
22895         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22896         ldobj or ldind_ref.  
22897         (StoreFromPtr): Handle stobj as well.
22898
22899         * expression.cs (UnaryMutator): Share more code.
22900
22901         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22902         down: I was not tracking the Filter function as well, which
22903         was affecting the results of the cache.
22904
22905 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
22906
22907         * attribute.cs: Remove the hack to handle the CharSet property on
22908         StructLayouts. 
22909
22910 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
22911
22912         * attribute.cs (DoResolve): More uglyness, we now only try to
22913         resolve the attribute partially, to extract the CharSet
22914         information (only if we are a StructLayout attribute).  Otherwise 
22915
22916         (GetExtraTypeInfo): Add some code to conditionally kill in the
22917         future this.   I am more and more convinced that the .NET
22918         framework has special code to handle the attribute setting on
22919         certain elements.
22920
22921         * expression.cs (IsParamsMethodApplicable): Revert my previous
22922         foreach change here, it was wrong.
22923
22924 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
22925
22926         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22927         (pp_expr): do not abort on unknown input, just return.
22928         (eval): abort if there are pending chars.
22929
22930         * attribute.cs (Attribute.Resolve): Positional parameters are
22931         optional.  Deal with that case.
22932
22933         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
22934         the Ansi/Unicode/Auto information for the type.
22935
22936         (TypeContainer.DefineType): instantiate the EmitContext here, as
22937         we will be using it during the type definition (to resolve
22938         attributes) and during the emit phase.
22939
22940         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
22941         to pull type information out of the attributes
22942
22943         (Attribute.Resolve): track the constructor builder, and allow for
22944         multiple invocations (structs and classes will use this).
22945
22946         * ecore.cs (MemberLookupFinal): new version with all the
22947         parameters customizable.
22948
22949         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
22950         constructors.  Return if the result value is null (as the error
22951         would have been flagged already by MemberLookupFinal)
22952
22953         Do not allow instances of abstract classes or interfaces to be
22954         created.
22955
22956         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
22957         We have to compare the assembly property here when dealing with
22958         FamANDAssem and Assembly access modifiers, because we might be
22959         creating an assembly from *modules* (that means that we are not
22960         getting TypeBuilders for types defined in other modules that are
22961         part of this assembly).
22962
22963         (Method.Emit): If the method is marked abstract and has a body,
22964         emit an error. 
22965
22966         (TypeContainer.DefineMembers): If both the defined member and the
22967         parent name match are methods, then do not emit any warnings: let
22968         the Method.Define routine take care of flagging warnings.  But if
22969         there is a mismatch (method overrides something else, or method is
22970         overriwritten by something, then emit warning).
22971
22972         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
22973         set to null, this means `do not check for the return type on the
22974         signature'. 
22975
22976         (Method.Define): set the return type for the method signature to
22977         null, so that we get methods with the same name and parameters and
22978         different return types.  This is used to flag warning 114 (you are
22979         hiding a method, and you probably want to use the new/override
22980         keywords instead).
22981
22982         * typemanager.cs (MemberLookup): Implemented proper access
22983         control, closing a long standing set of bug reports.  The problem
22984         was that the Framework only has two bits: Public and NonPublic,
22985         and NonPublic includes private and protected methods, but we need
22986         to enforce the FamANDAssem, FamOrAssem and Family. 
22987
22988 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
22989
22990         * statement.cs (GotoCase): Return true: Ammounts to giving up
22991         knowledge on whether we return or not, and letting the other case
22992         be responsible for it.
22993
22994 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
22995
22996         * driver.cs: Do not load directories for each file processed, only
22997         do it if there is a pattern.
22998
22999         * ecore.cs: Report readonly assigns here as well, as we might have
23000         been resolved only by MemberAccess.
23001
23002         (SimpleName.SimpleNameResolve): Also be useful for LValue
23003         resolution.   We need this to propagate assign to local readonly variables
23004
23005         * typemanager.cs: Use a ptrhashtable for the criteria, because we
23006         do not want to reuse potential criteria memory.
23007
23008         * class.cs (MyEventBuilder): Set reflected_type;
23009
23010         * ecore.cs (Constantify): Added support for constifying bools.
23011
23012         (RootContext.LookupType): Added a cache for values looked up in
23013         the declaration space.
23014
23015         * typemanager.cs (FindMembers): Now is a front-end to
23016         RealFindMembers, and provides a two-level hashtable-based cache to
23017         the request.  
23018
23019         15% performance improvement: from 22.5 to 19.2 seconds.
23020
23021         * expression.cs (IsParamsMethodApplicable): use foreach.
23022         (Invocation.DoResolve): ditto.
23023         (New.DoResolve): ditto.
23024         (ArrayCreation.DoResolve): ditto.
23025
23026         * ecore.cs (FindMostEncompassingType): use foreach.
23027
23028         * delegate.cs (NewDelegate.DoResolve): Use foreach
23029
23030         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
23031         (RemoveMethods): use foreach.
23032
23033         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
23034         nested foreach statements instead of for, and also break out of
23035         the inner loop once a match is found.
23036
23037         (Invocation.OverloadResolve): Use foreach, simplify the code. 
23038
23039 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
23040
23041         * cfold.cs (BinaryFold): During an enumeration evaluation context,
23042         we actually unwrap the expression to allow for extra information
23043         to be extracted. 
23044
23045         * expression.cs: Use Shr_Un on unsigned operations. 
23046
23047 2002-05-08  Ravi Pratap  <ravi@ximian.com>
23048
23049         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
23050         applicable operators was not being considered correctly. This closes
23051         the bug Miguel reported.
23052
23053 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
23054
23055         * attribute.cs: check that the type derives from System.Attribute
23056         and report the correct error in that case (moved the duplicate code to
23057         its own method, too).
23058
23059 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
23060
23061         * attribute.cs: lookup attribute type name as the spec says: first the
23062         bare attribute name and then name + "Attribute" (nant compiles with
23063         mcs after this fix).
23064
23065 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
23066
23067         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
23068         Because of the way we parse things, we should try to see if a
23069         UIntConstant can fit in an integer.
23070
23071 2002-05-07  Ravi Pratap  <ravi@ximian.com>
23072
23073         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
23074         when we are in an explicit context.
23075
23076         (ConvertReferenceExplicit): When converting from Iface type S to Class
23077         T make sure the rules are implemented as an OR.
23078
23079         * parameter.cs (ParameterType): Make it a property for now although the
23080         purpose really isn't anything immediate.
23081
23082         * expression.cs (Is*Applicable): Do better checking on the parameter type
23083         of a ref/out parameter. The ones from the system assemblies are already 
23084         marked with the correct type so we don't need to do any correction.
23085
23086         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
23087         the object type is standard too so include that.
23088
23089 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
23090
23091         * ecore.cs (StandardConversionExists): Augment with missing code:
23092         deal with IntConstant, LongConstants and Enumerations.
23093
23094         * assign.cs: Report the error, instead of failing silently
23095
23096         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
23097         typecontainer that they are declared, because the
23098         typecontainer/namespace will have the list of using clauses that
23099         need to be applied.
23100
23101         Assembly Attributes were escaping the normal registration
23102         mechanism. 
23103
23104         (EmitCode): Apply attributes within an EmitContext that represents
23105         the container they were declared on.
23106
23107         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
23108
23109 2002-05-06  Ravi Pratap  <ravi@ximian.com>
23110
23111         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
23112         Revamp completely - make much cleaner as we now operate only
23113         on a set of Types.
23114
23115         (FindMostSpecificSource, FindMostSpecificTarget): New methods
23116         to implement the logic detailed in the spec more correctly.
23117
23118         (UserDefinedConversion): Update accordingly.
23119
23120 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
23121
23122         * statement.cs: Return flow analysis information up.
23123
23124         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
23125         and the default.
23126
23127         (token): Do not consume an extra character before calling
23128         decimal_digits.
23129
23130 2002-05-06  Piers Haken <piersh@friskit.com>
23131
23132         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
23133
23134 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
23135
23136         * class.cs (Constructor.Emit): Set the IsStatic flag in the
23137         EmitContext during the instance constructor initializer
23138         resolution, to stop access to instance variables.
23139
23140         This is mandated by the spec, last paragraph of the `constructor
23141         initializers' section. 
23142
23143 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
23144
23145         * cs-parser.jay, class.cs (Accessor): new class used to represent
23146         an accessor (get or set).  In the past we used `null' to represent
23147         a missing accessor.  But this is ambiguous because there was no
23148         way to tell in abstract indexers/properties if one of them was
23149         specified.
23150
23151         Now there is a way of addressing that.
23152
23153         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
23154         instead of FindMembers.
23155
23156         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
23157         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
23158
23159         * attribute.cs: Treat indexers and properties as the same in terms
23160         of applying attributes
23161
23162         * ecore.cs (FindMostEncompassedType): Use statically initialized
23163         EmptyExpressions()s like we do elsewhere to avoid creating useless
23164         objects (and we take this out of the tight loop).
23165
23166         (GetConversionOperators): Move the code to extract the actual
23167         operators to a separate routine to clean things up.
23168
23169 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
23170
23171         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
23172         events are always registered FieldBuilders.
23173
23174         * class.cs (FieldBase): New class shared by Fields 
23175
23176         * delegate.cs: If we are a toplevel delegate, use our full name.
23177         If we are a nested delegate, then only use our tail name.
23178
23179 2002-05-02  Ravi Pratap  <ravi@ximian.com>
23180
23181         * expression.cs (IsApplicable): Ensure that we add the "&" to
23182         ref/out types before comparing it with the type of the argument.
23183
23184         (IsParamsMethodApplicable): Ditto.
23185
23186         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
23187         silly me ;-)
23188
23189         * delegate.cs : Handle the case when we have more than one applicable
23190         method. Flag an error only when we finish checking all.
23191
23192 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
23193
23194         * expression.cs: Add support for boolean static initializers.
23195
23196 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
23197
23198         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
23199
23200         * parameter.cs (ComputeParameterTypes,
23201         ComputeAndDefineParameterTypes): Better error handling: now we
23202         clear the `types' cache if we fail during any of the type lookups.
23203         We also return the status code correctly to our caller
23204
23205         * delegate.cs: If we fail to define a delegate, abort the extra
23206         steps. 
23207
23208         * expression.cs (Binary.ResolveOperator): for
23209         operator==(object,object) and operator !=(object, object) we also
23210         have to verify that there is an implicit conversion from one to
23211         the other.
23212
23213         (ArrayAccess.DoResolve): Array Access can operate on
23214         non-variables. 
23215
23216 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
23217
23218         * assign.cs (CompoundAssign): A new class used as a "flag" that
23219         the assignment actually is happening as part of a compound
23220         assignment operator.
23221
23222         During compound assignment, a few new rules exist to enable things
23223         like:
23224
23225         byte b |= 1 + 2
23226
23227         From the spec:
23228
23229         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
23230         to the type of x) if y is implicitly convertible to the type of x,
23231         and the operator is a builtin operator and the return type of the
23232         operator is explicitly convertible to the type of x. 
23233
23234         * rootcontext.cs: Reset warning level to 2.  4 catches various
23235         "interesting" features in mcs, we must clean this up at some
23236         point, but currently am trying to kill other bugs ;-)
23237
23238         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
23239         in container classes as well.  
23240
23241         * expression.cs (Binary.ResolveOperator): Handle string case
23242         before anything else (as operator overloading does emit an error
23243         before doing anything else).
23244
23245         This code could go away when we move to a table driven model, but
23246         i could not come up with a good plan last night.
23247
23248 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
23249
23250         * typemanager.cs (CSharpName): reimplementation using regex.
23251         * class.cs: added null check for fields in Emit
23252         * rootcontext.cs: set warninglevel to 4
23253
23254 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
23255
23256         * typemanager.cs (CSharpName): reimplemented with Lupus
23257         suggestion.
23258
23259 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
23260
23261         * statement.cs (If): correclty implement Resolve, because we were
23262         not catching sem errors in there.  The same process is needed
23263         everywhere else. 
23264         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23265
23266
23267         (Statement.Warning_DeadCodeFound): Factorize code.
23268         (While): Report dead code here too.
23269
23270         (Statement): Added Resolve virtual method to allow
23271         for resolution split from the emit code.
23272
23273 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23274
23275         * statement.cs (EmitBoolExpression): No longer try to resolve the
23276         expression here.    
23277         (MakeBoolean): New utility function that resolve, implicitly
23278         converts to boolean and tags the expression. 
23279
23280
23281         (If, Do): Implement dead code elimination.
23282         (While): Implement loop inversion
23283
23284         (Do, While, For, If): Resolve the expression prior to calling our
23285         code generation.
23286
23287 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
23288
23289         * class.cs:
23290           - added method Report28 (warning: program has more than one entry point)
23291           - added method IsEntryPoint, implements paragraph 10.1 of the spec
23292           - modified method Method.Define, the part at the end of the method
23293
23294         * rootcontext.cs: added static public Location EntryPointLocation;
23295           
23296         * ../errors/cs0028.cs : Add test case for the above warning.              
23297
23298         * typemanager.cs:
23299           - modified method CSharpName to allow arrays of primitive type to
23300             be printed nicely (e.g. instead of System.Int32[][] it now prints
23301             int[][])
23302           - added method CSharpSignature: returns the signature of a method
23303             in string format to be used in reporting errors, warnings, etc.
23304
23305         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23306         with String.Empty.
23307
23308 2002-04-26  Ravi Pratap  <ravi@ximian.com>
23309
23310         * delegate.cs (Define): Fix extremely silly bug where I was
23311         setting the type of the 'object' parameter of the BeginInvoke
23312         method to System.IAsyncResult instead of System.Object ;-)
23313
23314 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23315
23316         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23317         here. 
23318
23319         (Constructor.Emit): return if we fail to initialize the
23320         constructor.  Another door closed!  
23321
23322         * expression.cs (New.DoResolve): Improve error message (from -6 to
23323         1501).  Use DeclaredOnly lookup to find the exact constructor.
23324
23325         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23326         loop.  This is useful.
23327
23328         * cs-parser.jay: Adjust the default parameters so that destructors
23329         have the proper signature.
23330
23331 2002-04-26  Martin Baulig  <martin@gnome.org>
23332
23333         * driver.cs (LoadAssembly): If `assembly' contains any characters
23334         which are only valid in path names and not in assembly names
23335         (currently slash, backslash and point), use Assembly.LoadFrom ()
23336         instead of Assembly.Load () on the `assembly' (before iteration
23337         over the link_paths).
23338
23339 2002-04-26  Martin Baulig  <martin@gnome.org>
23340
23341         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23342
23343 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
23344
23345         * class.cs (Property): use the new typemanager.MemberLookup
23346
23347         (TypeContainer.MemberLookup): Implement using the
23348         TypeManager.MemberLookup now. 
23349
23350         * typemanager.cs: Make MemberLookup a function of the TypeManager,
23351         and return MemberInfos, so that these can be used without an
23352         EmitContext (what we had before).
23353
23354 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
23355
23356         * expression.cs: Fix the case where the argument to params if the
23357         type of the params.  I omitted handling this before.   Fixed
23358
23359 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23360
23361         * driver.cs: Call BootCorlib_PopulateCoreType
23362
23363         * class.cs (Property.CheckBase): Check for properties only, not
23364         for all members. 
23365
23366         * interface.cs: Temporary hack: try/catch around the
23367         CustomAttributeBuilder, because I am getting an exception that I
23368         do not understand.
23369
23370         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23371         types whose definitions are required to be there (attributes are
23372         defined before standard types).
23373
23374         Compute definitions as we boot the various types, as they are used
23375         immediately (value_type class will need object_type, but if we do
23376         not initialize object_type, we will pass a null, which will let
23377         the runtime pick the System.Object from the existing corlib, which
23378         is not what we want).
23379
23380 2002-04-22  Patrik Torstensson <totte@labs2.com>
23381
23382         * cs-tokenizer.cs: fixed a number of trim() issues.
23383
23384 2002-04-22  Ravi Pratap  <ravi@ximian.com>
23385
23386         * expression.cs (Argument.Type): Ensure that we return the correct
23387         type when we have out or ref parameters [in which case we 
23388         append a "&"].
23389
23390 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23391
23392         * class.cs (Property, Indexer): Allow extern modifier in there. 
23393
23394         * typemanager.cs (InitBaseTypes): Initializes object_type and
23395         value_type, since those will be used early on during the bootstrap
23396         process to compile corlib.
23397
23398         (InitCoreTypes): Move code from here to InitBaseTypes.
23399
23400 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
23401
23402         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23403         single-dimension arrays as using the ldlen opcode.  
23404
23405         Daniel Lewis discovered this optimization.  
23406
23407         * typemanager.cs: Add signature for System.Array::get_Length
23408
23409 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23410
23411         * statement.cs: report the error when the foreach does not apply to an
23412         array nor a collection.
23413
23414 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
23415
23416         * expression.cs: Add implicit conversions to the operator ~.
23417
23418         * constant.cs (DecimalConstant.Emit): Emit decimal value.
23419
23420         * typemanager.cs: Locate the decimal constructor.
23421
23422 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23423
23424         * attribute.cs: use the new property of TypeOf.
23425         * expression.cs: added 'get' property around typearg.
23426
23427         These changes fix a build breaker reported by NickD. Is this the
23428         correct way to fix?  If not, please, revert my changes and make it
23429         work :-).
23430
23431 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
23432
23433         * attribute.cs: Add support for typeof in attribute invocations.
23434         I am not sure that this is right though.
23435
23436 2002-04-14  Duncan Mak  <duncan@ximian.com>
23437
23438         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23439         Binary.Operator.Division case.
23440
23441 2002-04-13  Ravi Pratap  <ravi@ximian.com>
23442
23443         * class.cs (DefineType): Ensure that we do a proper check on
23444         attribute types and also register it with the TypeManager.
23445
23446         (TypeContainer.Targets): The default for attribute types is
23447         AttributeTargets.All.
23448
23449         * attribute.cs (ApplyAttributes): Registering the attribute type
23450         is done elsewhere, not when we discover we have a Usage attribute.
23451
23452 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23453
23454         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23455         and get rid of is_delegate parameter.
23456
23457         * everywhere : update.
23458
23459 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23460
23461         * cs-parser.jay (compilation_unit): Revamp completely to use
23462         some new ideas that I got from Rhys' grammar to solve the problems
23463         with assembly level attributes.
23464
23465         (outer_declaration): New grammar production.
23466
23467         (attribute_sections): Add.
23468
23469         (opt_attributes): Base on attribute_sections
23470
23471         (namespace_declaration): Allow opt_attributes to tackle the case
23472         when we have assembly level attributes - we are clever in this
23473         regard now ;-)
23474
23475         * attribute.cs (ApplyAttributes): Do not worry about assembly 
23476         attributes in the non-global context.
23477
23478         * rootcontext.cs (AddGlobalAttributes): Go back to using this
23479         instead of SetGlobalAttributes.
23480
23481         * class.cs, rootcontext.cs : Ensure we define and generate 
23482         attribute types before anything else.
23483
23484         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23485         and flag the new error -20 for the case when the attribute type
23486         does not have valid targets specified. csc does not catch this.
23487
23488         * ../errors/errors.txt : update for error # -20
23489
23490 2002-04-11  Ravi Pratap  <ravi@ximian.com>
23491
23492         * support.cs (InternalParameters.ParameterModifier): Do some null
23493         checking and return sane values.
23494
23495         * class.cs (Method.Define): If we are a PInvoke method, ensure
23496         that we are static and extern. Report error # 601
23497
23498         * ../errors/cs0601.cs : Add test case for the above error.
23499
23500 2002-04-07  Ravi Pratap  <ravi@ximian.com>
23501
23502         * rootcontext.cs (attribute_types): We need to keep type of
23503         all attribute types separately and emit code for them first.
23504
23505         (RegisterAttribute) : Implement.
23506
23507         * class.cs (DefineType): Check if the current Type is a custom
23508         attribute type and register it accordingly.
23509
23510         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23511         adding the first attribute twice and rename to
23512
23513         (SetGlobalAttributes): this.
23514
23515         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23516         lookups.
23517
23518         * attribute.cs (ApplyAttributes): Take an additional argument telling us
23519         if we are processing global arguments. Hmm, I am unsure of this.
23520
23521 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23522
23523         * expression.cs: added static array of strings to avoid calling
23524         Enum.ToString () for Operator in Binary. Significant recover of
23525         performance.
23526
23527 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
23528
23529         * class.cs (FindMembers): Allow the Builders of the various
23530         members to be null.  If they are skip them.  This only happens
23531         during the PInvoke declaration.
23532
23533 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
23534
23535         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23536         failure, so we do not keep going afterwards.
23537
23538         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23539         wanted to pass `false' as the `is_delegate' argument.  If this is
23540         the case, why not use delegate_type == null to mean `is_delegate =
23541         false' and anything else as is_delegate = true.
23542
23543 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
23544
23545         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23546         code for the section, not the beginning of the tests.
23547
23548 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
23549
23550         * cfold.cs: Handle operator + (Enum x, Underlying x) 
23551
23552         * expression.cs (Binary): same.  Warn about errors where we have
23553         Enum/Enum in operator + as well.
23554
23555 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
23556
23557         * statement.cs:
23558                 - added support for switch(bool)
23559                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23560                 - add TableSwitchEmit() to handle table-based switch statements
23561
23562 2002-04-05  Ravi Pratap  <ravi@ximian.com>
23563
23564         * expression.cs (Invocation.OverloadResolve): Factor out code which
23565         does parameter compatibility checking with arguments so that we can 
23566         re-use the code even from Delegate.VerifyApplicability
23567
23568         (VerifyArgumentsCompat): Move above code here.
23569
23570         * delegate.cs (VerifyApplicability): Get rid of duplicate code
23571         and instead make a call to the above method.
23572
23573 2002-03-31  Ravi Pratap  <ravi@ximian.com>
23574
23575         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23576         We use it to keep track of classes which are attribute types.
23577
23578 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
23579
23580         * delegate.cs (Delegate.Define): Correctly define the types in the
23581         presence of fixed and array parameters.
23582
23583         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23584         doing FindMembers.
23585
23586         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23587         include NonPublic after the first iteration.
23588
23589         * class.cs (Indexer.CheckBase): Only check if both parents are
23590         non-null. 
23591
23592         * cs-parser.jay (accessor_body): If empty, set to null.
23593
23594         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23595         same code path here to resolve constants names that we did have in
23596         MemberAccess.DoResolve.  There is too much code duplicated here.
23597
23598 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
23599
23600         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23601
23602         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23603         to MakeUnionSet.
23604
23605         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23606         tokens, numbers and strings.
23607
23608         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23609         parenthesis.
23610
23611         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23612         asyncronous parameters and the regular parameters.  
23613
23614         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23615         specify the target directory.
23616
23617         * expression.cs: (This.DoResolve): Simplify
23618         (As.Emit): Optimize, do not generate IsInst if the expression is
23619         always of the given type.
23620
23621         (Is.DoResolve): Bug fix, we were reporting both always/never for
23622         the is expression.
23623
23624         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23625         creating too many unnecessary arrays.
23626
23627 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
23628
23629         * class.cs (EmitFieldInitializer): Use Assign expression to assign
23630         fields instead of rolling our own initializer.   Takes care of all
23631         implicit conversions, and drops unnecessary static checks/argument.
23632
23633 2002-03-31  Dick Porter  <dick@ximian.com>
23634
23635         * driver.cs: use the GetDirectories() return values properly, and
23636         use "/" as path separator.
23637
23638 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
23639
23640         * expression.cs (Unary): Optimize - - expr into expr.
23641         (Binary): Optimize a + (-b) into a -b.
23642
23643         * codegen.cs (CodeGen): Made all methods static.
23644
23645 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
23646
23647         * rootcontext.cs: 
23648
23649         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23650         TypeBuilder property.
23651
23652         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23653         instead. 
23654
23655         * tree.cs: Removed the various RecordXXXX, and replaced with a
23656         single RecordDecl.  Removed all the accessor methods, and just
23657         left a single access point Type 
23658
23659         * enum.cs: Rename DefineEnum to DefineType.
23660
23661         * decl.cs: New abstract method `DefineType' used to unify the
23662         Defines for Enumerations, Interfaces, TypeContainers and
23663         Delegates.
23664
23665         (FindType): Moved LookupInterfaceOrClass here.  Moved the
23666         LookupBaseClasses method that used to live in class.cs and
23667         interface.cs here, and renamed to FindType.
23668
23669         * delegate.cs: Implement DefineType.  Take advantage of the
23670         refactored pattern for locating the parent builder without taking
23671         the parent_builder argument (which we know does not work if we are
23672         nested, and triggering a toplevel definition).
23673
23674 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23675
23676         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23677         accessibility of a member has changed during override and report
23678         an error if so.
23679
23680         * class.cs (Method.Define, Property.Define): Only complain on
23681         overrides if the method is private, any other accessibility is
23682         fine (and since we just checked the permission is the same, we are
23683         good to go).
23684
23685         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23686         and elif are processed always.  The other pre-processing
23687         directives are only processed if we are "taking" the path
23688
23689 2002-03-29  Martin Baulig  <martin@gnome.org>
23690
23691         * class.cs (Method.Emit): Only emit symbolic debugging info if the
23692         current location is not Null.
23693
23694         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23695         a separate method so we can profile it.
23696
23697         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23698         `span.Seconds' are just seconds, but no minutes or hours.
23699         (MainDriver): Profile the CodeGen.SaveSymbols calls.
23700
23701 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23702
23703         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23704         Remove the gratuitous set of Final:
23705
23706                                 // If an interface implementation, then we can set Final.
23707                                 if (((flags & MethodAttributes.Abstract) == 0) &&
23708                                     implementing.DeclaringType.IsInterface)
23709                                         flags |= MethodAttributes.Final;
23710
23711         I do not know what I was smoking when I used that.
23712
23713
23714         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23715         step into fixing the name resolution issues for delegates and
23716         unifying the toplevel name resolution.
23717
23718 2002-03-28  Martin Baulig  <martin@gnome.org>
23719
23720         * class.cs (Method.Emit): If we have a symbol writer, call its
23721         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23722         tell it about the current method.
23723
23724         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23725         writer that we're going to emit the first byte of IL code for a new
23726         statement (a new source line).
23727         (EmitContext.EmitTopBlock): If we have a symbol writer, call
23728         EmitContext.Mark() before emitting any code.
23729
23730         * location.cs (SymbolDocument): Return null when we're Null.
23731
23732         * statement.cs (Statement): Moved the `Location loc' variable here.
23733         (Statement.EmitBoolExpression): If we have a symbol writer, call
23734         ec.Mark() before emitting any code to tell it that we're at the
23735         beginning of a new statement.
23736         (StatementExpression): Added `Location' argument to the constructor.
23737         (Block): Added public readonly variable `StartLocation' and public
23738         variable `EndLocation'.  The latter is to be set using SetEndLocation().
23739         (Block): Added constructor which takes a start and end location.
23740         (Block.SetEndLocation): New method. This sets the end location.
23741         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23742         local variables we create.
23743         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23744         each statement and do also mark the begin and end of the block.
23745
23746         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23747         tell it the current lexer.Location, use Location.Null for the end of the
23748         block.
23749         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23750         current block, set its end location using SetEndLocation().
23751         (statement_expression): StatementExpression constructor now takes the
23752         lexer.Location as additional argument.
23753         (for_statement, declare_local_variables): Likewise.
23754         (declare_local_variables): When creating a new implicit block, use the
23755         new Block constructor and pass it the lexer.Location.
23756
23757 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23758
23759         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23760         members also on the parent interfaces recursively.
23761
23762 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
23763
23764         * report.cs: Use new formats, since Gonzalo finished the missing
23765         bits. 
23766
23767         * expression.cs (Binary.ResolveOperator): added missing operator|
23768         operator& and operator^ for bool/bool.
23769
23770         * cs-parser.jay: CheckDef now takes a Location argument that is
23771         used to report errors more precisly (instead of reporting the end
23772         of a definition, we try to track something which is a lot closer
23773         to the source of the problem).
23774
23775         * cs-tokenizer.cs: Track global token use, so we can properly flag
23776         the use of #define/#undef after the first token has been seen.
23777
23778         Also, rename the reportXXXX to Error_DescriptiveName
23779
23780         * decl.cs (DeclSpace.IsTopLevel): Move property here from
23781         TypeContainer, so that Enum and Interface can use this too.
23782
23783         * class.cs (TypeContainer.LookupInterfaceOrClass,
23784         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23785         `builder' argument.  Typically this was used to pass the parent
23786         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23787         the definition).  
23788
23789         The problem is that a nested class could trigger the definition of
23790         a toplevel class, and the builder would be obviously wrong in that
23791         case. 
23792
23793         So we drop this argument, and we compute dynamically the
23794         TypeBuilder/ModuleBuilder (the correct information was available
23795         to us anyways from DeclSpace.Parent)
23796
23797         * interface.cs (Interface.DefineInterface): Drop builder
23798         parameter cleanup like class.cs
23799
23800         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
23801         like class.cs
23802
23803         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23804         values. 
23805
23806         (Try.Emit): Propagate the returns value from the statement.
23807
23808         (Return.Emit): Even if we are leavning 
23809
23810         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23811
23812         * modifiers.cs: Fix the computation of MethodAttributes flags.
23813
23814 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23815
23816         * driver.cs: allow compilation of files that start with '/'.
23817         Add a default case when checking the argument of --target.
23818
23819 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
23820
23821         * interface.cs: Implement the same search algorithm for types in
23822         the interface code.
23823
23824         * delegate.cs: Do not allow multiple definition.
23825
23826         * Recovered ChangeLog that got accidentally amputated
23827
23828         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23829
23830         * rootcontext.cs: Load manually enum to allow core classes to
23831         contain enumerations.
23832
23833         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23834         Update to new static methods in TypeManager.
23835
23836         * typemanager.cs (GetMethod, GetConstructor): Use our
23837         implementation of FindMembers to find the members, since during
23838         corlib compilation, the types are TypeBuilders and GetMethod and
23839         GetConstructor do not work.
23840
23841         Make all methods in TypeManager static.
23842
23843         (InitCodeHelpers): Split the functionality from
23844         the InitCodeTypes function.
23845
23846         * driver.cs: Call InitCodeHelpers after we have populated the
23847         types. 
23848
23849         * cs-parser.jay (delegate_declaration): we did not used to compute
23850         the delegate name correctly for void delegates.
23851
23852 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
23853
23854         * rootcontext.cs (RootContext): Init the interface_resolve_order
23855         and type_container_resolve_order always.
23856
23857         (ResolveCore, BootstrapCorlib_ResolveClass,
23858         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23859         compiler when compiling with --nostdlib
23860
23861         * class.cs (TypeContainer.DefineType): Check that our parent is
23862         not null.  This test is most important when we are bootstraping
23863         the core types.
23864
23865         * codegen.cs: Split out the symbol writing code.
23866
23867 2002-03-25  Martin Baulig  <martin@gnome.org>
23868
23869         * driver.cs (-g): Made -g an alias for --debug.
23870
23871 2002-03-24  Martin Baulig  <martin@gnome.org>
23872
23873         * codegen.cs (SymbolWriter): New public variable. Returns the
23874         current symbol writer.
23875         (CodeGen): Added `bool want_debugging_support' argument to the
23876          constructor. If true, tell the ModuleBuild that we want debugging
23877         support and ask it for the ISymbolWriter.
23878         (Save): If we have a symbol writer, call it's Close() method after
23879         saving the assembly.
23880
23881         * driver.c (--debug): New command line argument to create a
23882         debugger information file.
23883
23884         * location.cs (SymbolDocument): New public property. Returns an
23885         ISymbolDocumentWriter object for the current source file or null
23886         if we don't have a symbol writer.
23887
23888 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
23889
23890         * driver.cs (LoadAssembly): Correctly return when all the paths
23891         have been tried and not before.
23892
23893         * statement.cs (Switch.Emit): return the actual coverage for this
23894         statement (returns/not-returns)
23895
23896         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23897         switch of the statement if we are the last switch section.  That
23898         kills two problems: try/catch problems (we used to emit an empty
23899         nop at the end) and switch statements where all branches would
23900         return. 
23901
23902 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
23903
23904         * driver.cs: Add default assemblies (the equivalent to the
23905         Microsoft CSC.RSP file)
23906
23907         * cs-tokenizer.cs: When updating `cols and setting it to zero,
23908         also update tokens_seen and set it to false.
23909
23910         * driver.cs: Implement --recurse for Mike.
23911
23912         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23913         correctly splitting out the paths.
23914
23915 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
23916
23917         * interface.cs (Interface.PopulateProperty): Instead of using
23918         `parent' as the declaration space for the set parameters, use
23919         `this' 
23920
23921         * support.cs (InternalParameters): InternalParameters constructor
23922         takes a DeclSpace instead of a TypeContainer.
23923
23924         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23925         types are being initialized, load the address of it before calling
23926         the function.  
23927
23928         (New): Provide a mechanism to disable the generation of local
23929         value type temporaries when the caller will be providing us with
23930         an address to store it.
23931
23932         (ArrayCreation.EmitDynamicInitializers): Use it.
23933
23934 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
23935
23936         * expression.cs (Invocation.EmitArguments): Only probe for array
23937         property if there is more than one argument.  Sorry about that.
23938
23939         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
23940         empty param arrays.
23941
23942         * class.cs (Method.LabelParameters): Fix incorrect code path that
23943         prevented the `ParamArrayAttribute' from being applied to the
23944         params attribute.
23945
23946 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
23947
23948         * support.cs (ReflectionParameters): Correctly compute whether the
23949         last argument is a params array.  Fixes the problem with
23950         string.Split ('a')
23951
23952         * typemanager.cs: Make the assemblies array always be non-null
23953         (empty, but non-null)
23954
23955         * tree.cs (RecordDecl): New function that abstracts the recording
23956         of names.  This reports error 101, and provides a pointer to the
23957         previous declaration.  Fixes a crash in the compiler.
23958
23959         * cs-parser.jay (constructor_declaration): Update to new grammar,
23960         and provide a constructor_body that can be empty.
23961
23962 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
23963
23964         * driver.cs: Add support for --resources.
23965
23966         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
23967         Make all types for the various array helper methods be integer.
23968
23969         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
23970         CheckState to ConvCast.
23971
23972         (ConvCast): Now it takes a `checked' state argument, to avoid
23973         depending on the emit context for the conversion, and just using
23974         the resolve time setting.
23975
23976         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
23977         instead of Invocation.EmitArguments.  We do not emit the original
23978         arguments, instead we emit those which have been converted to
23979         unsigned int expressions.
23980
23981         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
23982
23983         * codegen.cs: ditto.
23984
23985         * expression.cs (LocalVariableReference): Drop the use of the
23986         Store function that depended on the variable index.
23987
23988         * statement.cs (VariableInfo): Drop the `Idx' property from this
23989         class, as this is not taking into account the indexes for
23990         temporaries tat we generate during the execution, getting the
23991         indexes wrong.
23992
23993         * class.cs: First emit class initializers, then call the parent
23994         constructor. 
23995
23996         * expression.cs (Binary): Fix opcode emision.
23997         (UnaryMutator.EmitCode): Support checked code generation
23998
23999         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
24000         matches for events for both the Static and Instance scans,
24001         pointing to the same element.   Fix that.
24002
24003 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
24004
24005         * rootcontext.cs (ResolveTree): Always set the
24006         interface_resolve_order, because nested interfaces will be calling
24007         into us.
24008
24009         * class.cs (GetInterfaceOrClass): Track the same resolution
24010         process used by TypeManager.LookupType.  This fixes the nested
24011         type lookups in class declarations (separate path from
24012         LookupType). 
24013
24014         (TypeContainer.DefineType): Also define nested interfaces.
24015         (TypeContainer.RegisterOrder): New public function used to
24016         register the order in which child interfaces need to be closed.
24017
24018         Nested interfaces need to be closed after their parents have been
24019         created. 
24020
24021         * interface.cs (InterfaceAttr): Put all the logic for computing
24022         the interface attribute here. 
24023
24024         (DefineInterface): Register our interface order with the
24025         RootContext or with the TypeContainer depending on the case.
24026
24027 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
24028
24029         * cs-parser.jay: rework foreach statement to work with the new
24030         changes to the policy on SimpleNames.
24031
24032         * report.cs: support Stacktrace on warnings as well.
24033
24034         * makefile: drop --unsafe and /unsafe from the compile.
24035
24036 2002-03-13  Ravi Pratap  <ravi@ximian.com>
24037
24038         * ecore.cs (StandardConversionExists): Modify to take an Expression
24039         as the first parameter. Ensure we do null -> reference type conversion
24040         checking.
24041
24042         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
24043         temporary Expression objects.
24044
24045 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
24046
24047         * interface.cs: workaround bug in method overloading resolution
24048         (there is already a bugzilla bug for it).
24049
24050 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
24051
24052         We could also solve this problem by having a separate path for
24053         performing type lookups, instead of DoResolve, we could have a
24054         ResolveType entry point, and only participating pieces of the
24055         production (simplename, deref, array) would implement this. 
24056
24057         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
24058         signal SimpleName to only resolve type names and not attempt to
24059         resolve anything else.
24060
24061         * expression.cs (Cast): Set the flag.
24062
24063         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
24064
24065         * class.cs: Only report 108 if there is no `new' modifier.
24066
24067         * cs-parser.jay: rework foreach statement to work with the new
24068         changes to the policy on SimpleNames.
24069
24070         * report.cs: support Stacktrace on warnings as well.
24071
24072         * makefile: drop --unsafe and /unsafe from the compile.
24073
24074 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
24075
24076         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24077         lookups here, instead of doing that at parse time.  This means
24078         that our grammar will not introduce `LocalVariableReferences' as
24079         expressions at this point.  That solves the problem of code like
24080         this:
24081
24082         class X {
24083            static void Main ()
24084            { int X = 1;
24085             { X x = null }}}
24086
24087         This is only half the fix.  The full fix requires parameters to
24088         also be handled in this way.
24089
24090         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
24091         makes the use more obvious of the DeclSpace.  The
24092         ec.TypeContainer.TypeBuilder is now only used to pull the
24093         TypeBuilder for it.
24094
24095         My theory is that I can get rid of the TypeBuilder completely from
24096         the EmitContext, and have typecasts where it is used (from
24097         DeclSpace to where it matters).  
24098
24099         The only pending problem is that the code that implements Aliases
24100         is on TypeContainer, and probably should go in DeclSpace.
24101
24102         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24103         lookups here, instead of doing that at parse time.  This means
24104         that our grammar will not introduce `LocalVariableReferences' as
24105         expressions at this point.  That solves the problem of code like
24106         this:
24107
24108         class X {
24109            static void Main ()
24110            { int X = 1;
24111             { X x = null }}}
24112
24113         This is only half the fix.  The full fix requires parameters to
24114         also be handled in this way.
24115
24116         * class.cs (Property.DefineMethod): When implementing an interface
24117         method, set newslot, when implementing an abstract method, do not
24118         set the flag (before we tried never setting it, or always setting
24119         it, which is the difference).
24120         (Indexer.DefineMethod): same.
24121         (Method.DefineMethod): same.
24122
24123         * ecore.cs: Only set the status used flag if we get back a Field.
24124
24125         * attribute.cs: Temporary hack, so Paolo can keep working.
24126
24127 2002-03-08  Ravi Pratap  <ravi@ximian.com>
24128
24129         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
24130         the unmanaged type in the case we have a MarshalAs attribute.
24131
24132         (Resolve): Handle the case when we are parsing the special MarshalAs
24133         attribute [we need to store the unmanaged type to use later]
24134
24135         * typemanager.cs (marshal_as_attr_type): Built in type for the 
24136         MarshalAs Attribute.
24137
24138         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
24139         on parameters and accordingly set the marshalling info.
24140
24141 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
24142
24143         * class.cs: Optimizing slightly by removing redundant code after
24144         we switched to the `NoTypes' return value.
24145         (Property.DefineMethod): use NoTypes here too.
24146
24147         This fixes the bug I introduced in my last batch of changes.
24148
24149 2002-03-05  Ravi Pratap  <ravi@ximian.com>
24150
24151         * tree.cs (RecordEnum): Add. We now keep track of enums too.
24152
24153         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
24154         Enums since those are types too. 
24155
24156         * cs-parser.jay (enum_declaration): Record enums as we parse them.
24157
24158         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
24159         thanks to a call during the lookup process.
24160
24161 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
24162
24163         * statement.cs (Foreach): Lots of work to accomodate a particular
24164         kind of foreach statement that I had not kept in mind.  It is
24165         possible to have foreachs on classes that provide a GetEnumerator
24166         method that return objects that implement the "pattern" for using
24167         a foreach, there is no need to support GetEnumerator
24168         specifically. 
24169
24170         This is needed to compile nant.
24171
24172         * decl.cs: Only report 114 if the member is not `Finalize' and if
24173         the warning level is at least 2.
24174
24175         * class.cs: Moved the compare function from Method to
24176         MethodSignature. 
24177
24178         (MethodSignature.InheritableMemberSignatureCompare): Add new
24179         filter function that is used to extract inheritable methods from a
24180         class. 
24181
24182         (Method.Define): Use the new `inheritable_method_signature_filter'
24183         delegate
24184
24185         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
24186         command. 
24187
24188 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
24189
24190         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
24191
24192         * cs-parser.jay: Add opt_semicolon to the interface declaration.
24193
24194         * expression.cs: Pass location information to
24195         ConvertImplicitStandard. 
24196
24197         * class.cs: Added debugging code to track return values from
24198         interfaces. 
24199
24200 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
24201
24202         * expression.cs (Is.DoResolve): If either side of the `is' is an
24203         interface, do not flag the warning.
24204
24205         * ecore.cs (ImplicitReferenceConversion): We need a separate test
24206         for interfaces
24207
24208         * report.cs: Allow for --fatal to be used with --probe.
24209
24210         * typemanager.cs (NoTypes): Move the definition for the empty Type
24211         array here. 
24212
24213         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
24214         properties. 
24215         (TypeContainer.DefineProxy): New function used to proxy to parent
24216         implementations when implementing interfaces.
24217         (TypeContainer.ParentImplements): used to lookup if our parent
24218         implements a public function that is required by an interface.
24219         (TypeContainer.VerifyPendingMethods): Hook this up.
24220
24221         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
24222         `modules' and `assemblies' arraylists into arrays.  We only grow
24223         these are the very early start up of the program, so this improves
24224         the speedof LookupType (nicely measured).
24225
24226         * expression.cs (MakeByteBlob): Replaced unsafe code with
24227         BitConverter, as suggested by Paolo.
24228
24229         * cfold.cs (ConstantFold.Binary): Special case: perform constant
24230         folding of string concatenation, but if either side is a string,
24231         and the other is not, then return null, and let the runtime use
24232         the concatenation on the string plus the object (using
24233         `Object.ToString'). 
24234
24235 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
24236
24237         Constant Folding has been implemented now.
24238
24239         * expression.cs (Unary.Reduce): Do not throw an exception, catch
24240         the error instead on types that are not supported in one's
24241         complement. 
24242
24243         * constant.cs (Constant and all children): New set of functions to
24244         perform implict and explicit conversions.
24245
24246         * ecore.cs (EnumConstant): Implement the new functions to perform
24247         conversion by proxying to the child expression.
24248
24249         * codegen.cs: (ConstantCheckState): Constant evaluation has its
24250         own separate setting that can not be turned off from the command
24251         line using --unchecked or --checked and is only controlled using
24252         the checked/unchecked statements and expressions.  This setting is
24253         used by the constant folder to flag errors.
24254
24255         * expression.cs (CheckedExpr, UncheckedExpr): Set the
24256         ConstantCheckState as well.   
24257
24258         During Resolve, they also have to flag the state, because the
24259         constant folder runs completely in the Resolve phase.
24260
24261         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24262         well.
24263
24264 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24265
24266         * cfold.cs: New file, this file contains the constant folder.
24267
24268         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24269         argument to track whether we are using the resulting address to
24270         load or store a value and provide better error messages. 
24271
24272         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24273         new AddressOf arguments.
24274
24275         * statement.cs (Foreach.EmitCollectionForeach): Update
24276
24277         * expression.cs (Argument.Emit): Call AddressOf with proper
24278         arguments to track usage.
24279
24280         (New.DoEmit): Call AddressOf with new arguments.
24281
24282         (Unary.Emit): Adjust AddressOf call.
24283
24284 2002-03-01  Ravi Pratap  <ravi@ximian.com>
24285
24286         * cs-parser.jay (member_access): Change the case for pre-defined types
24287         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
24288         this suggestion.
24289
24290         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24291         a method body.
24292
24293         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24294         essentially like methods and apply attributes like MethodImplOptions to them too.
24295
24296         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24297         not being null.
24298
24299         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24300         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24301         is the DeclSpace.
24302
24303         * Update code everywhere accordingly.
24304
24305         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24306
24307         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24308
24309 2002-02-28  Ravi Pratap  <ravi@ximian.com>
24310
24311         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24312         try performing lookups against those instead of jumping straight into using
24313         the 'using' clauses.
24314
24315         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24316
24317         (LookupType): Perform lookups in implicit parents too.
24318
24319         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24320         sequence as RootContext.LookupType. 
24321
24322         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
24323         the various cases of namespace lookups into this method.
24324
24325 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24326
24327         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24328         in positional arguments)
24329
24330         * class.cs (Operator): Update the AllowedModifiers to contain
24331         extern. 
24332
24333         * cs-parser.jay: Update operator declaration to allow for the
24334         operator body to be empty.
24335
24336         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24337         values. 
24338
24339 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
24340
24341         * class.cs (Method.Emit): Label parameters.
24342
24343         * driver.cs: Return 1 or 0 as the program exit code.
24344
24345 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
24346
24347         * expression.cs: Special case the `null' object when trying to
24348         auto-compute the type, as anything can be explicitly converted to
24349         that. 
24350
24351         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24352         spotting this Paolo.
24353
24354         (Expression.ImplicitNumericConversion): Perform comparissions of
24355         the type using the underlying type in the case of an enumeration
24356         rather than using the enumeration type for the compare.
24357
24358         Cope with the underlying == type case, which is not possible to
24359         catch before. 
24360
24361         (Expression.ConvertNumericExplicit): Perform comparissions of
24362         the type using the underlying type in the case of an enumeration
24363         rather than using the enumeration type for the compare.
24364
24365         * driver.cs: If the user does not supply an extension, assume .exe
24366
24367         * cs-parser.jay (if_statement): Rewrote so that we can track the
24368         location for the if statement.
24369
24370         * expression.cs (Binary.ConstantFold): Only concat strings when
24371         the operation is "+", not everything ;-)
24372
24373         * statement.cs (Statement.EmitBoolExpression): Take a location
24374         argument. 
24375         (If, While, Do): Track location.
24376
24377         * expression.cs (Binary.ResolveOperator): In the object + string
24378         case, I was missing a call to ConvertImplicit
24379
24380 2002-02-25  Ravi Pratap  <ravi@ximian.com>
24381
24382         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24383         Location arguments. Ensure we use RootContext.LookupType to do our work
24384         and not try to do a direct Type.GetType and ModuleBuilder.GetType
24385
24386         * interface.cs (PopulateMethod): Handle the type of the parameter being
24387         null gracefully.
24388
24389         * expression.cs (Invocation.BetterFunction): Handle the case when we 
24390         have a params method with no fixed arguments and a call is made with no
24391         arguments.
24392
24393 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
24394
24395         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24396         the verbatim-string-literal
24397
24398         * support.cs (InternalParameters.ParameterModifier): handle null
24399         fixed parameters.
24400         (InternalParameters.ParameterType): ditto.
24401
24402         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24403         duplicating the name of the variable parameter.
24404         (GetParameterByName): Fix bug where we were not looking up array
24405         paramters if they were the only present (thanks Paolo!).
24406         (GetParameterInfo): We only have an empty set of types if both
24407         fixed and array are set to null.
24408         (GetParameterInfo-idx): Handle FixedParameter == null
24409
24410         * cs-parser.jay: Handle the case where there is no catch
24411         statements (missing null test).
24412
24413 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
24414
24415         * driver.cs (MainDriver): Be conservative on our command line
24416         handling.
24417
24418         Catch DirectoryNotFoundException when calling GetFiles.
24419
24420         (SplitPathAndPattern): Used to split the input specification into
24421         a path and a pattern that we can feed to Directory.GetFiles.
24422
24423 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
24424
24425         * statement.cs (Fixed): Implement the last case of the Fixed
24426         statement (string handling).
24427
24428         * expression.cs (StringPtr): New class used to return a char * to
24429         a string;  Used by the Fixed statement.
24430
24431         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
24432
24433         * expression.cs (Binary.ResolveOperator): Remove redundant
24434         MemberLookup pn parent type.
24435         Optimize union call, we do not need a union if the types are the same.
24436         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24437         type.
24438
24439         Specialize the use of MemberLookup everywhere, instead of using
24440         the default settings. 
24441
24442         (StackAlloc): Implement stackalloc keyword.
24443
24444         * cs-parser.jay: Add rule to parse stackalloc.
24445
24446         * driver.cs: Handle /h, /help, /?
24447
24448         * expression.cs (MakeByteBlob): Removed the hacks we had in place
24449         before we supported unsafe code.
24450
24451         * makefile: add --unsafe to the self compilation of mcs.
24452
24453 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
24454
24455         * expression.cs (PointerArithmetic): New class that is used to
24456         perform pointer arithmetic.
24457         (Binary.Resolve): Handle pointer arithmetic
24458         Handle pointer comparission.
24459         (ArrayPtr): Utility expression class that is used to take the
24460         address of an array.
24461
24462         (ElementAccess): Implement array access for pointers
24463
24464         * statement.cs (Fixed): Implement fixed statement for arrays, we
24465         are missing one more case before we are done.
24466
24467         * expression.cs (Indirection): Implement EmitAssign and set the
24468         ExprClass to Variable.  This allows pointer dereferences to be
24469         treated as variables, and to have values assigned to them.
24470
24471         * ecore.cs (Expression.StoreFromPtr): New utility function to
24472         store values dereferencing.
24473
24474 2002-02-20  Ravi Pratap  <ravi@ximian.com>
24475
24476         * expression.cs (Binary.ResolveOperator): Ensure that we are
24477         not trying to operate on a void type - this fixes the reported
24478         bug.
24479
24480         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24481         the parent implementation is sealed.
24482
24483         * ../errors/cs0239.cs : Add.
24484
24485         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24486
24487         * typemanager.cs (unverifiable_code_type): Corresponds to 
24488         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24489         which have unsafe code in them.
24490
24491         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
24492         unsafe context.
24493
24494 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
24495
24496         * cs-tokenizer.cs: Add support for @"litreal strings"
24497
24498         Make tokenizer accept pre-processor directives
24499         on any column (remove the old C-like limitation). 
24500
24501         * rootcontext.cs (EmitCode): Emit any global attributes.
24502         (AddGlobalAttributes): Used to keep track of assembly attributes. 
24503
24504         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24505
24506         * cs-parser.jay: Add support for global attributes.  
24507
24508 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
24509
24510         * expression.cs (Indirection): New helper class.  Unary will
24511         create Indirection classes to be able to implement the
24512         IMemoryLocation interface on it.
24513
24514 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
24515
24516         * cs-parser.jay (fixed_statement): reference the right statement.
24517
24518         * statement.cs (Fixed.Emit): Finish implementing the fixed
24519         statement for the &x case.
24520
24521 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
24522
24523         * class.cs (Property.Define, Method.Define): Remove newslot when
24524         `implementing'.  
24525
24526         * modifiers.cs: My use of NewSlot when `Abstract' was set was
24527         wrong.  NewSlot should only be used if the `new' keyword is present.
24528
24529         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24530         locating our system dir.  Sorry about this.
24531
24532 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24533
24534         * driver.cs (GetSystemDir): Compute correctly the location of our
24535         system assemblies.  I was using the compiler directory instead of
24536         the library directory.
24537
24538 2002-02-13  Ravi Pratap  <ravi@ximian.com>
24539
24540         * expression.cs (BetterFunction): Put back in what Miguel commented out
24541         since it is the correct fix. The problem is elsewhere ;-)
24542
24543         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24544         parameters of the parms method are themselves compatible or not !
24545
24546         (StandardConversionExists): Fix very dangerous bug where we were forgetting
24547         to check that a class implements an interface before saying that an implicit
24548         conversion was allowed. Use ImplementsInterface to do the checking.
24549
24550 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24551
24552         * class.cs (Method.Define): Track whether we are an explicit
24553         implementation or not.  And only call DefineMethodOverride if we
24554         are an explicit implementation.
24555
24556         (Property.DefineMethod): Ditto.
24557
24558 2002-02-11  Ravi Pratap  <ravi@ximian.com>
24559
24560         * expression.cs (BetterFunction): Catch hideous bug which was
24561          preventing us from detecting ambiguous calls due to implicit casts i.e
24562         cs0121.
24563
24564 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
24565
24566         * support.cs (Pair): Remove un-needed method.  I figured why I was
24567         getting the error in cs-parser.jay, the variable in a foreach loop
24568         is readonly, and the compiler does not really treat this as a variable.
24569
24570         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
24571         instead of EQUALS in grammar.  
24572
24573         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24574
24575         * expression.cs (Unary.DoResolve): Check whether the argument is
24576         managed or not.
24577
24578 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
24579
24580         * support.cs: Api for Pair to set a value.  Despite the fact that
24581         the variables are public the MS C# compiler refuses to compile
24582         code that accesses the field if the variable is part of a foreach
24583         statement. 
24584
24585         * statement.cs (Fixed): Begin implementation of the fixed
24586         statement.
24587
24588         (Block.AddVariable): Return the VariableInfo on success and null
24589         on failure instead of true/false. 
24590
24591         * cs-parser.jay (foreach): Catch errors on variables already
24592         defined (we were ignoring this value before) and properly unwind
24593         the block hierarchy
24594
24595         (fixed_statement): grammar for the fixed statement.
24596
24597 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
24598
24599         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24600         pointer types to be incretemented.
24601
24602         (SizeOf): Implement.
24603
24604         * cs-parser.jay (pointer_member_access): Implement
24605         expr->IDENTIFIER production.
24606
24607         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24608         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24609         on safe contexts.
24610
24611         (Unary): Implement indirection.
24612
24613         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24614         use in non-unsafe context).
24615
24616         (SimpleName.DoResolve): Check for pointers in field access on safe
24617         contexts. 
24618
24619         (Expression.LoadFromPtr): Factor the load-indirect code in this
24620         function.  This was duplicated in UnboxCast and ParameterReference
24621
24622 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
24623
24624         * expression.cs (ComposedCast): report an error if a pointer cast
24625         is used in a safe region.
24626
24627         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24628         pointer type casts in unsafe context.
24629
24630         * codegen.cs (EmitContext): Set up IsUnsafe.
24631
24632         * cs-parser.jay (non_expression_type): Add productions for pointer
24633         casts. 
24634
24635         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24636         code.  We should not use force into static mode if the method is
24637         not virtual.  Fixes bug in MIS
24638
24639         * statement.cs (Do.Emit, While.Emit, For.Emit,
24640         Statement.EmitBoolExpression): Add support to Do and While to
24641         propagate infinite loop as `I do return' semantics.
24642
24643         Improve the For case to also test for boolean constants.
24644
24645         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24646         to the list of attributes we can add.
24647
24648         Remove `EmitContext' argument.
24649
24650         * class.cs (Method.Define): Apply parameter attributes.
24651         (Constructor.Define): Apply parameter attributes.
24652         (MethodCore.LabelParameters): Move here the core of labeling
24653         parameters. 
24654
24655         * support.cs (ReflectionParameters.ParameterModifier,
24656         InternalParameters.ParameterModifier): Use IsByRef on the type and
24657         only return the OUT bit for these parameters instead of in/out/ref
24658         flags.
24659
24660         This is because I miss-understood things.  The ParameterInfo.IsIn
24661         and IsOut represent whether the parameter has the [In] and [Out]
24662         attributes set.  
24663
24664 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
24665
24666         * ecore.cs (FieldExpr.Emit): Release temporaries.
24667
24668         * assign.cs (LocalTemporary.Release): new function.
24669
24670         * codegen.cs (EmitContext.GetTemporaryStorage,
24671         EmitContext.FreeTemporaryStorage): Rework the way we deal with
24672         temporary storage.  Now we can "put back" localbuilders when we
24673         are done with them
24674
24675 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
24676
24677         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24678         need to make a copy of the variable to generate verifiable code.
24679
24680 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
24681
24682         * driver.cs: Compute dynamically the system directory.
24683
24684         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24685         Slower, but more generally useful.  Used by the abstract
24686         registering implementation. 
24687
24688         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24689         the rules for the special rule on Type/instances.  First check if
24690         we have the same name, and if so, try that special static path
24691         rather than the instance path.
24692
24693 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
24694
24695         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24696         for, while and if.
24697
24698         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24699         Enum, ValueType, Delegate or Array for non-corlib compiles.
24700
24701         * cs-tokenizer.cs: Catch long identifiers (645)
24702
24703         * typemanager.cs (IndexerPropetyName): Ravi never tested this
24704         piece of code.
24705
24706         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24707         fix, we were returning too early, so we were not registering
24708         pending methods from abstract classes.
24709
24710         Do not register pending methods if the class is abstract.
24711
24712         * expression.cs (Conditional.DoResolve): Report circular implicit
24713         conversions when we neecd to compute it for conditional
24714         expressions. 
24715
24716         (Is.DoResolve): If the expression is always of the provided type,
24717         flag warning 183.  If the expression can not ever be of the
24718         provided type flag warning 184.
24719
24720         * class.cs: Catch 169 as well.
24721
24722         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24723         read. 
24724
24725 2002-01-18  Nick Drochak  <ndrochak@gol.com>
24726
24727         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
24728
24729 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
24730
24731         * interface.cs: (PopulateMethod): Check for pointers being defined
24732         only if the unsafe context is active.
24733         (PopulateProperty): ditto.
24734         (PopulateIndexer): ditto.
24735
24736         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24737         specified.  If pointers are present, make sure that they are
24738         present in an unsafe context.
24739         (Constructor, Constructor.Define): ditto.
24740         (Field, Field.Define): ditto.
24741         (Property, Property.Define): ditto.
24742         (Event, Event.Define): ditto.
24743
24744         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24745         hashtable if there are classes or structs defined.
24746
24747         * expression.cs (LocalVariableReference.DoResolve): Simplify this
24748         code, as the constant resolution moved.
24749
24750         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24751         the metadata, so we can flag error 133. 
24752
24753         * decl.cs (MemberCore.UnsafeOK): New function to test that a
24754         pointer is being declared in an unsafe context.
24755
24756 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
24757
24758         * modifiers.cs (Modifiers.Check): Require a Location argument.
24759         Report error 227 for Unsafe use.
24760
24761         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24762
24763         * statement.cs (For.Emit): If the test is null, then report that
24764         we do `return', as we wont reach anything afterwards.
24765
24766         (Switch.SwitchGoverningType): Track the expression that matched
24767         the conversion.
24768
24769         * driver.cs: Allow negative numbers as an error code to flag.
24770
24771         * cs-parser.jay: Handle 1551.
24772
24773         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24774
24775 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24776
24777         * cs-parser.jay: Report 1518 (type declaration can only contain
24778         class, struct, interface, enum or delegate)
24779
24780         (switch_label): Report 1523 (keywords `case' or `default' must
24781         preced code)
24782
24783         (opt_switch_sections): Report 1522 (empty switch)
24784
24785         * driver.cs: Report 1515 (response file specified multiple times)
24786         Report 1516 (Source file specified multiple times).
24787
24788         * expression.cs (Argument.Resolve): Signal 1510
24789
24790         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24791         access not allowed in static code)
24792
24793 2002-01-11  Ravi Pratap  <ravi@ximian.com>
24794
24795         * typemanager.cs (IsPointerType): Utility method which we are going
24796         to need a lot.
24797
24798         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24799         the object type, so we take care of that.
24800
24801         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24802
24803         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24804         added to non-params parameters :-)
24805
24806         * typemanager.cs (CSharpName): Include 'void' type too. 
24807
24808         (void_ptr_type): Include in the set of core types.
24809
24810         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
24811         duplicating code.
24812
24813         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
24814         an unsafe context.
24815
24816         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
24817         completely forgotten about it.
24818
24819 2002-01-10  Ravi Pratap  <ravi@ximian.com>
24820
24821         * cs-parser.jay (pointer_type): Add. This begins our implementation
24822         of parsing rules for unsafe code.
24823
24824         (unsafe_statement): Implement.
24825
24826         (embedded_statement): Modify to include the above.
24827
24828         * statement.cs (Unsafe): Implement new class for unsafe blocks.
24829
24830         * codegen.cs (EmitContext.InUnsafe): Add. This determines
24831         if the current context is an unsafe one.
24832
24833         * cs-parser.jay (local_variable_pointer_type): Since local variable types
24834         are handled differently, we need separate rules for them.
24835
24836         (local_variable_declaration): Update to use local_variable_pointer_type
24837         to allow variable declarations of unmanaged pointer types.
24838
24839         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24840         in unsafe contexts.
24841
24842         * ../errors/cs0214.cs : Add.
24843
24844 2002-01-16  Nick Drochak  <ndrochak@gol.com>
24845
24846         * makefile: remove 'response' file when cleaning.
24847
24848 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24849
24850         * cs-parser.jay: Report 1524.
24851
24852 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
24853
24854         * typemanager.cs (RegisterMethod): drop checking if we have
24855         registered this from here
24856
24857 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
24858
24859         * class.cs (Method.EmitDestructor): Implement calling our base
24860         destructor. 
24861
24862         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24863         value of InFinally.
24864
24865         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24866         this routine and will wrap the call in a try/catch block.  Deal
24867         with the case.
24868
24869 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
24870
24871         * ecore.cs (Expression.MemberLookup): instead of taking a
24872         parameter `same_type' that was used to tell whether we could
24873         access private members we compute our containing type from the
24874         EmitContext.
24875
24876         (FieldExpr): Added partial support for volatile fields.  This does
24877         not work for volatile fields exposed from assemblies, as I can not
24878         figure out how to extract the modreq from it.
24879
24880         Updated all the source files to use this.
24881
24882         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24883         because it is referenced by MemberLookup very often. 
24884
24885 2002-01-09  Ravi Pratap  <ravi@ximian.com>
24886
24887         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24888         TypeBuilder.GetCustomAttributes to retrieve what we need.
24889
24890         Get rid of redundant default_member_attr_type as this is the same as
24891         default_member_type which already exists.
24892
24893         * interface.cs, attribute.cs : Update accordingly.
24894
24895 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
24896
24897         * typemanager.cs: Enable IndexerPropertyName again.  It does not
24898         work for TYpeBuilders though.  Ravi, can you please fix this?
24899
24900         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24901
24902         * expression.cs (Argument.Emit): Handle the case of ref objects
24903         being passed to ref functions;  
24904
24905         (ParameterReference.EmitLoad): Loads the content of the pointer
24906         without dereferencing.
24907
24908 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24909
24910         * cs-tokenizer.cs: Implemented the pre-processing expressions.
24911
24912 2002-01-08  Ravi Pratap  <ravi@ximian.com>
24913
24914         * class.cs (Indexer.DefineMethod): Incorporate the interface
24915         type in the name of the method if we are doing explicit interface
24916         implementation.
24917
24918         * expression.cs (ConversionExists): Remove as it is completely obsolete.
24919
24920         (BetterConversion): Fix extremely trivial bug where we were referring to
24921         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24922         again !
24923
24924         * ../errors/bug16.cs : Add although we have fixed it.
24925
24926 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24927
24928         * expression.cs (BaseIndexer): Begin implementation.
24929
24930         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
24931
24932         * cs-parser.jay (indexer_declarator): Use qualified_identifier
24933         production directly to remove a shift/reduce, and implement
24934         explicit interface implementation.
24935
24936         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
24937         after a floating point suffix.
24938
24939         * expression.cs (DoNumericPromotions): Improved the conversion for
24940         uint/uint.  If we have a constant, we avoid doing a typecast to a
24941         larger type.
24942
24943         * class.cs (Indexer): Implement explicit interface implementation
24944         for indexers.
24945
24946 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
24947
24948         * class.cs: make the default instance constructor public and hidebysig.
24949
24950 2001-01-03  Ravi Pratap  <ravi@ximian.com>
24951
24952         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
24953         so we can call it from elsewhere.
24954
24955         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
24956         we emit it internally if the class has a defined indexer; otherwise the user
24957         emits it by decorating the class definition with the DefaultMemberAttribute.
24958
24959         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
24960         attribute is not used on a type which defines an indexer.
24961
24962         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
24963         character when we skip whitespace.
24964
24965         * ../errors/cs0646.cs : Add.
24966
24967 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
24968
24969         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
24970         again. 
24971
24972         * makefile: Add practical target `mcs3.exe' which builds the third
24973         generation compiler. 
24974
24975         * expression.cs (New): Fix structures constructor calling.
24976
24977         * class.cs (Property, Method, Indexer): Emit Final flag on the
24978         method if we are an interface implementation and we are not
24979         abstract. 
24980
24981         * ecore.cs (PropertyExpr): New public field `IsBase', tells
24982         whether this property is referencing a `base' method.
24983
24984         * expression.cs (Invocation.EmitCall): take an extra argument:
24985         is_base, this is used to determine whether the `call' or
24986         `callvirt' opcode should be used.
24987
24988
24989         * delegate.cs: update EmitCall.
24990
24991         * class.cs (Method.Define): Set NewSlot for the cases where we are
24992         not implementing an interface method.
24993
24994         (Property.Define): ditto.
24995
24996 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
24997
24998         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
24999         'r'.  Allows mcs to parse itself fully.
25000
25001 2002-01-02  Ravi Pratap  <ravi@ximian.com>
25002
25003         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
25004         of the number of initializers that require the InitializeArray method.
25005
25006         (CheckIndices): Store the Expression in all cases - not the plain value. Also
25007         update the above field where necessary.
25008
25009         (MakeByteBlob): Update accordingly.
25010
25011         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
25012         greater than 2.
25013
25014         (EmitDynamicInitializers): Update in accordance with the new optimization.
25015
25016         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
25017         same OpCode applies.
25018
25019         * cs-parser.jay : Fix some glaring errors I introduced.
25020
25021 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
25022
25023         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
25024         so that we can check for name clashes there too.
25025
25026         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
25027         for interface indexers.
25028
25029         * interfaces.cs (Define): Emit the default member attribute.
25030
25031         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
25032         variable was being referred to while setting the value ;-)
25033
25034 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
25035
25036         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
25037         byte-by-byte information when we know the data is zero.
25038
25039         Make the block always a multiple of 4, because
25040         DefineInitializedData has a bug.
25041
25042         * assign.cs: Fix, we should assign from the temporary, not from
25043         the source. 
25044
25045         * expression.cs (MakeByteBlob): Fix my incorrect code.
25046
25047 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
25048
25049         * typemanager.cs (EnumToUnderlying): This function is used to get
25050         the underlying type from an enumeration, because it does not
25051         always work. 
25052
25053         * constant.cs: Use the I4_S form for values between -128 and 127.
25054
25055         * statement.cs (Block.LookupLabel): Looks up a label.
25056         (Block): Drop support for labeled blocks.
25057
25058         (LabeledStatement): New kind of statement that represents a label
25059         only.
25060
25061         (Goto): Finally implement this bad boy.
25062
25063         * cs-parser.jay: Update to reflect new mechanism to implement
25064         labels.
25065
25066 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
25067
25068         * codegen.cs (EmitContext.This): a codegen property that keeps the
25069         a single instance of this instead of creating many different this
25070         instances. 
25071
25072         * delegate.cs (Delegate.DoResolve): Update to use the property;
25073
25074         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
25075
25076         * expression.cs (BaseAccess.DoResolve): Ditto.
25077
25078 2001-12-29  Ravi Pratap  <ravi@ximian.com>
25079
25080         * typemanager.cs (methodimpl_attr_type): Add to hold the type
25081         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
25082
25083         (InitCoreTypes): Update accordingly.
25084
25085         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
25086         so we can quickly store the state.
25087
25088         (ApplyAttributes): Set the correct implementation flags
25089         for InternalCall methods.
25090
25091 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
25092
25093         * expression.cs (EmitCall): if a method is not virtual, then do
25094         not use callvirt on it.
25095
25096         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
25097         user defined stuff) requires the use of stobj, which takes an
25098         address on the stack instead of an array and an index.  So emit
25099         the Ldelema operation for it.
25100
25101         (EmitStoreOpcode): Use stobj for valuetypes.
25102
25103         (UnaryMutator.EmitCode): Use the right 1 value depending on
25104         whether we are dealing with int64/uint64, float or doubles.
25105
25106         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
25107         constructors that I implemented last night.
25108
25109         (Constructor.IsDefault): Fix to work properly for static
25110         constructors.
25111
25112         * cs-parser.jay (CheckDef): report method signature errors.
25113         Update error number 103 to be 132.
25114
25115         * decl.cs: New AdditionResult enumeration value: MethodExists.
25116         Although we do this check for methods later on in the semantic
25117         analysis, catching repeated default constructors is so easy that
25118         we catch these here. 
25119
25120         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
25121         promotions code.
25122
25123         (ParameterReference.EmitAssign, Emit): handle
25124         bools as bytes.
25125
25126         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
25127         (ArrayAccess.EmitStoreOpcode): ditto.
25128
25129         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
25130
25131         * expression.cs (MakeByteBlob): Complete all the missing types
25132         (uint, short, ushort, byte, sbyte)
25133
25134         * class.cs: Only init instance field initializers on instance
25135         constructors. 
25136
25137         Rename `constructors' to instance_constructors. 
25138
25139         (TypeContainer.AddConstructor): Only add constructors to the list
25140         if it is not static.
25141
25142         Make sure that we handle default_static_constructor independently
25143         everywhere where we handle instance_constructors
25144
25145 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
25146
25147         * class.cs: Do not lookup or create a base initializer for a
25148         static constructor.
25149
25150         (ConstructorInitializer.Resolve): use the proper type to lookup
25151         for constructors.
25152
25153         * cs-parser.jay: Report error 1585 (modifiers between type and name).
25154
25155         * enum.cs, interface.cs: Remove CloseType, this is taken care by
25156         in DeclSpace. 
25157
25158         * decl.cs: CloseType is now an virtual method, the default
25159         implementation just closes this type.
25160
25161 2001-12-28  Ravi Pratap  <ravi@ximian.com>
25162
25163         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
25164         to PreserveSig by default. Also emit HideBySig on such methods.
25165
25166         Basically, set the defaults to standard values.
25167
25168         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
25169         argument, if candidate is better, it can't be worse than the best !
25170
25171         (Invocation): Re-write bits to differentiate between methods being
25172         applicable in their expanded form and their normal form - for params
25173         methods of course.
25174
25175         Get rid of use_standard everywhere as only standard conversions are allowed
25176         in overload resolution. 
25177
25178         More spec conformance.
25179
25180 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
25181
25182         * driver.cs: Add --timestamp, to see where the compiler spends
25183         most of its time.
25184
25185         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
25186         `this' in static code.
25187
25188         (SimpleName.DoResolve): Implement in terms of a helper function
25189         that allows static-references to be passed upstream to
25190         MemberAccess.
25191
25192         (Expression.ResolveWithSimpleName): Resolve specially simple
25193         names when called by MemberAccess to implement the special
25194         semantics. 
25195
25196         (Expression.ImplicitReferenceConversion): Handle conversions from
25197         Null to reference types before others, as Null's type is
25198         System.Object. 
25199
25200         * expression.cs (Invocation.EmitCall): Handle the special case of
25201         calling methods declared on a reference type from a ValueType
25202         (Base classes System.Object and System.Enum)
25203
25204         (MemberAccess.Resolve): Only perform lookups on Enumerations if
25205         the left hand side is a TypeExpr, not on every enumeration. 
25206
25207         (Binary.Resolve): If types are reference types, then do a cast to
25208         object on operators != and == of both arguments.
25209
25210         * typemanager.cs (FindMembers): Extract instance and static
25211         members if requested.
25212
25213         * interface.cs (PopulateProperty): Use void_type instead of null
25214         as the return type for the setter method.
25215
25216         (PopulateIndexer): ditto.
25217
25218 2001-12-27  Ravi Pratap  <ravi@ximian.com>
25219
25220         * support.cs (ReflectionParameters): Fix minor bug where we
25221         were examining the wrong parameter for the ParamArray attribute.
25222
25223         Cope with requests for the type of the parameter at position
25224         greater than the params parameter's. We now return the element
25225         type of the params array as that makes more sense.
25226
25227         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
25228         accordingly as we no longer have to extract the element type
25229         ourselves.
25230
25231         (Invocation.OverloadResolve): Update.
25232
25233 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
25234
25235         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
25236         against IEnumerator, test whether the return value is a descendant
25237         of the IEnumerator interface.
25238
25239         * class.cs (Indexer.Define): Use an auxiliary method to implement
25240         the other bits of the method definition.  Begin support for
25241         explicit interface implementation.
25242
25243         (Property.DefineMethod): Use TypeManager.void_type instead of null
25244         for an empty return value.
25245
25246 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
25247
25248         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
25249         dealing with a FieldExpr which is composed of a FieldBuilder, in
25250         the code path we did extract the constant, but we should have
25251         obtained the underlying value to be able to cast it (otherwise we
25252         end up in an infinite loop, this is what Ravi was running into).
25253
25254         (ArrayCreation.UpdateIndices): Arrays might be empty.
25255
25256         (MemberAccess.ResolveMemberAccess): Add support for section
25257         14.5.4.1 that deals with the special case of E.I when E is a type
25258         and something else, that I can be a reference to a static member.
25259
25260         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25261         handle a particular array type to create byte blobs, it is just
25262         something we dont generate byteblobs for.
25263
25264         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25265         arguments. 
25266
25267         * location.cs (Push): remove the key from the hashtable that we
25268         are about to add.   This happens for empty files.
25269
25270         * driver.cs: Dispose files after we have parsed them.
25271
25272         (tokenize): new function that only runs the tokenizer on its
25273         input, for speed testing.
25274
25275 2001-12-26  Ravi Pratap  <ravi@ximian.com>
25276
25277         * class.cs (Event.Define): Define the private field only if there
25278         are no accessors defined.
25279
25280         * expression.cs (ResolveMemberAccess): If there is no associated
25281         field with the event, that means we have an event defined with its
25282         own accessors and we should flag error cs0070 since transforming
25283         ourselves into a field is not valid in that case.
25284
25285         * ecore.cs (SimpleName.DoResolve): Same as above.
25286
25287         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25288         and charset to sane values.
25289
25290 2001-12-25  Ravi Pratap  <ravi@ximian.com>
25291
25292         * assign.cs (DoResolve): Perform check on events only if they 
25293         are being accessed outside the declaring type.
25294
25295         * cs-parser.jay (event_declarations): Update rules to correctly
25296         set the type of the implicit parameter etc.
25297
25298         (add_accessor, remove_accessor): Set current local parameters.
25299
25300         * expression.cs (Binary): For delegate addition and subtraction,
25301         cast the return value from the method into the appropriate delegate
25302         type.
25303
25304 2001-12-24  Ravi Pratap  <ravi@ximian.com>
25305
25306         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25307         of these as the workaround is unnecessary.
25308
25309         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25310         delegate data - none of that is needed at all.
25311
25312         Re-write bits to extract the instance expression and the delegate method
25313         correctly.
25314
25315         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
25316         on delegates too.
25317
25318         * attribute.cs (ApplyAttributes): New method to take care of common tasks
25319         of attaching attributes instead of duplicating code everywhere.
25320
25321         * everywhere : Update code to do attribute emission using the above method.
25322
25323 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25324
25325         * expression.cs (IsParamsMethodApplicable): if there are not
25326         parameters, return immediately.
25327
25328         * ecore.cs: The 0 literal can be implicity converted to an enum
25329         type. 
25330
25331         (SimpleName.DoResolve): First lookup the type, then lookup the
25332         members. 
25333
25334         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25335         want to get its address.  If the InstanceExpression is not
25336         addressable, store the result in a temporary variable, then get
25337         the address of it.
25338
25339         * codegen.cs: Only display 219 errors on warning level or above. 
25340
25341         * expression.cs (ArrayAccess): Make it implement the
25342         IMemoryLocation interface.
25343
25344         (Binary.DoResolve): handle the operator == (object a, object b)
25345         and operator != (object a, object b) without incurring into a
25346         BoxedCast (because 5 != o should never be performed).
25347
25348         Handle binary enumerator operators.
25349
25350         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25351         value type, otherwise use Ldelem_ref.
25352
25353         Use precomputed names;
25354
25355         (AddressOf): Implement address of
25356
25357         * cs-parser.jay (labeled_statement): Fix recursive block
25358         addition by reworking the production.
25359
25360         * expression.cs (New.DoEmit): New has a special case:
25361                 
25362                  If we are dealing with a ValueType, we have a few
25363                  situations to deal with:
25364                 
25365                     * The target of New is a ValueType variable, that is
25366                       easy, we just pass this as the variable reference
25367                 
25368                     * The target of New is being passed as an argument,
25369                       to a boxing operation or a function that takes a
25370                       ValueType.
25371                 
25372                       In this case, we need to create a temporary variable
25373                       that is the argument of New.
25374
25375
25376 2001-12-23  Ravi Pratap  <ravi@ximian.com>
25377
25378         * rootcontext.cs (LookupType): Check that current_type is not null before
25379         going about looking at nested types.
25380
25381         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25382         not implement the IAssignMethod interface any more.
25383
25384         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25385         where we tranform them into FieldExprs if they are being resolved from within
25386         the declaring type.
25387
25388         * ecore.cs (SimpleName.DoResolve): Do the same here.
25389
25390         * assign.cs (DoResolve, Emit): Clean up code considerably. 
25391
25392         * ../errors/bug10.cs : Add.
25393
25394         * ../errors/cs0070.cs : Add.
25395
25396         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25397
25398         * assign.cs : Get rid of EventIsLocal everywhere.
25399
25400 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25401
25402         * ecore.cs (ConvertIntLiteral): finished the implementation.
25403
25404         * statement.cs (SwitchLabel): Convert the value we are using as a
25405         key before looking up the table.
25406
25407 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25408
25409         * codegen.cs (EmitTopBlock): Require a Location argument now.
25410
25411         * cs-parser.jay (constructor_declarator): We need to setup
25412         current_local_parameters before we parse the
25413         opt_constructor_initializer, to allow the variables to be bound
25414         to the constructor arguments.
25415
25416         * rootcontext.cs (LookupType): First lookup nested classes in our
25417         class and our parents before we go looking outside our class.
25418
25419         * expression.cs (ConstantFold): Extract/debox the values at the
25420         beginnning. 
25421
25422         * rootcontext.cs (EmitCode): Resolve the constants first before we
25423         resolve the types.  This is not really needed, but it helps debugging.
25424
25425         * statement.cs: report location.
25426
25427         * cs-parser.jay: pass location to throw statement.
25428
25429         * driver.cs: Small bug fix.
25430
25431         * report.cs: Updated format to be 4-zero filled digits.
25432
25433 2001-12-22  Ravi Pratap  <ravi@ximian.com>
25434
25435         * expression.cs (CheckIndices): Fix minor bug where the wrong
25436         variable was being referred to ;-)
25437
25438         (DoEmit): Do not call EmitStaticInitializers when the 
25439         underlying type is System.Object.
25440
25441 2001-12-21  Ravi Pratap  <ravi@ximian.com>
25442
25443         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25444         and do the usual workaround for SRE.
25445
25446         * class.cs (MyEventBuilder.EventType): New member to get at the type
25447         of the event, quickly.
25448
25449         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25450
25451         * assign.cs (Assign.DoResolve): Handle the case when the target
25452         is an EventExpr and perform the necessary checks.
25453
25454         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25455         interface.
25456
25457         (SimpleName.MemberStaticCheck): Include check for EventExpr.
25458
25459         (EventExpr): Set the type in the constructor itself since we 
25460         are meant to be born fully resolved.
25461
25462         (EventExpr.Define): Revert code I wrote earlier.
25463                 
25464         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25465         instance expression is null. The instance expression is a This in that case
25466         or a null, depending on whether it is a static method or not.
25467
25468         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25469         refers to more than one method.
25470
25471         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25472         and accordingly flag errors.
25473
25474 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25475
25476         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25477
25478 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25479
25480         * location.cs (ToString): Provide useful rutine.
25481
25482 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25483
25484         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25485         objects, return the actual integral boxed.
25486
25487         * statement.cs (SwitchLabel): define an ILLabel for each
25488         SwitchLabel. 
25489
25490         (Switch.CheckSwitch): If the value is a Literal, extract
25491         the underlying literal.
25492
25493         Also in the unused hashtable we had, add the SwitchLabel so we can
25494         quickly look this value up.
25495
25496         * constant.cs: Implement a bunch of new constants.  Rewrite
25497         Literal based on this.  Made changes everywhere to adapt to this.
25498
25499         * expression.cs (Expression.MakeByteBlob): Optimize routine by
25500         dereferencing array only once, and also copes with enumrations.
25501
25502         bytes are two bytes wide, not one.
25503
25504         (Cast): Perform constant conversions.
25505
25506         * ecore.cs (TryImplicitIntConversion): Return literals instead of
25507         wrappers to the literals here.
25508
25509         * expression.cs (DoNumericPromotions): long literals can converted
25510         to ulong implicity (this is taken care of elsewhere, but I was
25511         missing this spot).
25512
25513         * ecore.cs (Expression.Literalize): Make the return type Literal,
25514         to improve type checking.
25515
25516         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25517
25518 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25519
25520         * literal.cs: Revert code from ravi that checked the bounds.  The
25521         bounds are sane by the definition of the type itself. 
25522
25523         * typemanager.cs: Fix implementation of ImplementsInterface.  We
25524         need to actually look up in our parent hierarchy for interfaces
25525         implemented. 
25526
25527         * const.cs: Use the underlying type for enumerations
25528
25529         * delegate.cs: Compute the basename for the delegate creation,
25530         that should fix the delegate test case, and restore the correct
25531         Type Lookup semantics in rootcontext
25532
25533         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
25534         referencing a nested type with the Reflection API is using the "+"
25535         sign. 
25536
25537         * cs-parser.jay: Do not require EOF token at the end.
25538
25539 2001-12-20  Ravi Pratap  <ravi@ximian.com>
25540
25541         * rootcontext.cs (LookupType): Concatenate type names with
25542         a '.' instead of a '+' The test suite passes again.
25543
25544         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25545         field of the enumeration.
25546
25547         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25548         the case when the member is an EventExpr.
25549
25550         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25551         static has an associated instance expression.
25552
25553         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25554
25555         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25556
25557         * class.cs (Event.Define): Register event and perform appropriate checks
25558         for error #111.
25559
25560         We define the Add and Remove methods even if the use provides none because
25561         in that case, we provide default implementations ourselves.
25562
25563         Define a private field of the type of the event. This is done by the CSC compiler
25564         and we should be doing it too ;-)
25565
25566         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25567         More methods we use in code we generate.
25568
25569         (multicast_delegate_type, delegate_type): Two separate types since the distinction
25570         is important.
25571
25572         (InitCoreTypes): Update accordingly for the above.
25573
25574         * class.cs (Event.Emit): Generate code for default accessors that we provide
25575
25576         (EmitDefaultMethod): Do the job in the above.
25577
25578         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
25579         appropriate place.
25580
25581 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25582
25583         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25584         builders even if we were missing one.
25585
25586         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25587         pass the Basename as our class name instead of the Name.  The
25588         basename will be correctly composed for us.
25589
25590         * parameter.cs (Paramters): Now takes a Location argument.
25591
25592         * decl.cs (DeclSpace.LookupType): Removed convenience function and
25593         make all the code call directly LookupType in RootContext and take
25594         this chance to pass the Location information everywhere.
25595
25596         * Everywhere: pass Location information.
25597
25598 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
25599
25600         * class.cs (Constructor.Define): Updated way of detecting the
25601         length of the parameters.
25602
25603         (TypeContainer.DefineType): Use basename as the type name for
25604         nested types.
25605
25606         (TypeContainer.Define): Do not recursively define types here, as
25607         definition is taken care in order by the RootContext.
25608
25609         * tree.cs: Keep track of namespaces in a per-file basis.
25610
25611         * parameter.cs (Parameter.ComputeSignature): Update to use
25612         DeclSpace. 
25613
25614         (Parameters.GetSignature): ditto.
25615
25616         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25617         instead of a TypeContainer.
25618
25619         (Interface.SemanticAnalysis): Use `this' instead of our parent to
25620         resolve names.  Because we need to be resolve in our context, not
25621         our parents.
25622
25623         * driver.cs: Implement response files.
25624
25625         * class.cs (TypeContainer.DefineType): If we are defined, do not
25626         redefine ourselves.
25627
25628         (Event.Emit): Emit the code for add/remove handlers.
25629         (Event.Define): Save the MethodBuilders for add/remove.
25630
25631         * typemanager.cs: Use pair here too.
25632
25633         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25634         DictionaryEntry requires the first argument to be non-null.  
25635
25636         (enum_declaration): Compute full name for registering the
25637         enumeration.
25638
25639         (delegate_declaration): Instead of using
25640         formal_parameter_list, use opt_formal_parameter_list as the list
25641         can be empty.
25642
25643         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25644         (EventParsing): New property that controls whether `add' and
25645         `remove' are returned as tokens or identifiers (for events);
25646
25647 2001-12-19  Ravi Pratap  <ravi@ximian.com>
25648
25649         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25650         use MyEventBuilder only and let it wrap the real builder for us.
25651
25652         (MyEventBuilder): Revamp constructor etc.
25653
25654         Implement all operations that we perform on EventBuilder in precisely the same
25655         way here too.
25656
25657         (FindMembers): Update to use the EventBuilder member.
25658
25659         (Event.Emit): Update accordingly.
25660
25661 2001-12-18  Ravi Pratap  <ravi@ximian.com>
25662
25663         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25664         by calling the appropriate methods.
25665
25666         (GetCustomAttributes): Make stubs as they cannot possibly do anything
25667         useful.
25668
25669         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25670
25671 2001-12-17  Ravi Pratap  <ravi@ximian.com>
25672
25673         * delegate.cs (Delegate.Populate): Check that the return type
25674         and various parameters types are indeed accessible.
25675
25676         * class.cs (Constructor.Define): Same here.
25677
25678         (Field.Define): Ditto.
25679
25680         (Event.Define): Ditto.
25681
25682         (Operator.Define): Check that the underlying Method defined itself
25683         correctly - so it's MethodBuilder should not be null.
25684
25685         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25686         expression happens to be null.
25687
25688         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25689         members but as of now we don't seem to be able to do anything really useful with it.
25690
25691         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25692         not the EventBuilder.
25693
25694 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
25695
25696         * cs-tokenizer.cs: Add support for defines.
25697         Add support for #if, #elif, #else, #endif
25698
25699         (eval_var): evaluates a variable.
25700         (eval): stubbed for evaluating functions.
25701
25702         * cs-parser.jay: Pass the defines information
25703
25704         * driver.cs: Add --define command line option.
25705
25706         * decl.cs: Move MemberCore here.
25707
25708         Make it the base class for DeclSpace.  This allows us to catch and
25709         report 108 and 109 for everything now.
25710
25711         * class.cs (TypeContainer.Define): Extract all the members
25712         before populating and emit the warning 108 (new keyword required
25713         to override) instead of having each member implement this.
25714
25715         (MemberCore.Define): New abstract method, we will be using this in
25716         the warning reporting engine in Populate.
25717
25718         (Operator.Define): Adjust to new MemberCore protocol. 
25719
25720         * const.cs (Const): This does not derive from Expression, it is a
25721         temporary object we use to create fields, it is a MemberCore. 
25722
25723         * class.cs (Method.Define): Allow the entry point to be in a
25724         specific class.
25725
25726         * driver.cs: Rewrite the argument handler to clean it up a bit.
25727
25728         * rootcontext.cs: Made it just an auxiliary namespace feature by
25729         making everything static.
25730
25731         * driver.cs: Adapt code to use RootContext type name instead of
25732         instance variable.
25733
25734         * delegate.cs: Remove RootContext argument.
25735
25736         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25737         argument. 
25738
25739         * class.cs (Event.Define): The lookup can fail.
25740
25741         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
25742
25743         * expression.cs: Resolve the this instance before invoking the code.
25744
25745 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
25746
25747         * cs-parser.jay: Add a production in element_access that allows
25748         the thing to become a "type" reference.  This way we can parse
25749         things like "(string [])" as a type.
25750
25751         Note that this still does not handle the more complex rules of
25752         casts. 
25753
25754
25755         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
25756
25757         * ecore.cs: (CopyNewMethods): new utility function used to
25758         assemble the list of methods from running FindMembers.
25759
25760         (MemberLookup): Rework FindMembers so that 
25761
25762 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
25763
25764         * class.cs (TypeContainer): Remove Delegates who fail to be
25765         defined.
25766
25767         * delegate.cs (Populate): Verify that we dont get null return
25768         values.   TODO: Check for AsAccessible.
25769
25770         * cs-parser.jay: Use basename to emit error 574 (destructor should
25771         have the same name as container class), not the full name.
25772
25773         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25774         possible representation.  
25775
25776         Also implements integer type suffixes U and L.
25777
25778 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
25779
25780         * expression.cs (ArrayCreation.DoResolve): We need to do the
25781         argument resolution *always*.
25782
25783         * decl.cs: Make this hold the namespace.  Hold the root context as
25784         well.
25785         (LookupType): Move here.
25786
25787         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25788
25789         * location.cs (Row, Name): Fixed the code, it was always returning
25790         references to the first file.
25791
25792         * interface.cs: Register properties defined through interfaces.
25793
25794         * driver.cs: Add support for globbing on the command line
25795
25796         * class.cs (Field): Make it derive from MemberCore as well.
25797         (Event): ditto.
25798
25799 2001-12-15  Ravi Pratap  <ravi@ximian.com>
25800
25801         * class.cs (Event::Define): Check that the type of the event is a delegate
25802         type else flag error #66.
25803
25804         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25805         same.
25806
25807         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25808         values of EntryPoint, CharSet etc etc.
25809
25810         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25811
25812         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25813         be null and we should ignore this. I am not sure if this is really clean. Apparently,
25814         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25815         which needs this to do its work.
25816
25817         * ../errors/cs0066.cs : Add.
25818
25819 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
25820
25821         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25822         helper functions.
25823
25824         * class.cs: (MethodSignature.MethodSignature): Removed hack that
25825         clears out the parameters field.
25826         (MemberSignatureCompare): Cleanup
25827
25828         (MemberCore): New base class used to share code between MethodCore
25829         and Property.
25830
25831         (RegisterRequiredImplementations) BindingFlags.Public requires
25832         either BindingFlags.Instace or Static.  Use instance here.
25833
25834         (Property): Refactored code to cope better with the full spec.
25835
25836         * parameter.cs (GetParameterInfo): Return an empty array instead
25837         of null on error.
25838
25839         * class.cs (Property): Abstract or extern properties have no bodies.
25840
25841         * parameter.cs (GetParameterInfo): return a zero-sized array.
25842
25843         * class.cs (TypeContainer.MethodModifiersValid): Move all the
25844         method modifier validation to the typecontainer so we can reuse
25845         this on properties.
25846
25847         (MethodCore.ParameterTypes): return an empty sized array of types.
25848
25849         (Property.Define): Test property modifier validity.
25850
25851         Add tests for sealed/override too.
25852
25853         (Method.Emit): abstract or extern methods have no bodies.
25854
25855 2001-12-14  Ravi Pratap  <ravi@ximian.com>
25856
25857         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25858         thing.
25859
25860         (Method::Define, ::Emit): Modify accordingly.
25861
25862         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25863
25864         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25865
25866         * makefile: Pass in /unsafe.
25867
25868 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
25869
25870         * class.cs (MakeKey): Kill routine.
25871
25872         * class.cs (TypeContainer.Define): Correctly define explicit
25873         method implementations (they require the full interface name plus
25874         the method name).
25875
25876         * typemanager.cs: Deply the PtrHashtable here and stop using the
25877         lame keys.  Things work so much better.
25878
25879         This of course broke everyone who depended on `RegisterMethod' to
25880         do the `test for existance' test.  This has to be done elsewhere.
25881
25882         * support.cs (PtrHashtable): A hashtable that avoid comparing with
25883         the object stupid Equals method (because, that like fails all over
25884         the place).  We still do not use it.
25885
25886         * class.cs (TypeContainer.SetRequiredInterface,
25887         TypeContainer.RequireMethods): Killed these two routines and moved
25888         all the functionality to RegisterRequiredImplementations.
25889
25890         (TypeContainer.RegisterRequiredImplementations): This routine now
25891         registers all the implementations required in an array for the
25892         interfaces and abstract methods.  We use an array of structures
25893         which can be computed ahead of time to reduce memory usage and we
25894         also assume that lookups are cheap as most classes will not
25895         implement too many interfaces.
25896
25897         We also avoid creating too many MethodSignatures.
25898
25899         (TypeContainer.IsInterfaceMethod): Update and optionally does not
25900         clear the "pending" bit if we find that there are problems with
25901         the declaration.
25902
25903         (TypeContainer.VerifyPendingMethods): Update to report errors of
25904         methods that look like implementations but are not.
25905
25906         (TypeContainer.Define): Add support for explicit interface method
25907         implementation. 
25908
25909 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
25910
25911         * typemanager.cs: Keep track of the parameters here instead of
25912         being a feature of the TypeContainer.
25913
25914         * class.cs: Drop the registration of parameters here, as
25915         InterfaceMethods are also interface declarations.
25916
25917         * delegate.cs: Register methods with the TypeManager not only with
25918         the TypeContainer.  This code was buggy.
25919
25920         * interface.cs: Full registation here.
25921
25922 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
25923
25924         * expression.cs: Remove reducer for binary expressions, it can not
25925         be done this way.
25926
25927         * const.cs: Put here the code that used to go into constant.cs
25928
25929         * constant.cs: Put here the code for constants, this is a new base
25930         class for Literals.
25931
25932         * literal.cs: Make Literal derive from Constant.
25933
25934 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
25935
25936         * statement.cs (Return.Emit): Report error 157 if the user
25937         attempts to return from a finally block.
25938
25939         (Return.Emit): Instead of emitting a return, jump to the end of
25940         the function.
25941
25942         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
25943         LocalBuilder to store the result of the function.  ReturnLabel is
25944         the target where we jump.
25945
25946
25947 2001-12-09  Radek Doulik  <rodo@ximian.com>
25948
25949         * cs-parser.jay: remember alias in current namespace
25950
25951         * ecore.cs (SimpleName::DoResolve): use aliases for types or
25952         namespaces
25953
25954         * class.cs (LookupAlias): lookup alias in my_namespace
25955
25956         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
25957         aliases hashtable
25958         (LookupAlias): lookup alias in this and if needed in parent
25959         namespaces
25960
25961 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
25962
25963         * support.cs: 
25964
25965         * rootcontext.cs: (ModuleBuilder) Made static, first step into
25966         making things static.  I need this to avoid passing the
25967         TypeContainer when calling ParameterType.
25968
25969         * support.cs (InternalParameters.ParameterType): Remove ugly hack
25970         that did string manipulation to compute the type and then call
25971         GetType.  Use Parameter.ParameterType instead.
25972
25973         * cs-tokenizer.cs: Consume the suffix for floating values.
25974
25975         * expression.cs (ParameterReference): figure out whether this is a
25976         reference parameter or not.  Kill an extra variable by computing
25977         the arg_idx during emission.
25978
25979         * parameter.cs (Parameters.GetParameterInfo): New overloaded
25980         function that returns whether a parameter is an out/ref value or not.
25981
25982         (Parameter.ParameterType): The type of the parameter (base,
25983         without ref/out applied).
25984
25985         (Parameter.Resolve): Perform resolution here.
25986         (Parameter.ExternalType): The full type (with ref/out applied).
25987
25988         * statement.cs (Using.Emit, Using.EmitExpression): Implement
25989         support for expressions on the using statement.
25990
25991 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
25992
25993         * statement.cs (Using.EmitLocalVariableDecls): Split the
25994         localvariable handling of the using statement.
25995
25996         (Block.EmitMeta): Keep track of variable count across blocks.  We
25997         were reusing slots on separate branches of blocks.
25998
25999         (Try.Emit): Emit the general code block, we were not emitting it. 
26000
26001         Check the type of the declaration to be an IDisposable or
26002         something that can be implicity converted to it. 
26003
26004         Emit conversions if required.
26005
26006         * ecore.cs (EmptyExpression): New utility class.
26007         (Expression.ImplicitConversionExists): New utility function.
26008
26009 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
26010
26011         * statement.cs (Using): Implement.
26012
26013         * expression.cs (LocalVariableReference): Support read only variables.
26014
26015         * statement.cs: Remove the explicit emit for the Leave opcode.
26016         (VariableInfo): Add a readonly field.
26017
26018 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
26019
26020         * ecore.cs (ConvCast): new class used to encapsulate the various
26021         explicit integer conversions that works in both checked and
26022         unchecked contexts.
26023
26024         (Expression.ConvertNumericExplicit): Use new ConvCast class to
26025         properly generate the overflow opcodes.
26026
26027 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
26028
26029         * statement.cs: The correct type for the EmptyExpression is the
26030         element_type, not the variable type.  Ravi pointed this out.
26031
26032 2001-12-04  Ravi Pratap  <ravi@ximian.com>
26033
26034         * class.cs (Method::Define): Handle PInvoke methods specially
26035         by using DefinePInvokeMethod instead of the usual one.
26036
26037         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
26038         above to do the task of extracting information and defining the method.
26039
26040 2001-12-04  Ravi Pratap  <ravi@ximian.com>
26041
26042         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
26043         of the condition for string type.
26044
26045         (Emit): Move that here. 
26046
26047         (ArrayCreation::CheckIndices): Keep string literals in their expression
26048         form.
26049
26050         (EmitDynamicInitializers): Handle strings appropriately.
26051
26052 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
26053
26054         * codegen.cs (EmitContext): Replace multiple variables with a
26055         single pointer to the current Switch statement.
26056
26057         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
26058         EmitContext.
26059
26060 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
26061
26062         * statement.cs 
26063
26064         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
26065         default'.
26066
26067         (Foreach.Emit): Foreach on arrays was not setting
26068         up the loop variables (for break/continue).
26069
26070         (GotoCase): Semi-implented.
26071
26072 2001-12-03  Ravi Pratap  <ravi@ximian.com>
26073
26074         * attribute.cs (CheckAttribute): Handle system attributes by using
26075         Attribute.GetAttributes to examine information we need.
26076
26077         (GetValidPlaces): Same here.
26078
26079         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
26080
26081         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
26082
26083         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
26084
26085         (Method::Define): Set appropriate flags if we have a DllImport attribute.
26086
26087         (Method::Emit): Handle the case when we are a PInvoke method.
26088
26089 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
26090
26091         * expression.cs: Use ResolveWithSimpleName on compound names.
26092
26093 2001-12-02  Ravi Pratap  <ravi@ximian.com>
26094
26095         * constant.cs (EmitConstant): Make sure we resolve the associated expression
26096         before trying to reduce it.
26097
26098         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
26099
26100         * constant.cs (LookupConstantValue): Implement.
26101
26102         (EmitConstant): Use the above in emitting the constant.
26103
26104         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
26105         that are user-defined by doing a LookupConstantValue on them.
26106
26107         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
26108         too, like above.
26109
26110 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
26111
26112         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
26113
26114         (BaseAccess.DoResolve): Implement.
26115
26116         (MemberAccess.DoResolve): Split this routine into a
26117         ResolveMemberAccess routine that can be used independently
26118
26119 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
26120
26121         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
26122         As that share bits of the implementation.  Is returns a boolean,
26123         while As returns the Type that is being probed.
26124
26125 2001-12-01  Ravi Pratap  <ravi@ximian.com>
26126
26127         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
26128         instead of a Literal - much easier.
26129
26130         (EnumInTransit): Remove - utterly useless :-)
26131
26132         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
26133
26134         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
26135
26136         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
26137         chain when we have no associated expression.
26138
26139 2001-11-30  Ravi Pratap  <ravi@ximian.com>
26140
26141         * constant.cs (Define): Use Location while reporting the errror.
26142
26143         Also emit a warning when 'new' is used and there is no inherited
26144         member to hide.
26145
26146         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
26147         populated.
26148
26149         (LookupEnumValue): Implement to lookup an enum member's value and define it
26150         if necessary.
26151
26152         (Populate): Re-write accordingly to use the above routine.
26153
26154 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
26155
26156         * expression.cs (This): Fix prototype for DoResolveLValue to
26157         override the base class DoResolveLValue.
26158
26159         * cs-parser.cs: Report errors cs574 and cs575 (destructor
26160         declarations) 
26161
26162         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
26163         (we need to load the address of the field here).  This fixes
26164         test-22. 
26165
26166         (FieldExpr.DoResolveLValue): Call the DoResolve
26167         function to initialize the Instance expression.
26168
26169         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
26170         correctly the GetEnumerator operation on a value type.
26171
26172         * cs-parser.jay: Add more simple parsing error catches.
26173
26174         * statement.cs (Switch): Add support for string switches.
26175         Handle null specially.
26176
26177         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
26178
26179 2001-11-28  Ravi Pratap  <ravi@ximian.com>
26180
26181         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
26182
26183         (declare_local_constant): New helper function.
26184
26185         * statement.cs (AddConstant): Keep a separate record of constants
26186
26187         (IsConstant): Implement to determine if a variable is a constant.
26188
26189         (GetConstantExpression): Implement.
26190
26191         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
26192
26193         * statement.cs (IsVariableDefined): Re-write.
26194
26195 2001-11-27  Ravi Pratap  <ravi@ximian.com>
26196
26197         * class.cs (TypeContainer::FindMembers): Look for constants
26198         in the case when we are looking for MemberTypes.Field
26199
26200         * expression.cs (MemberAccess::DoResolve): Check that in the
26201         case we are a FieldExpr and a Literal, we are not being accessed
26202         by an instance reference.
26203
26204         * cs-parser.jay (local_constant_declaration): Implement.
26205
26206         (declaration_statement): Implement for constant declarations.
26207
26208 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
26209
26210         * statement.cs (Switch): Catch double defaults.
26211
26212         (Switch): More work on the switch() statement
26213         implementation.  It works for integral values now, need to finish
26214         string support.
26215
26216
26217 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
26218
26219         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
26220         integer literals into other integer literals.  To be used by
26221         switch. 
26222
26223 2001-11-24  Ravi Pratap  <ravi@ximian.com>
26224
26225         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
26226         some memory.
26227
26228         (EmitDynamicInitializers): Cope with the above since we extract data
26229         directly from ArrayData now.
26230
26231         (ExpectInitializers): Keep track of whether initializers are mandatory
26232         or not.
26233
26234         (Bounds): Make it a hashtable to prevent the same dimension being 
26235         recorded for every element in that dimension.
26236
26237         (EmitDynamicInitializers): Fix bug which prevented the Set array method
26238         from being found.
26239
26240         Also fix bug which was causing the indices to be emitted in the reverse
26241         order.
26242
26243 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
26244
26245         * expression.cs (ArrayCreation): Implement the bits that Ravi left
26246         unfinished.  They do not work, because the underlying code is
26247         sloppy.
26248
26249 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26250
26251         * cs-parser.jay: Remove bogus fixme.
26252
26253         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
26254         on Switch statement.
26255
26256 2001-11-23  Ravi Pratap  <ravi@ximian.com>
26257
26258         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26259         the same. 
26260
26261         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26262         parameter. Apparently, any expression is allowed. 
26263
26264         (ValidateInitializers): Update accordingly.
26265
26266         (CheckIndices): Fix some tricky bugs thanks to recursion.
26267
26268         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
26269         I was being completely brain-dead.
26270
26271         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26272         and re-write acordingly.
26273
26274         (DelegateInvocation): Re-write accordingly.
26275
26276         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26277
26278         (MakeByteBlob): Handle types more correctly.
26279
26280         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26281         initialization from expressions but it is incomplete because I am a complete
26282         Dodo :-|
26283
26284 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26285
26286         * statement.cs (If.Emit): Fix a bug that generated incorrect code
26287         on If.  Basically, we have to return `true' (ie, we do return to
26288         our caller) only if both branches of the if return.
26289
26290         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26291         short-circuit operators, handle them as short circuit operators. 
26292
26293         (Cast.DoResolve): Resolve type.
26294         (Cast.Cast): Take an expression as the target type.
26295
26296         * cs-parser.jay (cast_expression): Remove old hack that only
26297         allowed a limited set of types to be handled.  Now we take a
26298         unary_expression and we resolve to a type during semantic
26299         analysis.
26300
26301         Use the grammar productions from Rhys to handle casts (this is
26302         not complete like Rhys syntax yet, we fail to handle that corner
26303         case that C# has regarding (-x), but we will get there.
26304
26305 2001-11-22  Ravi Pratap  <ravi@ximian.com>
26306
26307         * class.cs (EmitFieldInitializer): Take care of the case when we have a
26308         field which is an array type.
26309
26310         * cs-parser.jay (declare_local_variables): Support array initialization too.
26311
26312         * typemanager.cs (MakeKey): Implement.
26313
26314         (everywhere): Use the above appropriately.
26315
26316         * cs-parser.jay (for_statement): Update for array initialization while
26317         declaring variables.
26318
26319         * ecore.cs : The error message was correct, it's the variable's names that
26320         were misleading ;-) Make the code more readable.
26321
26322         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26323         the correct type etc.
26324
26325         (ConvertExplicit): Handle Enum types by examining the underlying type.
26326
26327 2001-11-21  Ravi Pratap  <ravi@ximian.com>
26328
26329         * parameter.cs (GetCallingConvention): Always return
26330         CallingConventions.Standard for now.
26331
26332 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26333
26334         * expression.cs (Binary.ResolveOperator): Update the values of `l'
26335         and `r' after calling DoNumericPromotions.
26336
26337         * ecore.cs: Fix error message (the types were in the wrong order).
26338
26339         * statement.cs (Foreach.ProbeCollectionType): Need to pass
26340         BindingFlags.Instance as well 
26341
26342         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26343         implicit int literal conversion in an empty cast so that we
26344         propagate the right type upstream.
26345
26346         (UnboxCast): new class used to unbox value types.
26347         (Expression.ConvertExplicit): Add explicit type conversions done
26348         by unboxing.
26349
26350         (Expression.ImplicitNumericConversion): Oops, forgot to test for
26351         the target type before applying the implicit LongLiterals to ULong
26352         literal cast.
26353
26354 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
26355
26356         * cs-parser.jay (for_statement): Reworked the way For works: now
26357         we declare manually any variables that are introduced in
26358         for_initializer to solve the problem of having out-of-band code
26359         emition (that is what got for broken).
26360
26361         (declaration_statement): Perform the actual variable declaration
26362         that used to be done in local_variable_declaration here.
26363
26364         (local_variable_declaration): Do not declare anything, just pass
26365         the information on a DictionaryEntry
26366
26367 2001-11-20  Ravi Pratap  <ravi@ximian.com>
26368
26369         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26370         re-write of the logic to now make it recursive.
26371
26372         (UpdateIndices): Re-write accordingly.
26373
26374         Store element data in a separate ArrayData list in the above methods.
26375
26376         (MakeByteBlob): Implement to dump the array data into a byte array.
26377
26378 2001-11-19  Ravi Pratap  <ravi@ximian.com>
26379
26380         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26381         into CheckIndices.
26382
26383         * constant.cs (Define): Implement.
26384
26385         (EmitConstant): Re-write fully.
26386
26387         Pass in location info.
26388
26389         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26390         respectively.
26391
26392         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26393         DictionaryEntry since we need location info too.
26394
26395         (constant_declaration): Update accordingly.
26396
26397         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26398         code into another method : UpdateIndices.
26399
26400 2001-11-18  Ravi Pratap  <ravi@ximian.com>
26401
26402         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26403         some type checking etc.
26404
26405 2001-11-17  Ravi Pratap  <ravi@ximian.com>
26406
26407         * expression.cs (ArrayCreation::ValidateInitializers): Implement
26408         bits to provide dimension info if the user skips doing that.
26409
26410         Update second constructor to store the rank correctly.
26411
26412 2001-11-16  Ravi Pratap  <ravi@ximian.com>
26413
26414         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26415         and try to implement.
26416
26417         * ../errors/cs0150.cs : Add.
26418
26419         * ../errors/cs0178.cs : Add.
26420
26421 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
26422
26423         * statement.cs: Implement foreach on multi-dimensional arrays. 
26424
26425         * parameter.cs (Parameters.GetParameterByName): Also lookup the
26426         name of the params argument.
26427
26428         * expression.cs: Use EmitStoreOpcode to get the right opcode while
26429         initializing the array.
26430
26431         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26432         we can use this elsewhere.
26433
26434         * statement.cs: Finish implementation of foreach for single
26435         dimension arrays.
26436
26437         * cs-parser.jay: Use an out-of-band stack to pass information
26438         around, I wonder why I need this.
26439
26440         foreach_block: Make the new foreach_block the current_block.
26441
26442         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26443         function used to return a static Parameters structure.  Used for
26444         empty parameters, as those are created very frequently.
26445
26446         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26447
26448 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26449
26450         * interface.cs : Default modifier is private, not public. The
26451         make verify test passes again.
26452
26453 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26454
26455         * support.cs (ReflectionParameters): Fix logic to determine
26456         whether the last parameter is a params one. Test 9 passes again.
26457
26458         * delegate.cs (Populate): Register the builders we define with
26459         RegisterParameterForBuilder. Test 19 passes again.
26460
26461         * cs-parser.jay (property_declaration): Reference $6 instead
26462         of $$ to get at the location.
26463
26464         (indexer_declaration): Similar stuff.
26465
26466         (attribute): Ditto.
26467
26468         * class.cs (Property): Register parameters for the Get and Set methods
26469         if they exist. Test 23 passes again.
26470
26471         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26472         call to EmitArguments as we are sure there aren't any params arguments. 
26473         Test 32 passes again.
26474
26475         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26476         IndexOutOfRangeException. 
26477
26478         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26479         Test 33 now passes again.
26480
26481 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
26482
26483         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26484         broke a bunch of things.  Will have to come up with a better way
26485         of tracking locations.
26486
26487         * statement.cs: Implemented foreach for single dimension arrays.
26488
26489 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26490
26491         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26492         an error.  This removes the lookup from the critical path.
26493
26494         * cs-parser.jay: Removed use of temporary_loc, which is completely
26495         broken. 
26496
26497 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
26498
26499         * support.cs (ReflectionParameters.ParameterModifier): Report
26500         whether the argument is a PARAMS argument or not.
26501
26502         * class.cs: Set the attribute `ParamArrayAttribute' on the
26503         parameter argument.
26504
26505         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26506         and cons_param_array_attribute (ConstructorInfo for
26507         ParamArrayAttribute)., 
26508
26509         * codegen.cs: Emit the return using the `Return' statement, that
26510         way we can report the error correctly for missing return values. 
26511
26512         * class.cs (Method.Emit): Clean up.
26513
26514         * expression.cs (Argument.Resolve): Take another argument: the
26515         location where this argument is used.  Notice that this is not
26516         part of the "Argument" class as to reduce the size of the
26517         structure (we know the approximate location anyways).
26518
26519         Test if the argument is a variable-reference, if not, then
26520         complain with a 206.
26521
26522         (Argument.Emit): Emit addresses of variables.
26523
26524         (Argument.FullDesc): Simplify.
26525
26526         (Invocation.DoResolve): Update for Argument.Resolve.
26527
26528         (ElementAccess.DoResolve): ditto.
26529
26530         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26531         method should be virtual, as this method is always virtual.
26532
26533         (NewDelegate.DoResolve): Update for Argument.Resolve.
26534
26535         * class.cs (ConstructorInitializer.DoResolve): ditto.
26536
26537         * attribute.cs (Attribute.Resolve): ditto.
26538
26539 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
26540
26541         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26542
26543         * expression.cs (ParameterReference): Drop IStackStorage and implement
26544         IAssignMethod instead. 
26545
26546         (LocalVariableReference): ditto.
26547
26548         * ecore.cs (FieldExpr): Drop IStackStorage and implement
26549         IAssignMethod instead. 
26550
26551 2001-11-13  Miguel de Icaza <miguel@ximian.com>
26552
26553         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26554         enumerations that are used in heavily used structures derive from
26555         byte in a laughable and pathetic attempt to reduce memory usage.
26556         This is the kind of pre-optimzations that you should not do at
26557         home without adult supervision.
26558
26559         * expression.cs (UnaryMutator): New class, used to handle ++ and
26560         -- separatedly from the other unary operators.  Cleans up the
26561         code, and kills the ExpressionStatement dependency in Unary.
26562
26563         (Unary): Removed `method' and `Arguments' from this class, making
26564         it smaller, and moving it all to SimpleCall, so I can reuse this
26565         code in other locations and avoid creating a lot of transient data
26566         strucutres when not required.
26567
26568         * cs-parser.jay: Adjust for new changes.
26569
26570 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
26571
26572         * enum.cs (Enum.Populate): If there is a failure during
26573         definition, return
26574
26575         * cs-parser.jay (opt_enum_base): we used to catch type errors
26576         here, but this is really incorrect.  The type error should be
26577         catched during semantic analysis.
26578
26579 2001-12-11  Ravi Pratap  <ravi@ximian.com>
26580
26581         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26582         current_local_parameters as expected since I, in my stupidity, had forgotten
26583         to do this :-)
26584
26585         * attribute.cs (GetValidPlaces): Fix stupid bug.
26586
26587         * class.cs (Method::Emit): Perform check on applicability of attributes.
26588
26589         (Constructor::Emit): Ditto.
26590
26591         (Field::Emit): Ditto.
26592
26593         (Field.Location): Store location information.
26594
26595         (Property, Event, Indexer, Operator): Ditto.
26596
26597         * cs-parser.jay (field_declaration): Pass in location for each field.
26598
26599         * ../errors/cs0592.cs : Add.
26600
26601 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26602
26603         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26604
26605         (InitCoreTypes): Update accordingly.
26606
26607         (RegisterAttrType, LookupAttr): Implement.
26608
26609         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26610         info about the same.
26611
26612         (Resolve): Update to populate the above as necessary.
26613
26614         (Error592): Helper.
26615
26616         (GetValidPlaces): Helper to the above.
26617
26618         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26619
26620         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26621
26622 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26623
26624         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26625
26626         * ../errors/cs0617.cs : Add.
26627
26628 2001-11-11  Ravi Pratap  <ravi@ximian.com>
26629
26630         * enum.cs (Emit): Rename to Populate to be more consistent with what
26631         we expect it to do and when exactly it is called.
26632
26633         * class.cs, rootcontext.cs : Update accordingly.
26634
26635         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26636         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26637
26638         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26639
26640         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26641         of a fieldinfo using the above, when dealing with a FieldBuilder.
26642
26643 2001-11-10  Ravi Pratap  <ravi@ximian.com>
26644
26645         * ../errors/cs0031.cs : Add.
26646
26647         * ../errors/cs1008.cs : Add.
26648
26649         * ../errrors/cs0543.cs : Add.
26650
26651         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26652         enum type.
26653
26654         (FindMembers): Implement.
26655
26656         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26657         enums and delegates too.
26658
26659         (enum_types): Rename to builder_to_enum.
26660
26661         (delegate_types): Rename to builder_to_delegate.
26662
26663         * delegate.cs (FindMembers): Implement.
26664
26665 2001-11-09  Ravi Pratap  <ravi@ximian.com>
26666
26667         * typemanager.cs (IsEnumType): Implement.
26668
26669         * enum.cs (Emit): Re-write parts to account for the underlying type
26670         better and perform checking etc.
26671
26672         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26673         of the underlying type.
26674
26675         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26676         value
26677
26678         * enum.cs (error31): Helper to report error #31.
26679
26680         * cs-parser.jay (enum_declaration): Store location of each member too.
26681
26682         * enum.cs (member_to_location): New hashtable. 
26683
26684         (AddEnumMember): Update location hashtable.
26685
26686         (Emit): Use the location of each member while reporting errors.
26687
26688 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26689
26690         * cs-parser.jay: A for_initializer if is a
26691         local_variable_declaration really ammount to have an implicit
26692         block with the variable declaration and no initializer for for.
26693
26694         * statement.cs (For.Emit): Cope with null initializers.
26695
26696         This fixes the infinite loop on for initializers.
26697
26698 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
26699
26700         * enum.cs: More cleanup.
26701
26702         * ecore.cs: Remove dead code.
26703
26704         * class.cs (Property.Emit): More simplification.
26705         (Event.Emit): ditto.
26706
26707         Reworked to have less levels of indentation.
26708
26709 2001-11-08  Ravi Pratap  <ravi@ximian.com>
26710
26711         * class.cs (Property): Emit attributes.
26712
26713         (Field): Ditto.
26714
26715         (Event): Ditto.
26716
26717         (Indexer): Ditto.
26718
26719         (Operator): Ditto.
26720
26721         * enum.cs (Emit): Ditto.
26722
26723         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26724         Enums too.
26725
26726         * class.cs (Field, Event, etc.): Move attribute generation into the
26727         Emit method everywhere.
26728
26729         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26730         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26731         as we had no way of defining nested enums !
26732
26733         * rootcontext.cs : Adjust code accordingly.
26734
26735         * typemanager.cs (AddEnumType): To keep track of enum types separately.
26736
26737 2001-11-07  Ravi Pratap  <ravi@ximian.com>
26738
26739         * expression.cs (EvalConstantExpression): Move into ecore.cs
26740
26741         * enum.cs (Enum): Rename some members and make them public and readonly
26742         according to our convention.
26743
26744         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26745         nothing else.
26746
26747         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26748
26749         (Enum::Emit): Write a simple version for now which doesn't try to compute
26750         expressions. I shall modify this to be more robust in just a while.
26751
26752         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26753
26754         (TypeContainer::CloseType): Create the Enum types too.
26755
26756         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26757
26758         * expression.cs (EvalConstantExpression): Get rid of completely.
26759
26760         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26761         user-defined values and other cases.
26762
26763         (IsValidEnumLiteral): Helper function.
26764
26765         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
26766         out there in the case we had a literal FieldExpr.
26767
26768         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26769
26770         (Literalize): Revamp a bit to take two arguments.
26771
26772         (EnumLiteral): New class which derives from Literal to wrap enum literals.
26773
26774 2001-11-06  Ravi Pratap  <ravi@ximian.com>
26775
26776         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26777
26778         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26779
26780         (Resolve): Use the above to ensure we have proper initializers.
26781
26782 2001-11-05  Ravi Pratap  <ravi@ximian.com>
26783
26784         * expression.cs (Expression::EvalConstantExpression): New method to 
26785         evaluate constant expressions.
26786
26787         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26788
26789 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
26790
26791         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26792         in an array.
26793
26794         (Binary.ResolveOperator): Handle operator != (object a, object b)
26795         and operator == (object a, object b);
26796
26797         (Binary.DoNumericPromotions): Indicate whether the numeric
26798         promotion was possible.
26799
26800         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26801         Implement.  
26802
26803         Made the ArrayAccess implement interface IAssignMethod instead of
26804         IStackStore as the order in which arguments are passed reflects
26805         this.
26806
26807         * assign.cs: Instead of using expr.ExprClass to select the way of
26808         assinging, probe for the IStackStore/IAssignMethod interfaces.
26809
26810         * typemanager.cs: Load InitializeArray definition.
26811
26812         * rootcontext.cs (RootContext.MakeStaticData): Used to define
26813         static data that can be used to initialize arrays. 
26814
26815 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
26816
26817         * expression.cs: Handle operator== and operator!= for booleans.
26818
26819         (Conditioal.Reduce): Implement reducer for the ?: operator.
26820
26821         (Conditional.Resolve): Implement dead code elimination.
26822
26823         (Binary.Resolve): Catch string literals and return a new
26824         concatenated string.
26825
26826         (Unary.Reduce): Implement reduction of unary expressions.
26827
26828         * ecore.cs: Split out the expression core handling here.
26829
26830         (Expression.Reduce): New method used to perform constant folding
26831         and CSE.  This is needed to support constant-expressions. 
26832
26833         * statement.cs (Statement.EmitBoolExpression): Pass true and false
26834         targets, and optimize for !x.
26835
26836 2001-11-04  Ravi Pratap  <ravi@ximian.com>
26837
26838         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26839         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26840         set custom atttributes.
26841
26842         * literal.cs (Literal::GetValue): New abstract method to return the actual
26843         value of the literal, cast as an object.
26844
26845         (*Literal): Implement GetValue method.
26846
26847         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26848         expressions to the arraylist but objects of type Argument.
26849
26850         * class.cs (TypeContainer::Emit): Emit our attributes too.
26851
26852         (Method::Emit, Constructor::Emit): Ditto.
26853
26854         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26855         to be ignoring earlier.
26856
26857 2001-11-03  Ravi Pratap  <ravi@ximian.com>
26858
26859         * attribute.cs (AttributeSection::Define): Implement to do the business
26860         of constructing a CustomAttributeBuilder.
26861
26862         (Attribute): New trivial class. Increases readability of code.  
26863
26864         * cs-parser.jay : Update accordingly.
26865
26866         (positional_argument_list, named_argument_list, named_argument): New rules
26867
26868         (attribute_arguments): Use the above so that we are more correct.
26869
26870 2001-11-02  Ravi Pratap  <ravi@ximian.com>
26871
26872         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26873         to perform all checks for a method with a params parameter.
26874
26875         (Invocation::OverloadResolve): Update to use the above method and therefore
26876         cope correctly with params method invocations.
26877
26878         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
26879         params too.
26880
26881         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26882         constructors in our parent too because we can't afford to miss out on 
26883         protected ones ;-)
26884
26885         * attribute.cs (AttributeSection): New name for the class Attribute
26886
26887         Other trivial changes to improve readability.
26888
26889         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26890         use the new class names.
26891
26892 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26893
26894         * class.cs (Method::Define): Complete definition for params types too
26895
26896         (Indexer::Define): Ditto.
26897
26898         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26899         Cope everywhere with a request for info about the array parameter.
26900
26901 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26902
26903         * tree.cs (RecordNamespace): Fix up to check for the correct key.
26904
26905         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
26906         local_variable_type to extract the string corresponding to the type.
26907
26908         (local_variable_type): Fixup the action to use the new helper method.
26909
26910         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
26911         go.
26912
26913         * expression.cs : Clean out code which uses the above.
26914
26915 2001-10-31  Ravi Pratap  <ravi@ximian.com>
26916
26917         * typemanager.cs (RegisterMethod): Check if we already have an existing key
26918         and bale out if necessary by returning a false.
26919
26920         (RegisterProperty): Ditto.
26921
26922         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26923         and print out appropriate error messages.
26924
26925         * interface.cs (everywhere): Ditto.
26926
26927         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
26928         location to constructor.
26929
26930         * class.cs (Property, Event, Indexer): Update accordingly.
26931
26932         * ../errors/cs111.cs : Added.
26933
26934         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
26935         of a method, as laid down by the spec.
26936
26937         (Invocation::OverloadResolve): Use the above method.
26938
26939 2001-10-31  Ravi Pratap  <ravi@ximian.com>
26940
26941         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
26942         now take a TypeContainer and a Parameters object.
26943
26944         (ParameterData): Modify return type of ParameterModifier method to be 
26945         Parameter.Modifier and not a string.
26946
26947         (ReflectionParameters, InternalParameters): Update accordingly.
26948
26949         * expression.cs (Argument::GetParameterModifier): Same here.
26950
26951         * support.cs (InternalParameters::ParameterType): Find a better way of determining
26952         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
26953         symbol in it at all so maybe this is only for now.
26954
26955 2001-10-30  Ravi Pratap  <ravi@ximian.com>
26956
26957         * support.cs (InternalParameters): Constructor now takes an extra argument 
26958         which is the actual Parameters class.
26959
26960         (ParameterDesc): Update to provide info on ref/out modifiers.
26961
26962         * class.cs (everywhere): Update call to InternalParameters to pass in
26963         the second argument too.
26964
26965         * support.cs (ParameterData): Add ParameterModifier, which is a method 
26966         to return the modifier info [ref/out etc]
26967
26968         (InternalParameters, ReflectionParameters): Implement the above.
26969
26970         * expression.cs (Argument::ParameterModifier): Similar function to return
26971         info about the argument's modifiers.
26972
26973         (Invocation::OverloadResolve): Update to take into account matching modifiers 
26974         too.
26975
26976         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
26977         a new SetFormalParameters object which we pass to InternalParameters.
26978
26979 2001-10-30  Ravi Pratap  <ravi@ximian.com>
26980
26981         * expression.cs (NewArray): Merge into the ArrayCreation class.
26982
26983 2001-10-29  Ravi Pratap  <ravi@ximian.com>
26984
26985         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
26986         NewUserdefinedArray into one as there wasn't much of a use in having
26987         two separate ones.
26988
26989         * expression.cs (Argument): Change field's name to ArgType from Type.
26990
26991         (Type): New readonly property which returns the proper type, taking into 
26992         account ref/out modifiers.
26993
26994         (everywhere): Adjust code accordingly for the above.
26995
26996         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
26997         whether we are emitting for a ref or out parameter.
26998
26999         * expression.cs (Argument::Emit): Use the above field to set the state.
27000
27001         (LocalVariableReference::Emit): Update to honour the flag and emit the
27002         right stuff.
27003
27004         * parameter.cs (Attributes): Set the correct flags for ref parameters.
27005
27006         * expression.cs (Argument::FullDesc): New function to provide a full desc.
27007
27008         * support.cs (ParameterData): Add method ParameterDesc to the interface.
27009
27010         (ReflectionParameters, InternalParameters): Implement the above method.
27011
27012         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
27013         reporting errors.
27014
27015         (Invocation::FullMethodDesc): Ditto. 
27016
27017 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
27018
27019         * cs-parser.jay: Add extra production for the second form of array
27020         creation. 
27021
27022         * expression.cs (ArrayCreation): Update to reflect the above
27023         change. 
27024
27025         * Small changes to prepare for Array initialization.
27026
27027 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
27028
27029         * typemanager.cs (ImplementsInterface): interface might be null;
27030         Deal with this problem;
27031
27032         Also, we do store negative hits on the cache (null values), so use
27033         this instead of calling t.GetInterfaces on the type everytime.
27034
27035 2001-10-28  Ravi Pratap  <ravi@ximian.com>
27036
27037         * typemanager.cs (IsBuiltinType): New method to help determine the same.
27038
27039         * expression.cs (New::DoResolve): Get rid of array creation code and instead
27040         split functionality out into different classes.
27041
27042         (New::FormArrayType): Move into NewBuiltinArray.
27043
27044         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
27045         quite useless.
27046
27047         (NewBuiltinArray): New class to handle creation of built-in arrays.
27048
27049         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
27050         account creation of one-dimensional arrays.
27051
27052         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
27053
27054         (NewUserdefinedArray::DoResolve): Implement.
27055
27056         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
27057
27058         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
27059         we maintain inside the TypeManager. This is necessary to perform lookups on the
27060         module builder.
27061
27062         (LookupType): Update to perform GetType on the module builders too.     
27063
27064         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
27065
27066         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
27067
27068 2001-10-23  Ravi Pratap  <ravi@ximian.com>
27069
27070         * expression.cs (New::DoResolve): Implement guts of array creation.
27071
27072         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
27073
27074 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
27075
27076         * expression.cs: Fix bug I introduced lsat night that broke
27077         Delegates. 
27078
27079         (Expression.Resolve): Report a 246 error (can not resolve name)
27080         if we find a SimpleName in the stream.
27081
27082         (Expression.ResolveLValue): Ditto.
27083
27084         (Expression.ResolveWithSimpleName): This function is a variant of
27085         ResolveName, this one allows SimpleNames to be returned without a
27086         warning.  The only consumer of SimpleNames is MemberAccess
27087
27088 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
27089
27090         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
27091         might arrive here.  I have my doubts that this is correct.
27092
27093         * statement.cs (Lock): Implement lock statement.
27094
27095         * cs-parser.jay: Small fixes to support `lock' and `using'
27096
27097         * cs-tokenizer.cs: Remove extra space
27098
27099         * driver.cs: New flag --checked, allows to turn on integer math
27100         checking. 
27101
27102         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
27103         Threading.Monitor.Exit 
27104
27105 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
27106
27107         * expression.cs (IndexerAccess::DoResolveLValue): Set the
27108         Expression Class to be IndexerAccess.
27109
27110         Notice that Indexer::DoResolve sets the eclass to Value.
27111
27112 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
27113
27114         * class.cs (TypeContainer::Emit): Emit code for indexers.
27115
27116         * assign.cs (IAssignMethod): New interface implemented by Indexers
27117         and Properties for handling assignment.
27118
27119         (Assign::Emit): Simplify and reuse code. 
27120
27121         * expression.cs (IndexerAccess, PropertyExpr): Implement
27122         IAssignMethod, clean up old code. 
27123
27124 2001-10-22  Ravi Pratap  <ravi@ximian.com>
27125
27126         * typemanager.cs (ImplementsInterface): New method to determine if a type
27127         implements a given interface. Provides a nice cache too.
27128
27129         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
27130         method.
27131
27132         (ConvertReferenceExplicit): Ditto.
27133
27134         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
27135         various methods, with correct names etc.
27136
27137         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
27138         Operator.UnaryNegation.
27139
27140         * cs-parser.jay (operator_declarator): Be a little clever in the case where
27141         we have a unary plus or minus operator.
27142
27143         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
27144         UnaryMinus.
27145
27146         * everywhere : update accordingly.
27147
27148         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
27149         respectively.
27150
27151         * class.cs (Method::Define): For the case where we are implementing a method
27152         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
27153         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
27154
27155 2001-10-21  Ravi Pratap  <ravi@ximian.com>
27156
27157         * interface.cs (FindMembers): Implement to work around S.R.E
27158         lameness.
27159
27160         * typemanager.cs (IsInterfaceType): Implement.
27161
27162         (FindMembers): Update to handle interface types too.
27163
27164         * expression.cs (ImplicitReferenceConversion): Re-write bits which
27165         use IsAssignableFrom as that is not correct - it doesn't work.
27166
27167         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
27168         and accordingly override EmitStatement.
27169
27170         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
27171         using the correct logic :-)
27172
27173 2001-10-19  Ravi Pratap  <ravi@ximian.com>
27174
27175         * ../errors/cs-11.cs : Add to demonstrate error -11 
27176
27177 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
27178
27179         * assign.cs (Assign::Resolve): Resolve right hand side first, and
27180         then pass this as a hint to ResolveLValue.
27181
27182         * expression.cs (FieldExpr): Add Location information
27183
27184         (FieldExpr::LValueResolve): Report assignment to readonly
27185         variable. 
27186
27187         (Expression::ExprClassFromMemberInfo): Pass location information.
27188
27189         (Expression::ResolveLValue): Add new method that resolves an
27190         LValue. 
27191
27192         (Expression::DoResolveLValue): Default invocation calls
27193         DoResolve. 
27194
27195         (Indexers): New class used to keep track of indexers in a given
27196         Type. 
27197
27198         (IStackStore): Renamed from LValue, as it did not really describe
27199         what this did.  Also ResolveLValue is gone from this interface and
27200         now is part of Expression.
27201
27202         (ElementAccess): Depending on the element access type
27203
27204         * typemanager.cs: Add `indexer_name_type' as a Core type
27205         (System.Runtime.CompilerServices.IndexerNameAttribute)
27206
27207         * statement.cs (Goto): Take a location.
27208
27209 2001-10-18  Ravi Pratap  <ravi@ximian.com>
27210
27211         * delegate.cs (Delegate::VerifyDelegate): New method to verify
27212         if two delegates are compatible.
27213
27214         (NewDelegate::DoResolve): Update to take care of the case when
27215         we instantiate a delegate from another delegate.
27216
27217         * typemanager.cs (FindMembers): Don't even try to look up members
27218         of Delegate types for now.
27219
27220 2001-10-18  Ravi Pratap  <ravi@ximian.com>
27221
27222         * delegate.cs (NewDelegate): New class to take care of delegate
27223         instantiation.
27224
27225         * expression.cs (New): Split the delegate related code out into 
27226         the NewDelegate class.
27227
27228         * delegate.cs (DelegateInvocation): New class to handle delegate 
27229         invocation.
27230
27231         * expression.cs (Invocation): Split out delegate related code into
27232         the DelegateInvocation class.
27233
27234 2001-10-17  Ravi Pratap  <ravi@ximian.com>
27235
27236         * expression.cs (New::DoResolve): Implement delegate creation fully
27237         and according to the spec.
27238
27239         (New::DoEmit): Update to handle delegates differently.
27240
27241         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
27242         because of which we were printing out arguments in reverse order !
27243
27244         * delegate.cs (VerifyMethod): Implement to check if the given method
27245         matches the delegate.
27246
27247         (FullDelegateDesc): Implement.
27248
27249         (VerifyApplicability): Implement.
27250
27251         * expression.cs (Invocation::DoResolve): Update to accordingly handle
27252         delegate invocations too.
27253
27254         (Invocation::Emit): Ditto.
27255
27256         * ../errors/cs1593.cs : Added.
27257
27258         * ../errors/cs1594.cs : Added.
27259
27260         * delegate.cs (InstanceExpression, TargetMethod): New properties.
27261
27262 2001-10-16  Ravi Pratap  <ravi@ximian.com>
27263
27264         * typemanager.cs (intptr_type): Core type for System.IntPtr
27265
27266         (InitCoreTypes): Update for the same.
27267
27268         (iasyncresult_type, asynccallback_type): Ditto.
27269
27270         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27271         correct.
27272
27273         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27274         too.
27275
27276         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27277         the builders for the 4 members of a delegate type :-)
27278
27279         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27280         type.
27281
27282         * expression.cs (New::DoResolve): Implement guts for delegate creation.
27283
27284         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27285
27286 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
27287
27288         * statement.cs (Break::Emit): Implement.   
27289         (Continue::Emit): Implement.
27290
27291         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27292         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27293         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27294         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
27295         end loop
27296
27297         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27298         properties that track the label for the current loop (begin of the
27299         loop and end of the loop).
27300
27301 2001-10-15  Ravi Pratap  <ravi@ximian.com>
27302
27303         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27304         use of emitting anything at all.
27305
27306         * class.cs, rootcontext.cs : Get rid of calls to the same.
27307
27308         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27309
27310         (Populate): Define the constructor correctly and set the implementation
27311         attributes.
27312
27313         * typemanager.cs (delegate_types): New hashtable to hold delegates that
27314         have been defined.
27315
27316         (AddDelegateType): Implement.
27317
27318         (IsDelegateType): Implement helper method.
27319
27320         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27321
27322         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27323         and accordingly handle it.
27324
27325         * delegate.cs (Populate): Take TypeContainer argument.
27326         Implement bits to define the Invoke method. However, I still haven't figured out
27327         how to take care of the native int bit :-(
27328
27329         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
27330         Qualify the name of the delegate, not its return type !
27331
27332         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27333         conversion.
27334
27335         (StandardConversionExists): Checking for array types turns out to be recursive.
27336
27337         (ConvertReferenceExplicit): Implement array conversion.
27338
27339         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27340
27341 2001-10-12  Ravi Pratap  <ravi@ximian.com>
27342
27343         * cs-parser.jay (delegate_declaration): Store the fully qualified
27344         name as it is a type declaration.
27345
27346         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
27347         readonly.
27348
27349         (DefineDelegate): Renamed from Define. Does the same thing essentially,
27350         as TypeContainer::DefineType.
27351
27352         (Populate): Method in which all the definition of the various methods (Invoke)
27353         etc is done.
27354
27355         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27356         see.
27357
27358         (CloseDelegate): Finally creates the delegate.
27359
27360         * class.cs (TypeContainer::DefineType): Update to define delegates.
27361         (Populate, Emit and CloseType): Do the same thing here too.
27362
27363         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27364         delegates in all these operations.
27365
27366 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
27367
27368         * expression.cs: LocalTemporary: a new expression used to
27369         reference a temporary that has been created.
27370
27371         * assign.cs: Handle PropertyAccess back here, so that we can
27372         provide the proper semantic access to properties.
27373
27374         * expression.cs (Expression::ConvertReferenceExplicit): Implement
27375         a few more explicit conversions. 
27376
27377         * modifiers.cs: `NEW' modifier maps to HideBySig.
27378
27379         * expression.cs (PropertyExpr): Make this into an
27380         ExpressionStatement, and support the EmitStatement code path. 
27381
27382         Perform get/set error checking, clean up the interface.
27383
27384         * assign.cs: recognize PropertyExprs as targets, and if so, turn
27385         them into toplevel access objects.
27386
27387 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
27388
27389         * expression.cs: PropertyExpr::PropertyExpr: use work around the
27390         SRE.
27391
27392         * typemanager.cs: Keep track here of our PropertyBuilders again to
27393         work around lameness in SRE.
27394
27395 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
27396
27397         * expression.cs (LValue::LValueResolve): New method in the
27398         interface, used to perform a second resolution pass for LValues. 
27399
27400         (This::DoResolve): Catch the use of this in static methods.
27401
27402         (This::LValueResolve): Implement.
27403
27404         (This::Store): Remove warning, assigning to `this' in structures
27405         is 
27406
27407         (Invocation::Emit): Deal with invocation of
27408         methods on value types.  We need to pass the address to structure
27409         methods rather than the object itself.  (The equivalent code to
27410         emit "this" for structures leaves the entire structure on the
27411         stack instead of a pointer to it). 
27412
27413         (ParameterReference::DoResolve): Compute the real index for the
27414         argument based on whether the method takes or not a `this' pointer
27415         (ie, the method is static).
27416
27417         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27418         value types returned from functions when we need to invoke a
27419         method on the sturcture.
27420
27421
27422 2001-10-11  Ravi Pratap  <ravi@ximian.com>
27423
27424         * class.cs (TypeContainer::DefineType): Method to actually do the business of
27425         defining the type in the Modulebuilder or Typebuilder. This is to take
27426         care of nested types which need to be defined on the TypeBuilder using
27427         DefineNestedMethod.
27428
27429         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
27430         methods in RootContext, only ported to be part of TypeContainer.
27431
27432         (TypeContainer::GetInterfaceOrClass): Ditto.
27433
27434         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27435
27436         * interface.cs (Interface::DefineInterface): New method. Does exactly
27437         what RootContext.CreateInterface did earlier, only it takes care of nested types 
27438         too.
27439
27440         (Interface::GetInterfaces): Move from RootContext here and port.
27441
27442         (Interface::GetInterfaceByName): Same here.
27443
27444         * rootcontext.cs (ResolveTree): Re-write.
27445
27446         (PopulateTypes): Re-write.
27447
27448         * class.cs (TypeContainer::Populate): Populate nested types too.
27449         (TypeContainer::Emit): Emit nested members too.
27450
27451         * typemanager.cs (AddUserType): Do not make use of the FullName property,
27452         instead just use the name argument passed in as it is already fully
27453         qualified.
27454
27455         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27456         to TypeContainer mapping to see if a type is user-defined.
27457
27458         * class.cs (TypeContainer::CloseType): Implement. 
27459
27460         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27461         the default constructor.
27462
27463         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27464         twice.
27465
27466         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27467
27468         * interface.cs (CloseType): Create the type here.
27469
27470         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27471         the hierarchy.
27472
27473         Remove all the methods which are now in TypeContainer.
27474
27475 2001-10-10  Ravi Pratap  <ravi@ximian.com>
27476
27477         * delegate.cs (Define): Re-write bits to define the delegate
27478         correctly.
27479
27480 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
27481
27482         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27483
27484         * expression.cs (ImplicitReferenceConversion): handle null as well
27485         as a source to convert to any reference type.
27486
27487         * statement.cs (Return): Perform any implicit conversions to
27488         expected return type.  
27489
27490         Validate use of return statement.  
27491
27492         * codegen.cs (EmitContext): Pass the expected return type here.
27493
27494         * class.cs (Method, Constructor, Property): Pass expected return
27495         type to EmitContext.
27496
27497 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
27498
27499         * expression.cs: Make DoResolve take an EmitContext instead of a
27500         TypeContainer.
27501
27502         Replaced `l' and `location' for `loc', for consistency.
27503
27504         (Error, Warning): Remove unneeded Tc argument.
27505
27506         * assign.cs, literal.cs, constant.cs: Update to new calling
27507         convention. 
27508
27509         * codegen.cs: EmitContext now contains a flag indicating whether
27510         code is being generated in a static method or not.
27511
27512         * cs-parser.jay: DecomposeQI, new function that replaces the old
27513         QualifiedIdentifier.  Now we always decompose the assembled
27514         strings from qualified_identifier productions into a group of
27515         memberaccesses.
27516
27517 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
27518
27519         * rootcontext.cs: Deal with field-less struct types correctly now
27520         by passing the size option to Define Type.
27521
27522         * class.cs: Removed hack that created one static field. 
27523
27524 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27525
27526         * statement.cs: Moved most of the code generation here. 
27527
27528 2001-10-09  Ravi Pratap  <ravi@ximian.com>
27529
27530         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27531         seem very right.
27532
27533         (ElementAccess): Remove useless bits for now - keep checks as the spec
27534         says.
27535
27536 2001-10-08  Ravi Pratap  <ravi@ximian.com>
27537
27538         * expression.cs (ElementAccess::DoResolve): Remove my crap code
27539         and start performing checks according to the spec.
27540
27541 2001-10-07  Ravi Pratap  <ravi@ximian.com>
27542
27543         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27544         rank_specifiers instead.
27545
27546         (rank_specifiers): Change the order in which the rank specifiers are stored
27547
27548         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27549
27550         * expression.cs (ElementAccess): Implement the LValue interface too.
27551
27552 2001-10-06  Ravi Pratap  <ravi@ximian.com>
27553
27554         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27555         except that user defined conversions are not included.
27556
27557         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
27558         perform the conversion of the return type, if necessary.
27559
27560         (New::DoResolve): Check whether we are creating an array or an object
27561         and accordingly do the needful.
27562
27563         (New::Emit): Same here.
27564
27565         (New::DoResolve): Implement guts of array creation.
27566
27567         (New::FormLookupType): Helper function.
27568
27569 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27570
27571         * codegen.cs: Removed most of the code generation here, and move the
27572         corresponding code generation bits to the statement classes. 
27573
27574         Added support for try/catch/finalize and throw.
27575
27576         * cs-parser.jay: Added support for try/catch/finalize.
27577
27578         * class.cs: Catch static methods having the flags override,
27579         virtual or abstract.
27580
27581         * expression.cs (UserCast): This user cast was not really doing
27582         what it was supposed to do.  Which is to be born in fully resolved
27583         state.  Parts of the resolution were being performed at Emit time! 
27584
27585         Fixed this code.
27586
27587 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27588
27589         * expression.cs: Implicity convert the result from UserCast.
27590
27591 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27592
27593         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27594         prevented it from working correctly. 
27595
27596         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27597         merely ConvertImplicit.
27598
27599 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27600
27601         * typemanager.cs: Make the LookupTypeContainer function static,
27602         and not per-instance.  
27603
27604         * class.cs: Make static FindMembers (the one that takes a Type
27605         argument). 
27606
27607         * codegen.cs: Add EmitForeach here.
27608
27609         * cs-parser.jay: Make foreach a toplevel object instead of the
27610         inline expansion, as we need to perform semantic analysis on it. 
27611
27612 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27613
27614         * expression.cs (Expression::ImplicitUserConversion): Rename to
27615         UserDefinedConversion.
27616
27617         (Expression::UserDefinedConversion): Take an extra argument specifying 
27618         whether we look for explicit user conversions too.
27619
27620         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27621
27622         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27623
27624         (ExplicitUserConversion): Make it a call to UserDefinedConversion
27625         with the appropriate arguments.
27626
27627         * cs-parser.jay (cast_expression): Record location too.
27628
27629         * expression.cs (Cast): Record location info.
27630
27631         (Expression::ConvertExplicit): Take location argument.
27632
27633         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27634         to determine if we are doing explicit conversions.
27635
27636         (UserCast::Emit): Update accordingly.
27637
27638         (Expression::ConvertExplicit): Report an error if everything fails.
27639
27640         * ../errors/cs0030.cs : Add.
27641
27642 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
27643
27644         * modifiers.cs: If the ABSTRACT keyword is present, also set the
27645         virtual and newslot bits. 
27646
27647         * class.cs (TypeContainer::RegisterRequiredImplementations):
27648         Record methods we need.
27649
27650         (TypeContainer::MakeKey): Helper function to make keys for
27651         MethodBases, since the Methodbase key is useless.
27652
27653         (TypeContainer::Populate): Call RegisterRequiredImplementations
27654         before defining the methods.   
27655
27656         Create a mapping for method_builders_to_methods ahead of time
27657         instead of inside a tight loop.
27658
27659         (::RequireMethods):  Accept an object as the data to set into the
27660         hashtable so we can report interface vs abstract method mismatch.
27661
27662 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27663
27664         * report.cs: Make all of it static.
27665
27666         * rootcontext.cs: Drop object_type and value_type computations, as
27667         we have those in the TypeManager anyways.
27668
27669         Drop report instance variable too, now it is a global.
27670
27671         * driver.cs: Use try/catch on command line handling.
27672
27673         Add --probe option to debug the error reporting system with a test
27674         suite. 
27675
27676         * report.cs: Add support for exiting program when a probe
27677         condition is reached.
27678
27679 2001-10-03  Ravi Pratap  <ravi@ximian.com>
27680
27681         * expression.cs (Binary::DoNumericPromotions): Fix the case when
27682         we do a forcible conversion regardless of type, to check if 
27683         ForceConversion returns a null.
27684
27685         (Binary::error19): Use location to report error.
27686
27687         (Unary::error23): Use location here too.
27688
27689         * ../errors/cs0019.cs : Check in.
27690
27691         * ../errors/cs0023.cs : Check in.
27692
27693         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27694         case of a non-null MethodInfo object with a length of 0 !
27695
27696         (Binary::ResolveOperator): Flag error if overload resolution fails to find
27697         an applicable member - according to the spec :-)
27698         Also fix logic to find members in base types.
27699
27700         (Unary::ResolveOperator): Same here.
27701
27702         (Unary::report23): Change name to error23 and make first argument a TypeContainer
27703         as I was getting thoroughly confused between this and error19 :-)
27704
27705         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27706         (::FindMostEncompassedType): Implement.
27707         (::FindMostEncompassingType): Implement.
27708         (::StandardConversionExists): Implement.
27709
27710         (UserImplicitCast): Re-vamp. We now need info about most specific
27711         source and target types so that we can do the necessary conversions.
27712
27713         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27714         mathematical union with no duplicates.
27715
27716 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27717
27718         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27719         in order from base classes to child classes, so that we can in
27720         child classes look up in our parent for method names and
27721         attributes (required for handling abstract, virtual, new, override
27722         constructs: we need to instrospect our base class, and if we dont
27723         populate the classes in order, the introspection might be
27724         incorrect.  For example, a method could query its parent before
27725         the parent has any methods and would determine that the parent has
27726         no abstract methods (while it could have had them)).
27727
27728         (RootContext::CreateType): Record the order in which we define the
27729         classes.
27730
27731 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
27732
27733         * class.cs (TypeContainer::Populate): Also method definitions can
27734         fail now, keep track of this.
27735
27736         (TypeContainer::FindMembers): Implement support for
27737         DeclaredOnly/noDeclaredOnly flag.
27738
27739         (Constructor::Emit) Return the ConstructorBuilder.
27740
27741         (Method::Emit) Return the MethodBuilder. 
27742         Check for abstract or virtual methods to be public.
27743
27744         * rootcontext.cs (RootContext::CreateType): Register all the
27745         abstract methods required for the class to be complete and the
27746         interface methods that must be implemented. 
27747
27748         * cs-parser.jay: Report error 501 (method requires body if it is
27749         not marked abstract or extern).
27750
27751         * expression.cs (TypeOf::Emit): Implement.
27752
27753         * typemanager.cs: runtime_handle_type, new global type.
27754
27755         * class.cs (Property::Emit): Generate code for properties.
27756
27757 2001-10-02  Ravi Pratap  <ravi@ximian.com>
27758
27759         * expression.cs (Unary::ResolveOperator): Find operators on base type
27760         too - we now conform exactly to the spec.
27761
27762         (Binary::ResolveOperator): Same here.
27763
27764         * class.cs (Operator::Define): Fix minor quirk in the tests.
27765
27766         * ../errors/cs0215.cs : Added.
27767
27768         * ../errors/cs0556.cs : Added.
27769
27770         * ../errors/cs0555.cs : Added.
27771
27772 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27773
27774         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27775         single integer which is really efficient
27776
27777 2001-10-01  Ravi Pratap  <ravi@ximian.com>
27778
27779         *  expression.cs (Expression::ImplicitUserConversion): Use location
27780         even in the case when we are examining True operators.
27781  
27782         * class.cs (Operator::Define): Perform extensive checks to conform
27783         with the rules for operator overloading in the spec.
27784
27785         * expression.cs (Expression::ImplicitReferenceConversion): Implement
27786         some of the other conversions mentioned in the spec.
27787
27788         * typemanager.cs (array_type): New static member for the System.Array built-in
27789         type.
27790
27791         (cloneable_interface): For System.ICloneable interface.
27792
27793         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27794         we start resolving the tree and populating types.
27795
27796         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27797  
27798 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27799
27800         * expression.cs (Expression::ExprClassFromMemberInfo,
27801         Expression::Literalize): Create literal expressions from
27802         FieldInfos which are literals.
27803
27804         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27805         type casts, because they were wrong.  The test suite in tests
27806         caught these ones.
27807
27808         (ImplicitNumericConversion): ushort to ulong requires a widening
27809         cast. 
27810
27811         Int32 constant to long requires widening cast as well.
27812
27813         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27814         for integers because the type on the stack is not i4.
27815
27816 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
27817
27818         * expression.cs (report118): require location argument. 
27819
27820         * parameter.cs: Do not dereference potential null value.
27821
27822         * class.cs: Catch methods that lack the `new' keyword when
27823         overriding a name.  Report warnings when `new' is used without
27824         anything being there to override.
27825
27826         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27827
27828         * class.cs: Only add constructor to hashtable if it is non-null
27829         (as now constructors can fail on define).
27830
27831         (TypeManager, Class, Struct): Take location arguments.
27832
27833         Catch field instance initialization in structs as errors.
27834
27835         accepting_filter: a new filter for FindMembers that is static so
27836         that we dont create an instance per invocation.
27837
27838         (Constructor::Define): Catch errors where a struct constructor is
27839         parameterless 
27840
27841         * cs-parser.jay: Pass location information for various new
27842         constructs. 
27843
27844         * delegate.cs (Delegate): take a location argument.
27845
27846         * driver.cs: Do not call EmitCode if there were problesm in the
27847         Definition of the types, as many Builders wont be there. 
27848
27849         * decl.cs (Decl::Decl): Require a location argument.
27850
27851         * cs-tokenizer.cs: Handle properly hex constants that can not fit
27852         into integers, and find the most appropiate integer for it.
27853
27854         * literal.cs: Implement ULongLiteral.
27855
27856         * rootcontext.cs: Provide better information about the location of
27857         failure when CreateType fails.
27858
27859 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
27860
27861         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27862         as well.
27863
27864         * expression.cs (Binary::CheckShiftArguments): Add missing type
27865         computation.
27866         (Binary::ResolveOperator): Add type to the logical and and logical
27867         or, Bitwise And/Or and Exclusive Or code paths, it was missing
27868         before.
27869
27870         (Binary::DoNumericPromotions): In the case where either argument
27871         is ulong (and most signed types combined with ulong cause an
27872         error) perform implicit integer constant conversions as well.
27873
27874 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
27875
27876         * expression.cs (UserImplicitCast): Method should always be
27877         non-null. 
27878         (Invocation::BetterConversion): Simplified test for IntLiteral.
27879
27880         (Expression::ImplicitNumericConversion): Split this routine out.
27881         Put the code that performs implicit constant integer conversions
27882         here. 
27883
27884         (Expression::Resolve): Become a wrapper around DoResolve so we can
27885         check eclass and type being set after resolve.
27886
27887         (Invocation::Badness): Remove this dead function
27888
27889         (Binary::ResolveOperator): Do not compute the expensive argumnets
27890         unless we have a union for it.
27891
27892         (Probe::Emit): Is needs to do an isinst and then
27893         compare against null.
27894
27895         (::CanConvert): Added Location argument.  If the Location argument
27896         is null (Location.Null), then we do not report errors.  This is
27897         used by the `probe' mechanism of the Explicit conversion.  We do
27898         not want to generate an error for something that the user
27899         explicitly requested to be casted.  But the pipeline for an
27900         explicit cast first tests for potential implicit casts.
27901
27902         So for now, if the Location is null, it means `Probe only' to
27903         avoid adding another argument.   Might have to revise this
27904         strategy later.
27905
27906         (ClassCast): New class used to type cast objects into arbitrary
27907         classes (used in Explicit Reference Conversions).
27908
27909         Implement `as' as well.
27910
27911         Reverted all the patches from Ravi below: they were broken:
27912
27913                 * The use of `level' as a mechanism to stop recursive
27914                   invocations is wrong.  That was there just to catch the
27915                   bug with a strack trace but not as a way of addressing
27916                   the problem.
27917
27918                   To fix the problem we have to *understand* what is going
27919                   on and the interactions and come up with a plan, not
27920                   just get things going.
27921
27922                 * The use of the type conversion cache that I proposed
27923                   last night had an open topic: How does this work across
27924                   protection domains.  A user defined conversion might not
27925                   be public in the location where we are applying the
27926                   conversion, a different conversion might be selected
27927                   (ie, private A->B (better) but public B->A (worse),
27928                   inside A, A->B applies, but outside it, B->A will
27929                   apply).
27930
27931                 * On top of that (ie, even if the above is solved),
27932                   conversions in a cache need to be abstract.  Ie, `To
27933                   convert from an Int to a Short use an OpcodeCast', not
27934                   `To convert from an Int to a Short use the OpcodeCast on
27935                   the variable 5' (which is what this patch was doing).
27936
27937 2001-09-28  Ravi Pratap  <ravi@ximian.com>
27938
27939         * expression.cs (Invocation::ConversionExists): Re-write to use
27940         the conversion cache
27941
27942         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
27943         cache all conversions done, not just user-defined ones.
27944
27945         (Invocation::BetterConversion): The real culprit. Use ConversionExists
27946         to determine if a conversion exists instead of acutually trying to 
27947         perform the conversion. It's faster too.
27948
27949         (Expression::ConvertExplicit): Modify to use ConversionExists to check
27950         and only then attempt the implicit conversion.
27951
27952 2001-09-28  Ravi Pratap  <ravi@ximian.com>
27953
27954         * expression.cs (ConvertImplicit): Use a cache for conversions
27955         already found. Check level of recursion and bail out if necessary.
27956
27957 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
27958
27959         * typemanager.cs (string_concat_string_string, string_concat_object_object):
27960         Export standard methods that we expect for string operations.
27961
27962         * statement.cs (Block::UsageWarning): Track usage of variables and
27963         report the errors for not used variables.
27964
27965         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
27966         operator. 
27967
27968 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
27969
27970         * codegen.cs: remove unnneded code 
27971
27972         * expression.cs: Removed BuiltinTypeAccess class
27973
27974         Fix the order in which implicit conversions are
27975         done.  
27976
27977         The previous fixed dropped support for boxed conversions (adding a
27978         test to the test suite now)
27979
27980         (UserImplicitCast::CanConvert): Remove test for source being null,
27981         that code is broken.  We should not feed a null to begin with, if
27982         we do, then we should track the bug where the problem originates
27983         and not try to cover it up here.
27984
27985         Return a resolved expression of type UserImplicitCast on success
27986         rather than true/false.  Ravi: this is what I was talking about,
27987         the pattern is to use a static method as a "constructor" for
27988         objects. 
27989
27990         Also, do not create arguments until the very last minute,
27991         otherwise we always create the arguments even for lookups that
27992         will never be performed. 
27993
27994         (UserImplicitCast::Resolve): Eliminate, objects of type
27995         UserImplicitCast are born in a fully resolved state. 
27996
27997         * typemanager.cs (InitCoreTypes): Init also value_type
27998         (System.ValueType). 
27999
28000         * expression.cs (Cast::Resolve): First resolve the child expression.
28001
28002         (LValue): Add new method AddressOf to be used by
28003         the `&' operator.  
28004
28005         Change the argument of Store to take an EmitContext instead of an
28006         ILGenerator, because things like FieldExpr need to be able to call
28007         their children expression to generate the instance code. 
28008
28009         (Expression::Error, Expression::Warning): Sugar functions for
28010         reporting errors.
28011
28012         (Expression::MemberLookup): Accept a TypeContainer instead of a
28013         Report as the first argument.
28014
28015         (Expression::ResolvePrimary): Killed.  I still want to improve
28016         this as currently the code is just not right.
28017
28018         (Expression::ResolveMemberAccess): Simplify, but it is still
28019         wrong. 
28020
28021         (Unary::Resolve): Catch errors in AddressOf operators.
28022
28023         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
28024         index to a byte for the short-version, or the compiler will choose
28025         the wrong Emit call, which generates the wrong data.
28026
28027         (ParameterReference::Emit, ::Store): same.
28028
28029         (FieldExpr::AddressOf): Implement.
28030
28031         * typemanager.cs: TypeManager: made public variable instead of
28032         property.
28033
28034         * driver.cs: document --fatal.
28035
28036         * report.cs (ErrorMessage, WarningMessage): new names for the old
28037         Error and Warning classes.
28038
28039         * cs-parser.jay (member_access): Turn built-in access to types
28040         into a normal simplename
28041
28042 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28043
28044         * expression.cs (Invocation::BetterConversion): Fix to cope
28045         with q being null, since this was introducing a bug.
28046
28047         * expression.cs (ConvertImplicit): Do built-in conversions first.
28048
28049 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28050
28051         * expression.cs (UserImplicitCast::Resolve): Fix bug.
28052
28053 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28054
28055         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
28056         I had introduced long ago (what's new ?).
28057
28058         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
28059         the work of all the checking. 
28060         (ConvertImplicit): Call CanConvert and only then create object if necessary.
28061         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
28062
28063         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
28064         that is the right way. 
28065
28066         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
28067         overloading resolution. Use everywhere instead of cutting and pasting code.
28068
28069         (Binary::ResolveOperator): Use MakeUnionSet.
28070
28071         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
28072         we have to convert to bool types. Not complete yet.
28073
28074 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
28075
28076         * typemanager.cs (TypeManager::CSharpName): support ushort.
28077
28078         * expression.cs (Expression::TryImplicitIntConversion): Attempts
28079         to provide an expression that performsn an implicit constant int
28080         conversion (section 6.1.6).
28081         (Expression::ConvertImplicitRequired): Reworked to include
28082         implicit constant expression conversions.
28083
28084         (Expression::ConvertNumericExplicit): Finished.
28085
28086         (Invocation::Emit): If InstanceExpression is null, then it means
28087         that we perform a call on this.
28088
28089 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
28090
28091         * expression.cs (Unary::Emit): Remove some dead code.
28092         (Probe): Implement Resolve and Emit for `is'.
28093         (Expression::ConvertImplicitRequired): Attempt to do constant
28094         expression conversions here.  Maybe should be moved to
28095         ConvertImplicit, but I am not sure.
28096         (Expression::ImplicitLongConstantConversionPossible,
28097         Expression::ImplicitIntConstantConversionPossible): New functions
28098         that tell whether is it possible to apply an implicit constant
28099         expression conversion.
28100
28101         (ConvertNumericExplicit): Started work on explicit numeric
28102         conversions.
28103
28104         * cs-parser.jay: Update operator constants.
28105
28106         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
28107         (Parameters::GetSignature): Hook up VerifyArgs here.
28108         (Parameters::VerifyArgs): Verifies that no two arguments have the
28109         same name. 
28110
28111         * class.cs (Operator): Update the operator names to reflect the
28112         ones that the spec expects (as we are just stringizing the
28113         operator names).
28114
28115         * expression.cs (Unary::ResolveOperator): Fix bug: Use
28116         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
28117         previous usage did only work for our methods.
28118         (Expression::ConvertImplicit): Handle decimal implicit numeric
28119         conversions as well.
28120         (Expression::InternalTypeConstructor): Used to invoke constructors
28121         on internal types for default promotions.
28122
28123         (Unary::Emit): Implement special handling for the pre/post
28124         increment/decrement for overloaded operators, as they need to have
28125         the same semantics as the other operators.
28126
28127         (Binary::ResolveOperator): ditto.
28128         (Invocation::ConversionExists): ditto.
28129         (UserImplicitCast::Resolve): ditto.
28130
28131 2001-09-26  Ravi Pratap  <ravi@ximian.com>
28132
28133         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
28134         operator, return after emitting body. Regression tests pass again !
28135
28136         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
28137         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
28138         (Invocation::OverloadResolve): Ditto.
28139         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
28140
28141         * everywhere : update calls to the above methods accordingly.
28142
28143 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
28144
28145         * assign.cs (Assign): Make it inherit from ExpressionStatement.
28146
28147         * expression.cs (ExpressionStatement): New base class used for
28148         expressions that can appear in statements, so that we can provide
28149         an alternate path to generate expression that do not leave a value
28150         on the stack.
28151
28152         (Expression::Emit, and all the derivatives): We no longer return
28153         whether a value is left on the stack or not.  Every expression
28154         after being emitted leaves a single value on the stack.
28155
28156         * codegen.cs (EmitContext::EmitStatementExpression): Use the
28157         facilties of ExpressionStatement if possible.
28158
28159         * cs-parser.jay: Update statement_expression.
28160
28161 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
28162
28163         * driver.cs: Change the wording of message
28164
28165 2001-09-25  Ravi Pratap  <ravi@ximian.com>
28166
28167         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
28168         the type of the expression to the return type of the method if
28169         we have an overloaded operator match ! The regression tests pass again !
28170         (Unary::ResolveOperator): Ditto.
28171
28172         * expression.cs (Invocation::ConversionExists): Correct the member lookup
28173         to find "op_Implicit", not "implicit" ;-)
28174         (UserImplicitCast): New class to take care of user-defined implicit conversions.
28175         (ConvertImplicit, ForceConversion): Take TypeContainer argument
28176
28177         * everywhere : Correct calls to the above accordingly.
28178
28179         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
28180         (ConvertImplicit): Do user-defined conversion if it exists.
28181
28182 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
28183
28184         * assign.cs: track location.
28185         (Resolve): Use implicit conversions on assignment.
28186
28187         * literal.cs: Oops.  Not good, Emit of short access values should
28188         pass (Bytes) or the wrong argument will be selected.
28189
28190         * expression.cs (Unary::Emit): Emit code for -expr.
28191
28192         (Unary::ResolveOperator): Handle `Substract' for non-constants
28193         (substract from zero from the non-constants).
28194         Deal with Doubles as well. 
28195
28196         (Expression::ConvertImplicitRequired): New routine that reports an
28197         error if no implicit conversion exists. 
28198
28199         (Invocation::OverloadResolve): Store the converted implicit
28200         expressions if we make them
28201
28202 2001-09-24  Ravi Pratap  <ravi@ximian.com>
28203
28204         * class.cs (ConstructorInitializer): Take a Location argument.
28205         (ConstructorBaseInitializer): Same here.
28206         (ConstructorThisInitializer): Same here.
28207
28208         * cs-parser.jay : Update all calls accordingly.
28209
28210         * expression.cs (Unary, Binary, New): Take location argument.
28211         Update accordingly everywhere.
28212
28213         * cs-parser.jay : Update all calls to the above to take a location
28214         argument.
28215
28216         * class.cs : Ditto.
28217
28218 2001-09-24  Ravi Pratap  <ravi@ximian.com>
28219
28220         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
28221         (Invocation::BetterConversion): Same here
28222         (Invocation::ConversionExists): Ditto.
28223
28224         (Invocation::ConversionExists): Implement.
28225
28226 2001-09-22  Ravi Pratap  <ravi@ximian.com>
28227
28228         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
28229         Also take an additional TypeContainer argument.
28230
28231         * All over : Pass in TypeContainer as argument to OverloadResolve.
28232
28233         * typemanager.cs (CSharpName): Update to check for the string type and return
28234         that too.
28235
28236         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
28237         a given method.
28238
28239 2001-09-21  Ravi Pratap  <ravi@ximian.com>
28240
28241         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
28242         (Invocation::BetterFunction): Implement.
28243         (Invocation::BetterConversion): Implement.
28244         (Invocation::ConversionExists): Skeleton, no implementation yet.
28245
28246         Okay, things work fine !
28247
28248 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
28249
28250         * typemanager.cs: declare and load enum_type, delegate_type and
28251         void_type. 
28252
28253         * expression.cs (Expression::Emit): Now emit returns a value that
28254         tells whether a value is left on the stack or not.  This strategy
28255         might be reveted tomorrow with a mechanism that would address
28256         multiple assignments.
28257         (Expression::report118): Utility routine to report mismatches on
28258         the ExprClass.
28259
28260         (Unary::Report23): Report impossible type/operator combination
28261         utility function.
28262
28263         (Unary::IsIncrementableNumber): Whether the type can be
28264         incremented or decremented with add.
28265         (Unary::ResolveOperator): Also allow enumerations to be bitwise
28266         complemented. 
28267         (Unary::ResolveOperator): Implement ++, !, ~,
28268
28269         (Invocation::Emit): Deal with new Emit convetion.
28270
28271         * All Expression derivatives: Updated their Emit method to return
28272         whether they leave values on the stack or not.
28273
28274         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28275         stack for expressions that are statements. 
28276
28277 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28278
28279         * expression.cs (LValue): New interface.  Must be implemented by
28280         LValue objects.
28281         (LocalVariableReference, ParameterReference, FieldExpr): Implement
28282         LValue interface.
28283
28284         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28285         interface for generating code, simplifies the code.
28286
28287 2001-09-20  Ravi Pratap  <ravi@ximian.com>
28288
28289         * expression.cs (everywhere): Comment out return statements in ::Resolve
28290         methods to avoid the warnings.
28291
28292 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28293
28294         * driver.cs (parse): Report error 2001 if we can not open the
28295         source file.
28296
28297         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28298         not resolve it.
28299
28300         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28301         object. 
28302
28303         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28304         otherwise nested blocks end up with the same index.
28305
28306         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28307
28308         * expression.cs:  Instead of having FIXMEs in the Resolve
28309         functions, throw exceptions so it is obvious that we are facing a
28310         bug. 
28311
28312         * cs-parser.jay (invocation_expression): Pass Location information.
28313
28314         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28315         Use a basename for those routines because .NET does not like paths
28316         on them. 
28317
28318         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28319         already defined.
28320
28321 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
28322
28323         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28324         are loading the correct data types (throws an exception if not).
28325         (TypeManager::InitCoreTypes): Use CoreLookupType
28326
28327         * expression.cs (Unary::ResolveOperator): return the child
28328         expression for expressions which are just +expr.
28329         (Unary::ResolveOperator): Return negative literals for -LITERAL
28330         expressions (otherwise they are Unary {Literal}).
28331         (Invocation::Badness): Take into account `Implicit constant
28332         expression conversions'.
28333
28334         * literal.cs (LongLiteral): Implement long literal class.
28335         (IntLiteral): export the `Value' of the intliteral. 
28336
28337 2001-09-19  Ravi Pratap  <ravi@ximian.com>
28338
28339         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28340
28341         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
28342         instead of 'Operator'
28343
28344         * expression.cs (Binary::ResolveOperator): Update accordingly.
28345         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28346         and 'Minus'
28347
28348         * cs-parser.jay (unary_expression): Update to use the new names.
28349
28350         * gen-treedump.cs (GetUnary): Same here.
28351
28352         * expression.cs (Unary::Resolve): Implement.
28353         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
28354         operators are found instead of making noise ;-)
28355         (Unary::ResolveOperator): New method to do precisely the same thing which
28356         Binary::ResolveOperator does for Binary expressions.
28357         (Unary.method, .Arguments): Add.
28358         (Unary::OperName): Implement.   
28359         (Unary::ForceConversion): Copy and Paste !
28360
28361         * class.cs (Operator::Define): Fix a small bug for the case when we have 
28362         a unary operator.
28363
28364         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28365         for the inbuilt operators. Only overloading works for now ;-)
28366
28367 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
28368
28369         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28370         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28371
28372         * expression.cs (This::Emit): Implement. 
28373         (This::Resolve): Implement.
28374         (TypeOf:Resolve): Implement.
28375         (Expression::ResolveSimpleName): Add an implicit this to instance
28376         field references. 
28377         (MemberAccess::Resolve): Deal with Parameters and Fields. 
28378         Bind instance variable to Field expressions.
28379         (FieldExpr::Instance): New field used to track the expression that
28380         represents the object instance.
28381         (FieldExpr::Resolve): Track potential errors from MemberLookup not
28382         binding 
28383         (FieldExpr::Emit): Implement.
28384
28385         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28386         the last instruction contains a return opcode to avoid generating
28387         the last `ret' instruction (this generates correct code, and it is
28388         nice to pass the peverify output).
28389
28390         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28391         initializer for static and instance variables.
28392         (Constructor::Emit): Allow initializer to be null in the case of
28393         static constructors.  Only emit initializer for instance
28394         constructors. 
28395
28396         (TypeContainer::FindMembers): Return a null array if there are no
28397         matches.
28398
28399         Also fix the code for the MemberTypes.Method branch, as it was not
28400         scanning that for operators (or tried to access null variables before).
28401
28402         * assign.cs (Assign::Emit): Handle instance and static fields. 
28403
28404         * TODO: Updated.
28405
28406         * driver.cs: Stop compilation if there are parse errors.
28407
28408         * cs-parser.jay (constructor_declaration): Provide default base
28409         initializer for non-static constructors.
28410         (constructor_declarator): Do not provide a default base
28411         initializers if none was specified.
28412         Catch the fact that constructors should not have parameters.
28413
28414         * class.cs: Do not emit parent class initializers for static
28415         constructors, that should be flagged as an error.
28416
28417 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28418
28419         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28420         Move back code into TypeContainer::Populate.
28421
28422 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28423
28424         * class.cs (TypeContainer::AddConstructor): Fix the check to
28425         compare against Name, not Basename. 
28426         (Operator::OpType): Change Plus and Minus to Add and Subtract.
28427
28428         * cs-parser.jay : Update accordingly.
28429
28430         * class.cs (TypeContainer::FindMembers): For the case where we are searching
28431         for methods, don't forget to look into the operators too.
28432         (RegisterMethodBuilder): Helper method to take care of this for
28433         methods, constructors and operators.
28434         (Operator::Define): Completely revamp.
28435         (Operator.OperatorMethod, MethodName): New fields.
28436         (TypeContainer::Populate): Move the registering of builders into
28437         RegisterMethodBuilder.
28438         (Operator::Emit): Re-write.
28439
28440         * expression.cs (Binary::Emit): Comment out code path to emit method
28441         invocation stuff for the case when we have a user defined operator. I am
28442         just not able to get it right !
28443
28444 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28445
28446         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28447         argument. 
28448
28449         (Expression::MemberLookup): Provide a version that allows to
28450         specify the MemberTypes and BindingFlags. 
28451
28452         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28453         so it was not fetching variable information from outer blocks.
28454
28455         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28456         Beforefieldinit as it was buggy.
28457
28458         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28459         that Ravi put here.  
28460
28461         * class.cs (Constructor::Emit): Only emit if block is not null.
28462         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28463         deal with this by semantically definining it as if the user had
28464         done it.
28465
28466         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28467         constructors as we now "emit" them at a higher level.
28468
28469         (TypeContainer::DefineDefaultConstructor): Used to define the
28470         default constructors if none was provided.
28471
28472         (ConstructorInitializer): Add methods Resolve and Emit. 
28473
28474         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28475
28476 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28477
28478         * class.cs (TypeContainer::EmitDefaultConstructor): Register
28479         the default constructor builder with our hashtable for methodbuilders
28480         to methodcores.
28481
28482         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28483         and argument_count is 0 in which case we have a match.
28484         (Binary::ResolveOperator): More null checking and miscellaneous coding
28485         style cleanup.
28486
28487 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28488
28489         * rootcontext.cs (IsNameSpace): Compare against null.
28490
28491         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28492
28493         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28494         and Unary::Operator.
28495
28496         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28497         accordingly.
28498
28499         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28500         we have overloaded operators.
28501         (Binary::ResolveOperator): Implement the part which does the operator overload
28502         resolution.
28503
28504         * class.cs (Operator::Emit): Implement.
28505         (TypeContainer::Emit): Emit the operators we have too.
28506
28507         * expression.cs (Binary::Emit): Update to emit the appropriate code for
28508         the case when we have a user-defined operator.
28509
28510 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28511
28512         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28513
28514 2001-09-16  Ravi Pratap  <ravi@ximian.com>
28515
28516         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28517         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28518         (Constructor::Emit): Implement.
28519         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28520         if we have no work to do. 
28521         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
28522         Emit method.
28523
28524         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28525         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28526
28527         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28528         of parent.parent.
28529
28530 2001-09-15  Ravi Pratap  <ravi@ximian.com>
28531
28532         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28533         in the source.
28534         (Tree::RecordNamespace): Method to do what the name says ;-)
28535         (Tree::Namespaces): Property to get at the namespaces hashtable.
28536
28537         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
28538         keep track.
28539
28540         * rootcontext.cs (IsNamespace): Fixed it :-)
28541
28542 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28543
28544         * class.cs (TypeContainer::FindMembers): Add support for
28545         constructors. 
28546         (MethodCore): New class that encapsulates both the shared aspects
28547         of a Constructor and a Method.  
28548         (Method, Constructor): Factored pieces into MethodCore.
28549
28550         * driver.cs: Added --fatal which makes errors throw exceptions.
28551         Load System assembly as well as part of the standard library.
28552
28553         * report.cs: Allow throwing exceptions on errors for debugging.
28554
28555         * modifiers.cs: Do not use `parent', instead use the real type
28556         container to evaluate permission settings.
28557
28558         * class.cs: Put Ravi's patch back in.  He is right, and we will
28559         have to cope with the
28560
28561 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28562
28563         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28564         FamORAssem, not FamANDAssem.
28565
28566 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28567
28568         * driver.cs: Added --parse option that only parses its input files
28569         and terminates.
28570
28571         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
28572         incorrect.  IsTopLevel is not used to tell whether an object is
28573         root_types or not (that can be achieved by testing this ==
28574         root_types).  But to see if this is a top-level *class* (not
28575         necessarly our "toplevel" container). 
28576
28577 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28578
28579         * enum.cs (Enum::Define): Modify to call the Lookup method on the
28580         parent instead of a direct call to GetType.
28581
28582 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28583
28584         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28585         Modifiers.TypeAttr. This should just be a call to that method.
28586
28587         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28588         object so that we can determine if we are top-level or not.
28589
28590         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
28591         TypeContainer too.
28592
28593         * enum.cs (Enum::Define): Ditto.
28594
28595         * modifiers.cs (FieldAttr): Re-write.
28596
28597         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28598         (TypeContainer::HaveStaticConstructor): New property to provide access
28599         to precisely that info.
28600
28601         * modifiers.cs (MethodAttr): Re-write.
28602         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28603
28604         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28605         of top-level types as claimed.
28606
28607 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28608
28609         * expression.cs (MemberLookup): Fruitless attempt to lookup
28610         constructors.  Maybe I need to emit default constructors?  That
28611         might be it (currently .NET emits this for me automatically).
28612         (Invocation::OverloadResolve): Cope with Arguments == null.
28613         (Invocation::EmitArguments): new function, shared by the new
28614         constructor and us.
28615         (Invocation::Emit): Handle static and instance methods.  Emit
28616         proper call instruction for virtual or non-virtual invocations.
28617         (New::Emit): Implement.
28618         (New::Resolve): Implement.
28619         (MemberAccess:Resolve): Implement.
28620         (MethodGroupExpr::InstanceExpression): used conforming to the spec
28621         to track instances.
28622         (FieldExpr::Resolve): Set type.
28623
28624         * support.cs: Handle empty arguments.
28625                 
28626         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28627         SimpleLookup): Auxiliary routines to help parse a qualifier
28628         identifier.  
28629
28630         Update qualifier_identifier rule.
28631
28632         * codegen.cs: Removed debugging messages.
28633
28634         * class.cs: Make this a global thing, this acts just as a "key" to
28635         objects that we might have around.
28636
28637         (Populate): Only initialize method_builders_to_methods once.
28638
28639         * expression.cs (PropertyExpr): Initialize type from the
28640         PropertyType. 
28641
28642         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28643         Resolve pattern.  Attempt to implicitly convert value to boolean.
28644         Emit code.
28645
28646         * expression.cs: Set the type for the int32/int32 argument case.
28647         (Binary::ResolveOperator): Set the return type to boolean for
28648         comparission operators
28649
28650         * typemanager.cs: Remove debugging print code.
28651
28652         (Invocation::Resolve): resolve type.
28653
28654         * class.cs: Allocate a MemberInfo of the correct size, as the code
28655         elsewhere depends on the test to reflect the correct contents.
28656
28657         (Method::) Keep track of parameters, due to System.Reflection holes
28658
28659         (TypeContainer::Populate): Keep track of MethodBuilders to Method
28660         mapping here.
28661
28662         (TypeContainer::FindMembers): Use ArrayList and then copy an array
28663         of the exact size and return that.
28664
28665         (Class::LookupMethodByBuilder): New function that maps
28666         MethodBuilders to its methods.  Required to locate the information
28667         on methods because System.Reflection bit us again.
28668
28669         * support.cs: New file, contains an interface ParameterData and
28670         two implementations: ReflectionParameters and InternalParameters
28671         used to access Parameter information.  We will need to grow this
28672         as required.
28673
28674         * expression.cs (Invocation::GetParameterData): implement a cache
28675         and a wrapper around the ParameterData creation for methods. 
28676         (Invocation::OverloadResolve): Use new code.
28677
28678 2001-09-13  Ravi Pratap  <ravi@ximian.com>
28679
28680         * class.cs (TypeContainer::EmitField): Remove and move into 
28681         (Field::Define): here and modify accordingly.
28682         (Field.FieldBuilder): New member.
28683         (TypeContainer::Populate): Update accordingly.
28684         (TypeContainer::FindMembers): Implement.
28685
28686 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28687
28688         * statement.cs: (VariableInfo::VariableType): New field to be
28689         initialized with the full type once it is resolved. 
28690
28691 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
28692
28693         * parameter.cs (GetParameterInfo): Use a type cache to compute
28694         things only once, and to reuse this information
28695
28696         * expression.cs (LocalVariableReference::Emit): Implement.
28697         (OpcodeCast::Emit): fix.
28698
28699         (ParameterReference::Resolve): Implement.
28700         (ParameterReference::Emit): Implement.
28701
28702         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28703         that are expressions need to stay as Expressions.
28704
28705         * typemanager.cs (CSharpName): Returns the C# name of a type if
28706         possible. 
28707
28708         * expression.cs (Expression::ConvertImplicit): New function that
28709         implements implicit type conversions.
28710
28711         (Expression::ImplicitReferenceConversion): Implements implicit
28712         reference conversions.
28713
28714         (EmptyCast): New type for transparent casts.
28715
28716         (OpcodeCast): New type for casts of types that are performed with
28717         a sequence of bytecodes.
28718
28719         (BoxedCast): New type used for casting value types into reference
28720         types.  Emits a box opcode.
28721
28722         (Binary::DoNumericPromotions): Implements numeric promotions of
28723         and computation of the Binary::Type.
28724
28725         (Binary::EmitBranchable): Optimization.
28726
28727         (Binary::Emit): Implement code emission for expressions.
28728
28729         * typemanager.cs (TypeManager): Added two new core types: sbyte
28730         and byte.
28731
28732 2001-09-12  Ravi Pratap  <ravi@ximian.com>
28733
28734         * class.cs (TypeContainer::FindMembers): Method which does exactly
28735         what Type.FindMembers does, only we don't have to use reflection. No
28736         implementation yet.
28737
28738         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28739         typecontainer objects as we need to get at them.
28740         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28741
28742         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28743         typecontainer object.
28744
28745         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28746         of just a Report object.
28747
28748 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28749
28750         * class.cs (Event::Define): Go back to using the prefixes "add_" and
28751         "remove_"
28752         (TypeContainer::Populate): Now define the delegates of the type too.
28753         (TypeContainer.Delegates): Property to access the list of delegates defined
28754         in the type.
28755
28756         * delegates.cs (Delegate::Define): Implement partially.
28757
28758         * modifiers.cs (TypeAttr): Handle more flags.
28759
28760 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28761
28762         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28763         and not <=
28764         (Operator::Define): Re-write logic to get types by using the LookupType method
28765         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28766         (Indexer::Define): Ditto.
28767         (Event::Define): Ditto.
28768         (Property::Define): Ditto.
28769
28770 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28771
28772         * class.cs (TypeContainer::Populate): Now define operators too. 
28773         (TypeContainer.Operators): New property to access the list of operators
28774         in a type.
28775         (Operator.OperatorMethodBuilder): New member to hold the method builder
28776         for the operator we are defining.
28777         (Operator::Define): Implement.
28778
28779 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28780
28781         * class.cs (Event::Define): Make the prefixes of the accessor methods
28782         addOn_ and removeOn_ 
28783
28784         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28785         of the location being passed in too. Ideally, this should go later since all
28786         error reporting should be done through the Report object.
28787
28788         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28789         (Populate): Iterate thru the indexers we have and define them too.
28790         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28791         for the get and set accessors.
28792         (Indexer::Define): Implement.
28793
28794 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
28795
28796         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
28797         my previous implementation, did not work.
28798
28799         * typemanager.cs: Add a couple of missing types (the longs).
28800
28801         * literal.cs: Use TypeManager.bool_type instead of getting it.
28802
28803         * expression.cs (EventExpr): New kind of expressions.
28804         (Expressio::ExprClassFromMemberInfo): finish
28805
28806 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
28807
28808         * assign.cs: Emit stores to static fields differently.
28809
28810 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28811
28812         * Merge in changes and adjust code to tackle conflicts. Backed out my
28813         code in Assign::Resolve ;-) 
28814
28815 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28816
28817         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28818         instead Report.Error and also pass in the location.
28819         (CSharpParser::Lexer): New readonly property to return the reference
28820         to the Tokenizer object.
28821         (declare_local_variables): Use Report.Error with location instead of plain 
28822         old error.
28823         (CheckDef): Ditto.
28824
28825         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28826         (Operator.CheckBinaryOperator): Ditto.
28827
28828         * cs-parser.jay (operator_declarator): Update accordingly.
28829
28830         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28831         (CheckBinaryOperator): Same here.
28832
28833         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28834         on the name without any prefixes of namespace names etc. This is because we
28835         already might have something already fully qualified like 
28836         'System.Console.WriteLine'
28837
28838         * assign.cs (Resolve): Begin implementation. Stuck ;-)
28839
28840 2001-09-07  Ravi Pratap  <ravi@ximian.com>
28841
28842         * cs-tokenizer.cs (location): Return a string which also contains
28843         the file name.
28844
28845         * expression.cs (ElementAccess): New class for expressions of the
28846         type 'element access.'
28847         (BaseAccess): New class for expressions of the type 'base access.'
28848         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28849         respectively.
28850
28851         * cs-parser.jay (element_access): Implement action.
28852         (base_access): Implement actions.
28853         (checked_expression, unchecked_expression): Implement.
28854
28855         * cs-parser.jay (local_variable_type): Correct and implement.
28856         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28857
28858         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28859
28860         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28861         name and the specifiers.
28862
28863         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28864
28865         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
28866         making them all public ;-)
28867
28868         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28869         class anyways.
28870
28871 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
28872
28873         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28874         PropertyExprs.
28875         (FieldExpr, PropertyExprs): New resolved expressions.
28876         (SimpleName::MemberStaticCheck): Perform static checks for access
28877         to non-static fields on static methods. Maybe this should be
28878         generalized for MemberAccesses. 
28879         (SimpleName::ResolveSimpleName): More work on simple name
28880         resolution. 
28881
28882         * cs-parser.jay (primary_expression/qualified_identifier): track
28883         the parameter index.
28884
28885         * codegen.cs (CodeGen::Save): Catch save exception, report error.
28886         (EmitContext::EmitBoolExpression): Chain to expression generation
28887         instead of temporary hack.
28888         (::EmitStatementExpression): Put generic expression code generation.
28889
28890         * assign.cs (Assign::Emit): Implement variable assignments to
28891         local variables, parameters and fields.
28892
28893 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
28894
28895         * statement.cs (Block::GetVariableInfo): New method, returns the
28896         VariableInfo for a variable name in a block.
28897         (Block::GetVariableType): Implement in terms of GetVariableInfo
28898
28899         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28900         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28901
28902 2001-09-06  Ravi Pratap  <ravi@ximian.com>
28903
28904         * cs-parser.jay (operator_declaration): Continue on my quest : update
28905         to take attributes argument.
28906         (event_declaration): Ditto.
28907         (enum_declaration): Ditto.
28908         (indexer_declaration): Ditto.
28909
28910         * class.cs (Operator::Operator): Update constructor accordingly.
28911         (Event::Event): Ditto.
28912
28913         * delegate.cs (Delegate::Delegate): Same here.
28914
28915         * enum.cs (Enum::Enum): Same here.
28916
28917 2001-09-05  Ravi Pratap  <ravi@ximian.com>
28918
28919         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28920
28921         * ../tests/cs0658.cs : New file to demonstrate error 0658.
28922
28923         * attribute.cs (Attributes): New class to encapsulate all attributes which were
28924         being passed around as an arraylist.
28925         (Attributes::AddAttribute): Method to add attribute sections.
28926
28927         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
28928         (struct_declaration): Update accordingly.
28929         (constant_declaration): Update.
28930         (field_declaration): Update.
28931         (method_header): Update.
28932         (fixed_parameter): Update.
28933         (parameter_array): Ditto.
28934         (property_declaration): Ditto.
28935         (destructor_declaration): Ditto.
28936
28937         * class.cs (Struct::Struct): Update constructors accordingly.
28938         (Class::Class): Ditto.
28939         (Field::Field): Ditto.
28940         (Method::Method): Ditto.
28941         (Property::Property): Ditto.
28942         (TypeContainer::OptAttribute): update property's return type.
28943
28944         * interface.cs (Interface.opt_attributes): New member.
28945         (Interface::Interface): Update to take the extra Attributes argument.
28946
28947         * parameter.cs (Parameter::Parameter): Ditto.
28948
28949         * constant.cs (Constant::Constant): Ditto.
28950
28951         * interface.cs (InterfaceMemberBase): New OptAttributes field.
28952         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
28953         the attributes as a parameter.
28954         (InterfaceProperty): Update constructor call.
28955         (InterfaceEvent): Ditto.
28956         (InterfaceMethod): Ditto.
28957         (InterfaceIndexer): Ditto.
28958
28959         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
28960         pass the attributes too.
28961         (interface_event_declaration): Ditto.
28962         (interface_property_declaration): Ditto.
28963         (interface_method_declaration): Ditto.
28964         (interface_declaration): Ditto.
28965
28966 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
28967
28968         * class.cs (Method::Define): Track the "static Main" definition to
28969         create an entry point. 
28970
28971         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
28972         EntryPoint if we find it. 
28973
28974         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
28975         (EmitContext::ig): Make this variable public.
28976
28977         * driver.cs: Make the default output file be the first file name
28978         with the .exe extension.  
28979
28980         Detect empty compilations
28981
28982         Handle various kinds of output targets.  Handle --target and
28983         rename -t to --dumper.
28984
28985         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
28986         methods inherited from Expression return now an Expression.  This
28987         will is used during the tree rewriting as we resolve them during
28988         semantic analysis.
28989
28990         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
28991         the spec.  Missing entirely is the information about
28992         accessability of elements of it.
28993
28994         (Expression::ExprClassFromMemberInfo): New constructor for
28995         Expressions that creates a fully initialized Expression based on
28996         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
28997         a Type.
28998
28999         (Invocation::Resolve): Begin implementing resolution of invocations.
29000
29001         * literal.cs (StringLiteral):  Implement Emit.
29002
29003 2001-09-05  Ravi Pratap  <ravi@ximian.com>
29004
29005         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
29006         member.
29007
29008 2001-09-04  Ravi Pratap  <ravi@ximian.com>
29009
29010         * cs-parser.jay (attribute_arguments): Implement actions.
29011         (attribute): Fix bug in production. Implement action.
29012         (attribute_list): Implement.
29013         (attribute_target): Implement.
29014         (attribute_target_specifier, opt_target_specifier): Implement
29015         (CheckAttributeTarget): New method to check if the attribute target
29016         is valid.
29017         (attribute_section): Implement.
29018         (opt_attributes): Implement.
29019
29020         * attribute.cs : New file to handle attributes.
29021         (Attribute): Class to hold attribute info.
29022
29023         * cs-parser.jay (opt_attribute_target_specifier): Remove production
29024         (attribute_section): Modify production to use 2 different rules to 
29025         achieve the same thing. 1 s/r conflict down !
29026         Clean out commented, useless, non-reducing dimension_separator rules.
29027
29028         * class.cs (TypeContainer.attributes): New member to hold list
29029         of attributes for a type.
29030         (Struct::Struct): Modify to take one more argument, the attribute list.
29031         (Class::Class): Ditto.
29032         (Field::Field): Ditto.
29033         (Method::Method): Ditto.
29034         (Property::Property): Ditto.
29035
29036         * cs-parser.jay (struct_declaration): Update constructor call to
29037         pass in the attributes too.
29038         (class_declaration): Ditto.
29039         (constant_declaration): Ditto.
29040         (field_declaration): Ditto.
29041         (method_header): Ditto.
29042         (fixed_parameter): Ditto.
29043         (parameter_array): Ditto.
29044         (property_declaration): Ditto.
29045
29046         * constant.cs (Constant::Constant): Update constructor similarly.
29047         Use System.Collections.
29048
29049         * parameter.cs (Parameter::Parameter): Update as above.
29050
29051 2001-09-02  Ravi Pratap  <ravi@ximian.com>
29052
29053         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
29054         (TypeContainer.delegates): New member to hold list of delegates.
29055
29056         * cs-parser.jay (delegate_declaration): Implement the action correctly 
29057         this time as I seem to be on crack ;-)
29058
29059 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
29060
29061         * rootcontext.cs (RootContext::IsNamespace): new function, used to
29062         tell whether an identifier represents a namespace.
29063
29064         * expression.cs (NamespaceExpr): A namespace expression, used only
29065         temporarly during expression resolution.
29066         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
29067         utility functions to resolve names on expressions.
29068
29069 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
29070
29071         * codegen.cs: Add hook for StatementExpressions. 
29072
29073         * class.cs: Fix inverted test for static flag in methods.
29074
29075 2001-09-02  Ravi Pratap  <ravi@ximian.com>
29076
29077         * class.cs (Operator::CheckUnaryOperator): Correct error number used
29078         to make it coincide with MS' number.
29079         (Operator::CheckBinaryOperator): Ditto.
29080
29081         * ../errors/errors.txt : Remove error numbers added earlier.
29082
29083         * ../errors/cs1019.cs : Test case for error # 1019
29084
29085         * ../errros/cs1020.cs : Test case for error # 1020
29086
29087         * cs-parser.jay : Clean out commented cruft.
29088         (dimension_separators, dimension_separator): Comment out. Ostensibly not
29089         used anywhere - non-reducing rule.
29090         (namespace_declarations): Non-reducing rule - comment out.
29091
29092         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
29093         with TypeContainer::AddEnum.
29094
29095         * delegate.cs : New file for delegate handling classes.
29096         (Delegate): Class for declaring delegates.
29097
29098         * makefile : Update.
29099
29100         * cs-parser.jay (delegate_declaration): Implement.
29101
29102 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
29103
29104         * class.cs (Event::Define): Implement.
29105         (Event.EventBuilder): New member.
29106
29107         * class.cs (TypeContainer::Populate): Update to define all enums and events
29108         we have.
29109         (Events): New property for the events arraylist we hold. Shouldn't we move to using
29110         readonly fields for all these cases ?
29111
29112 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
29113
29114         * class.cs (Property): Revamp to use the convention of making fields readonly.
29115         Accordingly modify code elsewhere.
29116
29117         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
29118         the Define method of the Property class.
29119
29120         * class.cs : Clean up applied patch and update references to variables etc. Fix 
29121         trivial bug.
29122         (TypeContainer::Populate): Update to define all the properties we have. Also
29123         define all enumerations.
29124
29125         * enum.cs (Define): Implement.
29126
29127 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
29128
29129         * cs-parser.jay (overloadable_operator): The semantic value is an
29130         enum of the Operator class.
29131         (operator_declarator): Implement actions.
29132         (operator_declaration): Implement.
29133
29134         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
29135         validity of definitions.
29136         (Operator::CheckBinaryOperator): Static method to check for binary operators
29137         (TypeContainer::AddOperator): New method to add an operator to a type.
29138
29139         * cs-parser.jay (indexer_declaration): Added line to actually call the
29140         AddIndexer method so it gets added ;-)
29141
29142         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
29143         already taken care of by the MS compiler ?  
29144
29145 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
29146
29147         * class.cs (Operator): New class for operator declarations.
29148         (Operator::OpType): Enum for the various operators.
29149
29150 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
29151
29152         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
29153         ostensibly handle this in semantic analysis.
29154
29155         * cs-parser.jay (general_catch_clause): Comment out
29156         (specific_catch_clauses, specific_catch_clause): Ditto.
29157         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
29158         (catch_args, opt_catch_args): New productions.
29159         (catch_clause): Rewrite to use the new productions above
29160         (catch_clauses): Modify accordingly.
29161         (opt_catch_clauses): New production to use in try_statement
29162         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
29163         and re-write the code in the actions to extract the specific and
29164         general catch clauses by being a little smart ;-)
29165
29166         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
29167         Hooray, try and catch statements parse fine !
29168
29169 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29170
29171         * statement.cs (Block::GetVariableType): Fix logic to extract the type
29172         string from the hashtable of variables.
29173
29174         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
29175         I end up making that mistake ;-)
29176         (catch_clauses): Fixed gross error which made Key and Value of the 
29177         DictionaryEntry the same : $1 !!
29178
29179 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29180
29181         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
29182
29183         * cs-parser.jay (event_declaration): Correct to remove the semicolon
29184         when the add and remove accessors are specified. 
29185
29186 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29187
29188         * cs-parser.jay (IndexerDeclaration): New helper class to hold
29189         information about indexer_declarator.
29190         (indexer_declarator): Implement actions.
29191         (parsing_indexer): New local boolean used to keep track of whether
29192         we are parsing indexers or properties. This is necessary because 
29193         implicit_parameters come into picture even for the get accessor in the 
29194         case of an indexer.
29195         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
29196
29197         * class.cs (Indexer): New class for indexer declarations.
29198         (TypeContainer::AddIndexer): New method to add an indexer to a type.
29199         (TypeContainer::indexers): New member to hold list of indexers for the
29200         type.
29201
29202 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
29203
29204         * cs-parser.jay (add_accessor_declaration): Implement action.
29205         (remove_accessor_declaration): Implement action.
29206         (event_accessors_declaration): Implement
29207         (variable_declarators): swap statements for first rule - trivial.
29208
29209         * class.cs (Event): New class to hold information about event
29210         declarations.
29211         (TypeContainer::AddEvent): New method to add an event to a type
29212         (TypeContainer::events): New member to hold list of events.
29213
29214         * cs-parser.jay (event_declaration): Implement actions.
29215
29216 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
29217
29218         * cs-parser.jay (dim_separators): Implement. Make it a string
29219         concatenating all the commas together, just as they appear.
29220         (opt_dim_separators): Modify accordingly
29221         (rank_specifiers): Update accordingly. Basically do the same
29222         thing - instead, collect the brackets here.
29223         (opt_rank_sepcifiers): Modify accordingly.
29224         (array_type): Modify to actually return the complete type string
29225         instead of ignoring the rank_specifiers.
29226         (expression_list): Implement to collect the expressions
29227         (variable_initializer): Implement. We make it a list of expressions
29228         essentially so that we can handle the array_initializer case neatly too.
29229         (variable_initializer_list): Implement.
29230         (array_initializer): Make it a list of variable_initializers
29231         (opt_array_initializer): Modify accordingly.
29232
29233         * expression.cs (New::NType): Add enumeration to help us
29234         keep track of whether we have an object/delegate creation
29235         or an array creation.
29236         (New:NewType, New::Rank, New::Indices, New::Initializers): New
29237         members to hold data about array creation.
29238         (New:New): Modify to update NewType
29239         (New:New): New Overloaded contructor for the array creation
29240         case.
29241
29242         * cs-parser.jay (array_creation_expression): Implement to call
29243         the overloaded New constructor.
29244
29245 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
29246
29247         * class.cs (TypeContainer::Constructors): Return member
29248         constructors instead of returning null.
29249
29250 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
29251
29252         * typemanager.cs (InitCoreTypes): Initialize the various core
29253         types after we have populated the type manager with the user
29254         defined types (this distinction will be important later while
29255         compiling corlib.dll)
29256
29257         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29258         on Expression Classification.  Now all expressions have a method
29259         `Resolve' and a method `Emit'.
29260
29261         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29262         generation from working.     Also add some temporary debugging
29263         code. 
29264
29265 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
29266
29267         * codegen.cs: Lots of code generation pieces.  This is only the
29268         beginning, will continue tomorrow with more touches of polish.  We
29269         handle the fundamentals of if, while, do, for, return.  Others are
29270         trickier and I need to start working on invocations soon.
29271
29272         * gen-treedump.cs: Bug fix, use s.Increment here instead of
29273         s.InitStatement. 
29274
29275         * codegen.cs (EmitContext): New struct, used during code
29276         emission to keep a context.   Most of the code generation will be
29277         here. 
29278
29279         * cs-parser.jay: Add embedded blocks to the list of statements of
29280         this block.  So code generation proceeds in a top down fashion.
29281
29282 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
29283
29284         * statement.cs: Add support for multiple child blocks.
29285
29286 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
29287
29288         * codegen.cs (EmitCode): New function, will emit the code for a
29289         Block of code given a TypeContainer and its ILGenerator. 
29290
29291         * statement.cs (Block): Standard public readonly optimization.
29292         (Block::Block constructors): Link children. 
29293         (Block::Child): Child Linker.
29294         (Block::EmitVariables): Emits IL variable declarations.
29295
29296         * class.cs: Drop support for MethodGroups here, delay until
29297         Semantic Analysis.
29298         (Method::): Applied the same simplification that I did before, and
29299         move from Properties to public readonly fields.
29300         (Method::ParameterTypes): Returns the parameter types for the
29301         function, and implements a cache that will be useful later when I
29302         do error checking and the semantic analysis on the methods is
29303         performed.
29304         (Constructor::GetCallingConvention): Renamed from CallingConvetion
29305         and made a method, optional argument tells whether this is a class
29306         or a structure to apply the `has-this' bit.
29307         (Method::GetCallingConvention): Implement, returns the calling
29308         convention. 
29309         (Method::Define): Defines the type, a second pass is performed
29310         later to populate the methods.
29311
29312         (Constructor::ParameterTypes): implement a cache similar to the
29313         one on Method::ParameterTypes, useful later when we do semantic
29314         analysis. 
29315
29316         (TypeContainer::EmitMethod):  New method.  Emits methods.
29317
29318         * expression.cs: Removed MethodGroup class from here.
29319
29320         * parameter.cs (Parameters::GetCallingConvention): new method.
29321
29322 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
29323
29324         * class.cs (TypeContainer::Populate): Drop RootContext from the
29325         argument. 
29326
29327         (Constructor::CallingConvention): Returns the calling convention.
29328         (Constructor::ParameterTypes): Returns the constructor parameter
29329         types. 
29330
29331         (TypeContainer::AddConstructor): Keep track of default constructor
29332         and the default static constructor.
29333
29334         (Constructor::) Another class that starts using `public readonly'
29335         instead of properties. 
29336
29337         (Constructor::IsDefault): Whether this is a default constructor. 
29338
29339         (Field::) use readonly public fields instead of properties also.
29340
29341         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29342         track of static constructors;  If none is used, turn on
29343         BeforeFieldInit in the TypeAttributes. 
29344
29345         * cs-parser.jay (opt_argument_list): now the return can be null
29346         for the cases where there are no arguments. 
29347
29348         (constructor_declarator): If there is no implicit `base' or
29349         `this', then invoke the default parent constructor. 
29350
29351         * modifiers.cs (MethodAttr): New static function maps a set of
29352         modifiers flags into a MethodAttributes enum
29353         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
29354         MethodAttr, TypeAttr to represent the various mappings where the
29355         modifiers are used.
29356         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
29357
29358 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
29359
29360         * parameter.cs (GetParameterInfo): Fix bug where there would be no
29361         method arguments.
29362
29363         * interface.cs (PopulateIndexer): Implemented the code generator
29364         for interface indexers.
29365
29366 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
29367
29368         * interface.cs (InterfaceMemberBase): Now we track the new status
29369         here.  
29370
29371         (PopulateProperty): Implement property population.  Woohoo!  Got
29372         Methods and Properties going today. 
29373
29374         Removed all the properties for interfaces, and replaced them with
29375         `public readonly' fields. 
29376
29377 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
29378
29379         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29380         initialize their hashtables/arraylists only when they are needed
29381         instead of doing this always.
29382
29383         * parameter.cs: Handle refs and out parameters.
29384
29385         * cs-parser.jay: Use an ArrayList to construct the arguments
29386         instead of the ParameterCollection, and then cast that to a
29387         Parameter[] array.
29388
29389         * parameter.cs: Drop the use of ParameterCollection and use
29390         instead arrays of Parameters.
29391
29392         (GetParameterInfo): Use the Type, not the Name when resolving
29393         types. 
29394
29395 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
29396
29397         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29398         and instead use public readonly fields.
29399
29400         * class.cs: Put back walking code for type containers.
29401
29402 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
29403
29404         * class.cs (MakeConstant): Code to define constants.
29405
29406         * rootcontext.cs (LookupType): New function.  Used to locate types 
29407
29408
29409 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
29410
29411         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
29412         this System.Reflection code is.  Kudos to Microsoft
29413
29414         * typemanager.cs: Implement a type cache and avoid loading all
29415         types at boot time.  Wrap in LookupType the internals.  This made
29416         the compiler so much faster.  Wow.  I rule!
29417
29418         * driver.cs: Make sure we always load mscorlib first (for
29419         debugging purposes, nothing really important).
29420
29421         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
29422         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
29423
29424         * rootcontext.cs: Lookup types on their namespace;  Lookup types
29425         on namespaces that have been imported using the `using' keyword.
29426
29427         * class.cs (TypeContainer::TypeAttr): Virtualize.
29428         (Class::TypeAttr): Return attributes suitable for this bad boy.
29429         (Struct::TypeAttr): ditto.
29430         Handle nested classes.
29431         (TypeContainer::) Remove all the type visiting code, it is now
29432         replaced with the rootcontext.cs code
29433
29434         * rootcontext.cs (GetClassBases): Added support for structs. 
29435
29436 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
29437
29438         * interface.cs, statement.cs, class.cs, parameter.cs,
29439         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29440         Drop use of TypeRefs, and use strings instead.
29441
29442 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
29443
29444         * rootcontext.cs: 
29445
29446         * class.cs (Struct::Struct): set the SEALED flags after
29447         checking the modifiers.
29448         (TypeContainer::TypeAttr): new property, returns the
29449         TypeAttributes for a class.  
29450
29451         * cs-parser.jay (type_list): Oops, list production was creating a
29452         new list of base types.
29453
29454         * rootcontext.cs (StdLib): New property.
29455         (GetInterfaceTypeByName): returns an interface by type name, and
29456         encapsulates error handling here.
29457         (GetInterfaces): simplified.
29458         (ResolveTree): Encapsulated all the tree resolution here.
29459         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29460         types. 
29461
29462         * driver.cs: Add support for --nostdlib, to avoid loading the
29463         default assemblies.
29464         (Main): Do not put tree resolution here. 
29465
29466         * rootcontext.cs: Beginning of the class resolution.
29467
29468 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
29469
29470         * rootcontext.cs: Provide better error reporting. 
29471
29472         * cs-parser.jay (interface_base): set our $$ to be interfaces.
29473
29474         * rootcontext.cs (CreateInterface): Handle the case where there
29475         are no parent interfaces.
29476
29477         (CloseTypes): Routine to flush types at the end.
29478         (CreateInterface): Track types.
29479         (GetInterfaces): Returns an array of Types from the list of
29480         defined interfaces.
29481
29482         * typemanager.c (AddUserType): Mechanism to track user types (puts
29483         the type on the global type hash, and allows us to close it at the
29484         end). 
29485
29486 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
29487
29488         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29489         RecordInterface instead.
29490
29491         * cs-parser.jay: Updated to reflect changes above.
29492
29493         * decl.cs (Definition): Keep track of the TypeBuilder type that
29494         represents this type here.  Not sure we will use it in the long
29495         run, but wont hurt for now.
29496
29497         * driver.cs: Smaller changes to accomodate the new code.
29498
29499         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29500         when done. 
29501
29502         * rootcontext.cs (CreateInterface):  New method, used to create
29503         the System.TypeBuilder type for interfaces.
29504         (ResolveInterfaces): new entry point to resolve the interface
29505         hierarchy. 
29506         (CodeGen): Property, used to keep track of the code generator.
29507
29508 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
29509
29510         * cs-parser.jay: Add a second production for delegate_declaration
29511         with `VOID'.
29512
29513         (enum_body): Put an opt_comma here instead of putting it on
29514         enum_body or enum_member_declarations so we can handle trailing
29515         commas on enumeration members.  Gets rid of a shift/reduce.
29516
29517         (type_list): Need a COMMA in the middle.
29518
29519         (indexer_declaration): Tell tokenizer to recognize get/set
29520
29521         * Remove old targets.
29522
29523         * Re-add the parser target.
29524
29525 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29526
29527         * cs-parser.jay: Add precendence rules for a number of operators
29528         ot reduce the number of shift/reduce conflicts in the grammar.
29529
29530 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
29531
29532         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29533         and put it here.
29534
29535         Get rid of old crufty code.
29536
29537         * rootcontext.cs: Use this to keep track of the parsed
29538         representation and the defined types available to the program. 
29539
29540         * gen-treedump.cs: adjust for new convention.
29541
29542         * type.cs: Split out the type manager, and the assembly builder
29543         from here. 
29544
29545         * typemanager.cs: the type manager will live here now.
29546
29547         * cil-codegen.cs: And the code generator here. 
29548
29549 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
29550
29551         * makefile: Fixed up for easy making.
29552
29553 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29554
29555         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29556         the 
29557
29558         (unary_expression): Expand pre_increment_expression and
29559         post_decrement_expression to reduce a shift/reduce.
29560
29561 2001-07-11  Simon Cozens
29562
29563         * cs-tokenizer.cs: Hex numbers should begin with a 0.
29564
29565         Improve allow_keyword_as_indent name.
29566
29567 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
29568
29569         * Adjustments for Beta2. 
29570
29571 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
29572
29573         * decl.cs: Added `Define' abstract method.
29574         (InTransit): new property, used to catch recursive definitions. 
29575
29576         * interface.cs: Implement `Define'. 
29577
29578         * modifiers.cs: Map Modifiers.constants to
29579         System.Reflection.TypeAttribute flags.
29580
29581         * class.cs: Keep track of types and user-defined types.
29582         (BuilderInit): New method for creating an assembly
29583         (ResolveType): New function to launch the resolution process, only
29584         used by interfaces for now.
29585
29586         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29587         that are inserted into the name space. 
29588
29589 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
29590
29591         * ARGH.  I have screwed up my tree so many times due to the use of
29592         rsync rather than using CVS.  Going to fix this at once. 
29593
29594         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
29595         load types.
29596
29597 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
29598
29599         * Experiment successful: Use System.Type rather that our own
29600         version of Type.  
29601
29602 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
29603
29604         * cs-parser.jay: Removed nsAliases from here.
29605
29606         Use new namespaces, handle `using XXX;' 
29607
29608         * namespace.cs: Reimplemented namespace handling, use a recursive
29609         definition of the class.  Now we can keep track of using clauses
29610         and catch invalid using clauses.
29611
29612 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
29613
29614         * gen-treedump.cs: Adapted for all the renaming.
29615
29616         * expression.cs (Expression): this class now has a Type property
29617         which returns an expression Type.
29618
29619         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29620         `Type', as this has a different meaning now in the base
29621
29622 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
29623
29624         * interface.cs, class.cs: Removed from all the sources the
29625         references to signature computation, as we can not do method
29626         signature computation during the parsing time, as we are not
29627         trying to solve at that point distinguishing:
29628
29629         class X {
29630                 void a (Blah x) {}
29631                 void a (NS.Blah x) {}
29632         }
29633
29634         Which depending on the context might be valid or not, as we do not
29635         know if Blah is the same thing as NS.Blah at that point.
29636
29637         * Redid everything so the code uses TypeRefs now instead of
29638         Types.  TypeRefs are just temporary type placeholders, that need
29639         to be resolved.  They initially have a pointer to a string and the
29640         current scope in which they are used.  This is used later by the
29641         compiler to resolve the reference to an actual Type. 
29642
29643         * DeclSpace is no longer a CIR.Type, and neither are
29644         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
29645         are all DeclSpaces, but no Types. 
29646
29647         * type.cs (TypeRefManager): This implements the TypeRef manager,
29648         which keeps track of all the types that need to be resolved after
29649         the parsing has finished. 
29650
29651 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
29652
29653         * ARGH.  We are going to have to store `foreach' as a class rather
29654         than resolving it, as we need to verify error 1579 after name
29655         resolution.   *OR* we could keep a flag that says `This request to
29656         IEnumerator comes from a foreach statement' which we can then use
29657         to generate the error.
29658
29659 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
29660
29661         * class.cs (TypeContainer.AddMethod): we now add methods to the
29662         MethodGroup instead of the method hashtable.  
29663
29664         * expression.cs: Add MethodGroup abstraction, which gets us one
29665         step closer to the specification in the way we handle method
29666         declarations.  
29667
29668         * cs-parser.jay (primary_expression): qualified_identifier now
29669         tried to match up an identifier to a local variable reference or
29670         to a parameter reference.
29671
29672         current_local_parameters is now a parser global variable that
29673         points to the current parameters for the block, used during name
29674         lookup.
29675
29676         (property_declaration): Now creates an implicit `value' argument to
29677         the set accessor.
29678
29679 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
29680
29681         * parameter.cs: Do not use `param' arguments as part of the
29682         signature, per the spec.
29683
29684 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
29685
29686         * decl.cs: Base class for classes, structs and interfaces.  This
29687         is the "Declaration Space" 
29688
29689         * cs-parser.jay: Use CheckDef for checking declaration errors
29690         instead of having one on each function.
29691
29692         * class.cs: Factor out some code for handling error handling in
29693         accordance to the "Declarations" section in the "Basic Concepts"
29694         chapter in the ECMA C# spec.
29695
29696         * interface.cs: Make all interface member classes derive from
29697         InterfaceMemberBase.
29698
29699 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
29700
29701         * Many things: all interfaces are parsed and generated in
29702         gen-treedump.  Support for member variables, constructors,
29703         destructors, properties, constants is there.
29704
29705         Beginning of the IL backend, but very little done, just there for
29706         testing purposes. 
29707
29708 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
29709
29710         * cs-parser.jay: Fix labeled statement.
29711
29712         * cs-tokenizer.cs (escape): Escape " and ' always.
29713         ref_line, ref_name: keep track of the line/filename as instructed
29714         by #line by the compiler.
29715         Parse #line.
29716
29717 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
29718
29719         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29720         to match the values in System.CodeDOM.
29721
29722         Divid renamed to Divide.
29723
29724         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29725         statements. 
29726         (Statements.set): remove.
29727
29728         * System.CodeDOM/CodeCatchClause.cs: always have a valid
29729         statements. 
29730
29731         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29732         falseStatements always have valid values. 
29733
29734         * cs-parser.jay: Use System.CodeDOM now.
29735