2008-07-10 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-07-10  Marek Safar  <marek.safar@gmail.com>
2
3         * report.cs, ecore.cs: Flush recorder only when silent mode is off.
4
5 2008-07-10  Raja R Harinath  <harinath@hurrynot.org>
6
7         Fix bug #314902
8         * cs-tokenizer.cs (is_punct): If a generic lookahead is looking
9         only one '>', and finds a '>>', abort the generic lookahead.
10
11 2008-07-10  Marek Safar  <marek.safar@gmail.com>
12
13         A fix for bug #319902
14         * cs-tokenizer.cs: Always look-ahed for `>='  when tokenizing `>'.
15
16 2008-07-10  Marek Safar  <marek.safar@gmail.com>
17
18         A fix for bug #406371
19         * statement.cs: Moved EmitSymbolInfo to Block.
20
21 2008-07-09  Marek Safar  <marek.safar@gmail.com>
22
23         * ecore.cs: Report better error for extension method overload failures.
24
25 2008-07-09  Marek Safar  <marek.safar@gmail.com>
26
27         * expression.cs (Is): No need to box reference values.
28
29 2008-07-09  Marek Safar  <marek.safar@gmail.com>
30
31         * class.cs: Use event resolve context when initializing CreateEmitContext.
32
33 2008-07-09  Marek Safar  <marek.safar@gmail.com>
34
35         A fix for bug #394436
36         * anonymous.cs, class.cs, expression.cs, lambda.cs: Emit correctly extension
37         method used inside expression trees. Added more LINQ to expression tree
38         conversions.
39
40 2008-07-08  Marek Safar  <marek.safar@gmail.com>
41
42         A fix for bug #378189, #370577
43         * lambda.cs, ecore.cs: Implemented 3.0 enhancement to better conversion
44         from expression.
45
46 2008-07-08  Marek Safar  <marek.safar@gmail.com>
47
48         * anonymous.cs, class.cs, decl.cs: Emit CompilerGenerated attribute
49         hierarchically.
50
51 2008-07-08  Marek Safar  <marek.safar@gmail.com>
52
53         A fix for bug #406702
54         * anonymous.cs: Always park anonymous method in the nearest parent storey.
55
56 2008-07-07  Marek Safar  <marek.safar@gmail.com>
57
58         A fix for bug #406648
59         * cs-parser.jay: Report nullable use in mcs for some cases.
60
61 2008-07-07  Marek Safar  <marek.safar@gmail.com>
62
63         * ecore.cs: Improved argument mismatch error messages.
64
65 2008-07-07  Marek Safar  <marek.safar@gmail.com>
66
67         * anonymous.cs: Don't cache generic delegates when reference MVAR argument.
68
69 2008-07-07  Marek Safar  <marek.safar@gmail.com>
70
71         * expression.cs (TypeOf): Mutate type argument.
72
73 2008-07-04  Marek Safar  <marek.safar@gmail.com>
74
75         * class.cs: Report missing partial modifier for correct type.
76
77 2008-07-04  Marek Safar  <marek.safar@gmail.com>
78
79         * ecore.cs, expression.cs (VariableReference): Variable property is 
80         protected.
81
82 2008-07-04  Marek Safar  <marek.safar@gmail.com>
83
84         * ecore.cs, convert.cs: Made OpcodeCast more memory efficient.
85         
86 2008-07-04  Marek Safar  <marek.safar@gmail.com>
87
88         * anonymous.cs, class.cs, lambda.cs, iterator.cs: Cache static anonymous
89         method delegates.
90
91 2008-07-04  Marek Safar  <marek.safar@gmail.com>
92
93         * anonymous.cs, class.cs, expression.cs, iterator.cs, statement.cs: Reduce
94         anonymous method storey to an instance method when only "this" is hoisted.
95
96 2008-07-03  Marek Safar  <marek.safar@gmail.com>
97
98         A fix for bug #321615
99         * expression.cs: Pointer comparisons use unsigned operator.
100
101 2008-07-03  Marek Safar  <marek.safar@gmail.com>
102
103         * expression.cs: Fixed native pointer conversions. Also fixes #321615.
104
105 2008-07-02  Marek Safar  <marek.safar@gmail.com>
106
107         A fix for bug #404905
108         * class.cs: Always initialize local unsafe variables.
109
110 2008-06-30  Marek Safar  <marek.safar@gmail.com>
111
112         A fix for bug #396987
113         * expression.cs (NewInitialize): Clear local temporary variable for next run
114
115 2008-06-27  Marek Safar  <marek.safar@gmail.com>
116
117         A fix for bug #401020
118         * ecore.cs: Both types and modifiers have to match for ref and out arguments
119
120 2008-06-27  Marek Safar  <marek.safar@gmail.com>
121
122         A fix for bug #398319
123         * cs-parser.jay: Implemented undocumented base access expression inside
124         anonymous types.
125
126 2008-06-26  Marek Safar  <marek.safar@gmail.com>
127
128         A fix for bug #404227
129         * cs-parser.jay: Parse namespace declaration using qualified identifier.
130
131 2008-06-26  Marek Safar  <marek.safar@gmail.com>
132
133         A fix for bug #404227
134         * convert.cs: Fixed explicit array to interface cast.
135
136 2008-06-26  Marek Safar  <marek.safar@gmail.com>
137
138         A fix for bug #403894
139         * delegate.cs: Mutate DelegateInvocation type.
140
141 2008-06-26  Marek Safar  <marek.safar@gmail.com>
142
143         A fix for bug #379348
144         * delegate.cs: Box a load of generic parameters.
145
146 2008-06-26  Marek Safar  <marek.safar@gmail.com>
147
148         * expression.cs: Add an array creation arguments mutate.
149
150 2008-06-26  Marek Safar  <marek.safar@gmail.com>
151
152         A fix for bug #386068
153         * anonymous.cs, expression.cs: Emit correctly hoisted expression tree
154         parameter.
155
156 2008-06-25  Marek Safar  <marek.safar@gmail.com>
157
158         * ecore.cs, expression.cs: Fixed broken TypeCast clone, implemented few more
159         CloneTo.
160
161 2008-06-25  Marek Safar  <marek.safar@gmail.com>
162
163         A fix for bug #403518
164         * delegate.cs: Type correctly anonymous method new invocation.
165
166 2008-06-24  Marek Safar  <marek.safar@gmail.com>
167
168         A fix for bug #394826
169         * anonymous.cs: Fully qualify members when resolving anonymous type internal
170         calls.
171
172 2008-06-24  Marek Safar  <marek.safar@gmail.com>
173
174         A fix for bug #394826
175         * anonymous.cs, iterators.cs: Construct generic storey only when is really
176         needed.
177
178 2008-06-24  Marek Safar  <marek.safar@gmail.com>
179
180         * class.cs: Clone indexer parameters for localized capturing.
181
182 2008-06-24  Marek Safar  <marek.safar@gmail.com>
183
184         A fix for bug #402379
185         * expression.cs: Don't crash when an object initializer resolve fails.
186
187 2008-06-24  Marek Safar  <marek.safar@gmail.com>
188
189         A fix for bug #402888
190         * expression.cs: Mutate conditional expression.
191
192 2008-06-24  Marek Safar  <marek.safar@gmail.com>
193
194         A fix for bug #401012
195         * class.cs: Keep StructLayout in shared container.
196
197 2008-06-24  Marek Safar  <marek.safar@gmail.com>
198
199         A fix for bug #400438
200         * decl.cs, class.cs: Only properties can be automatically implemented.
201
202 2008-06-24  Marek Safar  <marek.safar@gmail.com>
203
204         * statement.cs (ChangeToIterator): Copy also labels.
205
206 2008-06-23  Marek Safar  <marek.safar@gmail.com>
207
208         * ecore.cs: Pass type argument details to parent extension method.
209
210 2008-06-23  Marek Safar  <marek.safar@gmail.com>
211
212         A fix for bug #375966
213         * delegate.cs: Fixed IsTypeCovariant generic type conversions.
214
215 2008-06-23  Raja R Harinath  <harinath@hurrynot.org>
216
217         * Makefile (bootstrap-libs): Pass NO_DIR_CHECK to sub-make.
218
219 2008-06-22  Marek Safar  <marek.safar@gmail.com>
220
221         A fix for bug #394347
222         * anonymous.cs: Cache compatible delegates as compatibility check produces
223         a new method every time.
224
225 2008-06-20  Marek Safar  <marek.safar@gmail.com>
226
227         * anonymous.cs: Propagate storey reference for single references.
228
229 2008-06-20  Marek Safar  <marek.safar@gmail.com>
230
231         A fix for bug #387615
232         * assign.cs, expression.cs: Correctly clone compound assignment.
233
234 2008-06-19  Marek Safar  <marek.safar@gmail.com>
235
236         A fix for bug #359611, #359604
237         * anonymous.cs: Mutate all types of hoisted parameters.
238
239 2008-06-19  Marek Safar  <marek.safar@gmail.com>
240
241         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
242         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
243         expression.cs, codegen.cs, statement.cs
244         
245         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
246         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
247         
248         ** Anonymous methods, lambda expressions rewrite **
249         
250         Anonymous expressions are now resolved when an explicit block is resolved 
251         and they don't require any registration procedure anymore. Further,
252         anonymous methods are defined when explicit block is emitted which allows
253         better control of whole process and opens possibilities for more
254         optimizations as well as alternative to reverse whole process.
255         
256         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
257         process consistent and to correctly emit hoisted generic methods when they
258         have at least 1 hoisted variable.
259         
260 2008-06-17  Martin Baulig  <martin@ximian.com>
261
262         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
263         iterator method.
264         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
265         virtual property; check it in Emit().
266         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
267         an iterator.
268         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
269         an iterator.
270         (Indexer.Define): Likewise.
271
272 2008-06-17  Marek Safar  <marek.safar@gmail.com>
273
274         * convert.cs: Don't use IsInterface on type arguments.
275         
276         * delegate.cs: DelegateInvocation uses MethodInfo.
277         
278         * parameter.cs: Removed IsTypeParameter.
279         
280         * generic-mcs.cs: More missing stuff.
281
282 2008-06-16  Martin Baulig  <martin@ximian.com>
283
284         * modifiers.cs
285         (Modifiers.DEBUGGER_HIDDEN): New public const.
286
287         * typemanager.cs
288         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
289
290         * class.cs
291         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
292         (AbstractPropertyEventMethod): Likewise.
293         (Constructor.Emit): Likewise.
294         (SourceMethod.SetCompilerGenerated): Removed.
295
296         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
297         on MoveNext().
298
299         * anonymous.cs
300         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
301         if we're an `IteratorHost'.
302         (AnonymousMethodMethod..ctor): Don't set
303         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
304         not on the method.
305
306 2008-06-16  Marek Safar  <marek.safar@gmail.com>
307
308         * statement.cs: Clean-up foreach statements.
309
310 2008-06-12  Marek Safar  <marek.safar@gmail.com>
311
312         * class.cs: Stop using public method which should not exist.
313
314 2008-06-11  Martin Baulig  <martin@ximian.com>
315
316         * location.cs
317         (Location.LookupFile): Add `CompilationUnit' argument; when given
318         a relative file name, make it relative to the directory the .cs
319         file is located in instead of using the current directory.
320
321 2008-06-11  Martin Baulig  <martin@ximian.com>
322
323         * class.cs
324         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
325         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
326         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
327         (SourceMethod.SetCompilerGenerated): Likewise.
328
329 2008-06-11  Marek Safar  <marek.safar@gmail.com>
330
331         * codegen.cs, driver: Only write symbol file when it's asked for.
332
333 2008-06-11  Marek Safar  <marek.safar@gmail.com>
334
335         * codegen.cs: Don't use assembly writer error handling for symbol writer.
336
337 2008-06-10  Martin Baulig  <martin@ximian.com>
338
339         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
340
341 2008-06-09  Marek Safar  <marek.safar@gmail.com>
342
343         A fix for bug #316290
344         * expression.cs: Include decimal operators in predefined table.
345         
346         * parameters.cs: More readonlyness.
347
348 2008-06-09  Marek Safar  <marek.safar@gmail.com>
349
350         A fix for bug #397213
351         * cs-parser.jay: One more missing current_local_parameters reset.
352
353 2008-06-09  Marek Safar  <marek.safar@gmail.com>
354
355         A fix for bug #396633
356         * class.cs: Host backing field in partial container.
357
358 2008-06-09  Marek Safar  <marek.safar@gmail.com>
359
360         A fix for bug #397068
361         * expression.cs: Check both operand types when predefined operator is used.
362
363 2008-06-05  Martin Baulig  <martin@ximian.com>
364
365         Merged the `debugger-kahalo' branch.
366
367         * class.cs
368         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
369         we're an iterator method.
370         (SourceMethod): Reflect latest symbol writer changes;
371         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
372         now `start_row' and `end_row'.
373         (Constructor.Emit): Fix the logic whether to emit symbol information.
374
375         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
376         generated methods.
377
378         * location.cs
379         (CompilationUnit): New public class; derives from `SourceFile'.
380         (SourceFileEntry.DefineSymbolInfo): New public method.
381         (SourceFileEntry.SetChecksum): New public method.
382         (Location): Encode hidden line numbers by using `column == 255';
383         the .ctor now accepts `column == -1' to mark a hidden line number.
384         (Location.Hidden): New public property.
385         (Location.CheckPoint): Add `CompilationUnit'.
386         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
387         (Location.Push): Add `CompilationUnit compile_unit' argument.
388         (Location.CompilationUnit): New public property.
389
390         * statement.cs
391         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
392
393         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
394
395         * driver.cs: `SourceFile' -> `CompilationUnit'.
396
397         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
398
399         * namespace.cs: `SourceFile' -> `CompilationUnit'.
400
401         * cs-tokenizer.cs: Add support for `#pragma checksum' and
402         `#line hidden'.
403
404         * symbolwriter.cs
405         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
406         new symbol writer API to also pass the file.
407
408 2008-06-05  Marek Safar  <marek.safar@gmail.com>
409
410         * statement.cs: Emit catch variable assignment using variable expression.
411         
412 2008-06-05  Marek Safar  <marek.safar@gmail.com>
413
414         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
415         with other variable types.
416
417 2008-06-04  Marek Safar  <marek.safar@gmail.com>
418
419         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
420         GetLength method emit, it breaks resolve rules.
421         
422 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
423             Marek Safar  <marek.safar@gmail.com>
424                         
425         A fix for bug #395542
426         * cs-parser.jay: The trailing comma is allowed in anonymous type member
427         declaration.
428         
429 2008-06-02  Marek Safar  <marek.safar@gmail.com>
430
431         A fix for bug #395287
432         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
433
434 2008-05-31  Marek Safar  <marek.safar@gmail.com>
435
436         A fix for bug #395845
437         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
438         non-nullable parameter type.
439         
440 2008-05-31  Marek Safar  <marek.safar@gmail.com>
441
442         * class.cs: Handle contructor initializer as a statement in top-level block.
443
444 2008-05-30  Marek Safar  <marek.safar@gmail.com>
445
446         * attribute.cs: Don't mix old and new corlib types when emitting corlib
447         security attributes.
448
449 2008-05-24  Marek Safar  <marek.safar@gmail.com>
450
451         * ecore.cs, expression.cs: Small IVariable refactoring.
452
453 2008-05-22  Marek Safar  <marek.safar@gmail.com>
454
455         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
456
457 2008-05-21  Marek Safar  <marek.safar@gmail.com>
458
459         * cs-parser.jay: Removed redundant catch type check.
460
461 2008-05-21  Marek Safar  <marek.safar@gmail.com>
462
463         A fix for bug #390372
464         * nullable.cs: Set correct return type.
465
466 2008-05-21  Marek Safar  <marek.safar@gmail.com>
467
468         A fix for bug #391062
469         * typemanager.cs: Fixed crash when comparing null types.
470
471 2008-05-21  Marek Safar  <marek.safar@gmail.com>
472
473         A fix for bug #391871
474         * cs-parser.jay: Better error handling for invalid catch type.
475
476 2008-05-20  Marek Safar  <marek.safar@gmail.com>
477
478         A fix for bug #392155
479         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
480
481 2008-05-15  Marek Safar  <marek.safar@gmail.com>
482
483         A fix for bug #390666
484         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
485         expressions.
486
487 2008-05-15  Marek Safar  <marek.safar@gmail.com>
488
489         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
490         in getter.
491
492 2008-05-13  Marek Safar  <marek.safar@gmail.com>
493
494         A fix for bug #389625
495         * delegate.cs, generic.cs: Some progress on method group return type
496         inference.
497
498 2008-05-13  Marek Safar  <marek.safar@gmail.com>
499
500         A fix for bug #378419
501         * namespace.cs: Inspect also parent namespaces not only namespace entries.
502
503 2008-05-12  Marek Safar  <marek.safar@gmail.com>
504
505         * class.cs (Constructor): Added IsCompilerGenerated.
506
507 2008-05-12  Marek Safar  <marek.safar@gmail.com>
508
509         * expression.cs: Enum binary operators can accept non-enum operand only when
510         is implicitly convertible to underlying type.
511
512 2008-05-12  Marek Safar  <marek.safar@gmail.com>
513
514         A fix for bug #389272
515         * support.cs: Workaround System.InvalidOperationException for enums.
516
517 2008-05-12  Marek Safar  <marek.safar@gmail.com>
518
519         A fix for bug #389073
520         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
521
522 2008-05-10  Marek Safar  <marek.safar@gmail.com>
523
524         * driver.cs: Split Parse.
525         
526         * location.cs (LookupFile): Uses string.Empty.
527
528 2008-05-07  Marek Safar  <marek.safar@gmail.com>
529
530         * expression.cs, parameter.cs: Small ParameterReference clean up.
531
532 2008-05-07  Marek Safar  <marek.safar@gmail.com>
533
534         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
535         hack. Fixes #387502.
536
537 2008-05-06  Martin Baulig  <martin@ximian.com>
538
539         * class.cs (Constructor.Emit): Fix the logic whether to emit
540         symbol information.
541
542 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
543
544         Fix #385503
545         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
546         InvalidOperationException when the iterator is before the start or
547         after the end.
548
549 2008-05-06  Marek Safar  <marek.safar@gmail.com>
550
551         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
552         when left is nullable type.
553
554 2008-05-06  Marek Safar  <marek.safar@gmail.com>
555
556         A fix for bug #386628
557         * expression.cs (LocalVariableReference): Continue in resolving when
558         variable is not assigned.
559
560 2008-05-05  Marek Safar  <marek.safar@gmail.com>
561
562         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
563         nullable operations.
564
565 2008-05-04  Marek Safar  <marek.safar@gmail.com>
566
567         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
568         it saves many redundant temporary variables for nullable operations.
569
570 2008-05-03  Marek Safar  <marek.safar@gmail.com>
571
572         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
573         
574         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
575         method.
576         
577         * nullable.cs: Constant coalescing operator optimizations.
578
579 2008-05-03  Marek Safar  <marek.safar@gmail.com>
580
581         * constant.cs: Use unsigned conversion for values which are unsigned only.
582
583 2008-05-03  Marek Safar  <marek.safar@gmail.com>
584
585         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
586         coalescing operator as it should be.
587
588 2008-05-02  Marek Safar  <marek.safar@gmail.com>
589
590         A fix for bug #371016
591         * expression.cs: All predefined delegate operators require implicit method
592         group conversion.
593         
594 2008-05-02  Marek Safar  <marek.safar@gmail.com>
595
596         * constant.cs: Emit long constant as uint when fits the range.
597         
598         * convert.cs, expression.cs: Fixed few unsafe conversions.
599
600 2008-05-02  Marek Safar  <marek.safar@gmail.com>
601
602         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
603
604 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
605
606         Fix #385758
607         * convert.cs (ImplicitNumericConversion): Don't modify the type of
608         'expr'.
609         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
610
611 2008-05-01  Marek Safar  <marek.safar@gmail.com>
612
613         * constant.cs, literal.cs: IsLiteral property for error reporting.
614         
615         * ecore.cs, expression.cs: Implemented Property expression.
616
617 2008-05-01  Marek Safar  <marek.safar@gmail.com>
618
619         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
620         
621         * nullable.cs: Implemented nullable coalescing null operator.
622
623         * ecore.cs, expression.cs: Expression trees work.
624
625 2008-05-01  Marek Safar  <marek.safar@gmail.com>
626
627         * ecore.cs: CreateExpressionTree is finally abstract.
628
629         * expression.cs, linq.cs: Updated.
630
631 2008-05-01  Marek Safar  <marek.safar@gmail.com>
632
633         * expression.cs, ecore.cs: Block base access expression inside expression
634         tree.
635
636 2008-05-01  Marek Safar  <marek.safar@gmail.com>
637
638         A fix for bug #385058
639         * expression.cs: User-defined operator implementations always take
640         precedence over predefined operator implementations.
641
642 2008-04-30  Marek Safar  <marek.safar@gmail.com>
643
644         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
645         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
646         expression tree conversions.
647         
648 2008-04-30  Marek Safar  <marek.safar@gmail.com>
649
650         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
651         operators method details to Operator class.
652
653 2008-04-30  Marek Safar  <marek.safar@gmail.com>
654
655         * anonymous.cs: Pass unsafe flags to anonymous container.
656         
657         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
658         inside expression tree.
659
660 2008-04-29  Martin Baulig  <martin@ximian.com>
661
662         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
663         (Tokenizer.PopPosition): Also restore the `line'.
664
665 2008-04-29  Marek Safar  <marek.safar@gmail.com>
666
667         * delegate.cs: Implemented Invoke expression.
668
669 2008-04-29  Marek Safar  <marek.safar@gmail.com>
670
671         * expression.cs: Fixed equality reference comparison regression.
672
673 2008-04-29  Marek Safar  <marek.safar@gmail.com>
674
675         * ecore.cs: Clean up EmptyCast hack.
676         
677         * expression.cs, nullable.cs: Implemented enum binary and unary operations
678         using correct conversion rules. Also fixes #383993.
679
680 2008-04-28  Martin Baulig  <martin@ximian.com>
681
682         * class.cs (Constructor.Emit): Don't emit debugging information
683         for generated default .ctor's.
684
685 2008-04-28  Marek Safar  <marek.safar@gmail.com>
686
687         * convert.cs: Empty-cast ushort to int conversion.
688
689 2008-04-28  Marek Safar  <marek.safar@gmail.com>
690
691         A fix for bug #384191
692         * ecore.cs, expression.cs: Fixed expression cloning.
693
694 2008-04-28  Marek Safar  <marek.safar@gmail.com>
695
696         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
697
698 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
699
700         Fix #381559, test-638.cs, test-639.cs
701         * assign.cs (CompoundAssign.Helper): New wrapper.
702         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
703         access.
704         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
705         Pass unconverted expressions to the params array creation expression.
706         (FieldExpr.EmitAssign): Don't special-case StringConcat.
707         (PropertyExpr.EmitAssign): Likewise.
708         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
709         element if it is of kind CompoundAssign.Helper.
710         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
711         first before anything else.
712         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
713         (ArrayAccess.LoadArrayAndArguments): Simplify.
714
715 2008-04-27  Marek Safar  <marek.safar@gmail.com>
716
717         * expression.cs: Fixed cloning of typeof(void).
718
719 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
720
721         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
722         (Assign.Emit): Likewise.  Move it to ...
723         (CompoundAssign.DoResolve): ... here and ...
724         (CompoundAssign.Emit): ... here.
725         (EventAddOrRemove): New helper to handle += and -= on events, and
726         avoid the use of BinaryDelegates.
727         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
728         (EventExpr.EmitAddOrRemove): Improve.
729         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
730
731         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
732         create VarExprs for 'foo.bar.var'.
733         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
734         is a highly inappropriate name for its functionality.
735
736 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
737
738         Simplify handling of multiple assignments
739         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
740         inheritable-only.
741         (SimpleAssign): New.  Class to be used for normal assignments.
742         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
743         * expression.cs, parameter.cs, statement.cs: Likewise.
744
745 2008-04-25  Marek Safar  <marek.safar@gmail.com>
746
747         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
748         for incompatible underlying types, more to come, uff.
749
750 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
751
752         Fix gtest-388.cs
753         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
754         Handle 'leave_copy'.
755
756 2008-04-25  Marek Safar  <marek.safar@gmail.com>
757
758         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
759
760 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
761
762         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
763         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
764         * statement.cs (While, Do, For): Allow test to have side effects.
765         (For.DoEmit): Always emit InitStatement.
766
767         Fix test-635.cs
768         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
769         Always create SideEffectConstant.
770         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
771         of type EnumConstant.
772
773         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
774         Handle 'right' being SideEffectConstant of type 'bool'.
775
776         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
777         Use left.EmitBranchable instead of open coding it, so as to
778         improve optimization opportunities.
779
780         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
781
782         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
783         assumptions.
784         (Expression.EmitSideEffect): Document.
785
786 2008-04-23  Marek Safar  <marek.safar@gmail.com>
787
788         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
789
790 2008-04-23  Marek Safar  <marek.safar@gmail.com>
791
792         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
793
794 2008-04-23  Marek Safar  <marek.safar@gmail.com>
795
796         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
797         conversion to expression tree.
798
799 2008-04-23  Marek Safar  <marek.safar@gmail.com>
800
801         * ecore.cs: Removed unused expression.
802
803 2008-04-22  Marek Safar  <marek.safar@gmail.com>
804
805         * expression.cs: Implemented NegateChecked and New expressions.
806
807 2008-04-22  Marek Safar  <marek.safar@gmail.com>
808
809         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
810
811 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
812
813         Fix #351102
814         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
815         needing final 'ret' instruction.
816
817 2008-04-22  Marek Safar  <marek.safar@gmail.com>
818
819         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
820
821 2008-04-21  Marek Safar  <marek.safar@gmail.com>
822
823         * expression.cs: Emit ldnull and not null expression as an instance argument
824          of static method expression calls.
825
826 2008-04-21  Marek Safar  <marek.safar@gmail.com>
827
828         A fix for bug #378200
829         * expression.cs: Fixed crash when creating parameterless expression tree
830         method call.
831
832 2008-04-21  Marek Safar  <marek.safar@gmail.com>
833
834         A fix for bug #375297
835         * anonymous.cs: Fixed crash when inferring from null argument anonymous
836         method.
837
838 2008-04-21  Marek Safar  <marek.safar@gmail.com>
839
840         A fix for bug #377596
841         * decl.cs, class.cs: Emit delegate type argument attributes.
842
843 2008-04-21  Marek Safar  <marek.safar@gmail.com>
844
845         A fix for bug #365314
846         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
847         
848 2008-04-21  Marek Safar  <marek.safar@gmail.com>
849
850         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
851         only.
852
853 2008-04-21  Marek Safar  <marek.safar@gmail.com>
854
855         * generic.cs (TypeParameter): Removed redundant location.
856
857 2008-04-19  Marek Safar  <marek.safar@gmail.com>
858
859         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
860         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
861         FullNamedExpression in all declaration type expression, statements will come
862         later.
863
864 2008-04-18  Marek Safar  <marek.safar@gmail.com>
865
866         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
867         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
868
869 2008-04-18  Marek Safar  <marek.safar@gmail.com>
870
871         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
872         code.
873
874 2008-04-17  Marek Safar  <marek.safar@gmail.com>
875
876         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
877         constraints.
878
879 2008-04-17  Marek Safar  <marek.safar@gmail.com>
880
881         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
882         name expressions.
883         Also fixes #340463.
884
885 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
886
887         Hook up 'EmitSideEffect'
888         * constant.cs (Constant.EmitSideEffect): New.
889         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
890         (SideEffectConstant.EmitSideEffect): New.
891         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
892         unconditional branch in EmitBranchable.
893         (FieldExpr.EmitBranchable): New.
894         * expression.cs (Unary.EmitSideEffect): New.
895         (Binary.EmitSideEffect): New.
896         (VariableReference.EmitSideEffect): New.  Do nothing.
897
898 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
899
900         Introduce 'EmitSideEffect'
901         * ecore.cs (Expression.EmitSideEffect): New.
902         (TypeCast): Rename from EmptyCast.
903         (EmptyCast): New.
904         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
905         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
906         * convert.cs, nullable.cs: Update to changes.
907
908 2008-04-16  Marek Safar  <marek.safar@gmail.com>
909
910         * class.cs, cs-parser.jay: Early check for base types expression.
911
912 2008-04-16  Marek Safar  <marek.safar@gmail.com>
913
914         * decl.cs (MemberName): Declare PrettyName as obsolete.
915
916 2008-04-16  Marek Safar  <marek.safar@gmail.com>
917
918         * namespace.cs: Use MemberName comparison.
919
920 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
921
922         Fix build break
923         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
924         FullName.
925         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
926         (MemberName.FullyQualifiedName): New.  Provides the functionality
927         that users assume FullName would have.
928         * ecore.cs, namespace.cs: Update to changes.
929
930         * statement.cs (Using.assign): Make into ExpressionStatement.
931         (Using.EmitPreTryBody): Simplify.
932
933 2008-04-16  Marek Safar  <marek.safar@gmail.com>
934
935         * report.cs: ColorFormat is protected.
936         
937         * rootcontext.cs: Unused fields clean-up.
938         
939         * namespace.cs: Made UsingEntry name private.
940
941 2008-04-16  Marek Safar  <marek.safar@gmail.com>
942
943         * cs-tokenizer.cs, location.cs: Removed unused field.
944
945 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
946             Raja R Harinath  <harinath@hurrynot.org>
947
948         Fix #379822
949         * constant.cs (SideEffectConstant.value): Rename from 'left'.
950         (SideEffectConstant.side_effect): Rename from 'right'.
951         (SideEffectConstant..ctor): Normalize 'side_effect'.
952         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
953         value of this constant.
954         * cfold.cs: Update to changes.
955
956 2008-04-15  Marek Safar  <marek.safar@gmail.com>
957
958         * cs-paser.jay: Removed unused variable.
959         
960         * driver.cs: Made Compile instance method.
961
962 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
963
964         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
965
966 2008-04-15  Marek Safar  <marek.safar@gmail.com>
967
968         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
969
970 2008-04-13  Jb Evain  <jbevain@novell.com>
971
972         * namespace.cs: update the System.Core fullname for 2.1
973         * driver.cs: update the list of required assemblies for 2.1.
974         Merged from the Moonlight 2 branch.
975
976 2008-04-11  Marek Safar  <marek.safar@gmail.com>
977
978         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
979         types and user defined operators. User operators arguments has to be checked
980         for null value before invocation, which also means no operator is called
981         when any argument is not convertible to unwrapped nullable type.
982         
983 2008-04-09  Marek Safar  <marek.safar@gmail.com>
984
985         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
986         of Unary expressions to follow operator overloading rules precisely.
987         Also fixes #321794, #323794
988         
989 2008-04-08  Marek Safar  <marek.safar@gmail.com>
990
991         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
992         expression.
993         
994 2008-04-08  Marek Safar  <marek.safar@gmail.com>
995
996         * expression.cs, ecore.cs: Implemented MemberInit expression.
997         
998 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
999
1000         Fix mono/tests/exception4.cs
1001         * statement.cs (ExceptionStatement, TryCatch): Revert to using
1002         ec.NeedReturnLabel () rather emitting a 'nop'.
1003
1004         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
1005         simple heuristic.
1006         (TryCatch.SomeCodeFollows): Likewise.
1007         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
1008         for 'break', 'continue' and 'return' statements inside a try.
1009         We're fairly sure that the generated IL stream will have more
1010         instructions textually following the try.
1011         (FlowBranchingTryCatch): Likewise.
1012
1013         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
1014         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
1015         overrides.
1016
1017         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
1018         wrapper -- forward everything to CollectionForeach.
1019         (CollectionForeach.NonDisposableWrapper): New.
1020         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
1021         instead of a pop + branch to end.
1022
1023 2008-04-07  Marek Safar  <marek.safar@gmail.com>
1024
1025         A fix for bug #377485
1026         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
1027         Propagate location for extension method groups. Report conversion failure at
1028         right place.
1029
1030 2008-04-07  Marek Safar  <marek.safar@gmail.com>
1031
1032         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
1033         ListInit and Field expressions.
1034
1035 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
1036
1037         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
1038         Since $PC is always -1 inside the body of MoveNext, the fault
1039         handler is a no-op.
1040         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
1041         * statement.cs (ExceptionStatement.emit_finally): Likewise.
1042         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
1043
1044         The denouement!  Fix #324708
1045         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
1046         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
1047         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
1048         'finally' inside the finally clause.
1049
1050         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
1051         inside an iterator.  Don't emit the body of the 'finally' inside
1052         the finally clause yet.
1053
1054         Use the ResumableStatement infrastructure for MoveNext ()
1055         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
1056         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
1057         'old_resume_points'.  Move dispatcher upfront.
1058         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
1059         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
1060         in an enumerator.  This encodes the main fix in this patch series
1061         -- we can only jump into the first instruction of a try from the
1062         outside, but we want to emit try/finally regions in iterators and
1063         resume in the middle of them.
1064
1065 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
1066
1067         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
1068         of NeedReturnLabel here.
1069
1070         Introduce a common point for emitting try/finally to IL
1071         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
1072         features of the various subclasses, which are now driven by ...
1073         (ExceptionStatement.EmitPreTryBody): ... this and ...
1074         (ExceptionStatement.EmitTryBody): ... this and the original
1075         EmitFinallyBody.
1076         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
1077         Remove DoEmit and update to follow above protocol.
1078
1079         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
1080         of the dispatcher are the same, skip emitting the 'switch'.
1081         * iterator.cs (Iterator.EmitDispose): Update to changes.
1082
1083         Clean up handling of 'using' statement
1084         * statement.cs (UsingTemporary): New.  Carved out of ...
1085         (Using): ... this.  Simplify drastically.  Handle exactly
1086         one variable.
1087         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
1088         or Using as appropriate.  If there are multiple variable declared,
1089         create nested Using statements.
1090         (resource_acquisition): Kill.
1091
1092         * statement.cs (ExceptionStatement.EmitForDispose): Use
1093         EmitFinallyBody, not EmitFinally.
1094
1095         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
1096         * iterator.cs: Update to changes.
1097
1098         Start using the ResumableStatement infrastructure
1099         * statement.cs (ResumeableStatement.PrepareForDispose): New.
1100         (ResumableStatement.EmitForDispose): New.
1101         (ExceptionStatement): Override them.
1102         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
1103         EmitForDispose to create the body of the Dispose method.  Don't
1104         use OldResumePoint.
1105
1106         * iterator.cs (Iterator.AddResumePoint): Move here from ...
1107         * statement.cs (Toplevel.AddResumePoint): ... here.
1108         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
1109         * flowanalysis.cs (FlowBranchingIterator): New.
1110         * codegen.cs (EmitContext): Update to changes.
1111
1112         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
1113         (Iterator.old_resume_points): Rename from 'resume_points'.
1114         (Iterator.MoveNextStatement): Remove unused class.
1115
1116         New infrastructure for try/finally in iterators (still unused)
1117         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
1118         (FlowBranchingToplevel.AddResumePoint): Hook into
1119         ToplevelBlock.AddResumePoint.
1120         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
1121         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
1122         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
1123         resume points and assign program-counter values.
1124         (ExceptionBlock.AddResumePoint): Collect resume points for
1125         de-muxer at the top of try block.
1126         * iterators.cs (Yield.CheckContext): Simplify.
1127         (Yield.Resolve): Use FlowBranching.AddResumePoint.
1128
1129 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
1130
1131         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
1132         argument to an ExitStatement.
1133         (FlowBranchingException): Refactor saved origins code.
1134         * statement.cs (ExitStatement): Update to cahges.
1135         * iterator.cs (YieldBreak): Likewise.
1136
1137         * statement.cs (ResumableStatement): New.  Common base class for
1138         YieldReturn and ExceptionStatement.
1139         (ExitStatement): New.  Common base class for Return and YieldBreak.
1140         (Return): Update to changes.
1141         * iterator.cs (YieldBreak): Likewise.
1142         * lambda.cs (ContextualReturn): Likewise.
1143
1144         Fix #377028
1145         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
1146         emit a meaningful error message.
1147
1148         Fix #324765, #319508
1149         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
1150         (VariableInfo.SetAssigned): Set it.
1151         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
1152         determine if CS0219 or CS0168 is appropriate.  Don't use
1153         flow-analysis information.
1154         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
1155         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
1156         (EmitContext.EndFlowBranching): ... this.
1157
1158 2008-04-03  Marek Safar  <marek.safar@gmail.com>
1159
1160         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
1161
1162 2008-04-03  Marek Safar  <marek.safar@gmail.com>
1163
1164         A fix for bug #376508
1165         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
1166         ImplicitConversionExists.
1167
1168 2008-04-03  Marek Safar  <marek.safar@gmail.com>
1169
1170         * expression.cs (Binary): Added remaining binary operators to expression
1171         tree builder.
1172
1173         * nullable.cs: Optimize shift with null argument.
1174
1175 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
1176
1177         Fix minor IL regression
1178         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
1179         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
1180         * cs-parser.jay (try_statement): Update to changes.
1181
1182         * statement.cs (TryFinally.need_exc_block): Delete.
1183         (TryFinally): Update to changes.
1184
1185         Now all ExceptionStatements are unconditional
1186         * statement.cs (CollectionForeach.DisposableWrapper): New.
1187         Extract out the try/finally code into a new wrapper.
1188         (CollectionForeach.Resolve): Use it to simplify the code.
1189
1190 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
1191
1192         Start at simplifying ExceptionStatement semantics a bit
1193         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
1194         * cs-parser.jay (try_statement): Update to changes.
1195         (opt_catch_clauses): Remove.
1196         * flowanalysis.cs: Update to changes.
1197         (FlowBranching.BranchingType.TryCatch): New.
1198         (FlowBranchingTryCatch): New.
1199
1200         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
1201         (FlowBranching.CreateBranching): Update to changes.
1202         (FlowBranchingBlock.AddSibling): Add sanity check.
1203         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
1204         Update to changes.
1205
1206         * iterators.cs (Iterator.MarkFinally): Remove.
1207         * statement.cs (ExceptionStatement): Update to changes.
1208
1209         Add support for skipping over finally blocks at runtime.  First
1210         in a series to fix #324708
1211         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
1212         (Iterator.EmitMoveNext): Initialize it.
1213         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
1214         branch over the body of the 'finally' clause.
1215
1216 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
1217
1218         Avoid lopsided use of Foo/DoFoo names
1219         * statement.cs (ExpressionStatement.EmitFinallyBody):
1220         Rename from EmitFinally.
1221         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
1222         * iterator.cs: Update to changes.
1223
1224 2008-04-02  Marek Safar  <marek.safar@gmail.com>
1225
1226         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
1227         based on UserOperatorCall. More binary nullable operators clean up.
1228
1229 2008-04-02  Martin Baulig  <martin@ximian.com>
1230
1231         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
1232
1233 2008-04-02  Marek Safar  <marek.safar@gmail.com>
1234
1235         * nullable.cs: Merge user and empty conversions when lifting expression
1236         trees.
1237         
1238         * expression.cs (StringConcat): Implemented expression tree representation.
1239
1240 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1241
1242         * nullable.cs: When lifting null literal and a user operator exists, no call 
1243         is made.
1244         
1245 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1246
1247         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
1248         null.
1249
1250 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1251
1252         * nullable.cs, expression.cs: Use namespace instead heavily nested
1253         monster abstract class.
1254
1255 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1256
1257         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
1258         lifting of null literal and user operators. Clean up of some temporary
1259         nullable hacks.
1260
1261 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
1262
1263         Fix #368224, test-629.cs
1264         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
1265         if it crossed an unwind-protect boundary.
1266         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
1267         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
1268         inside an unwind-protected region.
1269         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
1270         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
1271         'leave' instead of a 'br' if unwind-protected.
1272         (Iterator.EmitYieldBreak): Likewise.
1273
1274 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
1275
1276         * driver.cs: Only define versioninfo resources if no win32 resource
1277         file was specified.
1278
1279 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1280
1281         A fix for bug #372375
1282         * convert.cs: Fixed boxing of nullable types.
1283
1284 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1285
1286         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
1287         type.
1288
1289 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1290
1291         A fix for bug #374619
1292         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
1293         
1294 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1295
1296         * lambda.cs: Check return type only for invocation.
1297         
1298 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1299
1300         A fix for bug #374214
1301         * ecore.cs: Correctly report argument type mismatch.
1302
1303 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1304
1305         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
1306         and not rely on broken IsEnum.
1307
1308 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1309
1310         * nullable.cs: New file, extracted from generic.cs.
1311         
1312         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1313
1314 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1315
1316         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1317         predefined comparison operators and null literals.
1318         
1319         * report.cs: New warning ID.
1320         
1321 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1322
1323         A fix for bug #370577
1324         * lambda.cs: Check return type too.
1325
1326 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1327
1328         A fix for bug #372846
1329         * class.cs: Automatic properties can be declared as unsafe.
1330
1331 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1332
1333         * location.cs: Use string based concatenation.
1334         
1335         * expression.cs: LiftedBinaryOperator is gmcs only.
1336         
1337 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1338
1339         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1340         conversions rules and expression trees.
1341
1342 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1343
1344         * delegate.cs: Use extension method source as delegate target.
1345
1346 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1347
1348         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1349         binary operations to be purely based on binary operations and optimized
1350         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1351         and other ET refactoring.
1352         
1353         * typemanager.cs: Fixed warning.
1354         
1355 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1356
1357         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1358         
1359         * symbolwriter.cs: Fixed.
1360
1361 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1362
1363         * anonymous.cs, driver.cs: Reset anonymous types counters.
1364
1365 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1366
1367         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1368         
1369         * class.cs: Use fullname for all type member definitions.
1370         
1371 2008-02-19  Martin Baulig  <martin@ximian.com>
1372
1373         * class.cs
1374         (IMethodData.EmitExtraSymbolInfo): New interface method.
1375         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1376         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1377         interface method here as an empty public virtual method.
1378
1379         * anonymous.cs
1380         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1381         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1382         CodeGen.SymbolWriter.SetRealMethodName().       
1383
1384 2008-02-18  Martin Baulig  <martin@ximian.com>
1385
1386         * anonymous.cs
1387         (ScopeInfo.EmitType): Override this and emit debugging
1388         information for captured variables.
1389         (RootScopeInfo.EmitType): Override this and emit symbol
1390         information for a captured `this'.
1391
1392 2008-02-15  Martin Baulig  <martin@ximian.com>
1393
1394         * iterators.cs: Emit debugging info.
1395
1396         * codegen.cs
1397         (EmitContext.Flags): Add `OmitDebuggingInfo'.
1398         (EmitContext.OmitDebuggingInfo): New public property.
1399
1400         * statement.cs
1401         (While): Override Emit() and don't emit symbol info there; do it
1402         inside DoEmit() instead.
1403         (Block.Emit): Omit symbol information while emitting the scope
1404         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
1405         block logic.
1406         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1407         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1408         .ctor to make `IsIterator' work.
1409
1410 2008-03-14  Martin Baulig  <martin@ximian.com>
1411
1412         * symbolwriter.cs: Added the new symbol writer function from the
1413         debugger's `terrania' branch; temporarily enclose them inside
1414         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1415         my vacations.
1416
1417 2008-03-14  Martin Baulig  <martin@ximian.com>
1418
1419         * symbolwriter.cs
1420         (SymbolWriter): Make this a public static class.
1421
1422         * codegen.cs
1423         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1424         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1425
1426 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1427
1428         A fix for bug #370577
1429         * statement.cs, lambda.cs: Added extra limitations when dealing with void
1430         return type.
1431         
1432 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1433
1434         * typemanager.cs (CSharpName): Made 250 times faster.
1435
1436 2008-03-13  Marek Safar  <marek.safar@gmail.com>
1437
1438         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1439         
1440 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1441
1442         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1443         crash when predefined field does not exist.
1444         
1445 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1446
1447         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1448         
1449 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1450
1451         * class.cs (FixedField): Don't crash when contructors are missing.
1452
1453 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1454
1455         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1456         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1457         check internal types accessibility for internal and external types.
1458         Replaced EnumToUnderlying by GetEnumUnderlyingType.
1459
1460 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1461
1462         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1463         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1464         attribute.cs, statement: Use corect instance of predefined types (work
1465         related to #364674).
1466
1467 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1468
1469         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1470         
1471 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1472
1473         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
1474         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1475         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1476         predefined types clean up, delayed predefined types members initialization
1477         (work related to #364674).
1478
1479 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1480
1481         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1482         
1483 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1484
1485         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1486         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1487         predefined types clean up (work related to #364674).
1488
1489 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1490
1491         * ecore.cs: Print an error message instead of throwing exception.
1492         
1493 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1494
1495         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1496         expression.cs, statement.cs: Unififed null literal representation.
1497
1498 2008-03-03  Marek Safar  <marek.safar@gmail.com>
1499
1500         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1501         expression.cs: Refactored binary operators resolve phase and improved speed.
1502         The nullable code is still missing and won't work correctly, more fixes
1503         required.
1504
1505         It also fixes #323726, #324312, #324248, and many other unreported issues.
1506
1507 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
1508
1509         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
1510         instead of 'gmcs'.
1511
1512 2008-02-27  Marek Safar  <marek.safar@gmail.com>
1513
1514         * ecore.cs: Clean-up and split BetterConversion.
1515         
1516 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
1517
1518         Fix #363791
1519         * enum.cs (EnumMember.Value): Only access 'value' if
1520         ResolveValue says it's ok.
1521         (EnumMember.DoResolveValue): Don't set prev_member.value.
1522         (Enum.GetDefinition): Reverse arguments of Equals --
1523         EnumMember.Value can return 'null'.
1524
1525         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1526
1527 2008-02-22  Marek Safar  <marek.safar@gmail.com>
1528
1529         * generic.cs, expression.cs: More ongoing work on expression trees.
1530         
1531 2008-02-21  Marek Safar  <marek.safar@gmail.com>
1532
1533         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1534         handle missing matches when mutiple operators exist.
1535         
1536 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1537
1538         A fix for bug #363218
1539         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1540         initializers.
1541         
1542 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1543
1544         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1545         update. This time to deal correctly with SideEffectConstant expression used
1546         as an argument for another constant folding.
1547
1548 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
1549
1550         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1551         MethodBuilder.
1552
1553 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1554
1555         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1556
1557 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1558
1559         A fix for bug #328136
1560         * expression.cs: Do not fold immediately LogicalAnd operators when the left
1561         side is a false constant, because we still need to evaluate the right-hand
1562         side.
1563
1564         * statement.cs (If): Emit two types of boolean constants (simple constant,
1565         side-effect constant).
1566
1567 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1568
1569         * constant.cs (SideEffectConstant): Don't emit boolean constant.
1570
1571         * expression.cs: Fold immediately LogicalAnd operators when both sides are
1572         constants.
1573
1574 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1575
1576         A fix for bug #361457
1577         * ecore.cs (IsApplicable): Params methods have lower priority.
1578
1579         * support.cs: Return correct parameter modifier for params types.
1580
1581 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1582
1583         * generic.cs (TypeParameter): Cache attribute target name.
1584
1585         * support.cs: Removed unused variable.
1586
1587         * typemanager.cs: Removed debugging leftover.
1588
1589         * ecore.cs: Use local type instead of a property;
1590
1591         * class.cs (VerifyMembers): Consider also parent to test whether type member
1592         is local or public.
1593
1594         * expression.cs (FullMethodDesc): Removed.
1595
1596         * attribute.cs (IsValidArgumentType): Made static.
1597
1598 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
1599
1600         Cleanup to be more readable.
1601         * Makefile (GMCS_PROFILE): Remove.
1602         (COMPILER_NAME): New helper.
1603
1604 2008-02-15  Miguel de Icaza  <miguel@novell.com>
1605
1606         * cs-tokenizer.cs: if a conditional expression happens inside a
1607         (...) this also means that we do not need to de-ambiguate between
1608         an parenthesized expression and a cast.
1609
1610         Fixes 346484.
1611
1612         * constant.cs (SideEffectConstant): a constant value that happens
1613         to have a side effect.
1614
1615         Fixes the build regressions introduced by the fix for #359789
1616
1617 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
1618
1619         * expression.cs (Conditional.Emit): when emitting the ternary
1620         operator, use local variables to generate code verifiable code.
1621
1622         The verifier cannot infer that the type on stack before the
1623         stloc.0 is executed is of type ParentB. This happens because the
1624         stack merge algorithm uses only parent types when deciding which
1625         is the common type.  This is described in Part III 1.8.1.3 of ECMA
1626         335.
1627
1628         This code compiled with mcs is not verifiable under MS. The MS
1629         verifier picks the first common interface of Foo and Bar, which is
1630         wrong, but doesn't use a full join type of the 2 interfaces.
1631
1632         CSC uses a clever hack to compile such code in a verifiable
1633         way. It stores the intermediate values in a local variable with
1634         the expected type.
1635
1636         Fixes: #358102
1637
1638 2008-02-14  Miguel de Icaza  <miguel@novell.com>
1639
1640         * expression.cs: Do not fold BitwiseAnd operators when the left
1641         side is a false constant, because we still need to evaluate the
1642         right-hand side.
1643
1644         Fixes #359789
1645
1646         * support.cs: Instead of throwing an InternalErrorException when
1647         the position of the stream is outside the boundary of our buffer,
1648         reset the state of the reader, and restart the reading from the
1649         beginning of the file.
1650
1651 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1652
1653         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1654
1655 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1656
1657         A fix for bug #361686
1658         * decl.cs: A protected types used inside a private class which parents
1659         derives from the protected class are accessible.
1660
1661 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1662
1663         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1664         the parameterless constructor.
1665
1666 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1667
1668         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1669         lookup methods to use standard member cache when doing member lookup.
1670
1671 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1672
1673         * driver.cs: Don't report full path for referenced module as assembly error.
1674
1675 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1676
1677         * Makefile: Fixed `qh' target to work on all machines.
1678
1679         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1680         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1681         and HasElementType with TypeManager implementation.
1682
1683 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1684
1685         A fix for bugs #325134, #359749
1686         * expression.cs, ecore.cs: Try to resolve an extension method even if the
1687         first binds point to non-method member expression.
1688
1689 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1690
1691         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1692
1693 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1694
1695         A fix for bugs #321394, #323028
1696         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1697         Reworked naive IsAccessibleAs implementation to handle nested types.
1698
1699 2008-02-05  Jb Evain  <jbevain@novell.com>
1700
1701         * class.cs: use generic type comparison for parameters
1702         as well.
1703
1704 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1705
1706         A fix for bug #325372
1707         * class.cs: Use generic type comparison when testing method signatures.
1708
1709 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1710
1711         A fix for bug #357047
1712         * ecore.cs: Applied C# 3.0 changes to better conversion.
1713
1714 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1715
1716         A fix for bug #358374
1717         * cs-parser.jay: Correctly set modifiers for all constructor types.
1718
1719 2008-02-04  Marek Safar  <marek.safar@gmail.com>
1720
1721         A fix for bug #355251
1722         * generic.cs: Added base class constraint based type inference.
1723
1724 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1725
1726         A fix for bug #357255
1727         * decl.cs: One more missing visibility check.
1728
1729 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1730
1731         * support.cs: Fixed broken return.
1732
1733 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1734
1735         * report.cs: Correctly reset warnings count after probing.
1736
1737 2008-01-25  Martin Baulig  <martin@ximian.com>
1738
1739         * namespace.cs
1740         (NamespaceEntry.SymbolFileID): Make this work again after
1741         MemberName.ToString() is gone.
1742
1743 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1744
1745         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1746         expressions.
1747
1748 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1749
1750         * generic.cs: Use full implicit conversion for type inference fixing.
1751
1752 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1753
1754         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1755         Fixed user operator conversions.
1756
1757 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1758
1759         * generic.cs: Do nullable type to null comparison optimization during
1760         resolve phase.
1761
1762 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1763
1764         A fix for bug #355163
1765         * generic.cs: Enabled l-value resolve on nullable expressions.
1766
1767 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1768
1769         A fix for bug #353986
1770         * class.cs: Ingore static ctors with parameters for any further checks.
1771
1772 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1773
1774         A fix for bug #354310
1775         * namespace.cs: Removed redundant check.
1776
1777 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1778
1779         A fix for bug #354928
1780         * expression.cs: ElementInitializers can be resolved only once.
1781
1782 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1783
1784         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1785         Condition expressions.
1786
1787 2008-01-23  Marek Safar  <marek.safar@gmail.com>
1788
1789         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1790
1791 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1792
1793         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1794         not allowed.
1795
1796         * generic.cs: Implemented coalesce expression.
1797
1798 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1799
1800         A fix for bug #355145
1801         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1802         expression tree type inference.
1803
1804 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
1805
1806         Fix #354663
1807         * expression.cs (Binary.IsUnsignedType): Fix typo.
1808
1809 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1810
1811         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1812
1813 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1814
1815         A fix for bug #355161
1816         * ecore.cs, expression.cs: Wider range of extension method supported
1817         expressions.
1818
1819 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
1820
1821         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1822         AssemblyBuilder to operate in compiler context. Fixes mcs part of
1823         bug #354970.
1824
1825 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1826
1827         A fix for bug #355148
1828         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1829
1830 2008-01-22  Miguel de Icaza  <miguel@novell.com>
1831
1832         * expression.cs (CreateExpressionTree): Add support for or and
1833         logical or, and indent following the coding conventions.
1834
1835         * typemanager.cs (LinqExpression): renamed from
1836         ExpressionTreeManager, for a shorter name.
1837
1838         Use TypeManager.CoreLookupType to lookup types from our core
1839         assemblies and turn those into "Type" variables.
1840
1841         Consumers that previously used "Namespace" and "Type" from this
1842         class should instead use the TypeExpression which is a type that
1843         is fully resolved (without involving the regular C# resolution
1844         rules). 
1845
1846         This typically looks like this:
1847
1848         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1849         new MemberAccess (texpr, name, type_arguments, loc)
1850
1851         This avoids the problem in: #355178
1852
1853 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1854
1855         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1856         feature in parser only as we do in other cases.
1857         
1858 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1859
1860         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1861         typemanager.cs: A refactoring of params arguments to reuse existing
1862         expressions (params -> array initializer) to emit params argument instead
1863         of specialized handling.
1864         It was required by expression tree implementation and it has other benefits
1865         as well, we now apply same optimization for params arguments as we do for
1866         array initializers.
1867         
1868 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1869
1870         A fix for bug #353526
1871         * generic.cs: A type inference of params arguments may not required any
1872         temporary array creation.
1873         
1874 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1875
1876         A fix for bug #353534
1877         * generic.cs, ecore.cs, expression.cs: A method group type inference is
1878         supported for delegates only.
1879         
1880 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1881
1882         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1883         type for more than 1 candidates.
1884         
1885 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1886
1887         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1888         expressions.
1889         
1890 2008-01-16  Marek Safar  <marek.safar@gmail.com>
1891
1892         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1893         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1894         operator) expressions. 
1895                 
1896 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
1897
1898         * statement.cs: Avoid declaring an IL variable for this_variable since it is
1899         not accessed from the generated IL.
1900
1901 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1902
1903         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1904         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1905         statement.cs: The first expression tree implementation drop, mostly
1906         infrastructure work.
1907
1908 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1909
1910         * ecore.cs (IsNestedChild): Refactored.
1911
1912 2008-01-11  Marek Safar  <marek.safar@gmail.com>
1913
1914         * lambda.cs: Don't use a cast on unknown expression statement.
1915
1916 2008-01-10  Geoff Norton  <gnorton@novell.com>
1917
1918         * cs-tokenizer.cs: One more token to distinguish between method and lambda
1919         arguments
1920
1921 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1922
1923         * doc.cs: Report better /doc crash details.
1924         
1925 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1926
1927         A fix for bug #352536
1928         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1929
1930 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1931
1932         A fix for bug #352287
1933         * ecore.cs, expression.cs: Do `this' access checking in all member access
1934         expressions.
1935         
1936 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1937
1938         * rootcontext.cs, driver.cs: Switch to linq mode by default.
1939         
1940         * report.cs: Reset message stacks.
1941         
1942 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1943
1944         * generic.cs (InferInPhases): Correctly calculate params position.
1945         
1946 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1947
1948         * cs-tokenizer.cs: No need to parse full string when parsing lambda
1949         arguments.
1950
1951 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1952
1953         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1954         
1955         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1956         
1957         * driver.cs: Updated --help option.
1958         
1959 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1960
1961         * generic.cs (InferParamsTypeArguments): Removed.
1962         (InferInPhases): Add params type inference.
1963         (LowerBoundInference): Fixed scoring mechanism.
1964         
1965         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1966         
1967 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
1968
1969         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1970         byte array for unsigned "baked" assemblies.
1971
1972 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
1973
1974         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1975         array for assemblies that are not strongnamed.
1976
1977 2008-01-04  Marek Safar  <marek.safar@gmail.com>
1978
1979         A fix for bug #351481
1980         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1981         declaring type for nested generic types.
1982         
1983 2008-01-04  Marek Safar  <marek.safar@gmail.com>
1984
1985         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
1986         instead of ToString.
1987         
1988 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1989
1990         A fix for bug #351047
1991         * expression.cs (Binary.ResolveOperator): Allow equality operators between
1992         null and structs only when equality and inequality operators are defined
1993         either as an user-operators or predefined operators.
1994         
1995 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1996
1997         A fix for bug #351047
1998         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
1999         
2000 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2001
2002         A fix for bug #351257
2003         * cs-tokenizer.cs: Advance line number for '\r' correctly.
2004         
2005 2008-01-03  Marek Safar  <marek.safar@gmail.com>
2006
2007         A fix for bug #351157
2008         * class.cs (Using): Fixed yet another broken cloning.
2009         
2010         (Block): Put back more sensible default value for statements.
2011         
2012 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
2013
2014         * codegen.cs: Allow AssemblyVersion with only major version component.
2015         Fixes bug #351055.
2016
2017 2007-12-29  Marek Safar  <marek.safar@gmail.com>
2018
2019         A fix for bug #324654
2020         * class.cs: Use FullName property as member name.
2021
2022 2007-12-28  Marek Safar  <marek.safar@gmail.com>
2023
2024         A fix for bug #342117
2025         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
2026         constructor constraint.
2027
2028 2007-12-28  Marek Safar  <marek.safar@gmail.com>
2029
2030         A fix for bug #338273
2031         * class.cs (ProbertyBase): Access modifier checks are required for overrides
2032         only.
2033
2034 2007-12-28  Marek Safar  <marek.safar@gmail.com>
2035
2036         A fix for bug #350839
2037         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
2038
2039 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
2040
2041         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2042         GHOP:
2043         
2044         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
2045
2046         * statement.cs: Changed some Hashtables to use HybridDictionaries
2047         instead. It was observed that some HashTables only contained a few
2048         items in the vast majority of cases. Since HybridDictionary is
2049         more efficient on small sets (<10 elements), "known_variables"
2050         from class ExplicitBlock as well as "labels" and "constants " from
2051         class Block were changed to HybridDictionaries. 
2052
2053         Atsai results: (56216kb->54987kb)
2054
2055         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
2056
2057
2058 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
2059
2060         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
2061         GHOP:
2062         
2063         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
2064         
2065         * expression.cs: foreach loop to for loop, saved on allocation of
2066         enumerator (59333kb->59141kb)
2067
2068         * statement.cs. Changed foreach loops to for loops, saved on
2069         allocation of enumerator (59141kb->59006kb)
2070
2071         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
2072         when constructed with no specified capacity. This was causing a
2073         few ArrayLists to allocate more memory than they would potentially
2074         need in the Block class and MemberCache class. Setting the
2075         ArrayLists to construct with a capacity of 1 saves some
2076         memory. (56216kb->55585kb)
2077
2078 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2079
2080         A fix for bug #347189 (2nd issue)
2081         * expression.cs (MemberAccess): Nested type can be found in base non-generic
2082         type.
2083
2084 2007-12-27  Miguel de Icaza  <miguel@novell.com>
2085         
2086         * report.cs: Do not use colors if stdout and stderr are not a
2087         terminal.
2088
2089 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2090
2091         A fix for bug #346998
2092         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
2093         overloads.
2094
2095 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2096
2097         A fix for bug #343465
2098         * class.cs: Explicit method name for nested types uses dots only.
2099
2100 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2101
2102         A fix for bug #343707
2103         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
2104
2105 2007-12-27  Marek Safar  <marek.safar@gmail.com>
2106
2107         * ecore.cs: Report type inference errors only when arguments count matches
2108         parameter count.
2109         
2110         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
2111         
2112         * expression.cs, report.cs: New warning.
2113         
2114         * typemanager.cs: Catch anonymous method type too.
2115
2116 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2117
2118         A fix for bug #346379
2119         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
2120
2121 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2122
2123         A fix for bug #347359
2124         * expression.cs (Invocation): Don't resolve already resolved expression.
2125
2126 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2127
2128         A fix for bug #347189
2129         * class.cs (FixedField): Use non-dependent code only in the define phase.
2130
2131 2007-12-23  Marek Safar  <marek.safar@gmail.com>
2132
2133         A fix for bug #348076
2134         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
2135
2136 2007-12-22  Marek Safar  <marek.safar@gmail.com>
2137
2138         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
2139         discovered extension methods.
2140
2141 2007-12-22  Marek Safar  <marek.safar@gmail.com>
2142
2143         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
2144         method.
2145
2146 2007-12-21  Miguel de Icaza  <miguel@novell.com>
2147
2148         * report.cs (ErrorMessage): Add support for using colors on
2149         terminals that support it. 
2150
2151 2007-12-21  Marek Safar  <marek.safar@gmail.com>
2152
2153         * ecore.cs: Use information about expanded params for error reporting.
2154
2155 2007-12-21  Marek Safar  <marek.safar@gmail.com>
2156
2157         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
2158         and logic for params overloads.
2159         
2160 2007-12-15  Miguel de Icaza  <miguel@novell.com>
2161
2162         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
2163         as this is also created from the parser.  Fixes #349034
2164
2165 2007-12-12  Miguel de Icaza  <miguel@novell.com>
2166
2167         * statement.cs (Throw.CloneTo): it is valid to have empty
2168         expressions for throw. 
2169
2170 2007-12-03  Marek Safar  <marek.safar@gmail.com>
2171
2172         * cs-parser.jay: Set delegate constraint parsing region correctly.
2173
2174 2007-12-03  Marek Safar  <marek.safar@gmail.com>
2175
2176         A fix for bug #345467
2177         * typemanager.cs (IsEqual): Compare generic parameters position only.
2178         
2179 2007-11-28  Marek Safar  <marek.safar@gmail.com>
2180
2181         * expression.cs (BaseAccess): Type arguments can be null.
2182
2183 2007-11-27  Raja R Harinath  <harinath@gmail.com>
2184
2185         * statement.cs (Block.Resolve): Ensure flow-branching tree is
2186         consistent even when an error has occured.
2187         (Switch.Resolve): Likewise.
2188
2189 2007-11-22  Marek Safar  <marek.safar@gmail.com>
2190
2191         A fix for bug #334505
2192         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
2193         overrides.
2194         
2195 2007-11-22  Marek Safar  <marek.safar@gmail.com>
2196
2197         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
2198         refactorings required to resolve extension methods correctly when mixing
2199         generics and non-generics members.
2200         
2201 2007-11-20  Marek Safar  <marek.safar@gmail.com>
2202
2203         A fix for bug #342584
2204         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
2205         conversion.
2206         
2207 2007-11-19  Marek Safar  <marek.safar@gmail.com>
2208
2209         A fix for bug #342512
2210         * delegate.cs: Use delegate argument expression when is available. Don't
2211         emit virtual call when class is sealed.
2212         
2213 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2214
2215         A fix for bug #325423
2216         * assign.cs (FieldInitializer): Use resolved expression for emit.
2217         
2218         * class.cs: Print less confusing error message.
2219         
2220 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2221
2222         * cs-tokenizer.cs: Removed GMCS ifdefs.
2223         
2224         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
2225         mcs.
2226         
2227         * cs-parser.jay: Disabled nullable check.
2228         
2229         * generic-mcs: Copied more generic stuff.
2230                 
2231 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2232
2233         * gcs-parser.jay: Merged to cs-parser.jay.
2234         
2235         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
2236         * *.csproj, *.sources: Updated to use only jay parser file.
2237
2238 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2239
2240         * gcs-parser.jay: Added nullable and default expression feature checks.
2241         
2242 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2243
2244         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
2245         it fixes many TODOs and hidden bugs.
2246         
2247         * expression: Removed duplicate error check.
2248
2249 2007-11-15  Marek Safar  <marek.safar@gmail.com>
2250
2251         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
2252         implicitly type local variable only when it is used in a declaration.
2253
2254 2007-11-15  Marek Safar  <marek.safar@gmail.com>
2255
2256         * attribute.cs: Use CS0612 for empty strings.
2257
2258 2007-11-14  Marek Safar  <marek.safar@gmail.com>
2259
2260         * lambda.cs, statement.cs: Contextual return may act as a statement.
2261
2262 2007-11-14  Marek Safar  <marek.safar@gmail.com>
2263
2264         A fix for a regression cause by #324222
2265         * class.cs: Don't report unused even when it implements an interface.
2266         
2267 2007-11-13  Marek Safar  <marek.safar@gmail.com>
2268
2269         A fix for bug #341205
2270         * ecore.cs, expression.cs: Method group expression cannot do static
2271         method access with an instance reference check before overloading takes
2272         a place.
2273         
2274 2007-11-13  Marek Safar  <marek.safar@gmail.com>
2275
2276         A fix for bug #325359
2277         * class.cs: Use predictable name for automatically generated property.
2278         
2279 2007-11-12  Marek Safar  <marek.safar@gmail.com>
2280
2281         A fix for bug #324996
2282         * expression.cs (Is): Handle case where D is nullable and T is not
2283         correctly.
2284         
2285         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
2286         
2287 2007-11-12  Marek Safar  <marek.safar@gmail.com>
2288
2289         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
2290         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
2291         Flush small error reporting changes.
2292         
2293 2007-11-09  Marek Safar  <marek.safar@gmail.com>
2294
2295         A fix for bug #324996
2296         * expression.cs: Rewrote Is expression implementation to work with
2297         generics, nullable types, anonymous method. A const result expression 
2298         uses existing infrastructure instead of custom not fully-featured one.
2299         
2300 2007-11-08  Marek Safar  <marek.safar@gmail.com>
2301
2302         A fix for bug #340202
2303         * class.cs: Consider generics for volatile field.
2304
2305 2007-11-08  Marek Safar  <marek.safar@gmail.com>
2306
2307         A fix for bug #335594
2308         * expression.cs: Use conversion rules when handling string addition.
2309         
2310 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2311
2312         A fix for bug #336651
2313         * expression.cs: Fixed a crash when probing is on.
2314         
2315 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2316
2317         A fix for bug #324242
2318         * covert.cs: Added a conversion from any nullable-type with an 
2319         underlying enum-type to the type System.Enum.
2320         
2321 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2322
2323         A fix for bug #324222
2324         * class.cs: Report all non-used event fields.
2325         
2326 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2327
2328         A fix for bug #325161
2329         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2330         qualifier for generic types.
2331         
2332 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2333
2334         A fix for bug #322971
2335         * expression.cs, ecore.cs: Added intermediate result value check for
2336         indexers. 
2337         
2338 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2339
2340         A fix for bug #324754
2341         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2342         when it was requested.
2343
2344 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2345
2346         A fix for bug #325101
2347         * expression.cs: Do type not value comparison for `is' expression.
2348
2349 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2350
2351         A fix for bug #320236
2352         * convert.cs: Don't apply user conversion on underlying target type.
2353
2354 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2355
2356         * expression.cs: Don't use unresolved expression for error reporting.
2357  
2358 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2359
2360         A fix for bugs #337712, #324490
2361         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2362         overloading resolution too.
2363         
2364         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2365         the process consistent and more robust.
2366         
2367         * expression.cs, linq.cs, report.cs: Update.
2368
2369 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2370
2371         A fix for bug #332909
2372         * attribute.cs: Resolve attributes in correct context using error
2373         handling procedure.
2374         
2375         * rootcontext.cs: Define Obsolete attribute members as core members.
2376         
2377 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2378
2379         * statement.cs: Removed unused methods.
2380         
2381 2007-10-31  Wade Berrier  <wberrier@novell.com>
2382
2383         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
2384         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2385         during 'make dist')
2386
2387 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2388
2389         A fix for bug #338102
2390         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2391         methods registered as non-generics.
2392         
2393 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2394
2395         A fix for bugs #337712, #324490
2396         * delegate.cs: Delegate covariance and contravariance is not allowed for
2397         value types.
2398         
2399 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2400
2401         A fix for bug #337719 
2402         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2403         `from' keyword.
2404         
2405 2007-10-30  Marek Safar  <marek.safar@gmail.com>
2406  
2407         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2408
2409 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2410  
2411         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2412         query expressions.
2413
2414 2007-10-29  Raja R Harinath  <rharinath@novell.com>
2415
2416         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2417
2418 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2419  
2420         A fix for bug #334652
2421         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2422         extension methods when we have not found the best candidate in normal
2423         container.
2424
2425 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2426
2427         * AssemblyInfo.cs: Keep up-to-date.
2428
2429 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2430
2431         * Makefile: Fixed generics compiler name.
2432         
2433 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2434
2435         * lambda.test: removed, lambda parsing is done differently.
2436         
2437         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2438
2439 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
2440
2441         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2442
2443 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2444
2445         * Makefile, *.sources : All C# compilers are in mcs folder.
2446         
2447         * *.cs: Use existing 2_1 define for smcs.
2448
2449 2007-10-26  Marek Safar  <marek.safar@gmail.com>
2450
2451         A fix for bug #335847
2452         * assign.cs, expression.cs: Couple of changes to avoid creating a
2453         temporary variable for each object initializer assignment statement. It
2454         simplifies struct initialization too, otherwise two temporary variables
2455         would be required.
2456         Implemented optimization of redundant default element initializers.
2457         
2458 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2459
2460         A fix for bug #336766
2461         * expression.cs (Class.CheckBase): Use generic name when method is
2462         generic.
2463         
2464 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2465
2466         A fix for bug #334737
2467         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2468         variable and not variable argument for prepared copies.
2469
2470 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2471
2472         A fix for bug #325110
2473         * class.cs, expression.cs, attribute.cs: Use open generic method when
2474         checking conditional attribute.
2475         
2476 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2477
2478         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
2479         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2480         FeatureIsNotAvailable.
2481
2482 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2483
2484         ** C# 3.0 Partial methods
2485         
2486         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2487         methods support. Because of member cache issue with generics only
2488         non-generics partial methods are fully supported.
2489         
2490 2007-10-23  Marek Safar  <marek.safar@gmail.com>
2491         
2492         * class.cs, decl.cs: Rewrote member overloads check to cope with 
2493         generics and to use member cache for member checking. It also improves
2494         performance and fixes remaining overloads issues.
2495         
2496 2007-10-20  Marek Safar  <marek.safar@gmail.com>
2497         
2498         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2499         roottypes.cs, typemanager.cs:
2500                 
2501         A member cache creation logic changed to add members immediately and
2502         not rely on fallback. The member cache is now only prefered way
2503         how to access and find type declaration members. It saves 5 MB of memory
2504         during MWF compilation and makes code ready for more optimizations and
2505         clean-ups, it's also a pre-requirement for partial methods.
2506         
2507 2007-10-18  Raja R Harinath  <harinath@gmail.com>
2508
2509         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2510         handling for generic parameters.
2511
2512 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2513         
2514         * class.cs (FixedField): Removed redundant volatile check.
2515         
2516 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2517         
2518         * class.cs, decl.cs: Fixed overload members verification to do only one
2519         check per possible collision.
2520         
2521 2007-10-13  Marek Safar  <marek.safar@gmail.com>
2522         
2523         A fix for bug #325478
2524         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2525         and create only one disposable flags container.
2526         
2527 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2528         
2529         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2530         * statement.cs (Fixed): Fixed variables cloning.
2531         
2532 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2533         
2534         A fix for bug #333342
2535         * class.cs (EventField): Don't mark value type event as synchronized. 
2536         
2537 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2538         
2539         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2540         inference to identify best candidate method correctly.
2541         (ProperyExpr): A range variable is read only and cannot be modified.
2542         
2543 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2544         
2545         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2546         logic to identify best candidate method correctly.
2547         
2548 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2549         
2550         * location.cs (Equals, GetHashCode): Removed.
2551         
2552 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2553         
2554         * report.cs: Implemented message recorder. It is used mainly for lambda
2555         expressions to capture otherwise swallowed error messages.
2556         
2557         * anonymous.cs, lambda.cs.cs: Do full parameters check.
2558
2559         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2560         and not at the top.
2561         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2562                 
2563         * expression.cs (MemberAccess): Always report lookup failure.
2564         
2565         * location.cs: Implemented Equals, GetHashCode.
2566         
2567         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2568         
2569 2007-10-10  Jb Evain  <jbevain@novell.com>
2570
2571         * codegen.cs: re-enable assembly version check.
2572
2573 2007-10-09  Marek Safar  <marek.safar@gmail.com>
2574         
2575         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2576         checks.
2577         
2578         * namespace.cs (UsingAlias): Do correct version check.
2579         
2580 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2581         
2582         * expresison.cs, ecore.cs: Issue extension method error message when
2583         appropriate.
2584         
2585         * rootcontext.cs: Added ISO_2 compiler mode option.
2586
2587 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2588         
2589         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2590          message.
2591         
2592 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2593         
2594         * attribute.cs (GetString, GetBoolean): Work with both literal and
2595         constant.
2596         
2597         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2598         Moved method overload specific methods to MethodGroupExpr.
2599         
2600         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2601         it should be less memory consuming.
2602         
2603 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2604
2605         * codegen.cs: remove the assembly version check until the buildbot is
2606         fixed.
2607
2608 2007-10-07  Jb Evain  <jbevain@novell.com>
2609
2610         * attribute.cs (Attribute.GetString): if the value
2611         expression is a StringConstant, return its string value.
2612
2613 2007-10-07  Jb Evain  <jbevain@novell.com>
2614
2615         * typemanager.cs: add `assembly_version_attribute_type`.
2616         * codegen.cs: on attribute emission, check that the
2617         AssemblyVersionAttribute doesn't overflow.
2618
2619 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2620         
2621         A fix for bug #324677
2622         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2623         parent container of a scope container with currently resolved one. 
2624         
2625 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2626         
2627         A fix for bug #325534
2628         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2629         only.
2630         
2631 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2632         
2633         A fix for bug #327504
2634         * class.cs (Operator.Define): Refactored implicit and explicit user
2635         operator conversion rules.
2636         
2637 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2638         
2639         A fix for bug #327520
2640         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2641         
2642 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2643         
2644         A fix for bug #328022
2645         * class.cs (MethodData.Define): Use correct method to check whether
2646         a method implementents an accessor.
2647         
2648 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2649         
2650         A fix for bug #330069
2651         * statement.cs (Fixed.Resolve): Read the first array element only when
2652         an array is instantiated. 
2653         
2654 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2655         
2656         * expression.cs, assign.cs, generics.cs: Print correct operator when
2657         compound assignment is used.
2658         
2659 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2660         
2661         A fix for bug #325841
2662         * expression.cs (ArrayAccess): Use full argument cloning only for
2663         string compound concatenation.
2664         
2665 2007-10-03  Marek Safar  <marek.safar@gmail.com>
2666         
2667         A fix for bug #328774
2668         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2669         assignment.
2670         (PropertyExpr.EmitAssign): Fixed string concatenation compound
2671         assignment.
2672
2673 2007-10-03  Raja R Harinath  <rharinath@novell.com>
2674
2675         Fix #328490
2676         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2677         Event accessibility checks here.  Remove some bogus code that
2678         accidently made GenericMethods work.
2679         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2680
2681 2007-09-25  Marek Safar  <marek.safar@gmail.com>
2682         
2683         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2684         
2685         * statement.cs (Block): Refactored AddVariable to allow error handling
2686         customization.
2687         
2688         * generic.cs: New stub.
2689         
2690 2007-09-23  Marek Safar  <marek.safar@gmail.com>
2691         
2692         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2693         flag.
2694         
2695 2007-09-17  Marek Safar  <marek.safar@gmail.com>
2696
2697         * class.cs: Use partial container to record whether any partial part
2698         contains static field initializer and therefore default contructor has
2699         to be defined.
2700         
2701 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2702
2703         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2704         mono-list when only one of two partial parts has defined accessibility
2705         modifier.
2706         
2707 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2708
2709         A fix for bug #82845
2710         
2711         * class.cs (TypeContainer): Set correct resolve context for all field
2712         initializers.
2713         
2714 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2715
2716         * assign.cs: Fixed a crash when field is resolved twice with an error.
2717         
2718         * codegen.cs: Changed InFieldInitializer to be flag.
2719         
2720         * anonymous.cs, ecore.cs, expression.cs: Update after
2721         IsInFieldInitializer rename.
2722         
2723         * const.cs: Removed unused parameter.
2724         
2725         * class.cs: Changed the way how we resolve and emit field initializers.
2726         The field initilizers have to have access to contructor block to emit
2727         compiler generated code.
2728
2729 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2730
2731         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2732         generics use TypeContainer instead.
2733         
2734 2007-09-12  Marek Safar  <marek.safar@gmail.com>
2735         
2736         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2737
2738         * lambda.cs (ResolveParameters): Use more powerful
2739         InflateGenericArgument.
2740         
2741         * parameters.cs: Better exception message.
2742                 
2743 2007-09-10  Marek Safar  <marek.safar@gmail.com>
2744
2745         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2746         correct expression block type. 
2747         
2748         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2749         
2750         * expression.cs (Invocation): Extracted method group resolve to
2751         DoResolveOverload.
2752         
2753 2007-09-07  Marek Safar  <marek.safar@gmail.com>
2754
2755         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2756         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2757         
2758         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2759         generic extension methods.
2760
2761 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2762
2763         A fix for bug #82676 (Do I get it right now?)
2764         * convert.cs (Binary.ResolveOperator): An interface is converted to the
2765         object before a standard conversion is applied.
2766         
2767 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2768
2769         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2770         #82676.
2771         
2772 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2773
2774         A fix for bug #82676
2775         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2776         non-generic interface types.
2777         
2778 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2779
2780         A fix for bug #82690
2781         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2782         
2783 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2784
2785         A fix for bug #82571
2786         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
2787         modifier for container based methods.
2788         
2789 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2790
2791         A fix for bug #82676
2792         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2793         any interface-type T means to any of interface type T.
2794
2795 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2796
2797         * namespace.cs: We have 2 versions of System.Core assembly.
2798
2799 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2800
2801         A fix for bug #82652
2802         * class.cs (Class.GetClassBases): Compare types and not expressions.
2803
2804 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2805
2806         A fix for bug #82620
2807         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2808         actually never worked before.
2809         (IndexerAccess): Emit prepared arguments before they are modified.
2810         
2811 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2812
2813         A fix for bug #82563
2814         * assign.cs: Revert wrong fix.
2815         
2816         * expression.cs (VariableReference.EmitAssign): Handle ref reference
2817         correctly.
2818         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2819         Instead of ldelema/stdind we have to use temporary variables to handle
2820         cases like String.Concat (params string[]).
2821         
2822 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2823
2824         * class.cs: EmitAttributes to Emit rename.
2825         
2826         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2827         null.
2828         (MemberCore.HasClsCompliantAttribute): Don't depend on 
2829         GetClsCompliantAttributeValue execution.
2830         
2831 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2832
2833         * anonymous.cs: Use shorter type prefix.
2834         
2835         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2836         when exist.
2837         
2838         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2839         variables when probing is on.
2840         
2841         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
2842         unresolved variables.
2843         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2844         handle transparent identifiers.
2845         
2846 2007-08-26  Marek Safar  <marek.safar@gmail.com>
2847
2848         * attribute.cs (IsClsCompliant): Add nullable types test.
2849         
2850 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2851
2852         * doc.cs : catch other types of exception than XmlException to
2853           report CS1570. Fixed bug #82565.
2854
2855 2007-08-23  Marek Safar  <marek.safar@gmail.com>
2856
2857         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
2858         The number of delegate parameters has to match.
2859         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2860         arrays.
2861
2862 2007-08-21  Marek Safar  <marek.safar@gmail.com>
2863
2864         * anonymous.cs (AnonymousMethod): Generate private anonymous method
2865         to fix problem with private arguments.
2866
2867 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2868
2869         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2870         
2871         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
2872         
2873         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2874         empty. Add cloning suport.
2875         
2876         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2877
2878 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2879
2880         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
2881         to create EmptyCast. It handles EmptyConstantCast specialization for
2882         constants.
2883         
2884 2007-08-18  Marek Safar  <marek.safar@gmail.com>
2885
2886         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2887         (EmitArrayArgument): One routine for array arguments.
2888         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
2889         
2890 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2891
2892         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2893
2894 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2895
2896         * anonymous.cs: MemberLookupFinal update.
2897
2898         * class.cs (ConstructorInitializer): Is expression based.
2899         
2900         * delegate.cs: MethodGroupExpr update.
2901         
2902         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
2903         messages.
2904         (Error_MemberLookupFailed): Customizable error override.
2905         (MethodGroupExpr): Keep queried type for later usage.
2906         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2907         resolve.
2908         
2909         * expression.cs: Error_MemberLookupFailed refactoring.
2910         (New.DoResolve): Resolve as much as possible.
2911         (ElementInitializer.Error_MemberLookupFailed): Object initializer
2912         customization for invalid member types.
2913
2914         * statement.cs: MethodGroupExpr update.
2915         
2916 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2917
2918         * modifier.cs (Check): Check all modifiers and not only accessibility
2919         ones.
2920
2921 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2922
2923         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2924         type and not an expression.
2925
2926 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2927
2928         * statement.cs (Catch.Clone): Type and variable can be null.
2929
2930 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2931
2932         A fix for bug #81979
2933         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2934         I am really not sure whether this is the best fix.
2935         
2936         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2937         only once.
2938         
2939 2007-08-14  Marek Safar  <marek.safar@gmail.com>
2940
2941         ** C# 3.0 Object and collection initializers (major re-write)
2942         
2943         * assign.cs (DoResolve): Initializers are not assign related.
2944         
2945         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2946         used during collection or object initialization.
2947         
2948         * expression.cs (Error_InvalidArguments): Add initializers specific
2949         messages. More will come later because it requires some general
2950         refactoring.
2951         (New.DoResolve): Better error handling for unsafe types.
2952         (EmptyExpressionStatement): New class.
2953         (ElementInitializer): An object initializer expression.
2954         (CollectionElementInitializer): A collection initializer expression.
2955         (CollectionOrObjectInitializers): A block of object or collection
2956         initializers.
2957         (NewInitialize): New expression with element/object initializers.
2958         
2959         * statement.cs: Reverted object/collection initializer hacks.
2960         
2961         * typemanager.cs (CSharpName): Filter __arglist type.
2962         
2963 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2964
2965         ** C# 3.0 Anonymous Types (update to the latest standard)
2966         
2967         * expression.cs (Binary.ResolveOperator): Threat all null based types
2968         same.
2969         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2970         (AnonymousTypeParameter): Updated.
2971         
2972         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2973         (AnonymousTypeClass): New anonymous type container.
2974         
2975         * class.cs (AddField): Return operation result.
2976         
2977         * generic.cs: Another empty TypeArguments overload.
2978         
2979         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2980         are stored at top of normal hierarchy.
2981         
2982         * typemanager.cs (CSharpName): Filter anonymous types.
2983         
2984 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2985
2986         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
2987         as single Concat call. How could we miss that :-(
2988         
2989 2007-08-08  Marek Safar  <marek.safar@gmail.com>
2990
2991         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
2992         
2993 2007-08-07  Miguel de Icaza  <miguel@novell.com>
2994
2995         * expression.cs: Fix the previous commit, the creation of the
2996         arguments array list needs also to be conditional on the arguments
2997         not being null.
2998
2999         * class.cs: Add a little bit of help to help narrow down problems.
3000
3001         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
3002         not try to copy in that case. 
3003
3004         * driver.cs: When building SMCS, include a new different set of
3005         default assemblies here.   Do this here so we can control whether
3006         to include the default assemblies with /noconfig.
3007
3008 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3009
3010         A fix for bug #81979
3011         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
3012         only.
3013
3014 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3015
3016         A fix for bug #82300
3017
3018         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
3019         we are in probing scope.
3020
3021 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3022
3023         A fix for bug #82301
3024
3025         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
3026         (Statement.CloneTo): Clone and not map children blocks.
3027
3028 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3029
3030         A fix for bug #82299
3031
3032         * expression.cs (LocalVariableReference.CloneTo): Remap local info
3033         variable too.
3034         
3035         * statement.cs (Statement.CloneTo): Clone variables before statements
3036         to allow remaping of local variables.
3037
3038 2007-08-03  Marek Safar  <marek.safar@gmail.com>
3039
3040         A fix for bug #82296
3041
3042         * anonymous.cs,
3043         * report.cs: Log crash details for future clone problems.
3044         
3045         * statement.cs (Return.Clone): Don't clone non-existent expression.
3046
3047 2007-08-03  Raja R Harinath  <harinath@gmail.com>
3048
3049         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
3050         (Class.AddBasesForPart): Move CS0537 check here from ...
3051         * cs-parser.jay (class_declaration): ... here.  Move calling of
3052         'AddBasesForPart' to ...
3053         (class_bases): ... here.
3054         (struct_declaration, interface_declaration): Update to changes.
3055
3056 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3057
3058         A fix for bug #81923
3059
3060         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
3061         conversion is allowed.
3062
3063 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3064
3065         A fix for bug #81564
3066
3067         * ecore.cs (EventExpr): Add IsBase handling.
3068
3069         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
3070         too.    
3071         
3072 2007-08-02  Raja R Harinath  <harinath@gmail.com>
3073
3074         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
3075         * cs-parser.jay: Some whitespace cleanups.
3076         (current_delegate): New.
3077         (type_name): New.
3078         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
3079         a dummy code block, and use 'type_name' instead of 'member_name'.
3080         (interface_declaration, class_declaration): Likewise.
3081         (delegate_declaration): Likewise.  Rearrange slightly and use
3082         'current_delegate'.
3083         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
3084         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
3085
3086 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3087
3088         A fix for bug #82039
3089
3090         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
3091         available.
3092
3093         * typemanager.cs (CSharpName): Split to string overload.
3094
3095 2007-08-02  Marek Safar  <marek.safar@gmail.com>
3096
3097         * expression.cs,
3098         * report.cs: Updated warning CS0472.
3099
3100 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3101
3102         A fix for bug #82181
3103         * cs-parser.jay,
3104         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
3105
3106 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3107
3108         A fix for bug #82277
3109         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
3110
3111 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3112
3113         ** C# 3.0 Type Inference (major bits are working)
3114         
3115         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
3116         (.ImplicitStandardConversionExists): Uses compatible.
3117         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
3118         (.InferReturnType): New method.
3119         (.Compatible): Refactored.
3120         (.ResolveParameters): Uses factory to create resolved parameters.
3121         (.CompatibleMethod): Add probing mode support.
3122         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
3123         clearly distinguish between 2 different operations.
3124         (LambdaMethod): Moved to lambda.cs.
3125         (AnonymousMethod): Removed unused fields and methods.
3126         (AnonymousDelegate): Simplified.
3127         
3128         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
3129         
3130         * convert. cs (ImplicitConversionStandard): Compatible works differently.
3131         
3132         * delegate.cs (Delegate): New mehods to reduce code duplication.
3133         (.GetConstructor): New method.
3134         (.GetInvokeMethod): New method.
3135         (DelegateCreation): Updated.
3136         
3137         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
3138         does not exist.
3139         (OverloadResolve): Made probing little bit faster.
3140         
3141         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
3142         when probing is on.
3143         
3144         * generic.cs (TypeInferenceContext): Dummy implementation.
3145         
3146         * iterators.cs: Updated after Resolve/Define rename.
3147         
3148         * lambda.cs (LambdaExpression)
3149         (.ResolveParameters): Handles both type of arguments and type inference too.
3150         
3151         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
3152         (InflateTypes): Updated.
3153         
3154         * support.cs (InflateTypes): Changed signature and updated.
3155         
3156         * typemanager.cs (LookupMemberCache): Better dynamic type check.
3157         (MemberLookup_FindMembers): More MS tricks.
3158         (GetParameterData): Ditto.
3159         (GetDelegateParameters): Uses quick path for dynamic types.
3160         
3161 2007-08-01  Marek Safar  <marek.safar@gmail.com>
3162
3163         * class.cs (MethodData.Define): EmitContext is required for generic stuff
3164         only.
3165
3166 2007-07-31  Marek Safar  <marek.safar@gmail.com>
3167
3168         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
3169         syntax.
3170         
3171 2007-07-26  Jb Evain  <jbevain@novell.com>
3172
3173         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
3174         which takes a boolean 'report_errors', similar to the GetMethod.
3175         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
3176         in .net 2.1, do not report errors here.
3177
3178         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
3179         System.Runtime.CompilerServices.RequiredAttributeAttribute and
3180         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
3181         in .net 2.1.
3182
3183         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
3184         of the type InternalsVisibleToAttribute before the first call
3185         to CoreLookupType which is allowed to fail (third boolean parameter
3186         to true). Because, during the resolution for a type that is not
3187         immediately found, we try to check if the type is not defined in
3188         a friend assembly, and to do so, we need the
3189         InternalVisibleToAttribute.
3190
3191 2007-07-23  Miguel de Icaza  <miguel@novell.com>
3192
3193         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
3194         feature that allows structs to be compared against null and inline
3195         the result as true or false.
3196
3197         Notice that the same code is not permitted inside a generic block
3198         of code that would do:
3199
3200         class Foo<T> where T : struct {
3201             bool Eval (T x)
3202             {
3203                  return x == null;
3204             }
3205         }
3206
3207         It is only allowed if the type of T is not bound (no where
3208         clause).   In my opinion, this CSC 2 behavior is broken but people
3209         seem to be using it (IronRuby does, a few bug reports on bugzilla
3210         have it and some people have complained about it).
3211
3212         All of the users that depend on this behavior have code that is
3213         very likely broken. 
3214         
3215         * report.cs (Warning, Error): make these take object arguments,
3216         not strings, as that allows us to take advantage of Format.
3217
3218 2007-07-20  William Holmes  <billholmes54@gmail.com>
3219
3220         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
3221           Left member variable for the Count.
3222         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
3223           MemberName.CountTypeArguments to avoid a NRE. 
3224
3225         This code is contributed under the MIT X11 license
3226
3227 2007-07-18  Marek Safar  <marek.safar@gmail.com>
3228
3229         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
3230
3231 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
3232
3233         * doc.cs : generic method arguments are written as ``x while generic
3234           type arguments are `x. Combined with the previous change, fixed bug
3235           #79706.
3236
3237 2007-07-18  Raja R Harinath  <rharinath@novell.com>
3238
3239         Fix #82120
3240         * expression.cs (Binary.ResolveOperator): When converting
3241         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
3242
3243 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
3244
3245         * doc.cs : when T: or whatever x: is specified, it does not really
3246           check the doc comment's syntax correctness. Fixed bug #82006.
3247
3248 2007-07-18  Marek Safar  <marek.safar@gmail.com>
3249
3250         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
3251         LambdaExpression better.
3252         
3253         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
3254         
3255         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
3256         
3257         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
3258         as it can be generated.
3259         
3260         * expression.cs (Invocation.Error_InvalidArguments): Show correct
3261         modifiers.
3262         
3263         * lambda.cs (LambdaExpression): Refactored to share same code with
3264         AnonymousMethodExpression.
3265         
3266 2007-07-17  Marek Safar  <marek.safar@gmail.com>
3267
3268         * anonymous.cs (MakeName): Include host name for easier debugging.
3269         (LambdaMethod): New class for lambda spcecific stuff.
3270         
3271         * attribute.cs: Set EmitContext return type.
3272
3273         * class.cs: Set EmitContext return type.
3274         
3275         * codegen.cs (EmitContext): Return type cannot be null to stop messing
3276         with null/void meaning.
3277         
3278         * iterators.cs (ContainerType): Implemented.
3279         
3280         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
3281         
3282         * statement.cs (Return): Updated to lambda expressions.
3283         (Block.CloneTo): Parent can be null.
3284                 
3285 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3286
3287         A fix for bug #81917
3288         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
3289         
3290         * class.cs (FixedField): Check whether field is in unsafe scope.
3291
3292         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
3293         (FieldExpr.Emit): Fixed buffers cannot be volatile.
3294
3295         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
3296         FieldExpr.
3297         
3298         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
3299                 
3300 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3301
3302         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
3303         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
3304         from Report class.
3305
3306 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3307
3308         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
3309         
3310 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3311
3312         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3313         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3314         
3315         * codegen.cs(EmitContext): Add ProbingMode flag.
3316         
3317         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3318         
3319         * driver.cs: For now set both warning values.
3320         
3321         * ecore.cs (SimpleName): Name is readonly.
3322         (MethodGroup.OverloadResolve): One quick path for probing.
3323         
3324         * expression.cs (Unary): Set Oper r/o.
3325         (Binary): Set Oper r/o.
3326         (ParameterReference): Set few instance variables as r/o.
3327         (ParameterReference.DoResolveBase): Don't capture aruments when 
3328         the probing is on.
3329         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3330         (Arglist): arguments are private.
3331         (SizeOf): type is private and r/o.
3332         (MemberAccess): arguments are private.
3333
3334         * report.cs: Enhanced reporting on/off capabilities.
3335         
3336         * lambda.cs: Uses ec.IsInProbingMode.
3337         (ContextualReturn): Derives from return.
3338         
3339         * rootcontext.cs: For now set both warning values.
3340         
3341         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3342         copy if one exists.
3343         (Return.Resolve): Don't die immediately.
3344         (Block.Resolve): Speed-up probing.
3345         (Block.CloneTo): Clone only child blocks.
3346
3347 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3348
3349         * iterators.cs: reverted Miguel's latest change (r81925) as it
3350         breaks the build in System.
3351
3352 2007-07-13  Miguel de Icaza  <miguel@novell.com>
3353
3354         * iterators.cs (Yield.CheckContext): Check for the iterator type
3355         also here as we can call into Yield even in codepaths that are not
3356         directly checked by
3357         (MethodOrOperator is the only path that was checked).
3358
3359         In addition to the standard check, use a more specific check for
3360         constructors to report a more verbose error. 
3361
3362 2007-07-12  Miguel de Icaza  <miguel@novell.com>
3363
3364         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3365         report the warning and continue 
3366
3367         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3368         values on the stack on the call to Emit.   Use EmitStatement if
3369         possible, or using Emit + Pop if not possible.   Fixes #82064
3370
3371 2007-07-12  Raja R Harinath  <rharinath@novell.com>
3372
3373         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3374         avoid try...finally in some cases.
3375
3376 2007-07-10  Marek Safar  <marek.safar@gmail.com>
3377
3378         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3379         
3380         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3381         instead of method. Re-use standard error handling.
3382         (ConstructorInitializer.Emit): Simplified.
3383         
3384         * delegate.cs: Updated after Invocation.EmitCall change.
3385         
3386         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3387         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3388         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3389         method and don't permanently changing input arguments.
3390         (MethodGroupExpr): Introduced resolved best_candidate, when method group
3391         is resolved it has one of the candidates is the best one which is later
3392         used to emit. Removed a few unused method.
3393         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3394
3395         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3396         (Binary.ResolveOperator): Ditto.
3397         (ConditionalLogicalOperator.DoResolve): Ditto.
3398         (Invocation): Uses method group.
3399         (Invocation.DoResolve): Simplified.
3400         (Invocation.EmitCall): Removed useless is_static.
3401         (Invocation.Emit): Delegate to method group.
3402         (Invocation.EmitStatement): Simplified.
3403         (New): Uses method group.
3404         (MemberAccess.DoResolve): Don't destroy original expression.
3405         
3406         * statement.cs (ForEach.Resolve): Use null for no method arguments.
3407         
3408 2007-07-04  Marek Safar  <marek.safar@gmail.com>
3409
3410         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3411         
3412         * anonymous.cs,
3413         * lambda.cs: Add custom error message type.
3414
3415 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3416
3417         * lambda.cs: Simplified little bit.
3418         
3419         * parameter.cs: Introduced ImplicitLambdaParameter.
3420         (Parameters.CreateFullyResolved): New factory instead of ctor.
3421         
3422         * anonymous.cs,
3423         * class.cs,
3424         * delegate.cs: Updated parameter creation.
3425         
3426 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3427
3428         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3429         arguments.
3430         
3431         * generic.cs: Synchronized with gmcs.
3432         
3433 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3434
3435         * class.cs (Indexer): Check return type as soon as possible.
3436         
3437         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3438         members too.
3439         
3440         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3441         
3442         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3443         
3444         * parameter.cs (Parameter): Use expression type when it is available.
3445         
3446         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3447         method modifier for the first parameter only.
3448
3449 2007-06-24  Marek Safar  <marek.safar@gmail.com>
3450
3451         A fix for bug #81938
3452         * typemanager.cs (ChangeType): Fixed couple of char conversions.
3453         
3454         * constant.cs: Tide up an exception message.
3455
3456 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3457
3458         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3459         an uninitialized variable is used.
3460         
3461         * expression.cs (LocalVariableReference.DoResolve): Ditto.
3462
3463 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3464
3465         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3466         not found error handling.
3467
3468         * expression.cs (ArrayCreation): Removed redundant fields and little bit
3469         simplified.
3470         (ArrayCreation.ResolveArrayElement): To be ready to customization.
3471         (ArrayCreation.DoResolve): Simplified.
3472         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3473         its own resolve process.
3474         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3475
3476 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3477
3478         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3479         more error details.
3480         
3481 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3482
3483         * cs-tokenizer.cs: Removed var related stuff.
3484         
3485         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3486         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3487         a type and a keyword at same time.
3488         
3489         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3490         matches to "var".
3491         
3492         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3493         implicitly typed arrays, more changes will follow.
3494         
3495         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3496         
3497 2007-06-19  Marek Safar  <marek.safar@gmail.com>
3498
3499         * ecore.cs (VarExpr): Removed Handled field.
3500         
3501         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3502         build-in assign functionality.
3503         (ForEach.Resolve): Removed all implicitly typed local variable code and
3504         simplified.
3505         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3506         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3507
3508 2007-06-18  Marek Safar  <marek.safar@gmail.com>
3509
3510         * assign.cs: Removed implicitly typed local variable check.
3511         
3512         * expression.cs (LocalVariableReference.DoResolve): Add check for self
3513         referencing implicitly typed local variable.
3514         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3515         variable here.
3516         
3517         * statement.cs (Fixed): Removed unsupported implicitly typed local
3518         variable code.
3519
3520 2007-06-15  Marek Safar  <marek.safar@gmail.com>
3521
3522         * decl.cs (MemberName): Moved all Unbound stuff to parser.
3523
3524 2007-06-14  Marek Safar  <marek.safar@gmail.com>
3525
3526         A fix for bugs #81855 and #76274
3527         * attribute.cs (AttachTo): Always set owner for global attributes to
3528         prefined owner.
3529         
3530         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3531         usefull too.
3532         
3533         * cs-parser.jay: Assembly and module attributes must precede all other
3534         elements except using clauses and extern alias declarations.
3535
3536 2007-06-13  Marek Safar  <marek.safar@gmail.com>
3537
3538         A fix for bug #81748
3539         * cs-tokenizer.cs,
3540         * expression.cs: More checks for non ISO-1 features.
3541
3542 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3543
3544         A fix for bug #81807
3545         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3546         present inside switch statement and it is required by nullable check.
3547
3548 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3549
3550         A fix for bug #81840
3551         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3552         when type matching fails.
3553         
3554         * namespace.cs: Tiny error message change.
3555
3556 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3557
3558         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3559         reporting. Added automatic property check.
3560         
3561         * class.cs: Updated after CheckAbstractAndExtern relocation.
3562         (AEventPropertyAccessor.GetSignatureForError): Customized.
3563         
3564 2007-06-11  Marek Safar  <marek.safar@gmail.com>
3565
3566         * class.cs (DefineBaseTypes): Base type can be undefined.
3567         
3568         * ecore.cs (TypeLookup): Minor refactoring.
3569         (DoResolveAsTypeStep): Removed redundant check.
3570
3571         * namespace.cs (Lookup): Removed redundant check.
3572                 
3573         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
3574         ResolveAsTypeTerminal step.
3575         (BootstrapCorlib_*): Simplified.
3576         (PopulateCoreType): Core types can be now external.
3577
3578 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3579
3580         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3581          verification only.
3582          (InferTypeArguments): Infers anonymous expression type arguments.
3583          (Compatible): Split to Compatible and InferTypeArguments. 
3584         
3585         * lambda.cs: Updated.
3586
3587 2007-06-08  Marek Safar  <marek.safar@gmail.com>
3588
3589         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3590
3591 2007-06-07  Raja R Harinath  <harinath@gmail.com>
3592
3593         Fix #80477, cs0135-2.cs, cs0135-3.cs
3594         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3595         names to the "known" variables list.
3596         (Block.CheckInvariantMeaningInBlock): Handle the fact the
3597         parameter names are also "known".
3598         (Block.CheckError136): Remove.
3599         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
3600         null.
3601
3602 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3603
3604         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3605
3606 2007-06-06  Marek Safar  <marek.safar@gmail.com>
3607
3608         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3609         internal error not an user error.
3610          
3611         * expression.cs (IsApplicable): Refactored to make debugging easier.
3612
3613         * support.cs: More tricks for non-mono runtimes.
3614         
3615         * typemanager.cs (CoreLookupType): Made public.
3616         (InitSystemCore): All linq specific stuff moved to linq.cs
3617
3618 2007-06-05  Marek Safar  <marek.safar@gmail.com>
3619
3620         * typemanager.cs (CSharpSignature): One more missing build-in types
3621         replacement.
3622         More tricks for non-mono runtime.
3623
3624 2007-06-05  Raja R Harinath  <harinath@gmail.com>
3625
3626         * statement.cs (Block.CheckError136_InParents): Remove.
3627         (Block.AddVariable): Use GetParameterInfo instead.
3628         (ToplevelBlock.ProcessArguments): Likewise.
3629
3630 2007-06-04  Raja R Harinath  <rharinath@novell.com>
3631
3632         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
3633         information too.
3634         (ToplevelBlock.GetParameterInfo): Split out of ...
3635         (ToplevelBlock.GetParameterRefernce): ... this.
3636         (ToplevelBlock.ParameterMap): Remove.
3637         * expression.cs (ParameterReference): Update to use
3638         ToplevelParameterInfo.
3639
3640         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3641         regression.
3642
3643         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3644         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3645
3646         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3647         (ToplevelBlock.ProcessParameters) ... here.
3648         (ToplevelBlock..ctor): Invoke it.
3649
3650         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3651         new parameters.
3652
3653         * statement.cs (IKnownVariable): New interface.
3654         (LocalInfo): Implement it.
3655         (ToplevelParameterInfo): New class.
3656         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3657         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
3658         GetKnownVariableInfo.
3659
3660 2007-06-03  Raja R Harinath  <harinath@gmail.com>
3661
3662         Partly speed up CS0136 error checks.
3663         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3664         'recurse' parameter.
3665         (Block.DoCheckError136): Only check errors in parameters.  Move
3666         local variable checks ...
3667         (Block.AddVariable): ... here, and ...
3668         (ToplevelBlock.ResolveMeta): ... here.
3669
3670 2007-06-02  Raja R Harinath  <harinath@gmail.com>
3671
3672         * statement.cs (Block.IsChildOf): Remove.
3673
3674         * statement.cs (Statement.Clone): Move special case code ...
3675         (Block.CloneTo): ... here.
3676
3677 2007-05-29  Raja R Harinath  <rharinath@novell.com>
3678
3679         * statement.cs (ToplevelBlock.container): Remove field.  It's
3680         redundant with 'Parent'.
3681         (ToplevelBlock.ContainerBlock): Remove accessor.
3682         (ToplevelBlock..ctor): Update to changes.  Register anonymous
3683         child with parent here, ...
3684         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
3685         current_block.
3686         (start_anonymous): Don't save current_block.
3687         (top_current_block): Remove.
3688
3689         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3690         (Block.Resolve): Update to changes.
3691         (Block..ctor): Move setting of "correct" 'Toplevel'
3692         and 'Explicit' fields to ...
3693         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3694
3695 2007-05-27  Raja R Harinath  <harinath@gmail.com>
3696
3697         Kill Block.Implicit
3698         * statement.cs (Block.Implicit): Remove.
3699         (Block): Update to changes.
3700         * flowanalysis.cs: Likewise.
3701
3702         Mildly speed up CheckInvariantMeaningInBlock
3703         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3704         Recursively call AddKnownVariable to all enclosing blocks.
3705         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3706         Remove recursive calls.
3707         (Block): Update to changes.
3708
3709         New ExplicitBlock invariants
3710         * statement.cs (Block.Explicit): New field.  It points to the
3711         immediately enclosing non-implicit block.
3712         (Block..ctor): Maintain the invariant.
3713         * cs-parser.jay: Take advantage of invariant.
3714
3715         Introduce ExplicitBlock
3716         * statement.cs (ExplicitBlock): New.
3717         (ToplevelBlock): Derive from it.
3718         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3719         sense of flag.
3720         (Block.Implicit): Update to changes.
3721         * cs-parser.jay: Update to changes.
3722
3723         Remove unused field
3724         * codegen.cs (EmitContext.IsLastStatement): Remove.
3725         * statement.cs (Block.DoEmit): Update to changes.
3726
3727 2007-05-25  Raja R Harinath  <rharinath@novell.com>
3728
3729         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3730         modifying current_block directly.
3731
3732 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
3733         
3734         * class.cs: Implemented automatic properties (C# 3.0)
3735           Thanks to Marek for the help.
3736
3737 2007-05-23  Raja R Harinath  <rharinath@novell.com>
3738
3739         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3740         variable as assigned, note also that all its components are
3741         assigned too.
3742         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
3743
3744 2007-05-19  Marek Safar  <marek.safar@gmail.com>
3745
3746         * anonymous.cs, class.cs: Emit Compiler generated attribute when
3747         member is marked as compiler generated.
3748         
3749         * decl.cs (MemberCore): Refactored ModFlags into property.
3750
3751         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3752         (Check): Check only accessibility modifiers.
3753
3754 2007-05-18  Raja R Harinath  <rharinath@novell.com>
3755
3756         Track all assignable slots in one bit array
3757         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3758         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
3759         logic from VariableMap constructor here.  Use the same 'offset'
3760         variable that's later used for computing offsets of local
3761         variables.
3762         * flowanalysis.cs (UsageVector.parameters): Remove.
3763         (UsageVector): Update to changes.
3764         (VariableMap): Remove.
3765
3766         Avoid creating ParameterMap in every block
3767         * statement.cs (Block.ParameterMap): Move ...
3768         (ToplevelBlock.ParameterMap): ... here.
3769         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3770         only once.
3771         * flowanalysis.cs (FlowBranching.param_map): Remove.
3772         (FlowBranching.UsageVector): Update to changes.
3773         (FlowBranchingToplevel.CheckOutParameters): Likewise.
3774
3775         * statement.cs (Block.CloneTo): Clone Toplevel field too.
3776
3777         * expression.cs (ParameterReference): Distinguish between block
3778         where parameter was referenced and declared.
3779
3780 2007-05-18  Marek Safar  <marek.safar@gmail.com>
3781
3782         * flowanalysis.cs, statement.cs: Put back improved error handling.
3783
3784 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
3785         
3786         * assign.cs:
3787         * expression.cs:
3788           Imporved object and collection initialization (C# 3.0).
3789
3790 2007-05-15  Marek Safar  <marek.safar@gmail.com>
3791
3792         A fix for bug #81380
3793         * expression.cs (Is.DoResolve): Only value types have constant `is'
3794         behaviour.
3795
3796 2007-05-15  Raja R Harinath  <rharinath@novell.com>
3797
3798         * statement.cs (ToplevelBlock.child): Remove.
3799
3800 2007-05-15  Raja R Harinath  <harinath@gmail.com>
3801
3802         Rationalize ResolveMeta: refactoring
3803         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
3804         out constant handling code into ...
3805         (Block.DoResolveConstants): ... this.
3806
3807         Rationalize ResolveMeta: kill local_map
3808         * statement.cs (Block.local_map, Block.LocalMap): Remove.
3809         (Block.AssignableSlots): New.
3810         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
3811         for locals -- move code from VariableMap here.  Avoid unnecessary
3812         allocations.
3813         * flowanalysis.cs (FlowBranching.local_map): Remove.
3814         (FlowBranching..ctor): Use Block.AssignableSlots.
3815         (VariableMap): Remove unused constructors.
3816
3817 2007-05-11  Raja R Harinath  <rharinath@novell.com>
3818
3819         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3820
3821 2007-05-11  Marek Safar  <marek.safar@gmail.com>
3822
3823         * typemanager.cs (IsFriendAssembly): Should not be called for building
3824         assembly.
3825
3826 2007-05-09  Marek Safar  <marek.safar@gmail.com>
3827
3828         * literal.cs (NullConstant): Print null in all cases.
3829         
3830         * expression.cs (Binary.ResolveOperator): Implemented delegate
3831          comparison based on C# 2.0 changes.
3832
3833 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
3834
3835         This code is contributed under the MIT X11 license
3836         
3837         The following enables support for several C# 3.0 language features:
3838         
3839         * cs-tokenizer.cs: Added support for the "var" keyword.
3840         
3841         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3842           Added VarExpr class to facilitate type inferencing.
3843         
3844         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3845           to support anonymous types.
3846         
3847         * assign.cs: Added support for type inferencing and initialization.
3848         
3849         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3850         
3851         * expression.cs: Added implicit array support to ArrayCreation.
3852           Added 5 types and 1 interface:
3853           
3854           IInitializable                Implementing classes can inject initializing
3855                                         statements after object instantiation.
3856           
3857           Initializer                   Stores data for object initialization.
3858           
3859           AnonymousType                 An expression for anonymous types.
3860           
3861           AnonymousTypeParameter        Stores data about an anonymous type's field.
3862           
3863           NewInitialize                 An expression for object initialization.
3864           
3865           CollectionInitialize          An expression for collection initialization.
3866         
3867         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3868           statements.
3869
3870 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3871
3872         A fix for bug #81500
3873         * cs-tokenizer.cs: Add special handling for coalescing operator.
3874
3875 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3876
3877         A fix for bug #81529
3878         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3879         its value from base class until it is redefined.
3880
3881 2007-05-02  Raja R Harinath  <rharinath@novell.com>
3882
3883         Fix regression in cs0631-3.cs
3884         * cs-parser.jay (operator_declarator): Add opt_attributes to error
3885         fallback.  Make error fallback catch more cases.
3886
3887 2007-05-01  Miguel de Icaza  <miguel@novell.com>
3888
3889         * cs-parser.jay: Allow parameters in operator declarations to have
3890         attributes. 
3891
3892 2007-04-27  Miguel de Icaza  <miguel@novell.com>
3893
3894         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3895         exists. 
3896
3897         * lambda.cs (ContextualReturn.Resolve): An expression is valid
3898         inside the ContextualReturn, it does not have to be an
3899         ExpressionStatement. 
3900
3901 2007-04-24  Miguel de Icaza  <miguel@novell.com>
3902
3903         * lambda.cs (ContextualReturn.Resolve): if the return type is not
3904         set, set it.
3905
3906 2007-04-23  Miguel de Icaza  <miguel@novell.com>
3907
3908         * anonymous.cs (AnonymousContainer): split the virtual Resolve
3909         method in two methods: ResolveNoDefine and Resolve.
3910
3911         ResolveNoDefine will stop just after ResolveTopBlock has been
3912         called.   
3913
3914         Resolve will then continue by creating a method and issuing the
3915         call to method.Define ().
3916
3917         (AnonymousMethod): Split and implement the new Resolve and
3918         ResolveNoDefine as well.
3919
3920         * lambda.cs (LambdaExpression): Split the anonymous method
3921         resolution code into a separate routine (CoreCompatibilityTest)
3922         from DoCompatibleTest.
3923
3924         (LambdaExpression.TryBuild): New method, this method tries to
3925         build the LambdaExpression with the given set of types to be used
3926         as the types for the various parameters of the lambda expression. 
3927
3928         If the compilation succeed with the given types, the infered type
3929         of the Anonymous method is returned, otherwise null is returned.
3930
3931 2007-04-23  Marek Safar  <marek.safar@gmail.com>
3932
3933         A fix for bug #81414
3934         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3935
3936 2007-04-22  Miguel de Icaza  <miguel@novell.com>
3937
3938         * cs-tokenizer.cs: Change various identifiers here from the
3939         camelCasing to the recommended Linux-like style for instance
3940         variables from the Coding Guidelines. 
3941
3942 2007-04-19  Martin Baulig  <martin@ximian.com>
3943
3944         * convert.cs
3945         (Convert.ImplicitReferenceConversionCore): Allow conversions from
3946         System.Enum to System.ValueType.
3947
3948 2007-04-13  Martin Baulig  <martin@ximian.com>
3949
3950         Rewrote implicit reference conversions.  We need to distinguish
3951         between implicit reference conversions (13.1.4) and implicit
3952         boxing conversions (13.1.5).
3953
3954         According to the spec, there's an an implicit conversion
3955         "From a one-dimensional array-type S[] to IList<T> and base
3956         interfaces of this interface, provided there is an implicit
3957         reference conversion from S to T."  Note that this does not
3958         include boxing conversions.
3959
3960         * convert.cs
3961         (Convert.ImplicitTypeParameterBoxingConversion): New method.
3962         (Convert.ImplicitReferenceConversion): Split into
3963         ImplicitReferenceConversionCore() and
3964         ImplicitBoxingConversionExist().
3965         (Convert.ImplicitReferenceConversionExists): Use the new
3966         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3967
3968 2007-04-12  Martin Baulig  <martin@ximian.com>
3969
3970         * convert.cs (Convert.ImplicitReferenceConversion): Move the
3971         `TypeManager.null_type' checks up to the top of the method.
3972
3973 2007-04-11  Marek Safar  <marek.safar@gmail.com>
3974
3975         A fix for bug #81350
3976         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3977         extension methods.
3978
3979 2007-04-11  Martin Baulig  <martin@ximian.com>
3980
3981         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3982         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
3983         to make this work for generic classes; fixes #79561.
3984
3985 2007-04-11  Martin Baulig  <martin@ximian.com>
3986
3987         * expression.cs (As): Add support for nullable types; fixes #79371.
3988
3989 2007-04-11  Martin Baulig  <martin@ximian.com>
3990
3991         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
3992         `type.FullName' is null; fixes #80243.
3993
3994 2007-04-11  Martin Baulig  <martin@ximian.com>
3995
3996         * expression.cs (Invocation.IsApplicable): Don't modify the method
3997         if type inference succeeded, but the method was not applicable.
3998         Fixes #81250.
3999
4000 2007-04-10  Marek Safar  <marek.safar@gmail.com>
4001
4002         A fix for bug #81324
4003         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
4004         internal and external namespaces containers.
4005
4006 2007-04-10  Martin Baulig  <martin@ximian.com>
4007
4008         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
4009         TypeManager.DropGenericMethodArguments() so we also call
4010         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
4011
4012 2007-04-10  Martin Baulig  <martin@ximian.com>
4013
4014         * iterators.cs (Iterator.CreateIterator): Don't crash if
4015         `method.ReturnType' is null.  This happens if something went wrong
4016         while resolving that typ (we already reported an error in this case).
4017
4018 2007-04-10  Martin Baulig  <martin@ximian.com>
4019
4020         * expression.cs (New.DoResolve): Don't call CheckComImport() on
4021         generic interfaces; report the CS0144 directly.
4022
4023 2007-04-10  Martin Baulig  <martin@ximian.com>
4024
4025         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
4026         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
4027
4028 2007-04-10  Martin Baulig  <martin@ximian.com>
4029
4030         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
4031
4032 2007-04-09  Raja R Harinath  <rharinath@novell.com>
4033
4034         A better fix
4035         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
4036         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
4037
4038         Fix #81338
4039         * statement.cs (For.Resolve): If resolution fails, use
4040         KillFlowBranching.
4041
4042 2007-04-08  Marek Safar  <marek.safar@gmail.com>
4043
4044         * anonymous.cs (MakeName): Make faster and zero-based.
4045         (VerifyExplicitParameterCompatibility): Back to mode where generic
4046         parameter is ignored.
4047         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
4048
4049         * class.cs (EmitType): Method can emit another new method.
4050
4051         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
4052
4053         * driver.cs: Updated.
4054
4055         * lambda.cs: Reuse predefined empty parameters.
4056
4057         * parameter.cs: Updated
4058
4059         * support.cs: Implemented InflateTypes.
4060
4061         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
4062         (InitSystemCore): Introduced to isolate 3.0 dependencies.
4063
4064 2007-04-03  Martin Baulig  <martin@ximian.com>
4065
4066         Fix #80632.
4067
4068         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
4069         version of TypeManager.IsOverride() which also works with generic
4070         types.  
4071
4072 2007-04-03  Martin Baulig  <martin@ximian.com>
4073
4074         Fix #81044.
4075
4076         * convert.cs
4077         (Convert.ExplicitReferenceConversion): We need to cast when
4078         converting from IList<T> to S[].
4079
4080 2007-04-01  Marek Safar  <marek.safar@gmail.com>
4081
4082         * decl.cs (FindExtensionMethods): Consider all candidates with same name
4083         at this level.
4084         
4085         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
4086
4087 2007-03-31  Marek Safar  <marek.safar@gmail.com>
4088
4089         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
4090         argument and return type inferring.
4091
4092         * codegen.cs (InferReturnType): Flag whether return can be inferred.
4093         (ReturnType): Turned to property.
4094
4095         * statement.cs (Return): Implemented return type inferring.
4096
4097         * support.cs (ReflectionParameters): Use local types if possible.
4098
4099 2007-03-30  Raja R Harinath  <rharinath@novell.com>
4100
4101         * flowanalysis.cs (FlowBranching.Reachability): Remove.
4102         (FlowBranching.UsageVector): Update to changes.
4103
4104         Prepare to kill 'Reachability'
4105         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
4106         argument of constructor.
4107
4108 2007-03-29  Raja R Harinath  <rharinath@novell.com>
4109
4110         Prepare to kill 'Reachability'
4111         * flowanalysis.cs (UsageVector.is_unreachable): New.
4112         (UsageVector): Update to maintain 'is_unreachable' in parallel to
4113         'reachability', and verify they're consistent.
4114
4115         Fix #81121
4116         * expression.cs (New.EmitStatement): Handle type parameters here too.
4117
4118 2007-03-29  Martin Baulig  <martin@ximian.com>
4119
4120         Fix #79148.
4121
4122         * anonymous.cs
4123         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
4124         CompilerGeneratedClass.
4125         (ScopeInfo.EmitScopeInstance): Make this protected.
4126         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
4127         `ec.CurrentAnonymousMethod.Scope == Scope'.
4128
4129         * statement.cs (Block.ScopeInfo): Make this a property.
4130
4131 2007-03-27  Raja R Harinath  <harinath@gmail.com>
4132
4133         Prepare to kill 'Reachability'
4134         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
4135         (FlowBranching.UsageVector.Reachability): Remove property.
4136         (FlowBranching.UsageVector.IsUnreachable): New property.
4137         (FlowBranching.UsageVector.ResetBarrier): New.
4138         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
4139         * codegen.cs, statement.cs: Update to changes.
4140
4141 2007-03-27  Martin Baulig  <martin@ximian.com>
4142
4143         Fix #81209.
4144
4145         * decl.cs
4146         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
4147         generic types.
4148
4149 2007-03-26  Raja R Harinath  <rharinath@novell.com>
4150
4151         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
4152         instead of TriState.  Remove all mention of TriState.
4153
4154         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
4155         replaced by a boolean.  Add boolean 'is_unreachable' field, check
4156         and maintain invariants.
4157
4158 2007-03-25  Marek Safar  <marek.safar@gmail.com>
4159
4160         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
4161
4162 2007-03-25  Marek Safar  <marek.safar@gmail.com>
4163
4164         * expression.cs: Stop using obsolete 2.0 opcodes.
4165
4166 2007-03-25  Marek Safar  <marek.safar@gmail.com>
4167
4168         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
4169         one of the latests Martin's fixes.
4170
4171 2007-03-23  Miguel de Icaza  <miguel@novell.com>
4172
4173         * expression.cs: On BigEndian systems, swap the bytes, temporary
4174         solution until we get a new bitconverter class.
4175
4176 2007-03-23  Martin Baulig  <martin@ximian.com>
4177
4178         Fix #81158.
4179
4180         * decl.cs (MemberCache.AddMembers): Add generic methods both as
4181         "Method" and "Method`1".  Normally, a cache lookup is done on the
4182         "Method" form (ie. without the generic arity), but this one makes
4183         lookups on the full form work as well.
4184
4185 2007-03-22  Raja R Harinath  <rharinath@novell.com>
4186
4187         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
4188         unused properties.
4189
4190 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
4191         * class.cs: 
4192         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
4193         ordered_member_list, to TypeBuilder to store members to be defined
4194         in the order they were parsed in.
4195         - ordered_explicit_member_list contains all properties indexers
4196           and methods that are defined as explicit implementation of an
4197           interface or base class.
4198         - ordered_member_list contains all properties indexers and methods
4199           that are not defined as explicit implementation of an interface
4200           or base class.
4201
4202         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
4203         functionality in these removed classes has been replaced with 
4204         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
4205         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
4206
4207         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
4208         to CheckForDuplications inside GetMethod and SetMethod Define Method
4209         to handle method property and indexer name conflicts.
4210
4211         Fixes #79434
4212
4213         All code is contributed under the MIT/X11 license.
4214
4215 2007-03-20  Martin Baulig  <martin@ximian.com>
4216
4217         * class.cs (TypeContainer.Interfaces): Removed; they're now
4218         included in `TypeContainer.Types'.
4219
4220 2007-03-20  Martin Baulig  <martin@ximian.com>
4221
4222         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
4223
4224         * class.cs (TypeContainer.CreateType): New public method.  This is
4225         now called before DefineType() to create the TypeBuilders.
4226         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
4227         has already been created by CreateType().
4228         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
4229         don't resolve our base classes here; this has been moved into
4230         DefineBaseTypes().  We're now called from CreateType().
4231         (TypeContainer.DefineBaseTypes): New private method; resolve our
4232         base classes here.  We're now called from DefineType().
4233
4234         * rootcontext.cs
4235         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
4236         our types first to create all the TypeBuilders.  After that, call
4237         TypeContainer.DefineType() on all the types which'll resolve their
4238         base classes and setup the resolve order.
4239
4240 2007-03-20  Martin Baulig  <martin@ximian.com>
4241
4242         * class.cs (TypeContainer.Enums): Removed; they're now included in
4243         `TypeContainer.Types'.  
4244
4245 2007-03-20  Martin Baulig  <martin@ximian.com>
4246
4247         * class.cs
4248         (TypeContainer.DefineType): Don't call ResolveMembers() here.
4249         (TypeContainer.DoResolveMembers): Call DefineType() on our
4250         `compiler_generated' classes; moved here from DefineNestedTypes().
4251
4252         * rootcontext.cs
4253         (RootContext.ResolveTree): Call ResolveMembers() on all
4254         TypeContainer's in the `type_container_resolve_order'.
4255
4256 2007-03-19  Marek Safar  <marek.safar@gmail.com>
4257
4258         * class.cs: Use corlib to handle InternalMethodImplAttribute.
4259
4260 2007-03-17  Marek Safar  <marek.safar@gmail.com>
4261
4262         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
4263         implementation flags.
4264
4265 2007-03-17  Marek Safar  <marek.safar@gmail.com>
4266
4267         * class.cs: More optimizations for type parameters.
4268
4269 2007-03-15  Marek Safar  <marek.safar@gmail.com>
4270
4271         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
4272
4273         * ecore.cs, parameter.cs: More common code for both corlibs.
4274
4275         * typemanager.cs (IsGenericMethod): Simplified.
4276
4277 2007-03-15  Raja R Harinath  <rharinath@novell.com>
4278
4279         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4280         'returns'.
4281         * statement.cs, iterators.cs, lambda.cs: Update to changes.
4282
4283         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
4284         unconditionally.  Simplify explanation.
4285         (Try.Resolve, Using.Resolve): Likewise.
4286
4287 2007-03-15  Martin Baulig  <martin@ximian.com>
4288
4289         Fix #80731.
4290
4291         * decl.cs (DeclSpace): If we're a partial class, use our
4292         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
4293
4294 2007-03-15  Raja R Harinath  <rharinath@novell.com>
4295
4296         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4297         'throws'.
4298         (FlowBranching.UsageVector): Update to changes.
4299         (FlowBranching.MergeSiblings): Likewise.
4300         * statement.cs: Likewise.
4301
4302 2007-03-15  Martin Baulig  <martin@ximian.com>
4303
4304         Fix #79302.
4305
4306         * decl.cs
4307         (MemberCache): Added a special .ctor for type parameters.
4308
4309         * typemanager.cs
4310         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
4311         `MemberCache'.  
4312
4313 2007-03-09  Martin Baulig  <martin@ximian.com>
4314
4315         * enum.cs (Enum): Make this a TypeContainer.
4316         (EnumMember): Derive from `Const'.
4317
4318         * const.cs
4319         (Const.DoResolveValue): New protected virtual method; move most of
4320         the functionality of ResolveValue() here so we can override it in
4321         `EnumMember'.
4322         (Const.CreateConstantReference): Make this virtual.
4323
4324         * class.cs (Kind): Add `Kind.Enum'.
4325         (TypeContainer.Emit): Don't emit the enums here; they're already
4326         in the `RootContext.typecontainer_resolve_order'.
4327
4328         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4329         here; they're already in the `typecontainer_resolve_order'.
4330
4331         * ecore.cs (EnumConstant.ConvertImplicitly): Add
4332         TypeManager.DropGenericTypeArguments().
4333
4334         * typemanager.cs
4335         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4336         (TypeManager.IsEnumType): Likewise.
4337         (TypeManager.EnumToUnderlying): Likewise.
4338         (TypeManager.IsEqual): Add support for enums.
4339
4340 2007-03-12  Raja R Harinath  <rharinath@novell.com>
4341
4342         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4343         DefaultParameterValueAttribute to be undefined, say if System.dll
4344         is not referenced.
4345
4346 2007-03-11  Marek Safar  <marek.safar@gmail.com>
4347
4348         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4349         any mscorlib.
4350
4351 2007-03-10  Marek Safar  <marek.safar@gmail.com>
4352
4353         * class.cs, parameter.cs: Unified parameters verification.
4354
4355 2007-03-08  Martin Baulig  <martin@ximian.com>
4356
4357         * cs-parser.jay (constructor_header): Pass the location to the
4358         newly created TopLevelBlock.
4359
4360 2007-03-07  Martin Baulig  <martin@ximian.com>
4361
4362         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4363
4364 2007-03-06  Miguel de Icaza  <miguel@novell.com>
4365
4366         * convert.cs (ExplicitReferenceConversionExists): Sync this method
4367         with the changes from David, fixes the build.
4368
4369 2007-03-05  David Mitchell  <dmitchell@logos.com>
4370
4371         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4372         and its base interfaces to a one-dimensional array type S[],
4373         provided there is an implicit or explicit reference conversion
4374         from S to T.
4375
4376 2007-03-03  Marek Safar  <marek.safar@gmail.com>
4377
4378         * cs-tokenizer.cs: Implemented basic linq grammar.
4379
4380         * driver.cs: Set linq lang version on demand.
4381
4382 2007-02-26  Marek Safar  <marek.safar@gmail.com>
4383
4384         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4385
4386 2007-02-25  Marek Safar  <marek.safar@gmail.com>
4387
4388         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4389         (Fixes #80455)
4390
4391         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4392         here.
4393         Check property and event extern attributes.
4394
4395         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4396         charset.
4397
4398 2007-02-24  Marek Safar  <marek.safar@gmail.com>
4399
4400         A fix for bug #80407
4401         * ecore.cs: Don't report ambiguity error when methods have same parent.
4402
4403 2007-02-23  Marek Safar  <marek.safar@gmail.com>
4404
4405         A fix for bug #80878
4406         * class.cs, cs-parser.jay: Event property can host anonymous methods.
4407
4408 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4409
4410         * attribute.cs: Enable ExtensionAttribute presence test.
4411
4412 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4413
4414         * class.cs: Warn about missing GetHashCode only when Equals is override.
4415
4416         * decl.cs: Check accessibility of type arguments.
4417
4418         * typemanager.cs: Correctly report nullable array.
4419
4420 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4421
4422         * class.cs, report.cs: Capture more details when things go wrong.
4423
4424 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4425
4426         A fix for bug #80650
4427         * cs-parser.jay: Anonymous container starts at constructor declaration
4428         and not at block beginning because it has to be usable in constructor
4429         initializer.
4430
4431         * statement.cs: Use context location and not block one for error reporting.
4432
4433 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4434
4435         A fix for bug #78712
4436         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4437         too.
4438
4439 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4440
4441         A fix for bug #80493 by Atsushi Enomoto
4442         * cs-parser.jay: Ignore invalid attribute target.
4443
4444 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4445  
4446         * cs-tokenizer.cs: Ignore '\0' as white space character.
4447
4448 2007-02-17  Miguel de Icaza  <miguel@novell.com>
4449
4450         * cs-parser.jay: Add support for lambda expressions to the mcs
4451         compiler as well.
4452
4453         * lambda.cs: Only clone when we are probing, not on the final call
4454         (Compatible is the final call). 
4455
4456         * statement.cs (CloneContext): Introduce class to provide block
4457         remapping during clone.
4458
4459         All statements Clone themselves now.
4460
4461         (Clone): special handling for blocks, when we clone a block, we
4462         register the block inside this routine, as children of the block
4463         might trigger a lookup. 
4464         
4465         * expression.cs: Add support for CloneContext in all expressions. 
4466         
4467 2007-02-17  Marek Safar  <marek.safar@gmail.com>
4468  
4469         A fix for bug #80493
4470         * statement.cs: Report ambiguous warning when interfaces are not related.
4471
4472 2007-02-15  Marek Safar  <marek.safar@gmail.com>
4473
4474         C# 3.0 extension methods.
4475
4476         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4477         cannot be used directly.
4478
4479         * class.cs (Class.Emit): Emit extension attribute if any class method
4480         is extension method.
4481         (Method.Define): Add basic extension method validation conditions.
4482         (Method.Emit): Emit extension attribute for method.
4483
4484         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4485         extension method exists. Currently we follow same approach as Microsoft
4486         does, emit even if a method or a class are private but this can change
4487         later.
4488
4489         * cs-parser.jay: Add handling of `this' keyword in method parameters
4490         context.
4491
4492         * decl.cs (DeclSpace.IsStaticClass): New property.
4493         (MemberCache.FindExtensionMethods): Looks for extension methods with
4494         defined name and extension type.
4495
4496         * doc.cs: Updated after OverloadResolve changes.
4497
4498         * driver.cs: Add new soft reference to System.Core.dll.
4499
4500         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4501         (ExtensionMethodGroupExpr): Represents group of extension methods.
4502
4503         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4504         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4505         to MethodGroupExpr and made non-static for easier customization.
4506         (Invocation.DoResolve): Add extension method lookup when no standard
4507         method was found.
4508         (MemberAccess.DoResolve): Try extension methods if no member exists.
4509
4510         * modifiers.cs: Add METHOD_EXTENSION modifier.
4511
4512         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4513         as well as candidate extension type.
4514         (ComputeNamespaces): When assembly constains extension methods registers
4515         them.
4516         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4517         extension method lookup.
4518         (Namespace.LookupExtensionMethod): Looks for extension method in this
4519         namespace.
4520         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4521         find a method which matches name and extensionType.
4522
4523         * parameter.cs (Parameter): Add This modifer.
4524         (HasExtensionMethodModifier): New property.
4525         (Resolve): Add extension parameter check.
4526         (ModFlags): turned to property to exclude this modifier as it is not real
4527         parameter modifier.
4528         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4529
4530         * support.cs (ParameterData): Add ExtensionMethodType.
4531         (ReflectionParameters): Implemented ExtensionMethodType interface property.
4532
4533         * typemanager.cs: Add type and ctor extension attribute type.
4534
4535 2007-02-15  Miguel de Icaza  <miguel@novell.com>
4536
4537         * report.cs (DisableErrors, EnableErrors): used to prevent error
4538         output when we are "trying" to compile various methods with
4539         different types. 
4540
4541         * ecore.cs (Expression): Add Clone method that calls the virtual
4542         CloneTo method.  The current CloneTo method in Expression throws
4543         an exception so we can track down all the places where this must
4544         be implemented (not using abstract, because that would be a lot of
4545         up-front-work before we can start testing the implementation
4546         idea). 
4547
4548         Important: we only need Clone capabilities for expressions created
4549         by the parser, as the expressions we will be cloning are
4550         expressions in the pre-resolved state.   This vastly simplifies
4551         the work required. 
4552         
4553         (SimpleName): Add CloneTo that does nothing.
4554         (EmptyCast): Add CloneTo.
4555         
4556         * expression.cs (Binary): Implement CloneTo.
4557         (Invocation.IsApplicable): Store the current ec in
4558         EmitContext.TempEc and restore it on return.  This is used so we
4559         do not have to sprinkle hundres of methods with an extra
4560         EmitContext, we know that the only user is the lambda expression
4561         ImplicitConversionExists code. 
4562         
4563         (Argument): Add Cloning capabilities.
4564         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4565         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4566         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4567         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4568         IndexerAccess): Add Clone capability.
4569
4570         (LocalVariableReference, This): TODO: needs cloned Block mapping.
4571
4572         (Argument): Add cloning capability.
4573
4574         * assign.cs (Assign): Implement CloneTo.
4575
4576         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4577         
4578         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4579         version by calling Convert with the EmitContext (that we are
4580         currently storing in ec, this is not great, but will do for now,
4581         to avoid passing EmitContext parameters to hundreds of functions
4582         that do not need them now).
4583
4584         (SetExpression): Remove, it is not needed.
4585         
4586         (ContextualReturn): Implement CloneTo.
4587
4588         * statement.cs (Statement): Implement cloning infrastructure,
4589         similar to expressions.
4590
4591         (Block): Partial implementation of Clone for statements.
4592
4593         (Return): Implement clone.
4594         
4595         * constant.cs (Constant.CloneTo): New method, does nothing.
4596
4597         * codegen.cs (TempEc): Add a static EmitContext as a temporary
4598         solution, until we decide how to exactly do this.  
4599         
4600 2007-02-14  Marek Safar  <marek.safar@gmail.com>
4601  
4602         A fix for bug #80493
4603         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4604         a property is override we need to use second accessor.
4605
4606 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4607  
4608         A fix for bug #80418
4609         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4610         methods.
4611
4612 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4613
4614         Another fix for bug #80749
4615         * pending.cs: Abstract class has priority over interfaces.
4616
4617 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4618
4619         Another fix for bug #80749
4620         * pending.cs: Abstract class has priority over interfaces.
4621
4622 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4623
4624         Another fix for bug #80749
4625         * pending.cs: Abstract class has priority over interfaces.
4626
4627 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4628
4629         Another fix for bug #80749
4630         * pending.cs: Abstract class has priority over interfaces.
4631
4632 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4633
4634         * class.cs Better error message.
4635
4636         * driver.cs: Add shorter versions of -optimize option.
4637
4638 2007-02-13  Martin Baulig  <martin@ximian.com>
4639
4640         * class.cs (Constructor.Emit): Check the return value of
4641         ec.ResolveTopBlock() and return on error.
4642
4643 2007-02-13  Raja R Harinath  <rharinath@novell.com>
4644
4645         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4646         message to fix error message regression.
4647
4648 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4649
4650         * delegate.cs: Delegate creation expression cannot be of Nullable type.
4651
4652 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4653
4654         A fix for bug #80749
4655         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4656         its parent container.
4657
4658         * class.cs (DefineFieldInitializers): Each initializer can has different
4659         resolve context.
4660
4661         * const.cs: Updated.
4662
4663 2007-02-11  Miguel de Icaza  <miguel@novell.com>
4664
4665         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4666         now all the heavy lifting to check that embedded statements or
4667         expressions have the right form is done in the ContextualReturn.
4668
4669         (ContextualReturn): New class.  
4670
4671         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4672         method that can be invoked to report 201, so we do not replicate
4673         this everywhere.
4674
4675         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4676         
4677         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4678         treating tabs as spaces. 
4679
4680 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4681
4682         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4683         * assign.cs: Use full implicit conversion for right side check.
4684
4685 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4686
4687         * statement.cs (Switch): Switch over boolean type is not standardized.
4688
4689 2007-02-08  Marek Safar  <marek.safar@gmail.com>
4690
4691         A fix for bug #80755
4692         * decl.cs (FindBaseEvent): Don't use method cache for events.
4693
4694 2007-02-07  Marek Safar  <marek.safar@gmail.com>
4695
4696         * cs-parser.jay: Better syntax error handling.
4697
4698         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4699         instead of underlying type value.
4700
4701 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4702
4703         * driver.cs: Check define identifier before is registered.
4704
4705         * namespace.cs: Use existing error message.
4706
4707         * report.cs: New warning.
4708
4709 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4710
4711         A fix for bug #80742
4712         * expression.cs: Delegate Invoke method can be called directly.
4713
4714 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4715
4716         A fix for bug #80676
4717         * class.cs (IsEntryPoint): The Main method can have params modifier.
4718
4719 2007-02-04  Miguel de Icaza  <miguel@novell.com>
4720
4721         * parameter.cs (Parameter, Parameters): Add Clone method.
4722
4723         * anonymous.cs (Compatible): Turn method into virtual method, so
4724         LambdaExpression can implement a different behavior.
4725
4726         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4727         out the basic checking here, so it can be used by
4728         LambdaExpressions.
4729         
4730         * lambda.cs: Introduce "Compatible" function that will do the
4731         heavy lifting.
4732
4733 2007-02-02  Marek Safar  <marek.safar@gmail.com>
4734
4735         * attribute.cs: Unified one error message.
4736
4737         * class.cs (Class): Use type attributes and not properties to test static
4738         class.
4739         (IsEntryPoint): Don's pass local variable.
4740
4741         * convert.cs: Removed duplicate check.
4742
4743         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4744
4745         * driver.cs: Don't crash when soft reference does not exist.
4746
4747         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4748         (UsingEntry): Removed redundant allocation.
4749
4750         * parameter.cs: Add fast path for type parameters.
4751
4752         * support.cs: Don't allocate attribute when it's not used.
4753
4754 2007-01-30  Miguel de Icaza  <miguel@novell.com>
4755
4756         * anonymous.cs
4757         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4758         this into a virtual method, so we can override it in LambdaExpression.
4759
4760         * driver.cs: Improve diagnostics in case of failure. 
4761
4762         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4763         write a function that is slightly more complex and that parses:
4764
4765         type identifier [, type identifier]* )
4766
4767         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4768         this expression:
4769
4770                 (canEmpty ? i >= 0 : i > 0)
4771
4772 2007-01-30  Raja R Harinath  <rharinath@novell.com>
4773
4774         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4775         exception on possibly valid code.
4776
4777 2007-01-29  Raja R Harinath  <rharinath@novell.com>
4778
4779         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4780         Push/PopPosition.
4781         (parse_opt_type_arguments): Remove.  It's almost the same as
4782         parse_less_than.
4783         (parse_namespace_or_typename): Use parse_less_than.
4784
4785 2007-01-28  Miguel de Icaza  <miguel@novell.com>
4786
4787         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4788         this bug took a few hours to find, because the state saved and
4789         restored by PushPosition and PopPosition was ignoring the state of
4790         parse_generic_less_than.
4791
4792         I can also now remove the handling of OP_LT and OP_GT, this solves
4793         the big mistery.
4794         
4795         * cs-tokenizer.cs: store the location for the ARROW token, we use
4796         that in the parser.
4797
4798         (PushPosition, PopPosition): save/restore also `current_token',
4799         restore `parse_generic_less_than' (was missing).
4800
4801         (parse_opt_type_arguments): use parse_type, not
4802         parse_namespace_or_typename to parse types.
4803
4804         * lambda.cs: Empty new file, will eventually have the lambda
4805         expression implementation.
4806
4807         * lambda.test: used to test the internal tokenizer. 
4808
4809         * report.cs (FeatureIsNotISO1): Rename from
4810         FeatureIsNotStandardized, because it was about the language level
4811         (1 vs 2) it was not about standarization.
4812
4813         (FeatureRequiresLINQ): New.
4814
4815         * support.cs (SeekableStreamReader): Only require that the reader
4816         is a TextReader, not a StreamReader, so we can plug StringReader. 
4817
4818         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4819         given position in the input stream the following tokens can be
4820         parsed as a type followed by an identifier.
4821
4822         (is_punct): after a '(' if parse_type_and_parameter returns true,
4823         then return a special token OPEN_PARENS_LAMBDA which is used to
4824         avoid reduce/reduce errors in the grammar for the
4825         lambda_expression rules.
4826
4827         (parse_type): implement a type parser inside the
4828         tokenizer, the parser only returns true or false depending on
4829         whether the input at a given position can be parsed as a type.
4830
4831         (peek_token): new method used during type parsing.
4832
4833 2007-01-28  Raja R Harinath  <rharinath@novell.com>
4834
4835         Fix #80531
4836         * anonymous.cs (ScopeInfo.InflateParameters): New.
4837         (AnonymousContainer.Resolve): Use it to redirect types of
4838         delegate parameters.
4839
4840 2007-01-27  Raja R Harinath  <rharinath@novell.com>
4841
4842         Fix #80530
4843         * expression.cs (Error_InvalidArguments): Don't use two different
4844         messages for CS1503.  Use ExtraInformation and
4845         SymbolRelatedToPreviousError instead.
4846
4847         Fix #80358
4848         * decl.cs (DeclSpace.initialize_type_params): Don't access
4849         'type_params' of a partial class directly.
4850
4851 2007-01-26  Miguel de Icaza  <miguel@novell.com>
4852
4853         * constant.cs: Removed a handful of out-of-range checks that were
4854         not necessary. 
4855
4856 2007-01-25  Marek Safar  <marek.safar@gmail.com>
4857
4858         * expression.cs (CheckUselessComparison): Add additional check for char
4859         constants.
4860
4861         * namespace.cs: Fixed typo.
4862
4863 2007-01-23  Miguel de Icaza  <miguel@novell.com>
4864
4865         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4866         gone, instead we inline the test, preventing the needless casts to
4867         longs, ulongs and doubles for the parameters, avoiding calls to
4868         methods that overchecked stuff, and instead inlined things
4869         nicely. 
4870
4871 2007-01-20  Marek Safar  <marek.safar@gmail.com>
4872
4873         * cs-parser.jay: Better parameter error handling.
4874
4875 2007-01-17  Marek Safar  <marek.safar@gmail.com>
4876
4877         A fix for bug #80368, #80522
4878         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4879         whether array initializer contains constants only.
4880         (ArrayCreation.Emit): Use better formula to decide when
4881         are array initializers for static initialization.
4882         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4883         have to emit even constants otherwise they are pre-initialized.
4884
4885 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
4886             Raja R Harinath  <rharinath@novell.com>
4887
4888         Fix emit order of 'get' vs. 'set'.
4889         * support.cs (Accessors): New.
4890         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4891         Note the order in which accessors are declared in the source.
4892         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4893         Refactored from Property.Define and Indexer.Define.
4894         (PropertyBase.DefineAccessors): New helper that calls the above in
4895         appropriate order as noted by the parser.
4896         (Property.Define, Indexer.Define): Update to changes.
4897         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4898
4899 2007-01-17  Raja R Harinath  <rharinath@novell.com>
4900
4901         Fix cs0029-6.cs and gcs0029-2.cs (regression)
4902         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4903         there's an implicit conversion from the current type to the target
4904         type before converting the underlying constant.
4905
4906 2007-01-16  Marek Safar  <marek.safar@gmail.com>
4907
4908         * const.cs (ResolveValue): Updated after constant conversion was made more
4909         generic.
4910
4911         * constant.cs (GetAttributableValue): constant to object conversion is
4912         used for attributes only.
4913         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4914         constant conversions.
4915         (LongConstant.ConvertImplicitly): Ditto.
4916
4917         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4918         (ImplicitConversionStandard): Handle constant conversion as extra step.
4919         It solves the issue when constant conversion was called indirectly like
4920         inside array initializer and constant folding was skipped.
4921
4922         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4923         this change.
4924
4925         * statement.cs(ImplicitConversionStandard): Updated after constant
4926         conversion was made more generic.
4927
4928 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
4929
4930         * expression.cs (As.DoResolve): Use GenericConstraints instead of
4931         Constraints, solves the problem where the compiler incorrectly
4932         reported that a type parameter was not constrained to a class (Bug
4933         80518)
4934
4935 2007-01-14  Marek Habersack  <grendello@gmail.com>
4936
4937         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4938
4939 2007-01-14  Marek Safar  <marek.safar@gmail.com>
4940
4941         A fix for bug #80368
4942         * assign.cs (FieldInitializer): New class implements field
4943         initializer statement.
4944
4945         * attribute.cs: Update after FieldMember rename.
4946
4947         * class.cs (PropertyBasedMember): New common class for property based
4948         types.
4949         (InterfaceMemberBase): New base class for all members which can be used as
4950         an interface members.
4951         (MethodCore): Moved really common code to InterfaceMemberBase.
4952         (Method.Define): Equal and GetHasCode detection is relevant for methods
4953         only.
4954         (MethodData.Define): Don't assume that public event implements an
4955         interface automatically.
4956         (MethodData.DefineMethodBuilder): Issue an error even if only extern
4957         modifier is used.
4958         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4959         (FieldMember): Merged with FieldBase.
4960         (EventProperty.AEventPropertyAccessor): New specialization to check whether
4961         event extern modifier can be used.
4962         (EventField.EventFieldAccessor): Moved event field specific code here.
4963         (Event.AllowedModifiers): Even event can be extern.
4964         (Event.FindOutBaseMethod): New override specific to events.
4965         (Indexer.parameters): Reintroduce parameters because base class holds
4966         only properties common data.
4967         (Indexer.CheckForDuplications): Indexers are threated as methods so we
4968         need do extra parameters check.
4969
4970         * const.cs: Update after FieldMember rename.
4971
4972         * decl.cs (MemberCache.FindBaseEvent): New method.
4973
4974         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4975         to reflect that indexer is now derived from PropertyBased.
4976
4977         * ecore.cs (GetMemberType): Made public.
4978         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4979         obsolete event.
4980
4981         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
4982         
4983         * typemanager.cs (CSharpSignature): Correctly print event accessors.
4984         (RegisterEvent): Removed.
4985         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
4986         (GetPrivateFieldOfEvent): Renamed to GetEventField.
4987
4988 2007-01-11  Raja R Harinath  <rharinath@novell.com>
4989
4990         Fix #80249
4991         * statement.cs (CollectionForeach.TryType): Prefer generic
4992         GetEnumerator over non-generic variant.  Fix code to follow comments.
4993
4994 2007-01-09  Raja R Harinath  <rharinath@novell.com>
4995
4996         Fix #80446
4997         * support.cs (ReflectionParameter): Don't use an invalid index on
4998         the generic parameter data.
4999
5000 2007-01-08  Miguel de Icaza  <miguel@novell.com>
5001
5002         * driver.cs: Just add a tiny bit of infrastructure.
5003
5004 2007-01-02  Marek Safar  <marek.safar@gmail.com>
5005
5006         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
5007         where field type is struct from current assembly.
5008         
5009         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
5010         it is possible.
5011
5012 2007-01-02  Marek Safar  <marek.safar@gmail.com>
5013
5014         A fix for bug #80381
5015         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
5016         the core types.
5017
5018         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
5019         messages.
5020         (Namespace.LookupType): Always use core types from corlib when speficied.
5021
5022         * report.cs: A new warning.
5023
5024         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
5025         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
5026         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
5027
5028         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
5029         (InitCoreTypes): Set expression type of object_type and value_type
5030         immediately after lookup.
5031
5032 2007-01-01  Miguel de Icaza  <miguel@novell.com>
5033
5034         * cs-tokenizer.cs: Accept Pc class characters (Connector
5035         Punctuation) as valid identifiers.  Fixes #78259
5036
5037         * expression.cs (Invocation.DoResolve): Moved the check for the
5038         use of `this' for doing method calls to the Invocation resolution
5039         step, after overload resolution has taken place instead of doing
5040         the check at the low-level `This.DoResolve' level.
5041
5042         The `This.DoResolve'(appens before overload resolution, so it has
5043         no way of knowing if the method that will be called will be
5044         instace or static, triggering an erroneous report for cs0188 (Bug
5045         78113).
5046
5047         We now do the check for instance method invocations after we know
5048         what method will be called.
5049
5050         (This.CheckThisUsage): Move the actual use of this structure
5051         checking into its own method and expose it. 
5052
5053         * Everywhere that called Error_ValueCannotBeConverted: pass a new
5054         EmitContext.
5055
5056         Exceptions: Null.ConvertImplicitly,
5057         Constant.ImplicitConversionRequired as there are too many call
5058         sites for passing the ec. 
5059
5060         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
5061         EmitContext, if the value is null, then we do not try to provide
5062         the extra information from the error (If a userdefined conversion
5063         exists, as UserDefinedConversion requires a non null-EmitContext).
5064
5065         Fixes: #80347
5066
5067 2006-12-30  Raja R Harinath  <rharinath@novell.com>
5068
5069         * flowanalysis.cs (MyBitVector): Document some invariants.
5070         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
5071         introduced below, and add a couple of others, 
5072
5073 2006-12-30  Marek Safar  <marek.safar@gmail.com>
5074
5075         * attribute.cs (GetMethodObsoleteAttribute): Uses new
5076         GetPropertyFromAccessor and GetEventFromAccessor.
5077         
5078         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
5079         overrides non-obsolete one.
5080         (Indexer.Define): Error message has been moved to the parser.
5081
5082         * cs-parser.jay: Better syntax errors handling.
5083
5084         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
5085         when an invocation has no arguments.
5086
5087         * ecore.cs: Removed not used caching.
5088
5089         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
5090         implementation.
5091
5092         * report.cs: Add a new warning.
5093
5094         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
5095
5096         * typemanager.cs (enumeration_type): Removed.
5097         (CSharpSignature): Reuses IsSpecialMethod.
5098         (IsEqual): Hack for MS BCL.
5099         (GetPropertyFromAccessor): New method.
5100         (GetEventFromAccessor): New method.
5101         (IsSpecialMethod): Fixed to handle more cases.
5102
5103 2006-12-30  Marek Safar  <marek.safar@gmail.com>
5104
5105         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
5106         Made white spaces array static.
5107
5108         * ecore.cs (RemoveGenericArity): Optimized.
5109
5110         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
5111         10 times faster).
5112         (MyBitVector.initialize_vector): Simplified.
5113
5114 2006-12-22  Miguel de Icaza  <miguel@novell.com>
5115
5116         * ecore.cs: Am not entirely happy with this hack, but it seems to
5117         address the issue in 80257 (a small test case for
5118         CreativeDocs.NET). 
5119
5120         I set the MethodGroupExpr.Type to an internal compiler type
5121         (itself in this case) to force the resolution to take place.   Why
5122         it does not take place with a null is beyond me.
5123
5124 2006-12-20  Marek Safar  <marek.safar@gmail.com>
5125
5126         A fix for bug #80288
5127         * expression.cs (ResolveOperator): Consider user defined conversion for
5128         logical and operator too.
5129         (EmitBranchable): Optimization for logical and when full constant folding
5130         could not be applied but one operand is constant.
5131
5132 2006-12-19  Marek Safar  <marek.safar@gmail.com>
5133
5134         * class.cs (GetClassBases): Write 5 times every day, will never use
5135         FullName for error reporting.
5136
5137         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
5138
5139 2006-12-19  Martin Baulig  <martin@ximian.com>
5140
5141         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
5142         the symbol file info here.
5143
5144 2006-12-18  Marek Safar  <marek.safar@gmail.com>
5145
5146         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
5147         of `elseif' is taking then following sections are not taking.
5148         Fixes an issue reported on mono mailing list.
5149
5150 2006-12-18  Marek Safar  <marek.safar@gmail.com>
5151
5152         A fix for bug #80300
5153         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
5154         a caller is not taking.
5155
5156 2006-12-18  Raja R Harinath  <rharinath@novell.com>
5157
5158         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
5159         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
5160         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
5161         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
5162         * class.cs: Update to changes.
5163
5164 2006-12-17  Marek Safar  <marek.safar@gmail.com>
5165
5166         A fix for bug #79934
5167         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
5168         partial container.
5169
5170         * class.cs (ResolveMembers): Register an iterator in current container and
5171         not in shared one.
5172
5173 2006-12-16  Raja R Harinath  <rharinath@novell.com>
5174
5175         Fix test-543.cs
5176         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
5177         satisfy a params annotated parameter.
5178
5179 2006-12-16  Marek Safar  <marek.safar@gmail.com>
5180
5181         A fix for bug #77014
5182         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
5183         paramters correctly and not rely on hacks in Parameters class.
5184         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
5185         at any possition.
5186         (Invocation.VerifyArgumentsCompat): Ditto.
5187         (Invocation.EmitArguments): Changed to correctly emit params arguments at
5188         any possition.
5189
5190         * parameter.cs (HasParams): Don't assume that params is the last one.
5191
5192         * support.cs (ReflectionParameters.ctor): Look for params attribute
5193         correctly.
5194         (ReflectionParameters.ParameterType): Removed hack when we returned last
5195         parameter for out of range parameters.
5196         (ParameterName, ParameterModifier): Ditto.
5197
5198 2006-12-14  Marek Safar  <marek.safar@gmail.com>
5199
5200         A fix for bug #79987
5201         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
5202         when assembly is not CLS compliant but type is. I have no idea why is this
5203         allowed.
5204
5205         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
5206
5207 2006-12-13  Miguel de Icaza  <miguel@novell.com>
5208
5209         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
5210         in struct constructors, they are basically no-ops.
5211
5212 2006-12-12  Marek Safar  <marek.safar@gmail.com>
5213
5214         * cs-tokenizer.cs (Position): Save preprocessor status too.
5215
5216 2006-12-12  Marek Safar  <marek.safar@gmail.com>
5217
5218         A fix for bug #77794
5219         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
5220
5221 2006-12-12  Marek Safar  <marek.safar@gmail.com>
5222
5223         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
5224         Fixes #69299.
5225         (pp_expr): Report error for an invalid expression.
5226         (handle_preprocessing_directive): Simplified; add more error checking.
5227
5228 2006-12-11  Marek Safar  <marek.safar@gmail.com>
5229
5230         A fix for bug #74939
5231         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
5232         directives handling.
5233
5234 2006-12-10  Marek Safar  <marek.safar@gmail.com>
5235
5236         A fix for bugs #80093, and #75984
5237         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
5238         logic, it seems to me as it worked before "by coincidence".
5239         (xtoken): Simplified to use reworked handle_preprocessing_directive.
5240         (cleanup): Enabled endif check.
5241
5242 2006-12-09  Marek Safar  <marek.safar@gmail.com>
5243
5244         A fix for bug #80162
5245         * statement.cs (CollectionForeach.TryType): Generics and non-generics
5246         enumerators are never ambiguous.
5247
5248 2006-12-08  Raja R Harinath  <rharinath@novell.com>
5249
5250         Fix #80060
5251         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
5252
5253 2006-12-06  Marek Safar  <marek.safar@gmail.com>
5254
5255         A fix for bug #80144
5256         * class.cs (EventProperty.Define): Explicit implementation means
5257         that an even is used.
5258
5259 2006-12-06  Marek Safar  <marek.safar@gmail.com>
5260
5261         Fixes the operators implementation (part II)
5262
5263         * cfold.cs (DoConstantNumericPromotions): Renamed to
5264         DoBinaryNumericPromotions and simplified.
5265         (BinaryFold): Couple of conversion fixes; simplified.
5266
5267         * constant.cs, ecore.cs, literal.cs
5268         (ToType): Renamed to ConvertImplicitly.
5269         (Reduce): Renamed to ConvertExplicitly.
5270
5271         * class.cs, convert.cs: Updated.
5272
5273         * expression.cs: TryReduce doesn't throw an exception.
5274
5275 2006-12-01  Marek Safar  <marek.safar@gmail.com>
5276
5277         A fix for bug #80108
5278         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
5279         compatible.
5280
5281 2006-11-30  Marek Safar  <marek.safar@gmail.com>
5282
5283         Fixes unary operators implementation (part I)
5284         Also fixes #80026
5285
5286         * cfold.cs (Error_CompileTimeOverflow): Made internal
5287
5288         * const.cs (IConstant): Changed to use reference to constant and
5289         not constant itself.
5290         Updated IConstant implementations.
5291
5292         * constant.cs (CreateConstant): New factory method.
5293         Updated IConstant implementation.
5294
5295         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
5296
5297         * ecore.cs: Updated to use CreateConstantReference.
5298
5299         * enum.cs: Reflects IConstant changes.
5300
5301         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
5302
5303         * literal.cs (NullConstant): Change to be independently usable.
5304
5305 2006-11-29  Martin Baulig  <martin@ximian.com>
5306
5307         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
5308         we need to emit the scope initializer before calling the base .ctor.
5309
5310         * anonymous.cs: Merged back from the new anonymous methods branch.
5311         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
5312
5313         * expression.cs (ParameterReference.DoResolveBase): Create a
5314         "normal" ScopeInfo when capturing parameters rather than using the
5315         root scope; this makes things work with anonymous methods having
5316         parameters.
5317
5318         * statement.cs
5319         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5320
5321 2006-11-22  Marek Safar  <marek.safar@gmail.com>
5322
5323         A fix for bug #79987
5324         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5325         check to a base class.
5326         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5327         only when assembly has missing attribute.
5328         * report.cs: Update.
5329
5330 2006-11-21  Marek Safar  <marek.safar@gmail.com>
5331
5332         * cs-tokenizer.cs: Merged with gmcs version.
5333
5334 2006-11-20  Marek Safar  <marek.safar@gmail.com>
5335
5336         * cs-tokenizer.cs,
5337         * cs-parser.jay: Better error message when partial keyword is misplaced.
5338
5339 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
5340
5341         A fix for bug #79810
5342         report.cs: CS1058 only applies to 2.0 profile (gmcs).
5343         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5344         a RuntimeWrappedException by default.
5345
5346 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5347
5348         A fix for bug #79843
5349         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5350         implementation.
5351         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5352
5353 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5354
5355         * driver.cs, namespace.cs: Uses faster IndexOf version.
5356
5357 2006-11-17  Marek Safar  <marek.safar@gmail.com>
5358
5359         A fix for bug #79941
5360         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5361         operators.
5362         (Operator.Define): Implicit/Explicit operator of same type is duplicate
5363         even if internal name is different.
5364         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5365         (UserDefinedConversion): Simplified as the operators cannot be internal.
5366         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5367         conversions.
5368         (MethodLookup): Replaced EmitContext with parentType.
5369         * expression.cs: Updated.
5370
5371 2006-11-09  Raja R Harinath  <rharinath@novell.com>
5372
5373         * driver.cs (BadAssembly): Handle all the ugliness of
5374         DefineDynamicAssembly.
5375
5376 2006-11-08  Raja R Harinath  <rharinath@novell.com>
5377
5378         Address parts of #58244 -- most of what's left is in the runtime
5379         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
5380         CS1509 error checks, and handle them for all assembly loads, not
5381         just the first invocation.
5382         (LoadModule): Likewise.  Move handling of 'adder_method' ...
5383         * codegen.cs (AssemblyClass.AddModule): ... here.
5384
5385 2006-11-02  Marek Safar  <marek.safar@gmail.com>
5386
5387         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5388         IEnumerable<T> is ambiguous.
5389
5390 2006-10-31  Marek Safar  <marek.safar@gmail.com>
5391
5392         A fix for bug #67689
5393         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5394         GetEnumerator is ambiguous.
5395
5396         * report.cs: Add new warning.
5397
5398 2006-10-29  Marek Safar  <marek.safar@gmail.com>
5399
5400         A fix for bug #78602
5401         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5402         to protected member can be nested type.
5403
5404 2006-10-28  Marek Safar  <marek.safar@gmail.com>
5405
5406         A fix for bug #78965
5407         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5408         to protected member must derive from current type.
5409
5410 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5411
5412         assign.cs: Reuses error method.
5413
5414         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5415         instead of type for constants.
5416         (Expression.Error_ValueAssignment): Common error method.
5417
5418         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5419         for any assignment.
5420
5421 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5422
5423         A fix for bug #79081
5424         * expression.cs (MemberAccess.DoResolve): Check nested type
5425         accessibility.
5426
5427 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
5428
5429         * doc.cs : nested delegates were not handled. Fixed bug #79754.
5430
5431 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5432
5433         A fix for bug #76591
5434         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5435
5436 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5437
5438         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5439         type forwarder of the same type multiple times.
5440
5441 2006-10-26  Raja R Harinath  <rharinath@novell.com>
5442
5443         Fix #78820
5444         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5445         instance as an rvalue, even when we later resolve as an lvalue.
5446
5447 2006-10-25  Martin Baulig  <martin@ximian.com>
5448
5449         * anonymous.cs: Fix #79673.
5450
5451 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
5452
5453         A fix for bug #79666
5454         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5455         ignored when is optimized (= default value) as its value is already set.
5456
5457 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5458
5459         A fix for bug #79724
5460         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5461         TypeContainer for type lookup.
5462
5463 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5464
5465         A fix for bug #79231
5466         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5467         * expression.cs (OverloadResolve): Always convert type name for
5468         an error message.
5469         (ResolveNamespaceOrType): Don't confuse a nested type with any 
5470         other member.
5471
5472 2006-10-18  Martin Baulig <martin@ximian.com>
5473
5474         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5475
5476 2006-10-17  Miguel de Icaza  <miguel@novell.com>
5477
5478         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5479         an int32, but requesting an int64 from the conversion
5480
5481 2006-10-12  Martin Baulig  <martin@ximian.com>
5482
5483         * anonymous.cs
5484         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
5485         
5486 2006-10-12  Martin Baulig  <martin@ximian.com>
5487
5488         * statement.cs
5489         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5490
5491 2006-10-11  Miguel de Icaza  <miguel@novell.com>
5492
5493         * convert.cs: Remove broken code: I was doing the "Existance"
5494         tests for Implicit conversions.
5495
5496 2006-10-10  Miguel de Icaza  <miguel@novell.com>
5497
5498         * convert.cs: Added one missing case in
5499         ImplicitStandardConversionExists uint64 to intptr.
5500
5501         Fixes #59800
5502         
5503         * typemanager.cs (uintptr_type): another core known type.   
5504
5505         * ecore.cs (OperatorCast): routine used to do cast operations that
5506         depend on op_Explicit.  We could change some of the Decimal
5507         conversions to use this.
5508
5509         This one has a probe mechanism that checks both types for an op_
5510         which it coudl be used to eliminate two classes: CastToDecimal
5511         and CastFromDecimal.
5512
5513         * convert.cs: Implement the conversions documented in #59800
5514         
5515 2006-10-10  Martin Baulig  <martin@ximian.com>
5516
5517         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5518         before RootScope.ResolveMembers().
5519
5520         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5521         `CurrentType' if appropriate.
5522
5523 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
5524
5525         A fix for bug #78568
5526         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5527         when contains binary operators.
5528         * cs-parser.jay: Updated.
5529
5530 2006-10-09  Martin Baulig  <martin@ximian.com>
5531
5532         * delegate.cs
5533         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5534         moved that into Define() and also do the other type parameter
5535         checks there.  Fixes #79094.  Added gtest-292.cs.
5536
5537         * expression.cs
5538         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5539         since that doesn't include type parameters; don't use `Ldelema'
5540         for type parameters.  Fixes #78980.  Added gtest-293.cs.
5541
5542 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
5543
5544         A fix for #77796
5545         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5546         conversion is allowed.
5547
5548 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5549
5550         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5551         error reporting when no error occurs.
5552
5553 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5554
5555         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5556         does not exist.
5557
5558 2006-10-06  Raja R Harinath  <rharinath@novell.com>
5559
5560         Fix #79584
5561         * class.cs (DefineTypeBuilder): Check circular dependencies before
5562         setting the parent of the TypeBuilder.
5563         (CheckRecursiveDefinition): Don't use 'BaseType', since
5564         it may not be valid until after DefineTypeBuilder.  Use
5565         'base_type' instead.
5566
5567 2006-10-04  Martin Baulig  <martin@ximian.com>
5568
5569         Merged the Anonymous Methods patch.
5570
5571         * anonymous.cs, iterators.cs: The new anonymous methods code.
5572
5573         * statement.cs (Variable): New public abstract class.
5574         (LocalInfo.Variable): New public property.
5575         (LocalInfo.ResolveVariable): New public method.
5576         (Block.Flags): Add `IsIterator'.
5577         (Block.AddVariable): Improved the CS0136 check.
5578         (Block.AnonymousChildren): New public property.
5579         (Block.AddAnonymousChild): New public method.
5580         (ToplevelBlock): Update to use the new anonymous method framework.
5581         (ToplevelBlock.ctor): `container' is now a `Block' and not a
5582         `ToplevelBlock'; this is required to correctly implement the
5583         CS0136 check.
5584         (Fixed, Using): Use `TemporaryVariable' instead of directly
5585         creating the `LocalBuilder'.
5586
5587         * parameter.cs (Parameter.ResolveVariable): New public method.
5588         (Parameters.ResolveVariable): Likewise.
5589
5590         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5591
5592         * class.cs (TypeContainer): Replaced the `iterators' list and
5593         corresponding methods with a list of `CompilerGeneratedClass'es.
5594         (TypeContainer.ResolveMembers): New public method.
5595         (Method): `IIteratorContainer' has been replaced by
5596         `IAnonymousHost'.
5597
5598         * expression.cs (VariableReference): New public abstract base
5599         class for `LocalVariableReference', `ParameterReference' and
5600         `This'.
5601
5602         * codegen.cs (EmitContext): Removed `capture_context',
5603         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5604         (EmitContext.EmitThis): Removed.
5605
5606         * cs-parser.jay: Replace `iterator_container' with
5607         `anonymous_host'.       
5608
5609 2006-10-04  Martin Baulig  <martin@ximian.com>
5610
5611         * generic.cs (GenericMethod): Don't make this abstract.
5612         (Constraints.Clone): Added dummy implementation.
5613
5614 2006-10-04  Raja R Harinath  <harinath@gmail.com>
5615
5616         Fix #79577
5617         * namespace.cs (LookForAnyGenericType): Avoid nullref on
5618         'declspaces'.  Avoid allocating arrays willy-nilly.
5619
5620         Fix #79553
5621         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5622         cases out of the switch.
5623
5624 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5625
5626         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5627         message when non-generic type is used with the type arguments.
5628         * expression.cs: Updated.
5629
5630 2006-09-28  Raja R Harinath  <rharinath@novell.com>
5631
5632         Fix #79013
5633         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5634         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5635         Change semantics slightly.  Don't insist on having only one
5636         temporary EmptyExpression -- just throttle the creation of new ones.
5637
5638         Fix #79451
5639         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5640         non-interfaces too.  If no methods are found, don't try to create
5641         a MethodGroupExpr.
5642
5643 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5644
5645         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5646         generic type.
5647
5648         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5649         us produce better error message.
5650
5651 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
5652
5653         * expression.cs (Binary.ResolveOperator): Warn about a side effect
5654         of the `|' operator.
5655
5656         * report.cs: A new warning added.
5657
5658 2006-09-27  Martin Baulig  <martin@ximian.com>
5659
5660         * generic.cs (GenericMethod): Don't make this abstract.
5661
5662 2006-09-27  Martin Baulig  <martin@ximian.com>
5663
5664         * report.cs
5665         (InternalErrorException): Added overloaded ctor taking a params array.
5666
5667 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
5668
5669         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5670         Fixed the cases when same error was reported twice.
5671
5672         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5673         now report symbol information.
5674
5675 2006-09-25  Martin Baulig  <martin@ximian.com>
5676
5677         * class.cs: Completely unified with the gmcs version.
5678
5679 2006-09-25  Martin Baulig  <martin@ximian.com>
5680
5681         * typemanager.cs (TypeManager.IsNullableType): New public function.
5682         (TypeManager.IsNullableTypeOf): Likewise.
5683         (TypeManager.IsNullableValueType): Likewise.
5684
5685         * class.cs (MethodCore): Added the `GenericMethod' argument from
5686         gmcs and also unified all classes derived from `MethodCore' with gmcs.
5687
5688 2006-09-24  Raja R Harinath  <harinath@gmail.com>
5689
5690         * convert.cs: Unify with gmcs version.
5691
5692 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5693
5694         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5695         verify them as well.
5696
5697         * report.cs: New warning.
5698
5699 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5700
5701         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5702         for anonymous block with out argument.
5703
5704 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5705
5706         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5707         not used private events only.
5708
5709 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
5710
5711         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5712
5713         * const.cs (Const.Define): Check for constant type.
5714         (Const.IsConstantTypeValid): Looks for valid constant types.
5715
5716         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5717
5718         * ecore.cs (EmptyConstantCast): New common class for all constant based
5719         EmptyCast(s).
5720
5721         * expression.cs (Is.DoResolve): Handle null constant especially.
5722         (New.DoResolve): Check for new void().
5723         (MemberAccess.DoResolve): Cope with all kind of nulls.
5724
5725         * literal.cs (NullConstant): Uses EmptyConstantCast.
5726         (NullDefault): Based on EmptyConstantCast.
5727         (NullLiteral): Uses EmptyConstantCast.
5728
5729         * statement.cs (Block.ResolveMeta): Check for constant type.
5730
5731 2006-09-22  Martin Baulig  <martin@ximian.com>
5732
5733         * delegate.cs, attribute.cs: Merged with the gmcs versions.
5734
5735 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5736
5737         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5738         not the null type.
5739
5740         Fix part of #79451
5741         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5742         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
5743         code slightly.
5744
5745 2006-09-22  Martin Baulig  <martin@ximian.com>
5746
5747         * ecore.cs: Merged with the gmcs version.
5748
5749         * generic.cs (ConstructedType): New dummy class.
5750         (TypeArguments): Don't make this abstract.
5751
5752         * typemanager.cs
5753         (TypeManager.IsGenericTypeDefinition): New method.
5754         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5755
5756 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5757
5758         * expression.cs (ComposedCast): Check for arrays of TypedReference
5759         before creating the type, not after.
5760
5761 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
5762
5763         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5764         after ToType change.
5765
5766         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5767         when constant must be implicitly convertible.
5768
5769         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5770
5771         * ecore.cs (NullCast): Derives from NullConstant.
5772
5773         * expression.cs (Is.DoResolve): Removed useless variables.
5774         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5775         (New.Constantify): Add enum support.
5776         (MemberAccess.DoResolve): Add warning when accessing null constant or
5777         variable.
5778
5779         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5780         property.
5781
5782         * literal.cs (NullConstant): New abstract class with common
5783         functionality for all null specializations.
5784         (NullDefault): Represents default(X) when result can be
5785         reduced to null.
5786         (NullLiteral): Updated.
5787
5788         * report.cs: Add new warning.
5789
5790 2006-09-21  Martin Baulig  <martin@ximian.com>
5791
5792         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5793
5794 2006-09-21  Martin Baulig  <martin@ximian.com>
5795
5796         * generic.cs (GenericConstraints): New dummy class.
5797         (Constraints): Likewise.
5798         (TypeParameter): Likewise.
5799         (TypeParameterName): Likewise.
5800         (GenericMethod): Likewise.
5801
5802         * typemanager.cs (TypeManager.GetGenericArguments): New method.
5803
5804         * decl.cs: Merged with the gmcs version.
5805
5806 2006-09-21  Raja R Harinath  <rharinath@novell.com>
5807
5808         * generic.cs (TypeParameter): Implement IMemberContainer.
5809         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
5810
5811         * rootcontext.cs: Unify with gmcs version.
5812
5813         * report.cs: Unify with gmcs version.
5814         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5815         from gmcs/generics.cs.
5816         * generics.cs (TypeParameter): New dummy class.
5817
5818         * support.cs: Unify with gmcs version.
5819
5820 2006-09-20  Raja R Harinath  <rharinath@novell.com>
5821
5822         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5823         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5824
5825         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5826         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5827         * mcs.exe.sources: Add generic.cs.
5828
5829         * codegen.cs: Unify with gmcs version.
5830
5831         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5832         (EmitContext): Add GenericDeclContainer implementation.
5833         * decl.cs (MemberCore, DeclSpace): Likewise.
5834         * namespace.cs: Remove #ifdef GMCS_SOURCE.
5835
5836         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5837         MCS TypeManager has a corresponding dummy method.
5838
5839 2006-09-19  Martin Baulig  <martin@ximian.com>
5840
5841         * expression.cs: Completely merged with the gmcs version.
5842
5843 2006-09-19  Martin Baulig  <martin@ximian.com>
5844
5845         * expression.cs (Invocation): Merged with the gmcs version.
5846         (ArrayAccess.GetStoreOpcode): Likewise.
5847
5848 2006-09-19  Martin Baulig  <martin@ximian.com>
5849
5850         * typemanager.cs
5851         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5852         (TypeManager.IsGenericMethodDefinition): Likewise.
5853
5854 2006-09-19  Martin Baulig  <martin@ximian.com>
5855
5856         * typemanager.cs
5857         (TypeManager.IsEqual): Moved the gmcs implementation here.
5858         (TypeManager.DropGenericTypeArguments): Likewise.
5859         (TypeManager.DropGenericMethodArguments): Likewise.
5860         (TypeManager.GetTypeArguments): Moved here from gmcs.
5861         (TypeManager.HasGenericArguments): Likewise.
5862
5863 2006-09-19  Martin Baulig  <martin@ximian.com>
5864
5865         * expression.cs (Binary): Merged with the gmcs version.
5866
5867 2006-09-19  Martin Baulig  <martin@ximian.com>
5868
5869         * expression.cs (Probe, As, Is): Merged with the gmcs version.
5870
5871 2006-09-19  Martin Baulig  <martin@ximian.com>
5872
5873         * typemanager.cs: Merged with the gmcs version.
5874
5875 2006-09-16  Raja R Harinath  <rharinath@novell.com>
5876
5877         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5878         * driver.cs: Likewise.
5879
5880 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
5881
5882         A fix for #79401
5883         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5884         only if parent type is class.
5885         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5886         update.
5887
5888 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
5889
5890         * cs-parser.jay,
5891         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5892         keywords are used.
5893         * typemanager.cs(CSharpName): Converts NullType to null.
5894
5895 2006-09-15  Martin Baulig  <martin@ximian.com>
5896
5897         * typemanager.cs
5898         (TypeManager.GetMethodName): Added mcs implementation.
5899         (TypeManager.IsEqual): Likewise.
5900
5901         * ecore.cs
5902         (SimpleName.RemoveGenericArity): Added dummy implementation.
5903
5904         * pending.cs: Merged with the gmcs version.     
5905
5906 2006-09-15  Martin Baulig  <martin@ximian.com>
5907
5908         * statement.cs: Merge with the gmcs version.
5909
5910 2006-09-15  Martin Baulig  <martin@ximian.com>
5911
5912         * statement.cs (Switch): Merge with the gmcs implementation
5913         (without nullables), which is newer.
5914
5915 2006-09-15  Martin Baulig  <martin@ximian.com>
5916
5917         * statement.cs (Block.Variables): Make this public.
5918         (ToplevelBlock.Parameters): Make this a property.
5919         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5920
5921 2006-09-15  Martin Baulig  <martin@ximian.com>
5922
5923         * namespace.cs: Merge with the gmcs version.
5924
5925 2006-09-15  Martin Baulig  <martin@ximian.com>
5926
5927         * decl.cs (MemberName): Minor code cleanups.
5928
5929 2006-09-15  Martin Baulig  <martin@ximian.com>
5930
5931         * parameter.cs: Merge with the gmcs version.
5932
5933 2006-09-15  Martin Baulig  <martin@ximian.com>
5934
5935         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5936         and an error in mcs.
5937
5938 2006-09-15  Martin Baulig  <martin@ximian.com>
5939
5940         * flowanalysis.cs: Merged from GMCS; added the generics code into
5941         a `GMCS_SOURCE' conditional so we can share this file.
5942
5943 2006-09-08  Martin Baulig  <martin@ximian.com>
5944
5945         * typemanager.cs (TypeManager.interlocked_type): New public field.
5946         (TypeManager.int_interlocked_compare-exchange): New public field.
5947         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5948         enumerator types here and call InitGenericCoreTypes().
5949         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5950         after calling InitEnumUnderlyingTypes().
5951
5952         * rootcontext.cs
5953         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5954         `classes_second_stage'. 
5955
5956 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
5957
5958         * assign.cs, ecore.cs, expression.cs: Share error message text.
5959         * class.cs (FieldMember.Define): Check for varible of static type.
5960         * driver.cs (LoadAssembly): Uses error output for errors.
5961         * statement.cs: Updated.
5962
5963 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
5964
5965         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5966         type instance.
5967
5968 2006-09-07  Martin Baulig  <martin@ximian.com>
5969
5970         * driver.cs
5971         (MainDriver): Revert r62663 from Marek; see #70506 for details.
5972
5973 2006-08-29  Miguel de Icaza  <miguel@novell.com>
5974
5975         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5976         
5977 2006-08-17  Miguel de Icaza  <miguel@novell.com>
5978
5979         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5980         #52019 and #79064, the use of the \uXXXX sequence in source code
5981         to represent unicode characters.
5982
5983 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
5984
5985         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
5986         support.
5987         * class.cs, ecore.cs, statement.cs: Merged to one error message.
5988
5989 2006-08-13  Miguel de Icaza  <miguel@novell.com>
5990
5991         * assign.cs: Catch attempts to assign to a method groups in += and
5992         report as 1656
5993
5994 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
5995
5996         A fix for #79056
5997         * cs-parser.jay: Don't destroy current array type by typeof of array's.
5998
5999 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
6000
6001         * class.cs (Method.Define): Issue a warning when generic method looks like
6002         an entry point.
6003         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
6004         as well.
6005
6006 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
6007  
6008         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
6009         looking for ctor.
6010         * decl.cs (MemberCache.FindMembers): When container is interface we need to
6011         search all base interfaces as a member can be ambiguous.
6012         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
6013         Constructor member type filter. 
6014         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
6015         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
6016         reporting for returned memberinfos.
6017         * report.cs: Updated.
6018         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
6019         version to work on all runtimes.
6020         (TypeManager.RealMemberLookup): Removed members filtering.
6021
6022 2006-08-08  Raja R Harinath  <rharinath@novell.com>
6023
6024         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
6025         (PropertyExpr.EmitAssign): Likewise.
6026         * expression.cs (Indirection.EmitAssign): Likewise.
6027         (LocalVariableReference.EmitAssign): Likewise.
6028         (ParameterReference.EmitAssign): Likewise.
6029         (Invocation.EmitArguments): Likewise.
6030         (ArrayAccess.EmitAssign): Likewise.
6031         (IndexerAccess.EmitAssign): Likewise.
6032         (This.EmitAssign): Likewise.
6033         (ConditionalLogicalOperator.Emit): Likewise.
6034
6035         Fix #79026
6036         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
6037         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
6038         leave it in after returning it.
6039         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
6040
6041 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
6042
6043         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
6044         message.
6045
6046 2006-08-03  Raja R Harinath  <rharinath@novell.com>
6047
6048         Fix cs0146-3.cs and cs0146-4.cs.
6049         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
6050         enclosing types don't depend on the current type.
6051
6052 2006-08-02  Raja R Harinath  <rharinath@novell.com>
6053
6054         Fix #77963
6055         * class.cs (TypeContainer.DoDefineMembers): Use
6056         FindBaseMemberWithSameName on Parent, since we're interested in
6057         whether we hide inherited members or not.
6058         (FindBaseMemberWithSameName): Make slightly more robust.
6059
6060         Fix the non-generic testcase from #77396
6061         * decl.cs (DeclSpace.DeclContainer): Remove override.
6062
6063         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
6064         declspaces for doppelgangers too.
6065         (UsingEntry): Implement IResolveContext.
6066         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
6067         'this' as the resolve context.
6068         (LocalAliasEntry): Likewise.
6069
6070         Implement parts of #77403
6071         * roottypes.cs (RootDeclSpace): New.  Used to represent the
6072         toplevel declaration space.  Each namespace declaration introduces
6073         a "partial" root declaretion space.
6074         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
6075         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
6076         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
6077         from 'current_namespace.SlaveDeclSpace'.
6078         (namespace_declaration): Likewise.
6079         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
6080         check.  It can't happen now.
6081         * decl.cs (DeclSpace.LookupType): Likewise.
6082         * driver.cs (MainDriver): Sanity check.
6083
6084 2006-08-01  Raja R Harinath  <rharinath@novell.com>
6085
6086         * decl.cs (DeclSpace.FindNestedType): Remove.
6087         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
6088         LookupTypeContainer to get the container of the nested type.
6089         * class.cs (TypeContainer.FindNestedType): Make non-override.
6090
6091 2006-07-31  Raja R Harinath  <rharinath@novell.com>
6092
6093         * decl.cs (DeclSpace.PartialContainer): Move field from ...
6094         * class.cs (TypeContainer.PartialContainer): ... here.
6095         (TypeContainer.AddBasesForPart): New helper.
6096         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
6097         instead.
6098         * cs-parser.jay (current_class): Convert to DeclSpace.
6099         (struct_declaration, interface_declaration, class_declaration):
6100         Use AddBasesForPart instead of .Bases directly.
6101         * const.cs, iterators.cs: Update to changes.
6102
6103 2006-07-28  Raja R Harinath  <rharinath@novell.com>
6104
6105         * class.cs (TypeContainer.AddMemberType): Rename from
6106         AddToTypeContainer.
6107         (TypeContainer.AddMember): Rename from AddToMemberContainer.
6108         (AddTypeContainer): New.  Combine AddClassOrStruct and
6109         AddInterface.
6110         (AddPartial): Update.  Add 'is_partial' argument.
6111         * roottypes.cs: Update to changes.
6112         * cs-parser.jay (push_current_class): New helper for handling
6113         current_container and current_class.
6114         (struct_declaration, interface_declaration, class_declaration):
6115         Use it.
6116
6117 2006-07-26  Raja R Harinath  <rharinath@novell.com>
6118
6119         * roottypes.cs: Rename from tree.cs.
6120
6121         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
6122         * tree.cs (Tree, ITreeDump): Remove types.
6123         * rootcontext.cs (tree, Tree): Remove fields.
6124         (root, ToplevelTypes): New.
6125         * *.cs: Update to rename.
6126
6127         * tree.cs (Tree.RecordDecl): Remove.
6128         (RootTypes.AddToTypeContainer): Record the toplevel type in its
6129         namespace here.
6130         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
6131
6132 2006-07-23  Raja R Harinath  <harinath@gmail.com>
6133
6134         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
6135         DoFlowAnalysis and OmitStructFlowAnalysis here.
6136         (ec.With): Rename from WithUnsafe and generalize.
6137         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
6138         (ec.WithFlowAnalyis): New.
6139         * ecore.cs, expression.cs, statement.cs: Update.
6140
6141 2006-07-22  Raja R Harinath  <harinath@gmail.com>
6142
6143         * statement.cs (Block.ResolveMeta): Simplify slightly.
6144
6145         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
6146         multiple boolean fields.  Convert InUnsafe, constant_check_state,
6147         check_state to flags.
6148         (CheckState, ConstantCheckState): Update.
6149         (InUnsafe): New read-only property.
6150         (FlagsHandle): Rename from CheckStateHandle and convert to handle
6151         arbitrary flags.
6152         (WithUnsafe): New helper similar to WithCheckState.
6153         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
6154         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
6155
6156 2006-07-21  Raja R Harinath  <rharinath@novell.com>
6157
6158         Make comparisons use the same IL irrespective of whether they're
6159         in a 'checked' or 'unchecked' context: one of the issues in #78899
6160         * codegen.cs (EmitContext.CheckState): Make read-only property.
6161         (EmitContext.ConstantCheckState): Likewise.
6162         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
6163         helper that implement a save/restore stack for CheckState
6164         values.  This is the only way to change check-state.
6165         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
6166         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
6167         (CheckedExpr.EmitBranchable): New forwarding method.
6168         (UnCheckedExpr): Likewise.
6169         * statement.cs (Block.ResolveMeta): Use WithCheckState.
6170         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
6171         (Checked.Resolve, checked.DoEmit): Likewise.
6172
6173 2006-07-20  Miguel de Icaza  <miguel@novell.com>
6174
6175         * anonymous.cs: Cache the resolved anonymous delegate, and return
6176         this so that the ResolveTopBlock is only triggered once, not
6177         twice.
6178
6179         Currently we trigger ResolvetopBlock twice due to a first pass of
6180         argument check compatibility, and a second pass that does the
6181         actual resolution.   
6182         
6183 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
6184
6185         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
6186         modifiers.
6187         * rootcontext.cs (Reset): Add helper_classes.
6188
6189 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
6190
6191         A fix for #78860
6192         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
6193         correctly.
6194
6195 2006-07-13  Miguel de Icaza  <miguel@novell.com>
6196
6197         * statement.cs (Lock): Handle expressions of type
6198         TypeManager.null_type specially.  Fixes #78770
6199
6200 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
6201
6202         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
6203         to an event.
6204
6205 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
6206
6207         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
6208         for accessors as well.
6209         * ecore.cs (EventExpr): Add AccessorTable.
6210
6211 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
6212
6213         A fix for #78738
6214         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
6215         for CS0122 where appropriate.
6216         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
6217         level attributes.
6218         (Filter): Assembly can be null in the case of top level attributes.
6219
6220 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
6221
6222         A fix for #78690
6223
6224         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
6225         is done at global level.
6226
6227 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
6228
6229         A fix for #77002, Implemented TypeForwarder support.
6230
6231         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
6232         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
6233         * typemanager.cs (): Add type_forwarder_attr_type.
6234
6235 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
6236
6237         * report.cs: Add CS0469 warning.
6238
6239 2006-06-21  Martin Baulig  <martin@ximian.com>
6240
6241         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
6242         the `try'-block, so we also report CS0016 etc. there.
6243
6244 2006-06-21  Martin Baulig  <martin@ximian.com>
6245
6246         * delegate.cs
6247         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
6248
6249 2006-06-21  Martin Baulig  <martin@ximian.com>
6250
6251         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
6252         also report CS1686 for parameters.
6253
6254 2006-06-21  Martin Baulig  <martin@ximian.com>
6255
6256         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
6257         instead of an error if the value is not implicitly convertible to
6258         the switch types; fixes #77964.
6259
6260 2006-06-21  Raja R Harinath  <rharinath@novell.com>
6261
6262         Fix #78673
6263         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
6264         FieldBuilder is null.
6265
6266         Fix #78662
6267         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
6268         'left' and 'right' before error-checking.
6269
6270 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
6271
6272         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
6273         Fixed bug #78601.
6274         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
6275         (FieldExpr.DoResolve): likewise.
6276         (PropertyExpr.InstanceResolve): likewise.
6277         (EventExpr.InstanceResolve): likewise. 
6278
6279 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
6280
6281         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
6282         attribute applicable tests for attribute argument.
6283
6284 2006-06-02  Raja R Harinath  <rharinath@novell.com>
6285
6286         Fix #78079
6287         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
6288         (Binary.OverloadResolve_PredefinedIntegral): New.
6289         (Binary.OverloadResolve_PredefinedFloating): New.
6290         (Binary.OverloadResolve_PredefinedString): New.
6291         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
6292         Follow the standard more closely, and treat numeric promotions in
6293         terms of overload resolution.
6294         (Binary.CheckShiftArguments): Simplify.
6295
6296 2006-06-01  Raja R Harinath  <rharinath@novell.com>
6297
6298         * flowanalysis.cs (MyBitVector): Simplify representation.
6299         (MyBitVector.Clone): Avoid allocating BitArray.
6300         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
6301         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
6302         (*): Update.  Change all references to MyBitVector.And and
6303         MyBitVector.Or to &= and |=.
6304
6305 2006-05-29  Raja R Harinath  <rharinath@novell.com>
6306
6307         Fix cs0231-[34].cs.
6308         * cs-parser.jay (formal_parameter_list): Extend the pattern below
6309         to param arguments too.
6310
6311 2006-05-26  Miguel de Icaza  <miguel@novell.com>
6312
6313         * cs-parser.jay: Catch another parsing form for arglist being
6314         followed by other arguments.  Fixes #78313.
6315
6316 2006-05-24  Raja R Harinath  <rharinath@novell.com>
6317
6318         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6319         checking of out parameters to ...
6320         (FlowBranchingToplevel.Merge): ... here.
6321         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6322         set, propagate the origin upward, and only complain if there was
6323         no other error.
6324         (FlowBranchingException.AddContinueOrigin): Likewise.
6325         (FlowBranchingException.AddReturnOrigin): Likewise.
6326         (FlowBranchingException.AddGotoOrigin): Likewise.       
6327
6328 2006-05-23  Raja R Harinath  <rharinath@novell.com>
6329
6330         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6331         unreachable, skip it.
6332         (FlowBranchingException.Merge): Always propagate jumps, even if
6333         the finally block renders subsequent code unreachable.
6334
6335 2006-05-18  Raja R Harinath  <rharinath@novell.com>
6336
6337         Fix #77601
6338         * statement.cs (Goto.Resolve): Move responsibility for resolving
6339         'goto' to FlowBranching.AddGotoOrigin.
6340         (Goto.SetResolvedTarget): New.  Callback to set the
6341         LabeledStatement that's the target of the goto.
6342         (Goto.DoEmit): Use Leave instead of Br when crossing an
6343         unwind-protect boundary.
6344         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6345         LookupLabel and adjust to new semantics.
6346         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6347         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6348         Goto.SetResolvedTarget to update target.
6349         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6350         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6351         AddBreakOrigin & co.  Delay propagation until ...
6352         (FlowBranchingException.Merge): ... this.
6353
6354         * statement.cs (Block.Resolve): Always depend on flow-branching to
6355         determine unreachability.  Kill workaround that originally emitted
6356         only one statement after an "unreachable" label (see infloop in
6357         test-515.cs).
6358
6359         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6360         This is still "wrong", but anything better would probably need a
6361         multi-pass algorithm.
6362         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6363         usage vector.  Force current usage vector to be reachable, to
6364         optimistically signify backward jumps.
6365         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6366         detected.
6367         (FlowBranchingLabeled.Merge): New.  If no backward jump was
6368         detected, return the original salted-away usage vector instead,
6369         updated with appropriate changes.  Print unreachable warning if
6370         necessary.
6371         * statement.cs (Block.Resolve): Don't print unreachable warning on
6372         a labeled statement.
6373
6374 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
6375
6376         * driver.cs: Pass filename without path to AssemblyBuilder's 
6377         AddResourceFile. Fixes bug #78407.
6378
6379 2006-05-17  Raja R Harinath  <rharinath@novell.com>
6380
6381         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6382         * flowanalysis.cs (FlowBranchingLabeled): ... here.
6383         (FlowBranching.MergeChild): Overwrite
6384         reachability information from Labeled branchings too.
6385
6386 2006-05-16  Raja R Harinath  <rharinath@novell.com>
6387
6388         * statement.cs (Goto.Resolve): Merge jump origins here ...
6389         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6390
6391         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6392         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
6393         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
6394         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6395         here, ...
6396         * statement.cs (Goto.Resolve): ... not here.
6397         (Goto.Emit): Remove CS1632 check.
6398
6399 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
6400
6401         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6402         error message.
6403
6404 2006-05-11  Raja R Harinath  <rharinath@novell.com>
6405
6406         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6407         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6408         (FlowBranchingException.Label): Likewise.
6409
6410         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
6411         given value.
6412         (MyBitVector.Or): Use it to avoid losing information (Count).
6413         (FlowBranching.MergeOrigins): Likewise.
6414
6415         * flowanalysis.cs (UsageVector.IsDirty): Remove.
6416         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6417         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6418         (UsageVector.ToString): Simplify.
6419         (UsageVector.MergeSiblings): Move here from ...
6420         (FlowBranching.Merge): ... here.
6421         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6422         not a MyBitVector.
6423
6424 2006-05-10  Raja R Harinath  <rharinath@novell.com>
6425
6426         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6427         null bitvector is treated as all-true.
6428
6429         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6430         (MyBitVector): Rationalize invariants.  'vector != null' implies
6431         that we have our own copy of the bitvector.  Otherwise,
6432         'InheritsFrom == null' implies all inherited bits are true.
6433
6434 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
6435
6436         * statement.cs (LocalInfo): Add IsConstant.
6437         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6438         local variable for constants.
6439
6440 2006-05-09  Raja R Harinath  <rharinath@novell.com>
6441
6442         * flowanalysis.cs (MyBitVector.Empty): New.
6443         (MyBitVector): Don't allow InheritedFrom to be null.
6444         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6445         (UsageVector, FlowBranching): Update to changes.
6446
6447         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6448         recursion.  The 'Parent == null' condition isn't sufficient for
6449         anonymous methods.
6450         (FlowBranching.AddBreakOrigin): Likewise.
6451         (FlowBranching.AddContinueOrigin): Likewise.
6452         (FlowBranching.AddReturnOrigin): Likewise.
6453         (FlowBranching.StealFinallyClauses): Likewise.
6454         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6455         (FlowBranching.CheckOutParameters): Likewise.
6456         (FlowBranchingToplevel): Terminate all the above recursions here.
6457         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6458         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6459
6460         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
6461         toplevel block.
6462         (FlowBranchingToplevel): New.  Empty for now.
6463         (FlowBranching.MergeTopBlock): Update.
6464         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6465         branching for the anonymous delegate.
6466         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6467
6468         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6469         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6470         information at the start of the merge.  Reorganize.
6471
6472 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6473
6474         * class.cs (MethodData.Define): Method cannot implement interface accessor.
6475
6476 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6477
6478         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6479         to newly introduced ctor.
6480
6481         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6482         message to one place.
6483         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6484         global namespace.
6485
6486 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6487
6488         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6489
6490         * ecore.cs (Expression.ResolveAsConstant): Updated.
6491
6492         * statement.cs (ResolveMeta): Updated.
6493
6494 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6495
6496         * cs-parser.jay: __arglist cannot be used in initializer.
6497
6498 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6499
6500         A fix for #77879
6501         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6502         private types.
6503
6504 2006-05-05  Raja R Harinath  <rharinath@novell.com>
6505
6506         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6507         (LabeledStatement): Add 'name' parameter.
6508         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6509         (Block.AddLabel): Update to changes.
6510         * cs-parser.jay (labeled_statement): Likewise.
6511
6512         * flowanalysis.cs (BranchingType.Labeled): New.
6513         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6514         (FlowBranchingLabeled): New.  Does nothing for now, but will
6515         eventually handle 'goto' flows.
6516         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6517         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6518         that's terminated ...
6519         (Block.Resolve): ... here.
6520
6521         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6522         (UsageVector.MergeFinallyOrigins): Likewise.
6523         (FlowBranching.InTryOrCatch): Likewise.
6524         (FlowBranching.AddFinallyVector): Likewise.
6525         (FlowBranchingException): Update to changes.
6526
6527         Fix #78290
6528         * statement.cs (Return.Resolve): Move error checking to ...
6529         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6530         (FlowBranchingException): Handle return origins like break and
6531         continue origins.
6532         (FlowBranching.UsageVector.CheckOutParameters): Remove.
6533
6534 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6535
6536         A fix for #76122
6537         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6538         filter.
6539
6540 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6541
6542         A fix for #77543
6543         * class.cs (MethodData.Define): Do public accessor check only when method
6544         implements an interface.
6545
6546 2006-05-04  Raja R Harinath  <rharinath@novell.com>
6547
6548         Remove special handling of 'break'
6549         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6550         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
6551         (UsageVector.Break): Remove.
6552         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6553         reachability.
6554         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6555
6556         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6557         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
6558
6559 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6560
6561         A fix for #75726
6562         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6563         be the interface member.
6564
6565 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6566
6567         A fix for #60069
6568         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6569         for emitting small (int) values.
6570
6571 2006-05-03  Raja R Harinath  <rharinath@novell.com>
6572
6573         Fix #59427
6574         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6575         control-flow passes through the 'finally' after merging-in all the
6576         control-flows from 'try' and the 'catch' clauses.
6577
6578         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6579         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
6580         always true at the only non-recursive entry point.
6581         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6582         FlowBranchingBreakable.
6583         (FlowBranchingLoop): Remove.
6584         * statement.cs (Return.DoResolve): Update to changes.
6585
6586         Fix #76471, #76665
6587         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6588         (FlowBranching.CreateBranching): Handle it: create a
6589         FlowBranchingContinuable.
6590         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6591         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6592         except that it handles the 'continue' command.
6593         (FlowBranching.UsageVector.MergeOrigins): Rename from
6594         MergeBreakOrigins.
6595         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6596         except that it overrides AddContinueOrigin.
6597         (FlowBranchingException): Override AddContinueOrigin, similar to
6598         AddBreakOrigin.
6599         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6600         Create a new branching around the embedded statement.
6601         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
6602         control flow after the embedded statement.
6603         (Continue.Resolve): Move all error checking to AddContinueOrigin.
6604
6605         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6606         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6607         FlowBranchingBreakable.
6608         (FlowBranchingSwitch): Remove.
6609
6610         Fix test-503.cs
6611         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
6612         error reporting to ...
6613         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6614         Rename from 'AddBreakVector'.  Add new location argument.  Return
6615         a bool indicating whether the 'break' crosses an unwind-protect.
6616         (FlowBranchingException.AddBreakOrigin): Add.
6617         (FlowBranchingException.Merge): Propagate 'break's to surrounding
6618         flowbranching after updating with the effects of the 'finally'
6619         clause.
6620         (FlowBranchingBreakable): New common base class for
6621         FlowBranchingLoop and FlowBranchingSwitch.
6622
6623         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6624         embedded statement.
6625         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6626
6627 2006-05-02  Raja R Harinath  <rharinath@novell.com>
6628
6629         * statement.cs (Do.Resolve): If the loop is infinite, set the
6630         barrier.
6631         (While.Resolve, For.Resolve): Set a barrier after the embedded
6632         statement.  There's no direct control flow that goes from the end
6633         of the embedded statement to the end of the loop.
6634         * flowanalysis.cs (FlowBranching.Infinite): Remove.
6635         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
6636         above ensure that the reachability is correctly computed.
6637
6638         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6639         (UsageVector.MergeBreakOrigins): If the current path is
6640         unreachable, treat it as if all parameters/locals are initialized.
6641         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
6642         infinite loops before merging-in break origins.
6643
6644         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6645         (Reachability.Reachable): Split part into ...
6646         (Reachability.Unreachable): ... this.  Simplify.
6647         (Reachability.IsUnreachable): Use 'Unreachable' instead.
6648
6649         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6650         (Reachability.SetThrowsSometimes): Likewise.
6651         (FlowBranchingBlock.MergeTopBlock): Don't compare against
6652         TriState.Always, use corresponding property.
6653         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6654         (Block.Resolve): Likewise.  Remove some redundant checks.
6655
6656 2006-05-02  Raja R Harinath  <harinath@gmail.com>
6657
6658         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6659         (Reachability.Meet): Don't bother checking AlwaysThrows --
6660         barrier is always set.
6661         (FlowBranchingBlock.Merge): Likewise.
6662
6663 2006-05-01  Raja R Harinath  <harinath@gmail.com>
6664
6665         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6666         checks for unreachable.
6667
6668 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
6669
6670         A fix for #77980
6671         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6672
6673         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6674         whether field is really assigned.
6675
6676 2006-04-30  Raja R Harinath  <harinath@gmail.com>
6677
6678         * flowanalysis.cs (Reachability): Make 4-argument constructor
6679         private.
6680         (Reachability.Meet): Rename from 'And'.  Remove static variant.
6681         (Reachability.Always): Rename from the highly misleading
6682         'Reachability.Never'.
6683         (FlowBranching.Merge): Update to changes.  Mark an impossible
6684         situation with a 'throw'.
6685         (*): Update to changes.
6686
6687 2006-04-29  Raja R Harinath  <harinath@gmail.com>
6688
6689         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6690         Remove 'Undefined'.
6691         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6692         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6693         (*): Update to changes.
6694         * statement.cs: Update to changes.
6695
6696 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
6697
6698         A fix for #78049
6699         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6700
6701 2006-04-28  Raja R Harinath  <harinath@gmail.com>
6702
6703         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6704         dummy UsageVector.
6705
6706         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6707         argument to two arguments: an usage-vector and a bool.  Move call
6708         to FlowBranching.Merge () ...
6709         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6710
6711         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6712         handling of loop and switch reachability to ...
6713         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6714
6715 2006-04-27  Raja R Harinath  <harinath@gmail.com>
6716
6717         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6718         handling to FlowBranchingLoop.InLoop.
6719         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6720
6721 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
6722
6723         A fix for #78115
6724         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6725         anonymous method is allowed from AnonymousContainer here.
6726
6727         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6728
6729 2006-04-24  Raja R Harinath  <rharinath@novell.com>
6730
6731         Fix #78156
6732         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6733
6734 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
6735
6736         A fix for #49011.
6737         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6738         (DoubleConstant.Reduce): Ditto.
6739
6740 2006-04-23  Raja R Harinath  <rharinath@novell.com>
6741
6742         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6743         Remove 'lvalue_right_side' argument.  Move parts to ...
6744         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6745         (LocalVariable.DoResolveLValue): ... these.
6746
6747 2006-04-21  Raja R Harinath  <rharinath@novell.com>
6748
6749         Fix cs1655.cs
6750         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6751         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6752         (LocalVariableReference.DoResolveBase): Use it to implement new
6753         CS1655 check.
6754         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6755         (Argument.Resolve): Simplify.  Move CS1510 check ...
6756         * ecore.cs (Expression.ResolveLValue): ... here.
6757         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6758         (PropertyExpr.DoResolveLValue): Likewise.
6759         (FieldExpr.Report_AssignToReadonly): Likewise.
6760         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
6761         LValueMemberAccess or LValueMemberOutAccess on instance depending
6762         on it.
6763         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6764         DoResolve as appropriate.
6765
6766 2006-04-20  Raja R Harinath  <rharinath@novell.com>
6767
6768         Fix #75800
6769         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6770         implicit conversions on 'out' and 'ref' arguments.
6771
6772         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6773         improve clarity.  Remove dead code.
6774
6775         Fix #66031
6776         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6777         (Catch.Resolve): Resolve VarBlock if it exists.
6778
6779 2006-04-19  Miguel de Icaza  <miguel@novell.com>
6780
6781         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6782         twice, this was some residual code, the enumerator was emitted
6783         properly in the two branche of if later.
6784
6785 2006-04-19  Raja R Harinath  <rharinath@novell.com>
6786
6787         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
6788         cast is never an lvalue.
6789         (Cast.DoResolve, Cast.ResolveRest): Combine.
6790         (Argument.Emit): Simplify slightly.  Move 'Expr is
6791         IMemoryLocation' check ...
6792         (Argument.Resolve): ... here.
6793         (Argument.Error_LValueRequired): Remove.  Inline into only user.
6794
6795         Simplifications.  Fix cs0191-2.cs
6796         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6797         CS1649 and CS1651 to ...
6798         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
6799         the actual selection of the error code and message to a lookup
6800         table.  Add a dummy return value to simplify callsites.
6801         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6802         readonly fields of other instances of the same type.  Move CS0197
6803         warning from ...
6804         * expression.cs (Argument.Resolve): ... here.  Simplify code.
6805         Ensure that ec.InRefOutArgumentResolving is only set during LValue
6806         resolution of an out or ref argument.  The code simplification
6807         above uses this invariant.
6808
6809 2006-04-18  Raja R Harinath  <rharinath@novell.com>
6810
6811         Possibly fix #77752.  Fix cs1690-[4-7].cs.
6812         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6813         CheckMarshallByRefAccess.  Drop parameter.
6814         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
6815         warning.
6816         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6817         InstanceExpression.
6818         * report.cs (AllWarnings): Add CS1690.
6819         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6820         for ref access too.
6821         (LocalVariableReference.DoResolveBase): Update.
6822
6823 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6824
6825         * class.cs (MethodOrOperator): Moved common parts from method class.
6826         detect obsolete attributes.
6827         (Method.Define): Simplified as it reuses code from base.
6828         (Constructor.ValidAttributeTargets): Fixed issue found during
6829         refactoring.
6830         (Destructor.ValidAttributeTargets): Fixed issue found during
6831         refactoring.
6832         (Operator): Finished refactoring set off by #78020. Operator class is now
6833         ordinary method class.
6834
6835         * anonymous.cs: Updated.
6836
6837         * decl.cs (DeclSpace): Add IsGeneric
6838
6839 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6840
6841         * class.cs (Constructor.Emit): Don't emit the attributes twice.
6842
6843 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6844
6845         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6846         detect obsolete attributes.
6847         (Method.CreateEmitContext): Moved to MethodOrOperator.
6848
6849 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6850
6851         A fix for #78048.
6852         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6853         customized exception to make crash detection easier.
6854         (MethodOrOperator): Started to work on new base class for methods and
6855         operators.
6856         (Method): Derives from MethodOrOperator.
6857         (Constructor.Emit): Emits its own attributes.
6858         (AbstractPropertyEventMethod.Emit): Ditto.
6859         (Operator): Derives from MethodOrOperator, will refactor fully in extra
6860         patch.
6861         (Operator.Emit): It's temporary more tricky than should be.
6862         
6863         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6864
6865         * report.cs (InternalErrorException): Add ctor with inner exception.
6866
6867 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
6868
6869         A fix for #76744.
6870         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6871         only not visible.
6872
6873 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
6874
6875         A fix for #77916.
6876         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6877         array.
6878
6879 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6880
6881         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6882         attribute is present and Guid not.
6883         (Interface.ApplyAttributeBuilder): Ditto.
6884
6885         * attribute.cs: Add error message.
6886
6887 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6888
6889         A fix for #78020.
6890
6891         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6892         sources (it's composite) so hold them in extra array as they are used in
6893         Emit phase only. It worked in the previous versions by mistake.
6894         (Attribute.Emit): Emit attribute for more owners when exist.
6895
6896         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6897         it has now different behaviour.
6898
6899 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
6900
6901         * constant.cs (Constant.IsDefaultInitializer): New method.
6902
6903         * class.cs: Updated.
6904
6905         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6906         re-initialize default values. It saves KBs almost for every assembly.
6907         Thanks Zoltan for the idea.
6908         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6909         (ArrayCreation.DoResolve): Resolve only once.
6910         (ArrayCreation.Emit): Emit static initializer only when it is faster.
6911         (ArrayCreation.GetAttributableValue): Cope with optimized values.
6912
6913 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
6914
6915         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6916         From #77961.
6917
6918 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6919
6920         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6921         in an embedded statement too.
6922
6923 2006-04-01  Raja R Harinath  <rharinath@novell.com>
6924
6925         Fix #77958
6926         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6927
6928 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6929
6930         A fix for #77966.
6931
6932         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6933         was not specified.
6934
6935         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6936
6937 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
6938
6939         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6940         phase.
6941
6942         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6943         LocalTemporary change.
6944
6945         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6946         TypeContainer.
6947         (ClassOrStruct.DefineFieldInitializers): Implemented static field
6948         initializers optimization.
6949         (ClassOrStruct.TypeAttr): Moved from modifiers.
6950         (Constructor.CheckBase): Don't crash when static ctor has parameters.
6951         (FieldBase.ResolveInitializer): Resolves initializer.
6952         (FieldBase.HasDefaultInitializer): New property.
6953
6954         * cs-parser.jay: Removed message.
6955
6956         * expression.cs (CompilerGeneratedThis): New specialization.
6957
6958         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6959
6960 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
6961
6962         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6963
6964 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6965
6966         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6967         be now EnumConstants only.
6968
6969 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6970
6971         * attribute.cs, driver.cs: Reset more caches.
6972
6973 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6974
6975         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6976
6977 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6978
6979         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6980         for easier reuse. Updated all overrides.
6981         (IntegralConstant): New base class for all integral constants.
6982         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
6983         of the constant range, report custom error.
6984         (UIntConstant.Reduce): Fixed uint conversion.
6985
6986         * ecore.cs, literal.cs: Reduce updates.
6987
6988 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6989
6990         A fix for #75813.
6991
6992         * class.cs (Constructor.Define): Removed extra if for default ctors.
6993         A patch from Atsushi Enomoto.
6994
6995 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6996
6997         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
6998         GetAttributableValue.
6999
7000         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
7001         when required.
7002
7003         * convert.cs (ImplicitConversionRequired): Error message moved to
7004         DoubleLiteral.
7005
7006         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
7007         automatic implicit conversion of an output value.
7008         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
7009
7010         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
7011         conversion.
7012         (TypeOf.GetAttributableValue): Add extra handling for object type.
7013
7014         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
7015         special error message.
7016
7017 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
7018
7019         * class.cs (Constructor.Emit): Don't crash when struct ctor is
7020         InternalCall.
7021         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
7022         compatible with MS runtime.
7023
7024 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
7025
7026         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
7027         attribute arguments here.
7028
7029         * class.cs (Indexer.Define): The check was moved to attribute class.
7030
7031 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
7032
7033         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
7034         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
7035         easier.
7036
7037 2006-03-22  Raja R Harinath  <rharinath@novell.com>
7038
7039         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
7040         mcs to keep code differences small.
7041         * attribute.cs (Attribute.GetParameterDefaultValue): New.
7042         * typemanager.cs (parameter_default_value_attribute_type): New.
7043         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
7044         CS1908 check.
7045
7046 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
7047
7048         * expression.cs (StringConcat.Append): Reverted back to no warning state.
7049
7050 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
7051
7052         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
7053
7054         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
7055         the blocks too.
7056
7057 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
7058
7059         * doc-bootstrap.cs : fix build.
7060
7061 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
7062
7063         * expression.cs (StringConcat.Append): Issue a warning when empty string
7064         is going to append.
7065
7066 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
7067
7068         * assign.cs (CompoundAssign.ResolveSource): Removed.
7069
7070         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
7071         clean up.
7072
7073         * class.cs (TypeContainer.FindMethods): Removed.
7074         (TypeContainer.CheckMemberUsage): Made static.
7075
7076         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
7077
7078         * constant.cs (CheckRange): Removed unused type argument.
7079         (CheckUnsigned): Removed unused type argument.
7080
7081         * cs-parser.jay: Updated after MemberAccess clean up.
7082         Uses Length for empty string test.
7083
7084         * cs-tokenizer.cs: Uses Length for empty string test.
7085         (IsCastToken): Made static.
7086         (is_hex): Made static.
7087         (real_type_suffix): Made static.
7088
7089         * decl.cs (SetupCache): Made static.
7090         (OnGenerateDocComment): Removed unused ds argument.
7091
7092         * delegate.cs (VerifyDelegate): Removed unused argument.
7093
7094         * doc.cs: Uses Length for empty string test.
7095
7096         * driver.cs: Uses Length for empty string test.
7097
7098         * enum.cs (IsValidEnumType): Made static
7099
7100         * expression.cs (EnumLiftUp): Removed unused argument.
7101         (ResolveMethodGroup): Ditto.
7102         (BetterConversion): Ditto.
7103         (GetVarargsTypes): Ditto.
7104         (UpdateIndices): Ditto.
7105         (ValidateInitializers): Ditto.
7106         (MemberAccess.ctor): Ditto.
7107         (GetIndexersForType): Ditto.
7108
7109         * flowanalysis.cs: (MergeFinally): Removed unused argument.
7110
7111         * iterators.cs: Updated after MemberAccess clean up.
7112
7113         * location.cs: Uses Length for empty string test.
7114
7115         * namespace.cs: Uses Length for empty string test.
7116
7117          * report.cs (CheckWarningCode): Made static.
7118
7119         * statement.cs (LabeledStatement): Removed unused argument.
7120
7121         * typemanager.cs (FilterNone): Removed.
7122
7123 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7124
7125         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
7126         obsolete.
7127
7128         * class.cs: Updated.
7129
7130 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7131
7132         * cs-parser.jay.cs: __arglist is not allowed for delegates.
7133
7134 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7135
7136         A fix for #77822.
7137
7138         * expression.cs (VerifyArgumentsCompat): Reverted to double error
7139         reporting, it's more tricky than I thought.
7140
7141 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
7142
7143         A fix for #77816.
7144
7145         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
7146         host container.
7147         (AnonymousMethod.ImplicitStandardConversionExists): New method.
7148         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
7149         Add more error reporting; Fixed issue with params.
7150
7151         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
7152
7153         * cs-parser.jay: AnonymousMethod requires host container.
7154
7155         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
7156
7157 2006-03-18  Raja R Harinath  <harinath@gmail.com>
7158
7159         * class.cs: Change 'TypeContainer ds' constructor argument to
7160         'DeclSpace parent'.  Some classes were missed below due to
7161         different naming convention.
7162
7163         * class.cs (MemberCore.Parent): Delete.  This makes the
7164         ParentContainer changes below enforceable by the compiler.
7165
7166         Treat pointers to enclosing declaration space as 'DeclSpace', not
7167         'TypeContainer'.
7168         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
7169         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
7170
7171         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
7172         of TypeContainer.
7173         (Block.AddThisVariable): Likewise.
7174         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
7175         (AbstractPropertyEventMethod.Emit): Likewise.
7176         (AbstractPropertyEventMethod.EmitMethod): Likewise.
7177         (GetMethod.Define, SetMethod.Define): Likewise.
7178         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
7179         (DelegateMethod.EmitMethod): Likewise.
7180
7181         Fix regression test-partial-13.cs.
7182         Rationalize use of PartialContainer.  Ensure that the partial
7183         class semantics can be tied to type-correctness, i.e., any
7184         violation will cause a compile error.
7185         * class.cs, const.cs: Access all fields that belong to class
7186         TypeContainer via ParentContainer.  Arguments of EmitContexts and
7187         Resolve()-like functions still use 'Parent'.
7188
7189         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
7190         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
7191         (PropertyMethod.CheckModifiers): Remove unused argument.
7192         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
7193         DeclSpace.
7194
7195 2006-03-17  Raja R Harinath  <harinath@gmail.com>
7196
7197         Make semantics of PartialContainer simpler.
7198         * decl.cs (DeclSpace.IsPartial): Remove.
7199         * class.cs (TypeContainer.IsPartial): Likewise.
7200         (TypeContainer..ctor): Set PartialContainer to point to self.
7201         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
7202         (TypeContainer.FindNestedType): Likewise.
7203         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
7204
7205 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
7206
7207         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
7208
7209 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
7210
7211         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
7212         classes.
7213
7214 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
7215
7216         * class.cs (Operator.Define): An error for base conversion was not
7217         reported correctly.
7218
7219 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
7220
7221         * iterator.cs : yield break is allowed in try statement which has
7222           catch clauses. Fixed bug #77767.
7223
7224 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
7225
7226         A fix for #77593, #77574.
7227
7228         * class.cs (MethodCore.CheckBase): Another if for operator.
7229
7230 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
7231
7232         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
7233         were not resolved
7234
7235         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
7236         (DelegateCreation.ImplicitStandardConversionExists): New method for just
7237         conversion test.
7238         
7239         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
7240         not needed.
7241
7242         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
7243         Updated after another emitcontext usage was clean up. It should help us to
7244         synchronize with gmcs easier.
7245
7246 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
7247
7248         A fix for #77353.
7249
7250         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
7251         (Event.Define): ditto
7252         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
7253
7254         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
7255         Removed redundant code and set NewSlot for Invoke method too.
7256
7257         * parameter.cs (Parameters.ctor): Add custom, type ctor.
7258         (Parameters.MergeGenerated): New method. Use this method when you merge
7259         compiler generated argument with user arguments.
7260
7261 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
7262
7263         * attribute.cs (ResolveAsTypeTerminal): Removed.
7264
7265         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
7266         specialization for predefined types; 30% speed up.
7267         Finally placed obsolete check to right place.
7268         (Expression.ResolveType): Removed.
7269
7270         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
7271         Updated after ResolveType was removed.
7272
7273         * expression.cs (Cast.ctor): Check void cast.
7274         (Binary.ResolveAsTypeTerminal): Is never type.
7275         (Conditional.ResolveAsTypeTerminal): Is never type.
7276
7277         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
7278
7279 2006-03-01  Raja R Harinath  <rharinath@novell.com>
7280
7281         Fix #77679.
7282         * expression.cs (ParameterReference.DoResolveBase): Change return
7283         type to bool.
7284         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
7285         Update.
7286
7287         Fix #77628.
7288         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
7289
7290         Fix #77642.
7291         * typemanager.cs (GetFullNameSignature): Don't nullref on
7292         protected accessors.
7293
7294 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
7295
7296         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
7297         these two separated members to simplify the code.
7298         (Attribute.Resolve): Refactored to use new fields and methods.
7299         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
7300         implemented obsolete attribute checking.
7301         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
7302         implemented obsolete checking again. It look line never ending quest ;-)
7303         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
7304
7305         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
7306
7307         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
7308
7309         *class.cs (Property.Define): Add RegisterProperty call.
7310
7311         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
7312         argument groups (only 2).
7313
7314         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7315         encoding expression to arguments.
7316         (Expression.ExprClassToResolveFlags): Just turned to property.
7317
7318         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7319         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7320         optimized as well as implemented support for zero-length attributes.
7321
7322         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7323         Add caching of PropertyInfo's.
7324
7325 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7326
7327         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7328         error multiple times.
7329
7330 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7331
7332         New partial class implementation.
7333         A fix for #77027, #77029, #77403
7334
7335         * attribute.cs (Attributable): Made attributes protected.
7336
7337         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7338         the replacements of ClassPart and PartialContainer.
7339         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7340         (TypeContainer.AddInterface): Ditto.
7341         (TypeContainer.AddPartial): The main method for partial classes. It checks
7342         for errors and merges ModFlags and attributes. At the end class is added to
7343         partial_parts list.
7344         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7345         required here.
7346         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7347         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7348         from the rest of partial classes.
7349         (TypeContainer.GetClassBases): Simplified.
7350         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7351         DefineType.
7352         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7353         (TypeContainer.HasExplicitLayout): Uses Flags now.
7354         (PartialContainer): Removed.
7355         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7356         (StaticClass): Was merged with Class.
7357         (Class.GetClassBases): class and static class bases are verified here.
7358         (Class.TypeAttr): Added static attributes when class is static.
7359         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7360         (MemberBase): In some cases we need to call parent container for partial
7361         class. It should be eliminated but it's not easy now.
7362
7363         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7364
7365         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7366         partial classed to accumulate class comments.
7367         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7368
7369         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7370
7371         * driver.cs (MainDriver): Tree.GetDecl was removed.
7372
7373         * modifiers.cs (Modifiers): Add partial modifier.
7374
7375         * tree.cs (Tree.decl): Removed.
7376         (RootTypes): Started to use this class more often for root types
7377         specializations.
7378
7379 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7380
7381         A fix for #77615
7382
7383         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7384         external interface does not have an attribute.
7385
7386 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7387
7388         Another prerequisites for new partial classs implementation.
7389         
7390         * attribute.cs (Attribute.Equal): Implemented.
7391         (Attribute.Emit): Changed as attributes can be applied more than twice.
7392         (Attributes.Emit): Check for duplicate attributes here.
7393
7394         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7395         as a parameter, clean-up.
7396
7397 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7398
7399         A fix for #77485
7400
7401         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7402         contains obsolete attribute check which can in some cases look for base
7403         type of current class which is not initialized yet.
7404         (TypeContainer.BaseType): Replacement of ptype.
7405
7406         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7407
7408 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7409
7410         First of prerequisites for new partial classs implemention.
7411         
7412         * attribute.cs (Attributable): Extended by ResolveContext;
7413         Attributes finally have correct context for resolving in all cases.
7414         (AttachTo): Attribute owner is assigned here.
7415
7416         * codegen.cs (IResolveContext): Introduce new interface to hold
7417         all information needed in resolving phase.
7418         (EmitContext): Implements IResolveContext; more clean-up needed here.
7419         
7420         * decl.cs (MemberCore): Implemented IResolveContext.
7421
7422         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7423         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7424         parameter.cs, statement.cs, tree.cs, typemanager.cs:
7425         Refactored to use new IResolveContext instead of EmitContext; cleanup
7426
7427 2006-02-06  Miguel de Icaza  <miguel@novell.com>
7428
7429         * codegen.cs (EmitScopeInitFromBlock): check here the
7430         capture_context, there is no need to make two calls to the
7431         EmitContext. 
7432
7433         * anonymous.cs: Add some debugging messages that might help me
7434         track other instances of this problem in the future (the
7435         regression of test 467).
7436
7437         * cs-parser.jay: track the variable block, as we need to initalize
7438         any captured variables declared in this block for the "catch"
7439         portion of the "Try" statement.
7440
7441         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7442         scope initialization for captured variables. 
7443
7444         Also, move the emit for the variables after the block location has
7445         been marked.
7446
7447 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
7448
7449         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7450
7451 2006-02-02  Miguel de Icaza  <miguel@novell.com>
7452
7453         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7454         commit yesterday, the initialization for the roots is necessary.
7455         What is not necessary is the scope activation.
7456
7457 2006-02-02  Raja R Harinath  <rharinath@novell.com>
7458
7459         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7460         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7461         CS0206 checks.
7462         (Argument.Resolve): Remove CS0206 checks.
7463
7464 2006-02-01  Miguel de Icaza  <miguel@novell.com>
7465
7466         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7467         scopes for all the roots, the scopes will now be emitted when the
7468         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
7469
7470         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7471         code.  This reduces a lot of existing cruft.
7472         
7473         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7474         that the ScopeInfo is generated as we enter the scope, not at the
7475         time of use, which is what we used to do before.
7476
7477         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7478         every time a Block is about to be emitted if we have a
7479         CaptureContext. 
7480
7481 2006-02-01  Raja R Harinath  <rharinath@novell.com>
7482
7483         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7484         (Reset): Update.
7485         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7486
7487         * typemanager.cs (cons_param_array_attribute): Make private.
7488         (Reset): Set it to null.
7489         (InitCoreHelpers): Don't initialize it.
7490         (ConsParamArrayAttribute): New.  Initialize it as needed.
7491         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7492
7493 2006-01-31  Miguel de Icaza  <miguel@novell.com>
7494
7495         * expression.cs: There might be errors reported during the
7496         selection of applicable methods.  If there are errors, do not
7497         continue execution as it will lead the compiler to crash.
7498
7499 2006-01-30  Miguel de Icaza  <miguel@novell.com>
7500
7501         * expression.cs: Member access is not allowed on anonymous
7502         methods.  Fixes #77402.
7503
7504 2006-01-30  Raja R Harinath  <rharinath@novell.com>
7505
7506         Fix #77401
7507         * cs-parser.jay (VariableDeclaration): Don't set
7508         current_array_type to null.
7509         (field_declaration, event_declaration, declaration_statement):
7510         Set it to null here.
7511
7512 2006-01-28  Raja R Harinath  <harinath@gmail.com>
7513
7514         * typemanager.cs (GenericParameterPosition): New.
7515         * doc.cs: Use it.
7516
7517 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
7518
7519         * doc.cs : To process "include" elements, first we should create
7520           another list than XmlNodeList, because it could result in node
7521           removal, which could result in that the XmlNodeList gives up
7522           yielding next node.
7523
7524           (Also made code identical to gmcs again.)
7525
7526 2006-01-25  Miguel de Icaza  <miguel@novell.com>
7527
7528         * ecore.cs: Introduce an error report that we were not catching
7529         before, if not silent, we must report the error.  Gonzalo ran into
7530         it.
7531
7532 2006-01-23  Miguel de Icaza  <miguel@novell.com>
7533
7534         A fix for bug: #76957
7535         
7536         * iterators.cs (MoveNextMethod.CreateMethodHost): call
7537         ComputeMethodHost before creating the method, this is a new
7538         requirement. 
7539
7540         * anonymous.cs (AnonymousContainer): Now we track all the scopes
7541         that this method references (RegisterScope).  The actual scope
7542         where the method is hosted is computed with the ComputeMethodHost
7543         before we create the method.
7544
7545         Moved the Deepest routine here.
7546
7547         (AnonymousContainer.ComputeMethodHost): New routine used to
7548         compute the proper ScopeInfo that will host the anonymous method.
7549
7550         (ScopeInfo): Deal with multiple roots.  The problem was that we
7551         did not have a unique root where all ScopeInfos could be hanged
7552         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
7553         of roots.  
7554
7555         Remove AdjustMethodScope which is now computed at the end.  Remove
7556         LinkScope which did a partial link, instead link all ScopeInfos
7557         before code generation from the new "LinkScopes" routine. 
7558
7559         Simplify all the Add* routines as they no longer need to maintain
7560         the tree, they just need to record that they are using variables
7561         from a ScopeInfo.
7562
7563         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7564         routines to produce the forest of ScopeInfo trees.
7565
7566         * class.cs (TypeContainer.AppendMethod): This is just like
7567         AddMethod, but ensures that an interface implementation method
7568         (IEnumerable.XXX) is not inserted at the beginning of the queue of
7569         methods, but at the end.
7570
7571         We use this functionality to ensure that the generated MoveNext
7572         method in the iterator class is resolved/emitted before the
7573         enumerator methods created.   
7574
7575         This is required because the MoveNext method computes the right
7576         ScopeInfo for the method.  And the other methods will eventually
7577         need to resolve and fetch information computed from the anonymous
7578         method. 
7579
7580 2006-01-21  Raja R Harinath  <harinath@gmail.com>
7581             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
7582
7583         Fix rest of #76995.
7584         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7585         the 'aliases' hash.
7586         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7587         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7588
7589 2006-01-18  Raja R Harinath  <rharinath@novell.com>
7590
7591         Fix #76656, cs0231-2.cs.
7592         * cs-parser.jay (formal_parameter_list): Make error case catch
7593         more issues.
7594         (parenthesized_expression_0): Add CS1026 check.
7595         (invocation_expression): Remove unused { $$ = lexer.Location }.
7596
7597 2006-01-17  Raja R Harinath  <rharinath@novell.com>
7598
7599         Fix #76824.
7600         * cs-parser.jay (statement_expression): Don't list out the
7601         individual statement-expressions.  Convert syntax error into
7602         CS0201 check.
7603
7604 2006-01-16  Raja R Harinath  <rharinath@novell.com>
7605
7606         Fix #76874.
7607         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7608         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
7609         CheckIntermediateModification.
7610         (FieldExpr.DoResolve): Add new two-argument version that
7611         allows us to resolve the InstanceExpression as an lvalue.
7612         The one-argument variant is now just a wrapper.
7613         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7614         Resolve the lhs as an lvalue if the it has a value type.
7615         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7616         from Assign.DoResolve.
7617         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7618         resolved as an lvalue.
7619         (PropertyExpr.DoResolve): Update.
7620         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7621         has a value type.  Move CS1612 check here from
7622         CheckIntermediateModification.
7623         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7624         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
7625         'right_side' of a ResolveLValue on an 'out' argument.
7626         (EmptyExpression.LValueMemberAccess): New.  Used as the
7627         'right_side' of a propagated ResolveLValue on a value type.
7628         (LocalVariableReference.DoResolveBase): Recognize
7629         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7630         Add CS1654 check.
7631         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7632         EmptyExpression.Null.
7633
7634 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
7635
7636         * typemanager.cs : added IsGenericParameter(). In mcs it always
7637           return false.
7638         * doc.cs : for generic parameters, use GenericParameterPosition,
7639           not FullName.
7640
7641 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
7642
7643         * expression.cs: Fix Console.WriteLine ((this = x).foo);
7644
7645 2006-01-12  Miguel de Icaza  <miguel@novell.com>
7646
7647         This fixes the problem where we used ldfld instead of ldflda to
7648         load the "THIS" pointer on captured parameters, when THIS is a
7649         value type.  See bug #77205.
7650         
7651         * iterators.cs (CapturedThisReference.Emit): Pass false to
7652         EmitThis (we do not need the address).
7653
7654         * codegen.cs (EmitThis): it needs to know whether we need the
7655         address of `this' or not.  This is used by value types.  
7656
7657         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7658         every other call passes false.
7659
7660 2006-01-12  Raja R Harinath  <rharinath@novell.com>
7661
7662         Fix #77221.
7663         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7664         GetOverride.
7665         * expression.cs (Invocation.OverloadResolve): Update.
7666         (Invocation.DoResolve): Avoid double resolution of invocation.
7667
7668 2006-01-11  Raja R Harinath  <rharinath@novell.com>
7669
7670         Fix #77180.
7671         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7672         unary negation of floating point types as 0-expr; negation cannot
7673         overflow in floating point types.
7674
7675         Fix #77204.
7676         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7677         on operands of 'void' type.
7678
7679         Fix #77200.
7680         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7681         and ExclusiveOr for boolean constants too.
7682
7683 2006-01-09  Raja R Harinath  <rharinath@novell.com>
7684
7685         Fix #75636.
7686         * expression.cs (Invocation.OverloadResolve): Replace reflected
7687         override methods with their base virtual methods, rather than
7688         skipping over them.
7689         * typemanager.cs (TypeManager.GetOverride): New.
7690
7691 2006-01-05  Jb Evain  <jbevain@gmail.com>
7692
7693         * class.cs (Property.Define, Indexer.Define): do not tag the
7694         properties as SpecialName | RTSpecialName.
7695
7696 2006-01-04  Miguel de Icaza  <miguel@novell.com>
7697
7698         * class.cs (MethodCore.IsDuplicateImplementation): This method was
7699         doing a low-level comparission of parameter types.  It was lacking
7700         a check for __argslist. 
7701
7702 2005-12-30  Miguel de Icaza  <miguel@novell.com>
7703
7704         * expression.cs (ParameterReference.DoResolveBase): Allow
7705         reference parameters if they are local to this block. 
7706
7707         This allows the ref and out parameters of a delegate to be used in
7708         an anonymous method, for example:
7709
7710         delegate void set (out int x);
7711
7712         set s = delegate (out int x){
7713                 x = 0;
7714         };
7715
7716         This is used by functionality introduced late in the C# language.
7717         
7718         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7719         method that take ref and out parameters. 
7720
7721         Fixes #77119 which was a late change in the spec.
7722
7723 2005-12-23  Miguel de Icaza  <miguel@novell.com>
7724
7725         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7726         parent if its the same scope.  Fixes #77060.
7727
7728 2005-12-21  Miguel de Icaza  <miguel@novell.com>
7729
7730         * driver.cs: Report the case of no source files and no -out:
7731         argument provided.
7732
7733 2005-12-20  Raja R Harinath  <rharinath@novell.com>
7734
7735         Fix #77035.
7736         * expression.cs (ComposedCast.GetSignatureForError): Define.
7737
7738 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7739
7740         Fix #76995
7741
7742         * namespace.cs (NamespaceEntry): Add extern_aliases as a
7743         ListDictionary, to contain the ExternAliasEntry entries (in
7744         addition to the NamespaceEntry.aliases hashtable). This field is
7745         shared between the original entry and its doppelganger (bodyless 
7746         copy of it).
7747         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7748         extern_aliases field.
7749         (NamespaceEntry.Lookup): Move the IsImplicit check after the
7750         lookup in extern_aliases.
7751
7752 2005-12-16  Raja R Harinath  <rharinath@novell.com>
7753
7754         Fix #77006.
7755         * class.cs (TypeContainer.Mark_HasEquals): New.
7756         (TypeContainer.Mark_HasGetHashCode): New.
7757         (ClassPart): Override them.
7758         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7759
7760         Fix #77008.
7761         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7762         'parent' argument to the base constructor.
7763
7764         Remove all mention of TypeContainer from decl.cs.
7765         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7766         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7767         (DeclSpace.DeclSpace): Likewise.
7768         (DeclSpace.DefineMembers): Remove unused argument.
7769         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
7770         debugging check -- we don't care if the debug code throws an
7771         InvalidCastException instead of an InternalErrorException.
7772         * class.cs (TypeContainer.DefineMembers): Update to changes.
7773         (TypeContainer.DoDefineMembers): Likewise.
7774         (TypeContainer.GetMethods): Likewise.
7775         (PropertyMember.Define): Likewise.
7776         (MemberBase.Parent): New property that forwards to
7777         MemberCore.Parent, but ensures that we get a TypeContainer.
7778         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7779         (RootContext.PopulateTypes): Likewise.  Remove special case code
7780         for !RootContext.StdLib: DefineMembers is idempotent.
7781
7782 2005-12-14  Miguel de Icaza  <miguel@novell.com>
7783
7784         * convert.cs (ExplicitConversionCore): Check the return value from
7785         ExplicitConversionCore which can return null on failure.  Fixes #76914
7786
7787 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
7788
7789         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7790
7791 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
7792
7793         * doc.cs : The search for referenced namespace was insufficient to
7794           get global one as it used to do. Fixed bug #76965.
7795
7796 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
7797
7798         * doc.cs : check name in cref in the last phase that whether it is
7799           namespace or not.
7800
7801 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7802
7803         * cs-tokenizer.cs : reverted the latest change: it somehow broke
7804           Mono.C5.
7805
7806 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7807
7808         * doc.cs : so it turned out that we cannot skip override check for 
7809           interface members. Fixed bug #76954.
7810
7811 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7812
7813         * cs-tokenizer.cs : fixed bug #75984:
7814           - #warning and #error should not be handled when the source line
7815             is disabled.
7816           - #line is not checked strictly when the source line is disabled.
7817           - #define and #undef is on the other hand checked strictly at any
7818             state.
7819
7820 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
7821
7822         * cs-tokenizer.cs : missing Location (actually, filename) in one of
7823           CS1027 report.
7824
7825 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7826
7827         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7828
7829         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7830         event initializers.
7831         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7832         (FieldBase.Initializer): Initializer is now optional.
7833         (EventField.Define): Only event field can have initializer.
7834
7835         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7836
7837         * const.cs (Const): Reuse initializer.
7838
7839         * cs-parser.jay: Updated after FieldBase changes.
7840         Added current_array_type to simplify array initializers.
7841
7842         * ecore.cs (NullCast.IsDefaultValue): Implemented.
7843
7844         * expression.cs, iterators.cs: Updated.
7845
7846         * namespace.cs (NamespaceEntry): Made UsingFound private.
7847
7848 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7849
7850         * parameterCollection.cs: Obsolete, removed.
7851         * parser.cs: Obsolete, removed.
7852
7853 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7854
7855         Fix #76849.
7856         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7857
7858         * enum.cs (Enum.Define): Set obsolete context here.
7859
7860 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7861
7862         * doc.cs :
7863           - FindDocumentedMember() now expects 1) paramList as null
7864             when "we don't have to check the number of parameters" and
7865             2) Type.EmptyTypes when "there is no arguments".
7866           - Introduced FoundMember struct to hold the exact type which was
7867             used to find the documented member (the above change broke
7868             test-xml-044; it might be better just to use DeclaringType than
7869             what MS does, like this change does, but it depends on usage.)
7870
7871 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7872
7873         * doc.cs : documented member might be from DeclaringType for nested
7874           types. Fixed bug #76782.
7875
7876 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
7877
7878         * anonymous.cs: Have the param code handle leaving copies on the
7879         stack etc. Allows anonymous params to take part in the assignment
7880         code (++, +=, etc). Fixes bug #76550
7881
7882         * expression.cs: Handle the prepare_for_load/leave_copy by passing
7883         it down to the anon code.
7884
7885         * iterators.cs: Use dummy var here
7886
7887         * codegen.cs: Handle new vars
7888
7889 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7890
7891         Fix #76849.
7892         * class.cs (MethodData.Define): Set proper Obsolete context.
7893
7894         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7895         obsolete context.
7896         (FieldExpr.DoResolve): Ditto.
7897
7898 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7899
7900         Fix #76849.
7901         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7902         parent is not obsolete.
7903
7904 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
7905
7906         * doc.cs : (FindDocumentedMember) find parameterless members first
7907           and get CS0419 in the early stage. Fixed first case of bug #76727.
7908
7909 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
7910
7911         Fix #76859.
7912         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7913         no error was reported.
7914
7915         *expression.cs (Binary.DoResolve): left can be null.
7916
7917 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
7918
7919         Fix #76783.
7920         * class.cs (MethodData.Emit): Parameters should be labeled first.
7921
7922 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
7923
7924         Fix #76761.
7925         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7926
7927 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
7928
7929         * attribute.cs (AreParametersCompliant): Moved to Parameter.
7930
7931         * class.cs (MethodCore): Parameter clean up.
7932         (IMethodData): Added ParameterInfo.
7933         (MethodData): Parameter clean up.
7934         (Indexer.Define): Parameter clean up.
7935
7936         * anonymous.cs,
7937         * codegen.cs,
7938         * cs-parser.jay,
7939         * decl.cs,
7940         * doc.cs,
7941         * ecore.cs,
7942         * flowanalysis.cs,
7943         * iterators.cs,
7944         * pending.cs,
7945         * statement.cs,
7946         * typemanager.cs: Parameter clean up.
7947
7948         * delegate.cs (Define): Get rid of duplicated code.
7949
7950         * expression.cs (ParameterReference): Removed useless parameters
7951         and simplified.
7952         (Invocation): Ditto.
7953
7954         * parameter.cs (ParamsParameter): New class, params specialization.
7955         (ArglistParameter): Attemp to separate arglist.
7956         (Parameter): Refactored to be reusable and faster.
7957         (Parameter.Modifier): Made understandable.
7958         (Parameters): Changed to be used as a class for `this' assembly
7959         parameters. Refactored to use new specialized classes.
7960
7961         * support.cs (ParameterData): Added Types property.
7962         (InternalParameters): Deleted.
7963
7964 2005-08-20  Martin Baulig  <martin@ximian.com>
7965
7966         Merging this patch from GMCS to fix #75867.
7967
7968         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7969         scope if we don't already have it.
7970
7971 2005-11-17  Martin Baulig  <martin@ximian.com>
7972
7973         * anonymous.cs
7974         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7975         inherit the scope from our parent.  Fixes #76653.
7976
7977 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7978
7979         * doc.cs : the previous patch does not actually fix the bug.
7980           PropertyInfo override check is now implemented and really fixed it.
7981         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
7982
7983 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7984
7985         * doc.cs : apply "override filter" also to properties.
7986           Fixed bug #76730.
7987
7988 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7989
7990         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
7991           no need to check overrides. For classes, omit those results from 
7992           interfaces since they must exist in the class. Fixed bug #76726.
7993
7994 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7995
7996         * typemanager.cs : (GetFullNameSignature) differentiate indexers
7997           with different parameters. Fixed the second problem in #76685.
7998
7999 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
8000
8001         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
8002           get expected 'protected' access in CheckValidFamilyAccess()).
8003           Fixed bug #76692.
8004
8005 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
8006
8007         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
8008           Fixed bug #76705.  CS1569 was incorrectly commented out.
8009
8010 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
8011
8012         * doc.cs : use Invocation.IsOverride() to do real override check.
8013         * expression.cs : made Invocation.IsOverride() internal.
8014
8015 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
8016
8017         * doc.cs : use TypeManager.FindMembers() instead of (possible)
8018           TypeBuilder.FindMembers() and filter overriden base members out.
8019           Fixed bug #76990.
8020
8021 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8022
8023         * doc.cs : ref/out parameters are represented as '@' (instead of
8024           '&' in type FullName). Fixed bug #76630 (additionally crefs).
8025
8026 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8027
8028         * doc.cs : when there was no '.' in cref to methods in doc comment,
8029           then parameters were missing in the output. Fixed bug #76691.
8030
8031 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8032
8033         * driver.cs : don't output docs when there is an error.
8034           Fixed bug #76693.
8035
8036 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8037
8038         * doc.cs :
8039           Now it should detect indexers. Fixed primary concern in bug #76685.
8040           Fixed CS0419 message to not show the identical member signature in
8041           the message.
8042
8043 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
8044
8045         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
8046           instead of Type.FindMembers() since it does not handle events.
8047           Fixed bug #71604.
8048
8049 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
8050
8051         * codegen.cs: Fixed typo (speficied -> specified).
8052
8053 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
8054
8055         Fix #76369.
8056         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
8057
8058 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
8059
8060         * attribute.cs: Changed error message.
8061
8062         * cs-tokenizer.cs: One more check.
8063
8064 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
8065
8066         * statement.cs (Block.Resolve): Ignore empty statement.
8067
8068 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
8069
8070         * report.cs: Made error/warning methods more strict to avoid
8071         their misuse.
8072
8073         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
8074         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
8075         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
8076         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
8077
8078 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
8079
8080         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
8081         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
8082
8083         * class.cs (TypeContainer.IsComImport): New property.
8084         (Constructor.Define): Create proper ctor for ComImport types.
8085
8086         * expression.cs (New.CheckComImport): Fixed.
8087
8088 2005-11-07  Miguel de Icaza  <miguel@novell.com>
8089
8090         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
8091         that a parameter has been captured does not mean that we do not
8092         have to do the rest of the processing.  This fixes the second part
8093         of #76592.  If there was another anonymous method capturing
8094         values in the past, the Scope would never be set for the second
8095         method that captured the same parameter.
8096
8097         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
8098         properly manipulate the stack.   Second part of fix for #76592.
8099
8100         * expression.cs (New): Add support for invoking "new" on
8101         interfaces that have been flagged with the ComImport attribute and
8102         the CoClass.  Fixes #76637 
8103
8104         * statement.cs (Try.DoEmit): When a variable is captured, do not
8105         try to emit the vi.LocalBuilder variable as it has been captured.
8106         Create a temporary variable and store the results on the
8107         FieldBuilder.  Fixes #76642
8108
8109 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
8110
8111         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
8112
8113         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
8114
8115         * expression.cs (Binary.DoResolve): Added && optimalization.
8116     
8117         * typemanager.cs (AddUserType): Removed useless argument.
8118
8119 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
8120
8121         * statement.cs (Block.variables): Uses ListDictionary.
8122
8123 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
8124
8125         Fix #75969.
8126         * class.cs (PartialContainer.EmitType): Customized to emit
8127         security attributes.
8128         (ClassPart.ApplyAttributeBuilder): Transform security attribute
8129         for partial classes.
8130
8131 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
8132
8133         Fix #76599.
8134         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
8135         access has to be fixed.
8136         
8137         * typemanager.cs (IsUnmanagedType): Wrong common field type.
8138
8139 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
8140
8141         Fix #76590.
8142         * ecore.cs (NullCast.Reduce): Implemented.
8143
8144         * expression.cs (ArrayCreation.CheckIndices): Correcly check
8145         constant type.
8146         
8147         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
8148         properly.
8149         (Foreach.Resolve): Catch null properly.
8150
8151 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
8152  
8153         * cs-tokenizer.cs: Warning text fix.
8154
8155         * driver.cs: AllWarningNumbers exposed on public interface.
8156
8157         * report.cs (): Reviewed warning numbers.
8158         (IsValidWarning): Use binary search.
8159
8160 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
8161  
8162         * driver.cs: Implemeted resource visibility.
8163         (Resources): New class for code sharing between /res: and
8164         /linkres:
8165  
8166 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
8167
8168         Fix #76568.
8169         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
8170         folding.
8171         
8172         * convert (Convert.ImplicitReferenceConversion): NullCast holds
8173         contants only.
8174         
8175         * ecore.cs (NullCast): Child is contant only.
8176         
8177         * literal.cs (NullLiteral.Reduce): null can be converted to any
8178         reference type.
8179
8180 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
8181
8182         * driver.cs: Use Encoding.Default as default code page instead
8183           of ISO-28591.
8184
8185 2005-10-27  Raja R Harinath  <rharinath@novell.com>
8186
8187         Fix #76085.
8188         * expression.cs (Invocation.Error_InvalidArguments): Handle
8189         __arglist parameters.
8190         (Invocation.VerifyArgumentsCompat): Likewise.
8191         * support.cs (ReflectionParameters.GetSignatureForError): Print
8192         __arglist parameters.
8193         (InternalParamters.GetSignatureForError): Likewise.
8194         * parameter.cs (Parameters.GetSignatureForError): Likewise.
8195
8196 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
8197
8198         * attribute.cs (GetPropertyValue): Made public.
8199
8200         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
8201         Resolve.
8202         Add new property WrapNonExceptionThrows to handle 2.0 assembly
8203         attribute.
8204         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
8205         is not defined.
8206         
8207         * driver.cs: Reflect method name change.
8208         
8209         * statement.cs (Try.Resolve): Warn when try has both general
8210         exception handlers.
8211         
8212         * typemanager.cs: runtime_compatibility_attr_type new predefined
8213         type.
8214
8215 2005-10-26  Raja R Harinath  <harinath@gmail.com>
8216
8217         Fix #76419.
8218         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
8219         treat it as an empty parameter list.
8220
8221 2005-10-26  Raja R Harinath  <rharinath@novell.com>
8222
8223         Fix #76271.     
8224         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
8225         ResolveAsTypeStep silent.
8226         * statement.cs (Block.AddConstant): Mark block as used.
8227         (Block.ResolveMeta): Avoid piling on error messages
8228         if a constant initializer resolution fails.
8229
8230 2005-10-25  Raja R Harinath  <rharinath@novell.com>
8231
8232         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
8233         Remove.
8234         (NamespaceEntry.VerifyAllUsing): New.
8235         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
8236         behaviour.  Delegates actual resolution of alias to ...
8237         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
8238         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
8239         Update.
8240         * driver.cs (Driver.MainDriver): Update.
8241         
8242         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
8243         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
8244         property.
8245         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
8246         Remove.
8247         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
8248         RootNamespace.DefineNamespacesForAll.
8249
8250 2005-10-24  Raja R Harinath  <harinath@gmail.com>
8251
8252         * typemanager.cs (assemblies, external_aliases, modules)
8253         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
8254         (ComputeNamespaces, GetRootNamespace): Remove extra staging
8255         overhead.  Move resposibility ...
8256         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
8257         * driver.cs, attribute.cs, codegen.cs: Update to changes.
8258
8259 2005-10-23  Raja R Harinath  <harinath@gmail.com>
8260
8261         * namespace.cs (RootNamespace.all_namespaces): Renamed from
8262         cached_namespaces.  Improve usage.
8263         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
8264         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
8265         Move from GlobalRootNamespace and simplify.
8266         (RootNamespace.Global): Make instance variable.
8267         (RootNamespace.RootNamespace): Add "alias name" parameter.
8268         (GlobalRootNamespace): Simplify drastically.
8269         (Namespace.Lookup): Don't use GetNamespace.
8270         * typemanager.cs (GetRootNamespace): Rename from
8271         ComputeNamespaceForAlias.
8272         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
8273
8274 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8275
8276         * anonymous.cs (AnonymousContainer): Don't crash when container
8277         doesn't exist.
8278
8279 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8280
8281         * expression.cs (Binary.DoResolve): Warn when comparing same
8282         values.
8283
8284 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8285
8286         Fix #76486.
8287         * expression.cs (Binary.DoResolve): It looks like there are no
8288         convetsion rules in enum context.
8289
8290 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8291
8292         Add support for extern alias qualifiers.
8293         * typemanager.cs: Move some LookupTypeReflection code
8294         to namespace.cs, to have cleaner code. Added some methods
8295         to help us keep track of the extern aliased references.
8296         * driver.cs: Add suport for extern alias assemblies on command
8297         line and check for their warnings/errors. Also keep track of the
8298         extern aliased assemblies.
8299         * namespace.cs: Move the global functionality of Namespace
8300         to GlobalRootNamespace/RootNamespace. Now the global namespace
8301         is GlobalRootNamespace.Globa. Also the code moved from 
8302         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
8303         Finally added LocalAliasEntry (AliasEntry before) and
8304         ExternAliasEntry, to handle alias statements.
8305         * cs-parser.jay: Add support in the grammar for extern alias
8306         statement.
8307         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
8308         Update callings to Namespace (now in GlobalRootNamespace).
8309
8310 2005-10-18  Raja R Harinath  <rharinath@novell.com>
8311
8312         Fix #76371.
8313         * class.cs (TypeContainer.DefineType): Move updating of
8314         topological sort earlier in the code.
8315         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8316
8317 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
8318
8319         Fix #76273.
8320         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8321         
8322         * constant.cs (Constant.TryReduce): Moved from Cast class.
8323         (Reduce): Made little bit more OO and fixed missing conversions.
8324         
8325         * ecore.cs (Reduce): Implemented.
8326         (Binary.EnumLiftUp): New method to upgrade values to enum values.
8327         
8328         * literal.cs (Reduce): Implemented.
8329         
8330         * class.cs: Reverted Miguel's wrong commit.
8331
8332 2005-10-14  Miguel de Icaza  <miguel@novell.com>
8333
8334         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8335
8336 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
8337
8338         * cs-parser.jay, expression.cs : CS0214 was missing error location
8339           for constants. Fixed bug #76404.
8340
8341 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
8342
8343         Fix #76370.
8344         * convert.cs (ExplicitConversionCore): Fixed object->enum
8345         conversion.
8346
8347 2005-10-10  Raja R Harinath  <rharinath@novell.com>
8348
8349         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8350         InstanceExpression.
8351         (PropertyExpr.EmitCall): Likewise.
8352         * expression.cs (Invocation.EmitArguments): Handle case where
8353         arguments == null.
8354         (Invocation.EmitCall): Avoid allocating temporary variable if
8355         there are no arguments.
8356
8357 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8358
8359         Fix #76323.
8360         * convert.cs (ImplicitConversionStandard): Move conversion of
8361         void* to arbitrary pointer types ...
8362         (ExplicitConversionStandard): .. here.
8363         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8364         error to always print typenames.
8365
8366 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8367
8368         * convert.cs (GetConversionOperator): Rename from
8369         GetConversionOperators.  Move operator selection code from ...
8370         (UserDefinedConversion): ... here.
8371
8372 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
8373
8374         * convert.cs (ExplicitConversionCore): Removed duplicate enum
8375         conversion.
8376
8377 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
8378
8379         * assign.cs (Assign.DoResolve): Error method changed.
8380
8381         * cfold.cs (DoConstantNumericPromotions): Error method changed.
8382         
8383         * const.cs (ResolveValue): Reset in_transit immediately.
8384         
8385         * constant.cs: Error method changed.
8386         
8387         * convert.cs: Removed useless location parameter.
8388         (ExplicitNumericConversion): Don't do double enum check.
8389         (ExplicitConversionCore): Renamed from ExplicitConversion.
8390         (ExplicitUnsafe): Extracted from ExplicitConversion.
8391         (ExplicitConversion): Uses for error reporting.
8392         
8393         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8394         error messages.
8395         (ResolveBoolean): Uses common error method.
8396         (CastToDecimal): Get rid of ec.
8397         (CastFromDecimal): Optimized.
8398         (ConvCast): Get rid of ec.
8399         
8400         * enum.cs (ResolveValue): Reset in_transit immediately.
8401         (Emit): Return after first error.
8402         
8403         * expression.cs: Convert changes.
8404         
8405         * literal.cs: Error method changed.
8406         
8407         * statement.cs: Error method changed.
8408
8409 2005-10-03  Raja R Harinath  <rharinath@novell.com>
8410
8411         * support.cs (SeekableStreamReader.Position): Don't error out when
8412         the requested position is just beyond the end of the current
8413         buffered data.
8414
8415 2005-09-28  Raja R Harinath  <rharinath@novell.com>
8416
8417         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
8418         try to keep in sync with the byte count of the underlying Stream.
8419         However, this limits us to a window size of 2048 characters: i.e.,
8420         the maximum lookahead of our lexer/parser can be 2048 characters.
8421
8422 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
8423
8424         Fix #76255.
8425         * driver.cs: Fix compilation files with full root path.
8426
8427 2005-09-25  Miguel de Icaza  <miguel@novell.com>
8428
8429         * report.cs (SymbolRelatedToPreviousError): Format the output so
8430         it does not use an open parenthesis that is never closed. 
8431
8432         * driver.cs: Follow coding guidelines
8433
8434 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8435
8436         Fix #72930.
8437         * const.cs (Const.ResolveValue): Check for assigning non-null
8438         value to reference type.
8439
8440 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8441
8442         * anonymous.cs: Implemented ExprClassName.
8443         
8444         * assign.cs (Assign.DoResolve): Don't chrash when type is not
8445         delegate.
8446         
8447         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8448         check.
8449         
8450         * class.cs (StaticClass.DefineContainerMembers): Report protected
8451         members as error.
8452         
8453         * codegen.cs: if(ed) PRODUCTION.
8454         
8455         * convert.cs (Error_CannotImplicitConversion): Better error
8456         distinction.
8457         
8458         * cs-parser.jay: More error checks.
8459         
8460         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8461         
8462         * driver.cs (CSCParseOption): Enabled wrong option check.
8463         
8464         * ecore.cs (Expression.ExprClassName): Turned to property.
8465         (MemberExpr.CheckIntermediateModification): For checking boxed
8466         value types     modification.
8467         
8468         * statement.cs (Fixed.Resolve): Expression type must be
8469         convertible to fixed type.
8470         (CollectionForeach.GetEnumeratorFilter,TryType):
8471         Small refactoring for easier error checking.
8472
8473 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
8474
8475         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8476         attributes.
8477         
8478         * class.cs (GeneratedBaseInitializer): New class for customization
8479         compiler generated initializers.
8480         (MemberBase.DoDefine): Check Obsolete attribute here.
8481         (FieldMember.DoDefine): Ditto.
8482         
8483         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8484         constants.
8485         
8486         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8487         (MemberCore.GetObsoleteAttribute): Removed argument.
8488         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8489         (MemberCore.CheckObsoleteType): New helper.
8490         
8491         * delegate.cs,
8492         * enum.cs,
8493         * statement.cs: Updates after MemberCore changes.
8494         
8495         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8496         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8497         
8498         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8499         obsolete attribute for compiler construct.
8500         (As.DoResolve): Cache result.
8501         
8502         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8503
8504 2005-09-26  Raja R Harinath  <rharinath@novell.com>
8505
8506         Fix #76133.
8507         * expression.cs (This.VerifyFixed): In a value type T, the type of
8508         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
8509         value type R, 'this' is treated as a value parameter.
8510
8511 2005-09-22  Miguel de Icaza  <miguel@novell.com>
8512
8513         * statement.cs (Lock): Use the TemporaryVariable class instead of
8514         manually using local variables as those do not work when variables
8515         are captured.
8516
8517         * ecore.cs: Moved the TemporaryVariable class from being a nested
8518         class inside Foreach to be a public class that can be employed in
8519         other places. 
8520
8521 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
8522
8523         * cs-parser.jay: interface_accessors replaced by
8524         accessor_declarations.
8525
8526         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8527         location.
8528         
8529         * statement.cs (GotoCase.Resolve): Convert null constant to
8530         null case.
8531         (SwitchLabel.ResolveAndReduce): Ditto.
8532         (SwitchLabel.NullStringCase): Custom null stamp.
8533         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8534         
8535         typemanager.cs (CSharpSignature): Don't skip first argument
8536         for full names.
8537
8538 2005-09-18  Miguel de Icaza  <miguel@novell.com>
8539
8540         * driver.cs: Set InEmacs based on the environment variable EMACS. 
8541
8542         * location.cs (InEmacs): in this mode, do not report column
8543         location as it confuses Emacs.
8544
8545 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
8546
8547         * cfold.cs, constant.cs, convert.cs, ecore.cs,
8548         expression.cs, iterators.cs, literal.cs: Store constants and
8549         literals location.
8550         
8551         * class.cs (MemberBase.ShortName): Pass location.
8552         
8553         * cs-parser.jay: Some location fixes.
8554         
8555         * ecore.cs (Expression.Location): Made virtual.
8556
8557 2005-09-05  Miguel de Icaza  <miguel@novell.com>
8558
8559         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8560         if the underlying types are the same, otherwise we need to produce
8561         code that will do the proper cast.
8562
8563         This was exposed by Marek's constant rewrite which produced
8564         invalid code for the call site:
8565
8566         enum X : long { a }
8567         void Method (X v) {}
8568
8569         Method ((X) 5)
8570
8571         This fixes test-49.cs
8572
8573 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8574
8575         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8576           Type/Object should be allowed as well. Fixed bug #75968.
8577
8578 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8579
8580         * expression.cs : (Binary.DoResolve): when one is enum constant and
8581           another is constant 0, then return enum one *as enum type*.
8582           Fixed bug 74846.
8583
8584 2005-09-02  Raja R Harinath  <rharinath@novell.com>
8585
8586         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8587         internal.
8588
8589         Fix #75941.
8590         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8591         flow-branching for LocalVariableReferences in case we were invoked
8592         from a MemberAccess.
8593         * expression.cs (LocalVariableReference.VerifyAssigned): New.
8594         Carved out of ...
8595         (LocalVariableReference.DoResolveBase): ... this.
8596         (MemberAccess.Resolve): Do the check that was disabled during
8597         SimpleNameResolve.
8598
8599 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8600
8601         * class.cs :
8602           (PartialContainer.Create): check abstract/sealed/static strictly
8603           but abstract/sealed can exist only at one side. Fixed bug #75883.
8604
8605 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
8606
8607         Fix #75945.
8608         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8609         specified, don't default to UnmanagedType.I4.
8610
8611 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8612
8613         * expression.cs : conditional operator should check possibly
8614           incorrect assign expression. Fixed bug #75946.
8615
8616 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8617
8618         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8619           Reverting the change. gmcs is much complex than mcs on this matter.
8620
8621 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8622
8623         * cs-tokenizer.cs : To read another token ahead of the actual 
8624           consumption, use new SavedToken and cache token instead of moving
8625           back the stream with SeekableStreamReader (it seemed problematic).
8626         * cs-parser.jay,
8627           driver.cs : Thus use StreamReader directly.
8628         * support.cs : Thus removed SeekableStreamReader.
8629
8630 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8631
8632         Fix #75934.
8633         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8634         (ScopeInfo.EmitScopeType): Use it to construct field names from
8635         names of captured locals.
8636
8637         Fix #75929.
8638         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8639         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8640         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
8641         (ExplicitConversion): Remove enum cases already handled by
8642         implicit conversion.  Move implicit conversion check to the beginning.
8643         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8644         * expression.cs (ArrayCreation.EmitDynamicInitializers):
8645         Don't treat System.Enum as a struct.
8646
8647 2005-08-30  Jb Evain  <jbevain@gmail.com>
8648
8649         * attribute.cs: handles as expression in parameters.
8650
8651 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8652
8653         Fix #75802.
8654         * class.cs (TypeContainer.VerifyClsName): Don't use a
8655         PartialContainer when verifying CLS compliance.
8656         (AbstractPropertyEventMethod): Set Parent here, ...
8657         (PropertyMethod): ... not here.
8658
8659 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
8660
8661         * attribute.cs : escaped attribute name should not be allowed to be
8662           resolved (e.g. @class as classAttribute). Fixed bug #75930.
8663
8664 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8665
8666         Fix #75927.
8667         * convert.cs (ImplicitStandardConversionExists): Allow zero also
8668         when converting a long constant to unsigned long.
8669         * expression.cs (Invocation.OverloadResolve): Add sanity check to
8670         detect where IsApplicable and VerifyArgumentsCompat disagree.
8671
8672 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8673         and Carlos Alberto Cortez  <carlos@unixmexico.org>
8674
8675         Fix #75848.
8676         * class.cs (TypeContainer.CanElideInitializer): New helper.
8677         (TypeContainer.EmitFieldInitializers): Use it to determine if we
8678         can safely emitting the initializer of a field.
8679
8680 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8681
8682         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8683           allowed inside a switch (without loop). Fixed bug #75433.
8684
8685 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
8686
8687         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8688         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8689
8690 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8691
8692         * driver.cs : kinda reverting the default encoding changes (not exact 
8693           revert since I noticed that "codepage:reset" might not work fine).
8694
8695 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8696
8697         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8698           Location. Now getter and setter store location correctly.
8699           (errors/cs0111-12.cs now reports the expected location.)
8700
8701 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8702
8703         * driver.cs : Use default encoding on the environment.
8704           Removed (now that) extra parameter for SeekableStreamReader.
8705         * support.cs : (SeekableStreamReader) third .ctor() argument for
8706           StreamReader is not required (always true). preamble size could
8707           be acquired in simpler and safe way.
8708
8709 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
8710
8711         * cs-parser.jay: report CS0642 at warning level 3
8712           and report CS0642 for an if else statement also
8713           fixes bug #74745. Patch by John Luke (and a bit
8714           modified by me).
8715           Removed extra CS0642 warning check for "while",
8716           "for" and "fixed".
8717         * statement.cs: In Block.Resolve(), CS0642 check
8718           is reimplemented to check a sequence of an empty
8719           statement and a block.
8720
8721           Both fix bug #66777.
8722
8723 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
8724
8725         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8726         detection until I fix it.
8727         
8728         * cs-tokenizer.cs: Changed error message.
8729         
8730         * cs-parser.jay: Fixed 2 error locations.
8731         
8732         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8733         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8734         properties.
8735         
8736         * enum.cs (GetSignatureForError): Fixed.
8737         
8738         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8739         method detection.
8740         
8741         * class.cs,
8742         * typemanager.cs (RegisterProperty): Removed.
8743         
8744         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8745
8746 2005-08-24  Raja R Harinath  <rharinath@novell.com>
8747
8748         Fix #75874.
8749         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8750         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8751
8752 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8753
8754         * expression.cs : tiny fix is required for not warning positive ulong.
8755           See test-441.cs.
8756
8757 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8758
8759         * expression.cs : add CS0652 check for constant and integral
8760           expression. Fixed bug #53974.
8761
8762 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8763
8764         * expression.cs : in DoNumericPromotions(), check if there is implicit
8765           conversion overload for string (to check CS0034). Fixed bug #52492.
8766
8767 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8768
8769         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8770
8771 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8772
8773         * ecore.cs : report location when it is *not* Null.
8774
8775 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8776
8777         * codegen.cs,
8778           ecore.cs,
8779           flowanalysis.cs,
8780           expression.cs:
8781           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8782           correctly. Fixed bug #75721.
8783
8784 2005-08-23  Raja R Harinath  <rharinath@novell.com>
8785
8786         * support.cs (SeekableStreamReader.Position): Avoid an expensive
8787         loop that performs 'min (pos, char_count)'.
8788
8789         Fix #75862.
8790         * expression.cs (Unary.ResolveOperator): Don't discard implicit
8791         converted value in Operator.OnesComplement.
8792
8793 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
8794
8795         * anonymous.cs: If the anon method is pulled into a helper class,
8796         it needs to be `internal' not `private'. Fixes runtime behavior on
8797         msft. bug #75704
8798
8799 2005-08-20  Martin Baulig  <martin@ximian.com>
8800
8801         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8802         scope if we don't already have it.
8803
8804         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8805         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8806         fixes #75867.
8807
8808 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
8809
8810         Fix #75803
8811         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8812         is a partial class.
8813
8814 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
8815
8816         The big constants rewrite
8817         Fix #75746, #75685 and more
8818         As a side effect saved 1MB for MWF ;-)
8819         
8820         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8821         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8822         enum based for corlib compilation.
8823         
8824         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8825         subtractions.
8826         
8827         * class.cs (FixedField.Define): Use ResolveAsConstant.
8828         
8829         * const.cs (IConstant): Interface constants and enums.
8830         (Const.ResolveValue): New method for constant resolvning.
8831         (ExternalConstant): Constants from imported assemblies.
8832         
8833         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8834         conversion; like enums.
8835         (Constant.ToType): Converts this constant to different type.
8836         (Constant.Increment): Adds 1.
8837         
8838         * convert.cs (ImplicitConversionRequired): Simplified.
8839         
8840         * cs-parser.jay: Create EnumMember directly.
8841         
8842         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8843         
8844         * doc.cs (GenerateEnumDocComment): Removed.
8845         
8846         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8847         (ConvertIntLiteral): Removed.
8848         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8849         
8850         * enum.cs (EnumMember): Implement IConstant.
8851         (Enum.IsValidEnumConstant): Removed.
8852         (Enum.GetNextDefaultValue): Removed.
8853         (Enum.FindMembers): Updated.
8854         (Enum.GenerateDocComment): Iterate enum members.
8855         
8856         * expression.cs (Cast.TryReduce): Handle enums correctly.
8857         (New.Constantify): Made public.
8858         (MemberAccess.DoResolve): Removed contant specific if(s).
8859         
8860         * literal.cs (NullLiteral): Implement new abstract methods.
8861         
8862         * statement.cs (GotoCase.Resolve): Use new constant methods.
8863         (SwitchLabel.ResolveAndReduce): Use new constant methods.
8864         
8865         * typemanager.cs (LookupEnum): Removed.
8866         (IsEnumType): Fixed to work with corlib.
8867         (RegisterConstant): Removed.
8868         (LookupConstant): Removed.
8869         (GetConstant): Changed to work with IConstant.
8870
8871 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
8872
8873         * location.cs : Fixed overflown (>255) column number.
8874
8875 2005-08-03  Raja R Harinath  <rharinath@novell.com>
8876
8877         First cut of the qualified-alias-member feature.
8878         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8879         token.
8880         * cs-parser.jay (DOUBLE_COLON): New token.
8881         (namespace_or_type_name): Add rule for recognizing
8882         qualified-alias-members.
8883         (primary_expression): Likewise.
8884         (element_access): Allow QualifiedAliasMember as a possible
8885         type-bearing expression.
8886         (local_variable_type, local_variable_pointer_type): Likewise.
8887         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
8888         aliases in the current and enclosing namespace declarations.
8889         (NamespaceEntry.UsingAlias): Add CS0440 warning.
8890         * decl.cs (MemberName.is_double_colon): New.
8891         (MemberName.MemberName): Add new constructor for alias-member.
8892         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8893         * expression.cs (QualifiedAliasMember): New expression type.
8894
8895 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8896
8897         * location.cs : it borked when no argument was specified.
8898
8899 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8900
8901         * location.cs : tiny ToString() format fix.
8902
8903 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8904
8905         * statement.cs : oops, it was missing.
8906
8907 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8908
8909         A set of fixes for precise line/column location.
8910
8911         * location.cs :
8912           "token" field now holds a file/line "delta", a line number offset 
8913           from the segment, and a column number. See also:
8914           http://lists.ximian.com/pipermail/mono-devel-list/2004-
8915           December/009508.html
8916           Removed static IsNull. Use instance IsNull property instead.
8917         * cs-tokenizer.cs :
8918           For some tokens it stores Location. For Identifier it stores
8919           LocatedToken which is a pair of string name and location.
8920           Column numbers are adjusted only at getChar().
8921         * report.cs :
8922           Use Location.ToString() for reporting (it now contains column).
8923         * cs-parser.jay :
8924           Largely modified to use LocatedToken instead of
8925           string (IDENTIFIER), and to acquire Location from some tokens.
8926         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8927           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8928           codegen.cs :
8929           Now MemberName holds Location. DeclSpace.ctor() receives Location
8930           as a parameter. Removed extra parameters to all derived classes.
8931           Replaced Location.IsNull() with instance property.
8932         * assign.cs, expression.cs :
8933           Added .ctor() overload that omits Location.
8934         * attribute.cs :
8935           Added "nameEscaped" flag that indicates the identifier was escaped
8936           in the source file. This fixes bug #57047.
8937
8938 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
8939
8940         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8941         New method, looking for lo-case imported cls type.
8942
8943         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8944         here.
8945
8946         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8947
8948         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8949
8950         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8951         all_imported_types.
8952         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8953
8954         Optimized to save 3.5 MB for SWF compilation.
8955
8956 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8957
8958         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8959         (PartialContainer.Create): Moved logic AddToContainer.
8960         (PartialContainer.MarkForDuplicationCheck): Shares name.
8961         
8962         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8963         place.
8964         
8965         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8966         initialization.
8967         (Namespace.GetSignatureForError): New method.
8968         
8969         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8970         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8971
8972 2005-08-01  Raja R Harinath  <rharinath@novell.com>
8973
8974         Fix #75669.
8975         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8976         member lookup rather than qualifier_type, since qualifier_type can
8977         be null.
8978
8979 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8980
8981         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
8982         enum member.
8983
8984 2005-07-31  Miguel de Icaza  <miguel@novell.com>
8985
8986         * statement.cs: Copy the local exception into the exception
8987         captured local.  Fixes 75674
8988
8989 2005-07-31  Raja R Harinath  <harinath@gmail.com>
8990
8991         Fix #75658.
8992         * expression.cs (Invocation.OverloadResolve): Don't report error
8993         CS1501 if error CS1502 has been reported.
8994         (New.DoResolve): Delegate CS1501 reporting to
8995         Invocation.OverloadResolve.
8996
8997         Fix #75656.
8998         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
8999         invariant-meaning-in-block property in an enclosing block if
9000         necessary.
9001
9002 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
9003
9004         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
9005         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
9006         (Switch.CheckSwitch): Just save 50kb for SWF.
9007
9008 2005-07-27  Martin Baulig  <martin@ximian.com>
9009
9010         * anonymous.cs (CaptureContext.AddField): Added
9011         `AnonymousContainer am' argument; compute its toplevel scope if
9012         it's not already computed.  Fixes #75649.
9013
9014 2005-07-26  Raja R Harinath  <rharinath@novell.com>
9015
9016         Fix #75628.
9017         * class.cs (Constructor.Emit): Reset block to null if the block
9018         resolve fails.
9019
9020 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
9021
9022         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
9023
9024 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
9025
9026         * class.cs (MethodData.Define): Check whether accessor implementing
9027         interface is public.
9028
9029         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
9030
9031 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
9032
9033         Fix #57245
9034         * namespace.cs (LookupType): Moved same type check to...
9035         
9036         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
9037         with the same name.
9038
9039 2005-07-21  Raja R Harinath  <rharinath@novell.com>
9040
9041         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
9042         already found a typebuilder.
9043         * class.cs (MethodCore.IsDuplicateImplementation): Compare
9044         MemberNames, not strings.
9045
9046         * const.cs (Error_ExpressionMustBeConst): 
9047         Rename from Error_EpressionMustBeConst.
9048         * const.cs, class.cs, statement.cd: Update.
9049
9050 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
9051
9052         Fix #65573
9053
9054         * const.cs (Const.LookupConstantValue): Report missing contant expression
9055         everytime.
9056         (Error_EpressionMustBeConstant): Only one error method.
9057
9058         * class.cs, statement.c: Updated.
9059
9060 2005-07-20  Raja R Harinath  <rharinath@novell.com>
9061
9062         * statement.cs (Block.Flags): Add back HasVarargs.
9063         (Block.flags): Make protected.
9064         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
9065
9066         * typemanager.cs (types, typecontainers, user_types): Remove.
9067         (UserTypes, TypeContainers): Likewise.
9068         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
9069         (CleanUp, Reset): Update.
9070         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
9071         (GetNestedType): Use Type.GetNestedType.
9072         (CoreLookupType): Take two arguments, the namespace and the
9073         basename of the type.  Update to use the Namespace.Lookup
9074         mechanism.
9075         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
9076         (RealMemberLookup): Use IsNestedChildOf instead of playing with
9077         string concatenation and substring matches.
9078         * class.cs, enum.cs, delegate.cs: Update to changes.
9079
9080 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
9081
9082         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
9083         Expression and made virtual.
9084
9085         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
9086         (ImplicitStandardConversionExists): Fixed `byte' typo ?
9087
9088         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
9089
9090         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
9091         error message.
9092
9093         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
9094         change.
9095
9096 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
9097
9098         Fix #57707
9099         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
9100         AssemblyCultureAttribute is not used on executable.
9101
9102         * rootcontext.cs,
9103         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
9104
9105 2005-07-16  Raja R Harinath  <rharinath@novell.com>
9106
9107         Fix #60638.
9108         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
9109         New.  Reports CS0252/CS0253.
9110         Mostly taken from preliminary patch by Duncak Mak.
9111         (Binary.DoResolveOperator): Store results of operator lookup.
9112         Use them to detect if we need to warn about unintended reference
9113         comparisons.
9114
9115 2005-07-15  Raja R Harinath  <rharinath@novell.com>
9116
9117         Fix #72969.
9118         * namespace.cs (Namespace.Lookup): Add back location parameter.
9119         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
9120         * delegate.cs, ecore.cs, expression.cs: Update to changes.
9121
9122         * codegen.cs (EmitContext.DeclSpace): Make readonly.
9123         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
9124         (Namespace.LookupType): ... this.
9125         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
9126         of namespaces.
9127         * typemanager.cs (LookupTypeReflection): Remove buggy code that
9128         purported to handle pointers.
9129         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
9130         CoreLookupType.
9131
9132 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
9133
9134         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
9135         type as namespace.
9136
9137 2005-07-15  Raja R Harinath  <rharinath@novell.com>
9138
9139         * namespace.cs (Namespace.Lookup): Drop location parameter.
9140         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
9141         (NamespaceEntry.Lookup): ... this.
9142         (NamespaceEntry.Error_AmbiguousTypeReference):
9143         Move here from DeclSpace.
9144         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
9145         names ...
9146         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
9147         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
9148         Move to NamespaceEntry.
9149         * delegate.cs, expression.cs: Update to changes.
9150
9151 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
9152
9153         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
9154         CheckAttributeType and refactored.
9155         (Attribute.ResolvePossibleAttributeType): Changed to reuse
9156         ResolveAsTypeTerminal error handling.
9157         (ResolveAsTypeTerminal): Introduced because of global attributes extra
9158         handling.
9159         (GetSignatureForError): Print errors in same way.
9160
9161         * class.cs,
9162         * codegen.cs: Reflect attribute GetSignatureForError change.
9163
9164         * ecore.cs,
9165         * expression.cs: Add silent parameter to ResolveAsTypeStep.
9166
9167         * namespace.cs (UsingEntry): Refactored to make fields private.
9168
9169         * assign.cs,
9170         statement.cs: Error_UnexpectedKind has extra parameter.
9171
9172 2005-07-14  Raja R Harinath  <rharinath@novell.com>
9173
9174         * ecore.cs (IAlias): Remove.
9175         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
9176         that implement the interface.
9177         * namespace.cs (Namespace): Likewise.
9178         (Namespace.declspaces): Renamed from 'defined_names'.
9179         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
9180         DeclSpace instead of an IAlias.
9181         * tree.cs (Tree.AddDecl): Update.
9182
9183 2005-07-12  Raja R Harinath  <rharinath@novell.com>
9184
9185         * statement.cs (Block.Flags); Remove HasVarargs.
9186         (Block.HasVarargs): Move to ToplevelBlock.
9187         (Block.ThisVariable, Block.AddThisVariable): Likewise.
9188         (Block.Variables): Make protected.  Initialize variable hashtable
9189         if necessary.
9190         (Block.AddVariable): Update.
9191         (Block.Resolve): Update to changes.
9192         (ToplevelBlock.HasVarargs): New boolean.
9193         (ToplevelBlock.ThisVariable): Move here from Block.
9194         (ToplevelBlock.AddThisVariable): Likewise.
9195         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
9196         * expression.cs (This.ResolveBase): Update to changes.
9197         (ArglistAccess.DoResolve): Likewise.
9198
9199 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
9200
9201         Fix #75321
9202         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
9203
9204         * class.cs (TypeContainer.VerifyMembers): Distinguish between
9205         not used and not used & assigned.
9206         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
9207
9208 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
9209
9210         Fix #75053
9211         * expression.cs (Is.DoResolve): null is never provided type.
9212
9213 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
9214
9215         Fix #52496
9216         * cs-parser.jay: Less strict event error rule to catch more errors.
9217
9218 2005-07-08  Martin Baulig  <martin@ximian.com>
9219
9220         Fix test-iter-10.cs - distinguish whether we `yield' in a property
9221         gettter (allowed) or setter (not allowed).
9222
9223         * class.cs (Accessor): Implement IIteratorContainer.
9224         (Accessor.Yields): New public field.
9225         (PropertyBase.PropertyMethod.Define): Handle iterators on a
9226         per-accessor basis.
9227
9228         * cs-parser.jay
9229         (get_accessor_declaration, set_accessor_declaration): Set the
9230         `yields' flag on the accessor, not the property.
9231         (property_declaration): Do the iterators check on a per-accessor
9232         basis and not for the whole property.
9233
9234 2005-07-08  Martin Baulig  <martin@ximian.com>
9235
9236         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
9237         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
9238
9239 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
9240
9241         Fix #74975
9242         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
9243         (ExtractSecurityPermissionSet): Cope with self referencing security
9244         attributes properly.
9245
9246         * driver.cs (SetOutputFile): Made public property OutputFile.
9247
9248 2005-07-07  Raja R Harinath  <rharinath@novell.com>
9249
9250         Fix #75486.
9251         * class.cs (TypeContainer.first_nonstatic_field): Rename from
9252         has_nonstatic_fields.  Make into a FieldBase pointer.
9253         (TypeContainer.AddField): Add CS0282 check.
9254         (TypeContainer.EmitType): Update.
9255
9256 2005-07-06  Miguel de Icaza  <miguel@novell.com>
9257
9258         * cs-tokenizer.cs (consume_identifier): Do not create strings to
9259         compare if they start with __.
9260
9261 2005-07-06  Raja R Harinath  <rharinath@novell.com>
9262
9263         * statement.cs (Switch.SwitchGoverningType): Only look at
9264         UserCasts that don't need implicit standard conversions to one of
9265         the allowed switch types (Fixes test-322.cs).
9266         (LocalInfo.Resolve): Re-enable sanity-test.
9267
9268 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
9269
9270         * cs-tokenizer.cs (consume_identifier): Detect double undescores
9271         
9272         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
9273         
9274         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
9275
9276 2005-07-06  Raja R Harinath  <rharinath@novell.com>
9277
9278         Fix #75472.
9279         * ecore.cs (SimpleName.GetSignatureForError): Add.
9280         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
9281         (MemberAccess.GetSignatureForError): Add.
9282
9283 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
9284  
9285         The big error and warning messages review.
9286         
9287         * anonymous.cs,
9288         * assign.cs,
9289         * attribute.cs,
9290         * class.cs,
9291         * codegen.cs,
9292         * convert.cs,
9293         * cs-parser.jay,
9294         * cs-tokenizer.cs,
9295         * decl.cs,
9296         * delegate.cs,
9297         * doc.cs,
9298         * driver.cs,
9299         * ecore.cs,
9300         * enum.cs,
9301         * expression.cs,
9302         * flowanalysis.cs,
9303         * iterators.cs,
9304         * literal.cs,
9305         * location.cs,
9306         * modifiers.cs,
9307         * namespace.cs,
9308         * parameter.cs,
9309         * pending.cs,
9310         * report.cs,
9311         * rootcontext.cs,
9312         * statement.cs,
9313         * support.cs,
9314         * tree.cs,
9315         * typemanager.cs: Updated.
9316         
9317         * class.cs: (MethodCore.SetYields): Moved here to share.
9318         (PropertyMethod.Define): Moved iterator setup here.
9319         
9320         * iterators.cs: Add orig_method to have full access to parent
9321         container.
9322
9323 2005-07-05  Raja R Harinath  <rharinath@novell.com>
9324
9325         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9326         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9327         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9328         variable of struct type.
9329         * expression.cs (Unary.ResolveOperator): Update to change.
9330         (Indirection.VerifyFixed): Likewise.
9331         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9332         (ParameterReference.VerifyFixed): Value parameters are fixed.
9333         (This.VerifyFixed): Treat 'this' as a value parameter.
9334         * statement.cs (LocalInfo.IsFixed): Remove.
9335
9336 2005-07-01  Martin Baulig  <martin@ximian.com>
9337
9338         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9339         `ec.EmitThis ()' to get the correct scope.
9340
9341 2005-07-01  Martin Baulig  <martin@ximian.com>
9342
9343         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9344         instance is a ParameterReference; fixes #75299.
9345
9346 2005-07-01  Martin Baulig  <martin@ximian.com>
9347
9348         Reverted Marek's latest patch (r46725):
9349         - it contains structural changes which are neither mentioned in
9350           the ChangeLog nor explained anywhere; for example the additional
9351           argument of EmitContext's and Iterator's .ctor's and the
9352           TypeContainer.DefineMembers() change.
9353         - structural changes like this should go in in seperate patches
9354           and not be hidden in a huge patch which just seems to affect
9355           warnings and errors.
9356           a big and hard to understand patch.
9357         - it breaks iterators and causes regressions, for instance in
9358           test-iter-03.cs.      
9359
9360 2005-06-30  Raja R Harinath  <rharinath@novell.com>
9361
9362         Fix #75412.
9363         * expression.cs (Indexers.map): Remove.
9364         (Indexers.Append): Filter out inaccessible setters and getters.
9365         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9366
9367         Fix #75283.
9368         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
9369         Refactored from ...
9370         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9371         (FieldExpr.Emit, PropertyExpr.Emit): Update.
9372         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9373         * expression.cs (Invocation.EmitCall): Add CS0120 check.
9374
9375 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
9376
9377         Fix #75322
9378         * class.cs (FieldBase.GetInitializerExpression): One more field
9379         for backup.
9380
9381 2005-06-28  Miguel de Icaza  <miguel@novell.com>
9382
9383         * pending.cs: Do not define a proxy if the base method is virtual,
9384         it will be picked up by the runtime (bug 75270).
9385
9386 2005-06-08  Martin Baulig  <martin@ximian.com>
9387
9388         The big Iterators rewrite :-)
9389
9390         * iterators.cs: Rewrite this to use the anonymous methods framework.
9391
9392         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9393         before the TypeContainers; see 2test-21.cs.
9394
9395         * class.cs
9396         (TypeContainer.DefineType): Don't create a new EmitContext if we
9397         already have one (this only happens if we're an Iterator).
9398         (TypeContainer.Define): Also call Define() on all our iterators.
9399         (Method.CreateEmitContext): Added support for iterators.
9400
9401         * anonymous.cs
9402         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9403         (AnonymousContainer.CreateMethodHost): Moved here from
9404         AnonymousMethod and made abstract.
9405         (AnonymousContainer.CreateScopeType): New abstract method.
9406         (AnonymousContainer.IsIterator): New public property.
9407         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9408         get the ScopeTypeBuilder rather than manually defining it here. 
9409         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9410         iterators here.
9411
9412         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9413         before RootContext.DefineTypes().
9414
9415         * codegen.cs (EmitContext.RemapToProxy): Removed.
9416         (EmitContext.CurrentAnonymousMethod): Changed type from
9417         AnonymousMethod -> AnonymousContainer.
9418         (EmitContext.ResolveTopBlock): Protect from being called twice.
9419         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9420         (EmitContext.EmitThis): Removed the iterators hacks; use the
9421         anonymous methods framework for that.
9422
9423         * statement.cs
9424         (ToplevelBlock.Container): Make this a property, not a field.
9425         (ToplevelBlock.ReParent): New public method; move the
9426         ToplevelBlock into a new container.
9427         (Foreach.TemporaryVariable): Simplify.
9428
9429 2005-06-05  Martin Baulig  <martin@ximian.com>
9430
9431         * statement.cs (LocalInfo.CompilerGenerated): New flag.
9432         (Block.AddTemporaryVariable): New public method; creates a new
9433         `LocalInfo' for a temporary variable.
9434         (Block.EmitMeta): Create the LocalBuilders for all the temporary
9435         variables here.
9436         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9437         non-iterator variables.
9438
9439 2005-06-05  Martin Baulig  <martin@ximian.com>
9440
9441         * statement.cs (Foreach.TemporaryVariable): Create the
9442         LocalBuilder in the Emit phase and not in Resolve since in some
9443         situations, we don't have an ILGenerator during Resolve; see
9444         2test-19.cs for an example.
9445
9446 2005-06-04  Martin Baulig  <martin@ximian.com>
9447
9448         **** Merged r45395 from GCS ****
9449
9450         The big Foreach rewrite - Part II.
9451
9452         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9453         with `PropertyInfo ienumerator_getcurrent'.
9454
9455         * codegen.cs (VariableStorage): Removed.
9456
9457         * statement.cs
9458         (Foreach): Derive from Statement, not ExceptionStatement.
9459         (Foreach.CollectionForeach): New nested class.  Moved all the code
9460         dealing with collection foreach here.
9461         (Foreach.ForeachHelperMethods): Removed.
9462         (Foreach.TemporaryVariable): Implement IMemoryLocation.
9463
9464 2005-05-23  Martin Baulig  <martin@ximian.com>
9465
9466         * statement.cs (Try.DoResolve): Don't create a `finally' if we
9467         don't need to.  Fix #75014.
9468
9469 2005-05-20  Martin Baulig  <martin@ximian.com>
9470
9471         Merged r44808 from GMCS.
9472
9473         * class.cs (TypeContainer.CircularDepException): Removed.
9474         (TypeContainer.DefineType): Removed the `InTransit' stuff.
9475         (TypeContainer.CheckRecursiveDefinition): Check for circular class
9476         (CS0146) and interface (CS0529) dependencies here.
9477
9478 2005-06-21  Raja R Harinath  <rharinath@novell.com>
9479
9480         * expression.cs (Invocation.EmitCall): Fix initialization
9481         'this_call' to reflect current behaviour.  Fix indentation.
9482
9483         * convert.cs (FindMostEncompassedType): Add two trivial special
9484         cases (number_of_types == 0 || number_of_types == 1).
9485         (FindMostEncompasingType): Likewise.
9486
9487 2005-06-17  Raja R Harinath  <rharinath@novell.com>
9488
9489         Some cleanups preparing for the fix of #75283.
9490         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9491         error testing.
9492         (EventExpr.InstanceResolve): Likewise.
9493         (EventExpr.DoResolve): Remove redundant checks.
9494
9495 2005-06-10  Duncan Mak  <duncan@novell.com>
9496
9497         * cs-tokenizer.cs (process_directives): New flag for controlling
9498         the processing of preprocessor directives.
9499         (x_token): After seeing a '#', return Token.NONE instead of going
9500         to handle_preprocessing_directive() when not processing
9501         directives. This avoids unnecessary processing during the token peek in
9502         is_punct().
9503
9504         This fixes #74939.
9505
9506         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9507         the existing error reporting methods instead of Report.Error.
9508
9509         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9510         after Raja's rewrite.
9511
9512 2005-06-08  Miguel de Icaza  <miguel@novell.com>
9513
9514         * class.cs: Small fix.
9515
9516 2005-06-08  Raja R Harinath  <rharinath@novell.com>
9517
9518         Fix #75160.
9519         * class.cs (GetPartialBases): Fix return value check of
9520         part.GetClassBases.
9521
9522 2005-06-07  Raja R Harinath  <rharinath@novell.com>
9523
9524         Ensure that partial classes are registered in their enclosing
9525         namespace.  Initial part of fix of #75160.
9526         * tree.cs (Tree.RecordDecl): Add new namespace argument.
9527         Register declspace with namespace here, not in
9528         DeclSpace.RecordDecl.
9529         * cs-parser.jay: Pass namespace to RecordDecl.
9530         * class.cs (PartialContainer.Create): Likewise.
9531         (ClassPart.DefineType): New sanity-check.  Throws an exception if
9532         called.
9533         * decl.cs (Declspace.RecordDecl): Remove.
9534         * namespace.cs (NamespaceEntry.DefineName): Remove.
9535
9536 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
9537
9538         * rootcontext.cs: Reset TargetExt as well.
9539
9540 2005-06-03  Raja R Harinath  <rharinath@novell.com>
9541
9542         * ecore.cs (Expression.Resolve): Emit CS0654 error when
9543         -langversion:ISO-1.
9544
9545 2005-06-02  Raja R Harinath  <rharinath@novell.com>
9546
9547         Fix #75080, cs0119.cs.
9548         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
9549         of ...
9550         (Expression.Resolve): ... this.  Use it.  Remove bogus code
9551         allowing ExprClass.Type and ExprClass.Namespace for
9552         ResolveFlags.VariableOrValue.
9553         (Expression.Resolve) [1-argument variant]: Change default resolve
9554         flags based on language version.
9555         (Expression.Error_UnexpectedKind): Use a simple string array
9556         rather than an ArrayList.
9557         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9558         not ExprClass.Type.
9559         (TypeOfVoid.DoResolve): Likewise.
9560         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
9561         flags argument -- it always has the same value.
9562
9563 2005-05-31  Raja R Harinath  <rharinath@novell.com>
9564
9565         Fix #75081.
9566         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9567         Use it in the error message.
9568         * assign.cs, expression.cs, statement.cs: Update.
9569
9570 2005-05-30  Raja R Harinath  <rharinath@novell.com>
9571
9572         Fix #75088.
9573         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9574         the "almostMatchedMember" case too.
9575         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9576         that failed the accessibility checks to 'almost_match'.
9577
9578 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
9579
9580         * attribute.cs: Use internal MethodBuilder methods to set
9581         ExactSpelling and SetLastError on PInvoke methods, instead
9582         of passing them via charset.  Fixes #75060.
9583
9584 2005-05-27  Raja R Harinath  <rharinath@novell.com>
9585
9586         * parameter.cs (Parameter): Remove TODO comment.
9587         (Parameter.DefineParameter): Remove Location parameter.
9588         (Parameters.LabelParameters): Likewise.
9589         * class.cs (Constructor.Emit): Update to change.
9590         (MethodData.Emit): Likewise.
9591         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
9592         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9593
9594 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
9595
9596         * parameter.cs,
9597           Removed Parameters.Location and added Parameter.Location instead.
9598           Removed Location parameter from Emit() and GetSignature().
9599         * anonymous.cs,
9600           class.cs,
9601           cs-parser.jay,
9602           delegate.cs,
9603           iterators.cs,
9604           statement.cs :
9605           Modified all related calls.
9606
9607 2005-05-26  Raja R Harinath  <rharinath@novell.com>
9608
9609         Improve user-defined conversion handling.
9610         * convert.cs (GetConversionOperators): Rewrite.  Return only the
9611         applicable operators.
9612         (AddConversionOperators): New.  Helper for GetConversionOperators.
9613         (FindMostEncompassedType, FindMostEncompassingType): Verify that
9614         there is only one most encompassed/encompassing type.
9615         (FindMostSpecificSource, FindMostSpecificTarget): Remove
9616         "applicable operator" handling.
9617         (UserConversion): Move cache here from GetConversionOperators.
9618         Directly cache the chosen operator, rather than the whole
9619         MethodGroup.
9620         (ExplicitNumericConversion): Fix buggy implementation of Decimal
9621         case.  Allow conversion of decimal to sbyte and byte too.
9622         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9623         New static methods.  Used to avoid allocating EmptyExpressions in
9624         convert.cs.
9625
9626 2005-05-24  Duncan Mak  <duncan@novell.com>
9627
9628         * ecore.cs (CastFromDecimal): New class for casting a decimal to
9629         another class, used in Convert.ExplicitNumericConversion.
9630         (CastToDecimal): New class, similar to above, but casts to
9631         System.Decimal, used in Convert.ImplicitNumericConversion and also
9632         in explicit convesion from double/float to decimal.
9633
9634         * convert.cs (ImplicitNumericConversion): Handle implicit
9635         conversions to System.Decimal.
9636         (ExplicitNumericConversion): handle explicit conversions to
9637         System.Decimal.
9638
9639         This fixes #68711.
9640         
9641 2005-05-20  Miguel de Icaza  <miguel@novell.com>
9642
9643         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9644         know the type at this stage, just break through.   Fixes #75008 
9645
9646 2005-05-19  Martin Baulig  <martin@ximian.com>
9647
9648         * delegate.cs
9649         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9650         to disable error reporting.
9651
9652         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9653         here since we don't want to report an error; see the new test-336.cs.
9654
9655 2005-05-19  Raja R Harinath  <rharinath@novell.com>
9656
9657         * statement.cs (ToplevelBlock.GetParameterReference)
9658         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9659         Move here from class Block.
9660         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9661         * expression.cs (ParameterReference.DoResolveBase): Likewise.
9662
9663 2005-05-18  Martin Baulig  <martin@ximian.com>
9664
9665         Fix #74978.
9666
9667         * flowanalysis.cs
9668         (FlowBranching.Reachability): Add non-static public And() and Or()
9669         methods.
9670         (FlowBranchingSwitch): New class; do the `break_origins' thing
9671         like in FlowBranchingLoop.
9672         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9673         reachability, not just locals and parameters.
9674         (FlowBranching.MergeChild): Remove some of the hacks for loop and
9675         switch; MergeBreakOrigins() now takes care of that.
9676
9677 2005-05-18  Martin Baulig  <martin@ximian.com>
9678
9679         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9680         a loop and may leave it, reset the barrier; fixes #74974.
9681
9682 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
9683         
9684         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9685         is back.
9686         
9687         * cs-parser.jay: Catch more lexical errors.
9688         
9689         * report.cs: Add one more Error method.
9690         
9691         * rootcontext.cs,
9692         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9693
9694 2005-05-17  Martin Baulig  <martin@ximian.com>
9695
9696         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9697         #70970. 
9698
9699 2005-05-16  Raja R Harinath  <rharinath@novell.com>
9700
9701         Fix test-382.cs.  Emit values of decimal constants.
9702         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9703         Carved out of ...
9704         (TypeContainer.AddField): ... this.
9705         (TypeContainer.EmitFieldInitializers): Allow the list of fields
9706         with initializers to include 'Const's.
9707         (ClassPart.RegisterFieldForInitialization): Forward to
9708         PartialContainer.
9709         * const.cs (Const.Const): Pass initializer to base class.
9710         (Const.Define): In case of decimal constants, register them for
9711         initialization in a static constructor.
9712
9713 2005-05-14  Martin Baulig  <martin@ximian.com>
9714
9715         * statement.cs (Block.Resolve): Correctly handle unreachable code;
9716         do not call ResolveUnreachable() on unreachable statements in
9717         here, see the comment in the source code.
9718
9719 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9720
9721         Fix #74934.
9722         * expression.cs (BinaryResolveOperator): If one of the operands of
9723         an equality comparison is 'null' and the other is a pointer type,
9724         convert the null to a NullPointer.
9725         * convert.cs (ImplicitReferenceConversion): If the expression is a
9726         NullLiteral and the target type is a pointer type, return a
9727         NullPointer instead.
9728         (ImplicitConversionStandard): Likewise.
9729
9730 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
9731         
9732         * cs-parser.jay: Set readonly context based on special constructs.
9733         
9734         * expression.cs (LocalVariableReference.DoResolveBase): Improved
9735         readonly variable error handling.
9736         
9737         * rootcontext.cs (EmitCode): Don't verify members when error
9738         occurred.
9739         
9740         * statement.cs (LocalInfo): Add reaodnly context information.
9741         (SetReadOnlyContext, GetReadOnlyContext): New methods.
9742
9743 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9744
9745         * statement.cs (Block.Resolve): Revert change below.  Modify fix
9746         for #74041 to initialize 'resolved' to false only for explicit
9747         blocks.  Fixes #74873.
9748
9749 2005-05-12  Raja R Harinath  <harinath@gmail.com>
9750
9751         Fix #74920.
9752         * typemanager.cs (unmanaged_enclosing_types): New.
9753         (IsUnmanagedType): Avoid infloops by using
9754         'unmanaged_enclosing_types' to talk with recursive invocations.
9755
9756 2005-05-13  Martin Baulig  <martin@ximian.com>
9757
9758         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9759         instance variable, not a local.  Fix #74873.
9760         (Block.ResolveUnreachable): Set it to true here.
9761
9762 2005-05-11  Duncan Mak  <duncan@novell.com>
9763
9764         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9765         continuing to process for 'arg'.
9766         (handle_preprocessing_directive): Check the argument of the #endif
9767         directive and report error CS1025 if there are any trailing
9768         characters.
9769
9770         According to the C# spec, having even whitespace after the #endif
9771         directive is illegal; however, because we call arg.TrimEnd ()
9772         beforehand, we have the same behavior as csc, allowing whitespace
9773         after the directive.
9774
9775         Fixes #74892.
9776
9777 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
9778
9779         Fix #74863.
9780         
9781         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9782         (Constructor.GetObsoleteAttribute): Implemented correctly.
9783
9784 2005-05-10  Martin Baulig  <martin@ximian.com>
9785
9786         * support.cs (ReflectionParameters.ParameterModifier): Use
9787         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9788         and `ParameterAttributes.In'.  Fixes #74884.
9789
9790 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
9791
9792         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9793         
9794         * expression.cs (Argument.GetParameterModifier): Turned to property.
9795         (Invocation.Error_InvalidArguments): Add more descriptive errors.
9796         
9797         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9798         its C# equivalent.
9799         
9800 2005-05-09  Raja R Harinath  <rharinath@novell.com>
9801
9802         Fix #74852.
9803         * decl.cs (MemberCache.AddMethods): Register override methods,
9804         rather than non-override methods.
9805         * typemanager.cs (RegisterOverride): New.
9806         (IsOverride): Update.
9807
9808 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
9809
9810         Fix #73105.
9811         
9812         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9813         recursive declaration.
9814         
9815         * statement.cs (Block.ResolveMeta): Report any error in resolving.
9816         
9817 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
9818
9819         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9820         
9821         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9822
9823 2005-05-05  Raja R Harinath  <rharinath@novell.com>
9824
9825         Fix #74797.
9826         * decl.cs (DeclSpace.FamilyAccessible): 
9827         Use TypeManager.IsNestedFamilyAccessible.
9828
9829         Fix reopened #64812.
9830         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9831         internal'.
9832
9833 2005-05-04  Raja R Harinath  <rharinath@novell.com>
9834             Abin Thomas  <projectmonokochi@rediffmail.com>
9835             Anoob V E  <projectmonokochi@rediffmail.com>
9836             Harilal P R  <projectmonokochi@rediffmail.com>
9837
9838         Fix #64812.
9839         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9840         allow access to all static members.
9841
9842 2005-05-04  Martin Baulig  <martin@ximian.com>
9843
9844         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9845
9846 2005-05-04  Martin Baulig  <martin@ximian.com>
9847
9848         Fix #74655.
9849
9850         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9851         section at the end; make things work if `default' is not the last
9852         section.        
9853
9854 2005-05-04  Martin Baulig  <martin@ximian.com>
9855
9856         Fix #70400.
9857
9858         * statement.cs (Switch): Replaced the `got_default' field with a
9859         `default_section' one.
9860         (Switch.CheckSwitch): Set `default_section' here.
9861         (Switch.Resolve): If we're a constant switch and the constant is
9862         not found, use the default section.
9863
9864 2005-05-03  Martin Baulig  <martin@ximian.com>
9865
9866         * expression.cs (ArrayAccess.EmitGetLength): New public method.
9867
9868         * statement.cs (Foreach.ArrayForeach): New nested class.
9869         (Foreach.TemporaryVariable): New nested class.
9870         (Foreach.EmitArrayForeach): Removed; this is now in the new
9871         ArrayForeach class.
9872
9873 2005-05-03  Raja R Harinath  <rharinath@novell.com>
9874
9875         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
9876         more conservative.
9877         (VerifyPendingMethods): Revert change below.
9878
9879         * typemanager.cs (IsOverride, RegisterNonOverride): New.
9880         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9881         that used to trigger warning -28.  Remove warning -28.
9882         * expression.cs (Invocation.OverloadResolve): Use
9883         TypeManager.IsOverride to distinguish override methods.
9884
9885         Fix #74773.
9886         * pending.cs (VerifyPendingMethods): If a base type implements the
9887         requested interface, don't bother checking individual methods of
9888         the base type.  As a side-effect, this prevents the creation of
9889         unnecessary proxies.
9890
9891 2005-05-02  Martin Baulig  <martin@ximian.com>
9892
9893         Fix #70182.
9894
9895         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9896         Also `And' the locals if the old vector is null.
9897         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9898         null; in this case we basically reset all the variables.        
9899
9900 2005-05-02  Martin Baulig  <martin@ximian.com>
9901
9902         Fix #74529.
9903
9904         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9905         Added `FlowBranching branching' argument; always `and' the
9906         variables instead of `or'ing them unless we're an infinite loop.
9907
9908         * statement.cs (While.Resolve): Create a new sibling unless we're
9909         infinite.       
9910
9911 2005-05-02  Martin Baulig  <martin@ximian.com>
9912
9913         Fix #70140.
9914
9915         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9916         arguments; use it instead of creating a new TopLevelBlock.
9917         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9918         our ConstructorInitializer.
9919
9920         * statement.cs
9921         (TopLevelBlock.TopLevelBranching): New public property.
9922         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9923         and create our `TopLevelBranching'.
9924
9925         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9926         anonymous method host, use `block.TopLevelBranching' rather than
9927         creating a new branching.
9928
9929 2005-04-20  Miguel de Icaza  <miguel@novell.com>
9930
9931         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9932         a ScopeInfo, if any of the current children is a child of the new
9933         entry, move those children there.
9934
9935 2005-04-30  Martin Baulig  <martin@ximian.com>
9936
9937         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9938         at the beginning of a SwitchSection.  Fix #73335.
9939
9940 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
9941
9942         Fix #74378
9943         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9944         
9945         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9946         (FieldExpr.DoResolve): Obsolete members are ignored for field
9947         initializers.
9948         
9949 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
9950
9951         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9952         of arrays detection.
9953
9954         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9955         verification.
9956         (Field.VerifyClsCompliance): Volatile fields are not compliant.
9957
9958         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9959         arrays report.
9960
9961 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
9962
9963         * cs-parser.jay: Use the prefered version of -unsafe in error
9964         message.
9965
9966 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
9967
9968         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9969         circumstances.
9970
9971 2005-04-20  John Luke  <john.luke@gmail.com>
9972
9973         * driver.cs: fix typo in error message, --outout to --output
9974
9975 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
9976
9977         * codegen.cs (InRefOutArgumentResolving): New field.
9978         
9979         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9980         fields outside contructor.
9981         
9982         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
9983         
9984 2005-04-19  Miguel de Icaza  <miguel@novell.com>
9985
9986         * anonymous.cs (CaptureContext.EmitParameterInstance): The
9987         parameter code was not completed ever, so it was not as up-to-date
9988         as local variables.  Must finish it.
9989
9990         The bug fix was to compare the Toplevel of the block, not the
9991         current block.  Thanks for Ben for pointing this out. 
9992
9993 2005-04-19  Raja R Harinath  <rharinath@novell.com>
9994
9995         * decl.cs (AddMethods): Use the declaring type of the problem
9996         method to determine if we want to squash a warning.
9997
9998 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
9999
10000         * attribute.cs: Removed debug output.
10001
10002         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
10003         
10004         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
10005         Report.Stderr.
10006         
10007 2005-04-18  Raja R Harinath  <rharinath@novell.com>
10008
10009         Fix #74481.
10010         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
10011         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
10012         all null comparisons against reference types.
10013
10014 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
10015
10016         Fix# 74565
10017         * class.cs (TypeContainer.CircularDepException) New nested
10018         exception class.
10019         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
10020         (TypeContainer.DefineType): Removed error, reset InTransit before
10021         exit.
10022         (Class.DefineType): Throw exception when is in Transit.
10023         Catch exception and report error.
10024         (Struct.DefineType): Throw exception when is in Transit.
10025         Catch exception and report error.
10026         (Interface.DefineType): Throw exception when is in Transit.
10027         Catch exception and report error.
10028
10029         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
10030         handle nested exception handlers.
10031
10032         * flowanalysis.cs (InTryWithCatch): New method, search for try with
10033         a catch.
10034
10035         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
10036         InFinally and InCatch storage.
10037
10038         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
10039         (Catch.Resolve): Set and Restore ec.InCatch.
10040         (Try.Resolve): Set and Restore ec.InFinally.
10041         (Try.HasCatch): True when try has catch.
10042
10043 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
10044
10045         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
10046           for the same event member, so exclude such cases from warning 419.
10047           Fixed bug #74633.
10048
10049 2005-04-16  Miguel de Icaza  <miguel@novell.com>
10050
10051         * expression.cs (Binary.ResolveOperator): Apply patch from John
10052         Luke to fix bug 59864: operators &, | and ^ on enumerations
10053         require that the same enum type on both sides.
10054
10055         * driver.cs: Add warnings to old flag usage, this is to assist
10056         people who produce Makefiles and hope that the Makefiles will be
10057         used on Windows.
10058
10059         * class.cs (TypeContainer.EmitType): Moved the definition of the
10060         special $PRIVATE$ field from the resolve phase to the Emit phase.
10061         During resolve we do not know if we are a struct with
10062         HasExplicitLayout, we know this only after the attributes for the
10063         type are emitted.
10064
10065         Set the FieldOffset to zero on the dummy field that we create for
10066         the class.   Fixes 74590.
10067
10068 2005-04-16  Raja R Harinath  <rharinath@novell.com>
10069
10070         Fix #73834.
10071         * ecore.cs (PropertyExpr.resolved): New.
10072         (DoResolve): Use it to handle a case of double resolution here.
10073         Handle a case of identical-name-and-type-name.
10074         * expression.cs (ArrayCreation.CheckIndices): Avoid double
10075         resolution by storing the results of expression resolution back
10076         into the "probes" array.
10077
10078 2005-04-15  Raja R Harinath  <rharinath@novell.com>
10079
10080         Fix cs0208-7.cs and cs0208-8.cs.
10081         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
10082         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
10083         error reporting to point out the reason a struct is not unmanaged.
10084
10085 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10086
10087         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
10088           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
10089
10090 2005-04-13  Raja R Harinath  <rharinath@novell.com>
10091
10092         Fix #74528.
10093         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
10094         IdenticalNameAndTypeName here.
10095         (EventExpr.InstanceResolve): Likewise.
10096
10097 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
10098
10099         C# 2.0 DefaultCharSetAttribute implementation
10100         
10101         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
10102         which allows us to set GlobalNamespace for every resolve.
10103         (Attribute.ResolveArguments): Cut from Resolve.
10104         (Attribute.GetCharSetValue): Returns CharSet named argument.
10105         (Attribute.DefinePInvokeMethod): Gets default charset from
10106         module settings.
10107         (GlobalAttribute.ResolveAsTypeStep): Override.
10108         (GlobalAttribute.ResolveArguments): Override.
10109         
10110         * class.cs (TypeAttr): Is protected.
10111         
10112         * codegen.cs (ModuleClass.DefaultCharSet): New member.
10113         (ModuleClass.DefaultCharSetType): New memeber.
10114         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
10115         
10116         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
10117         charset from module.
10118         
10119         * delegate.cs (TypeAttr): Override.
10120         (Delegate.DefineType): Use this TypeAttr.
10121         
10122         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
10123         at very early stage (before types are defined) to resolve model
10124         module attributes. It will probably not work with corlib but it
10125         should be ok.
10126         
10127         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
10128         charset from module.
10129         
10130         * typemanager.cs (default_charset_type): New type.
10131
10132 2005-04-13  Raja R Harinath  <rharinath@novell.com>
10133
10134         * decl.cs (MemberCache.AddMethods): Don't warn if
10135         System.Object.Finalize has buggy MethodAttributes.
10136
10137         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
10138         removed below.
10139
10140 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10141
10142         * doc.cs : detect ambiguous reference to overloaded members.
10143           Fixed bug #71603. MS 1.1 csc does not detect it.
10144
10145 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
10146
10147         * doc.cs : delegates must not be referenced with parameters.
10148           Fixed bug #71605.
10149
10150 2005-04-12  Miguel de Icaza  <miguel@novell.com>
10151
10152         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
10153
10154 2005-04-10  Miguel de Icaza  <miguel@novell.com>
10155
10156         * driver.cs (MainDriver): Stop processing if the CLS stage found
10157         errors. 
10158
10159         (CompilerCallableEntryPoint.InvokeCompiler): Always
10160         reset after execution;   Take a TextWriter argument for the
10161         output.
10162
10163         * report.cs: Use the error stream instead of hardcoding stderr. 
10164
10165 2005-04-09  Miguel de Icaza  <miguel@novell.com>
10166
10167         * class.cs: Reduce code paths to test, too small of an
10168         optimization to make it worth the extra testing.  Always perform
10169         it. 
10170
10171 2005-04-08  Raja R Harinath  <rharinath@novell.com>
10172
10173         Fix #74510.
10174         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
10175         operators that had errors reported on them.
10176
10177 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
10178
10179         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
10180         argument types.
10181         (Attribute.Resolve): Add named argument type checking.
10182         
10183         * class.cs (FixedField.Define): Use IsPrimitiveType
10184         
10185         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
10186         
10187         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
10188         unsafe parameter types.
10189         
10190         * statement.cs (Using.ResolveExpression): Add better error description.
10191         
10192         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
10193         
10194 2005-04-08  Raja R Harinath  <rharinath@novell.com>
10195
10196         Fix #74484.
10197         * attribute.cs (Attribute.GetAttributeUsage): Resolve
10198         AttributeUsageAttribute in the emitcontext of the attribute class,
10199         not in the emitcontext of the attributable entity it was attached to.
10200         * cs-parser.jay: Use 'current_class', not 'current_container',
10201         when creating a GlobalAttribute.
10202
10203 2005-04-08  Alp Toker  <alp@atoker.com>
10204
10205         * pending.cs: The fix to #58413 failed to compile methods implementing
10206         interfaces with/without params modifiers and vice versa, even though
10207         params modifiers aren't part of the signature. Make the modifier check
10208         less strict as in csc.
10209
10210 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
10211             Anoob V E  <projectmonokochi@rediffmail.com>
10212             Harilal P R  <projectmonokochi@rediffmail.com>
10213
10214         Fix #58413.
10215         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
10216         modifiers of pending methods.
10217         (PendingImplementation.PendingImplementation): Initialize it.
10218         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
10219         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
10220         with ParameterData.  Add check for modifiers.
10221         * class.cs (MethodData.Define): Update to changes.
10222
10223 2005-04-07  Raja R Harinath  <rharinath@novell.com>
10224
10225         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
10226
10227 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
10228
10229         * class.cs (PropertyMethod.Define): Check private accessor in abstract
10230         property.
10231         
10232         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
10233         
10234         * rootcontext.cs,
10235         * typemanager.cs: Registered RequiredAttributeAttribute.
10236         
10237 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
10238
10239         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
10240         Warning CS0169 is back at level 3.
10241         (IMethodData.SetMemberIsUsed): New method.
10242         
10243         * decl.cs (IsUsed): New value; moved from FieldBase.Status
10244         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
10245         
10246         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
10247
10248         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
10249         contants.
10250         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
10251         is used.
10252         
10253         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
10254         is used.
10255         
10256         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
10257         to avoid the problems with nested types.
10258
10259 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
10260             Anoob V.E  <projectmonokochi@rediffmail.com>
10261             Harilal P.R  <projectmonokochi@rediffmail.com>
10262             Raja R Harinath  <rharinath@novell.com>
10263
10264         Fix #73820.
10265         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
10266         attribute.
10267         * typemanager (GetConstructor): Make public.
10268
10269 2005-04-05  John Luke  <john.luke@gmail.com>
10270             Raja R Harinath  <rharinath@novell.com>
10271
10272         Fix #62232.
10273         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
10274         struct too.  Return false quicker in a few cases.
10275         (VerifyUnManaged): Use it.
10276
10277 2005-04-05  Raja R Harinath  <rharinath@novell.com>
10278
10279         Fix #74041.
10280         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
10281         not 'unreachable_seen'.
10282
10283 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
10284
10285         * attribute.cs (Attribute.GetValue): Removed unused.
10286         
10287         * codegen.cs (CodeGen.TrimExt): Removed unused.
10288         
10289         * cs-parser.jay (output): Removed unused.
10290         
10291         * cs-tokenizer.cs (hex_digits): Removed unused.
10292         
10293         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
10294         
10295         * expression.cs (Indirection.LoadExprValue): Removed unused.
10296         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
10297         
10298         * iterators.cs (Iterator.param_types): Removed unused.
10299         
10300         * statement.cs (Goto.block): Removed unused.
10301         (ToplevelBlock.did): Removed unused.
10302         (Switch.ResolveConstantSwitch): Removed unused.
10303
10304 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
10305
10306         * rootcontext.cs: Allow mcs to bootstrap with the compilation
10307         resetting thingy.
10308
10309 2005-04-01  Raja R Harinath  <rharinath@novell.com>
10310
10311         Fix #74232 and cs0208-3.cs.
10312         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10313         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10314         unmanaged type.  Don't use FieldBuilders when 't' is a
10315         TypeBuilder.  Use ModFlags and MemberType fields.
10316         * class.cs (MemberBase.member_type): Rename from MemberType.
10317         (MemberBase.MemberType): New property.  Determines member_type on
10318         demand.
10319         (MemberBase.DoDefine): Don't initialize MemberType here.
10320         (FieldMember.Define): Likewise.
10321
10322 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
10323
10324         Fix #74241
10325         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10326         Attributes are emitted there.
10327         
10328 2005-04-01  Raja R Harinath  <rharinath@novell.com>
10329
10330         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10331         keyword in 'partial enum' too.
10332         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10333         is not allowed).
10334         Report from Kamil Skalski <nazgul@omega.pl>.
10335
10336         Fix #74309.
10337         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10338         have partial containers too.
10339
10340         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10341         in block' checks to Block.CheckInvariantMeaningInBlock.
10342         * statement.cs (Block.GetKnownVariableInfo): Make private.
10343         (Block.IsVariableUsedInChildBlock): Remove.
10344         (Block.IsVariableUsedInBlock): Likewise.
10345         (Block.CheckInvariantMeaningInBlock): New.  Show location of
10346         conflicting declaration.
10347         (Block.AddVariable): Make error messages less long-winded and more
10348         specific.  Show location of conflicting declaration.
10349         * parameter.cs (Parameters.Location): New readonly property.
10350
10351 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10352
10353         Clean up semantics of invoking ResolveMemberAccess.
10354         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10355         can have an instance, ensure that we pass in a non-TypeExpression
10356         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
10357         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10358         argument.  Update to changes and simplify.
10359         (FieldExpr.Emitinstance): Remove CS0120 check.
10360         (PropertyExpr.EmitInstance): Likewise.
10361         * expression.cs (Argument.Resolve): Likewise.
10362         (Invocation.DoResolve): Update to changes in semantics of
10363         InstanceExpression.
10364
10365 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
10366
10367         Fix #74241
10368         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10369         customization.
10370         
10371         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10372
10373 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10374
10375         Fix difference in behaviour with commandline invocation.
10376         * driver.cs (Driver.Reset): New.
10377         (CompilerCallableEntryPoint): Call it.
10378
10379         * statement.cs (If.Resolve): Avoid spurious "uninitialized
10380         variable" warnings if the boolean expression failed to resolve.
10381
10382 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
10383
10384         * attribute.cs: Fix the union of several permissions when some of them
10385         are unrestricted (so the result isn't an unrestricted permission set).
10386         Fix #74036.
10387
10388 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10389
10390         * ecore.cs (MemberExpr): New class.  Convert from interface
10391         IMemberExpr.
10392         (MemberExpr.ResolveMemberAccess): Refactor and move here from
10393         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
10394         error checks.
10395         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10396         (MethodGroupExpr.IsExplicitImpl): Remove.
10397         (Expression.GetFieldFromEvent): Remove.
10398         (SimpleName.MemberStaticCheck): Remove.
10399         (SimpleName.DoSimpleNameResolve): Update to changes.
10400         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10401         (MemberAccess.IdenticalNameAndTypeName): Remove.
10402         (MemberAccess.error176): Move to MemberExpr.
10403         (MemberAccess.DoResolve): Update to changes.
10404         (BaseAccess.DoResolve): Likewise.
10405
10406 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
10407
10408         C# 2.0 Conditional attribute class implementation
10409         
10410         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10411         Analyzes class whether it has attribute which has ConditionalAttribute
10412         and its condition is not defined.
10413         
10414         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10415         (Class.IsExcluded): New method. Search for at least one defined
10416         condition in ConditionalAttribute of attribute class.
10417
10418 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10419
10420         * ecore.cs (PropertyExpr): Derive from Expression, not
10421         ExpressionStatement.
10422         (PropertyExpr.EmitStatement): Remove.
10423
10424 2005-03-29  Raja R Harinath  <rharinath@novell.com>
10425
10426         Fix #74060.
10427         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10428         internal field "value__" of an enum be private.  The examples for
10429         "value__" that I found on MSDN all used FieldAttributes.Private.
10430
10431         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10432         Don't mention IL method attribute names.
10433
10434         Fix #47991.  Remove a TODO.
10435         * statement.cs (Block.Toplevel): Make into a field.
10436         (Block.Parameters): Move into ToplevelBlock.
10437         (Block.known_variables): Rename from child_variable_names.
10438         (Block.Block): Remove variants that take Parameters.  Initialize
10439         'Toplevel' with the immediately surrounding toplevel block.
10440         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
10441         LocalInfo parameter.
10442         (Block.GetKnownVariableInfo): New.
10443         (Block.IsVariableNameUsedInChildBlock): Update.
10444         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
10445         the block, even though it may not be in scope.
10446         (Block.AddVariable): Remove Parameters parameter.  Use
10447         Toplevel.Parameters instead.
10448         (Block.AddConstant): Remove Parameters parameter.
10449         (Block.GetParameterReference): Update to use Toplevel.Parameters.
10450         (Block.IsParamaterReference): Likewise.
10451         (Block.IsLocalParameter): Likewise.  Simplify a lot.
10452         (ToplevelBlock.Parameters): New.  Moved from Block.
10453         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
10454         initialize Parameters to a non-null value.
10455         * cs-parser.jay: Update to changes.
10456         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10457         simple names that mean different things in the same block.  Use
10458         Block.IsVariableNameUsedInBlock.
10459
10460 2005-03-28  Raja R Harinath  <rharinath@novell.com>
10461
10462         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10463         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10464         GetTypeHandle.  It is possible for a reflected type to derive from
10465         a TypeBuilder (e.g., int[] derives from the TypeBuilder
10466         System.Array during mscorlib compilation).
10467         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10468         contain a method_hash, don't create one either.  Don't create a
10469         deep copy of the base cache's method_hash.
10470         (MemberCache.SetupCache): Rename back from DeepCopy.
10471         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10472         already initialized.  If we see an override function, add its
10473         underlying base virtual function to the member_hash too.
10474
10475         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10476
10477 2005-03-26  Raja R Harinath  <harinath@acm.org>
10478
10479         Fix #73038.
10480         * assign.cs (Assign.DoResolve): When the RHS of an assignment
10481         fails to resolve, ensure that the LHS is still resolved as an
10482         lvalue.
10483
10484 2005-03-25  Raja R Harinath  <harinath@acm.org>
10485
10486         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10487         ec.ContainerType.
10488         (Enum.current_ec): Remove.
10489         (Enum.LookupEnumValue): Remove EmitContext argument.
10490         Just uses the one created during DefineType.
10491         (Enum.FindMembers): Update.
10492         * expression.cs (MemberAccess.DoResolve): Update.
10493
10494 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
10495
10496         * assign.cs (Assign.DoResolve): Check for CS1717 when
10497         source and target are same (uses Equals).
10498
10499         * expression.cs (LocalVariableReference, ParameterReference,
10500         This): Implemented Equals, GetHashCode.
10501
10502         * statement.cs (Block.GetParameterReference): Removed useless
10503         local variable.
10504
10505 2005-03-22  Raja R Harinath  <rharinath@novell.com>
10506
10507         Fix cs0128.cs
10508         * statement.cs (Block.AddVariable): Ensure that we skip implicit
10509         blocks before deciding whether the error is cs0136 or cs0128.
10510
10511         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10512         (using_alias_directive, using_namespace_directive): Pass
10513         MemberName, not an expression to Namespace.UsingAlias and
10514         Namespace.Using.
10515         (MakeName): Use the MemberName of the namespace.
10516         * namespace.cs (Namespace.MemberName): New.
10517         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10518         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10519         Likewise.
10520         * decl.cs (MemberName.Name): Make readonly.
10521         (MemberName.FromDotted): New "constructor".
10522         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10523         (MemberCore.Name): Compute from MemberName on demand.
10524         (MemberCore.SetMemberName): Provide a way to change the
10525         MemberName.
10526         (MemberCore.AddToContainer): Don't take a fullname parameter.
10527         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10528         fully qualified name of the container to the member name.
10529         (TypeContainer.AddToTypeContainer): Use a fully qualified name
10530         only if the type is a member of the root container.
10531         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10532         MemberName.Left rather than searching for an embedded ".".
10533         (PartialContainer.CreatePart): Update to changes in RootContext.
10534         (MemberBase.ShortName): Turn into a property.  Use
10535         MemberCore.SetMemberName.
10536         (MemberBase.ExplicitInterfaceName): Remove.
10537         (MemberBase.UpdateMemberName): Remove.
10538         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10539         (PropertyBase.SetMemberName): New override.
10540         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10541         (Tree.GetDecl): New.
10542         (Tree.AllDecls): Rename from Decls.
10543         * attribute.cs, enum.cs, report.cs: Update to changes.
10544         * driver.cs (MainDriver): Use MemberName.FromDotted on
10545         RootContext.MainClass.
10546
10547 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
10548
10549         * class.cs (FixedField.Define): Check for CS1664 and more sanity
10550         checks.
10551
10552         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10553
10554 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
10555
10556         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10557         property accessor modifiers.
10558
10559         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10560         fixed buffer attribute (CS1716).
10561         (PropertyMethod.HasCustomAccessModifier): When property accessor
10562         has custom modifier.
10563
10564         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10565         modifiers.
10566         (PropertyExpr.DoResolveLValue): Add CS0272.
10567
10568 2005-03-17  Miguel de Icaza  <miguel@novell.com>
10569
10570         * convert.cs: When converting to a pointer, use the proper Conv.U
10571         or Conv.I depending on the source data type.
10572
10573         * cs-tokenizer.cs: Make the size for large decimal constants,
10574         fixes #72957.
10575
10576 2005-03-17  Martin Baulig  <martin@ximian.com>
10577
10578         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10579         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
10580
10581 2005-03-17  Martin Baulig  <martin@ximian.com>
10582
10583         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10584         to bool so we can return an error condition.
10585         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10586         returned an error.
10587
10588 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
10589
10590         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10591         attributes.
10592
10593 2005-03-16  Raja R Harinath  <rharinath@novell.com>
10594
10595         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10596         Refactor to avoid traversing the list of assemblies, and to avoid
10597         string concatenation.
10598         * typemanager.cs (guid_attr_type): Remove.
10599         (negative_hits, pointers, references): Remove hashes.
10600         (type_hash): New.
10601         (GetConstructedType): New.  Uses type_hash to handle constructed
10602         types (arrays, references, pointers).
10603         (GetReferenceType, GetPointerType): Use it.
10604         (GetNestedType): New.  Uses type_hash to handle nested types of
10605         reflected types.
10606         (LookupType, LookupTypeDirect): Remove.
10607         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
10608         'types' hash and LookupTypeReflection directly.
10609         (params_string, params_object): Use GetConstructedType.
10610         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
10611         top-level types.
10612         (Namespace.Lookup): Use cached_types.
10613         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10614         provided by old TypeManager.LookupType.
10615         * rootcontext.cs (MakeFQN): Remove.
10616         * decl.cs (DeclSpace.MakeFQN): Likewise.
10617         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10618         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10619         TypeManager.GetConstructedType.
10620         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10621
10622 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
10623
10624         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10625         indexers.
10626
10627         * cs-parser.jay: Reports CS1527 for any namespace element.
10628
10629         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10630         Added CS0407.
10631
10632         * expression.cs (ParameterReference.IsAssigned): Changed error to
10633         CS0269.
10634         (Error_WrongNumArguments): Moved CS0245 detection here.
10635
10636         * statement.cs (Return.Resolve): Add CS1622 report.
10637
10638 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
10639
10640         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10641
10642 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
10643
10644         * attribute.cs expression.cs: Get rid of some allocations.
10645
10646 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
10647
10648         * doc.cs : just eliminate the latest change.
10649
10650 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10651
10652         * doc.cs : commented out the latest change. It breaks xml-030.cs
10653
10654 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10655
10656         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10657           fail. So invoke CreateType() in FindDocumentedType().
10658
10659 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10660
10661         * cs-tokenizer.cs : added IsKeyword().
10662         * doc.cs : Detect keyword incorrectly used as identifier.
10663           Allow identifiers prefixed by @.
10664
10665 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
10666
10667         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10668         It caused exception in namespace resolving (again!).
10669         
10670         * class.cs (Class.ctor): Removed exit.
10671         (PropertyMethod.ctor): ditto.
10672         
10673         * codegen.cs (Codegen.Reset): Reset static data.
10674         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10675         
10676         * cs-tokenizer.cs (Cleanup): Removed.
10677         
10678         * driver.cs (GetSystemDir): Rewrote to one line command.
10679         It caused problem with unloaded dynamic modules.
10680         (UnixParseOption): Removed Exit.
10681         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10682         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10683         Now can be mcs used as library.
10684         
10685         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10686         empty location.
10687         
10688         * location.cs (Reset): Reset static data.
10689         
10690         * namespace.cs (Reset): Reset static data.
10691         
10692         * report.cs (Report.Reset): Reset static data.
10693         
10694         * rootcontext.cs (RootContext.Reset): Reset static data.
10695         
10696         * tree.cs (RootTypes.ctor): Use Location.Null
10697         
10698         * typemanager.cs (TypeManager.Reset): Reset static data.
10699         (CoreLookupType): Removed Exit.
10700         (TypeHandle.Reset): Reset static data.
10701         
10702 2005-03-10  Raja R Harinath  <rharinath@novell.com>
10703
10704         Fix #73516.
10705         * typemanager.cs (ComputeNamespaces): Import namespaces from
10706         referenced modules too.
10707
10708 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10709
10710         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10711         than '.'.
10712
10713 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10714
10715         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10716         enclosing DeclSpace.  This ensures that a name-lookup populates
10717         more caches and there are fewer 'TypeExpression's.  Carve out
10718         nested type lookup into ...
10719         (LookupNestedTypeInHierarchy): ... this.
10720
10721 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10722
10723         Clean up a few partial-class semantics.  
10724         Fixes test-357.cs and cs1618-2.cs.
10725         * cs-parser.jay (struct_declaration): Use 'current_class' as
10726         parent of newly-created struct.  Remove call to Register ().
10727         Use 'pop_current_class' to complete handing the current struct.
10728         (interface_declaration): Likewise.
10729         (class_declaration): Likewise.
10730         (enum_declaration): Use 'current_class' as parent of newly created
10731         enum.
10732         (delegate_declaration): Likewise.
10733         (pop_current_class): New function.  This is used to handle closing
10734         up the 'current_class' and 'current_container', and pointing them
10735         to the enclosing class/container.
10736         (CSharpParser): Initialize 'current_class' too.
10737         * decl.cs (MemberCore): Add check for invariant: a partial
10738         container is not a parsed entity, and thus does not enclose any
10739         parsed members.
10740         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10741         (DeclSpace.BaseTypeExpr): Use it.
10742         (DeclSpace.LookupType): Add check for invariant.
10743         * class.cs (TypeContainer): Add check for invariant: a nested
10744         class should have the same NamespaceEntry as its enclosing class.
10745         (TypeContainer.EmitFieldInitializers): Make virtual.
10746         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10747         MemberCore.
10748         (TypeContainer.Register): Remove.
10749         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10750         null.  Use TypeResolveEmitContext for resolving base types and
10751         interfaces.  Move initialization of Parts.TypeBuilder here from
10752         ...
10753         (TypeContainer.DefineNestedTypes): ... here.
10754         (PartialContainer): Take a Namespace not a NamespaceEntry.
10755         (PartialContainer.Create): Don't use Register.  Call the
10756         appropriate Add... function directly.
10757         (ClassPart): Take both the PartialContainer and the enclosing
10758         class as constructor arguments.
10759         (ClassPart.EmitFieldInitializers): Override.
10760         (ClassPart.PartFindNestedTypes): Remove.
10761         (FieldBase.GetInitializerExpression): Resolve the initializer
10762         expression in the emit context of the enclosing class.
10763         * tree.cs (RootTypes): Remove Register ().
10764         
10765 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
10766
10767         * cs-parser.jay: Removed CS0134.
10768         
10769         * driver.cs: Removed CS1901.
10770         
10771         * expression.cs (SizeOf.DoResolve): Don't report CS0233
10772         for predefined types.
10773
10774 2005-03-07  Duncan Mak  <duncan@novell.com>
10775
10776         * codegen.cs (Save):  Catch UnauthorizedAccessException as
10777         well. Fixes bug #73454.
10778
10779 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
10780
10781         * cs-tokenizer.cs (xtoken): Add CS1035.
10782         
10783         * class.cs (MethodData.Define): Add CS0683.
10784         (FieldMember.ctor): Add CS0681.
10785
10786 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10787
10788         * ecore.cs (SimpleName.DoResolve): Rename from
10789         SimpleName.DoResolveAllowStatic.
10790         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10791         Pass 'intermediate' flag to MemberStaticCheck.
10792         (SimpleName.MemberStaticCheck): Skip "static check" only in case
10793         of "intermediate" lookups via MemberAccess.
10794         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
10795         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10796
10797 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10798
10799         Fix #73394.
10800         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10801         slipped in because of variable names that are identical to a
10802         builtin type's BCL equivalent ('string String;', 'int Int32;').
10803         (PropertyExpr.EmitInstance): Likewise.
10804
10805 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
10806
10807         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10808         
10809         * report.cs (warning_ignore_table): Made public.
10810
10811 2005-03-04  Raja R Harinath  <rharinath@novell.com>
10812
10813         Fix #73282.
10814         * class.cs (MethodData.Emit): Pass 'container' to
10815         container.GetObsoleteAttribute instead of 'container.Parent'.
10816
10817 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
10818
10819         * cs-parser.jay: Add 1534 error test.
10820
10821         * iterators.cs (Yield.CheckContext): Add error 1629.
10822         (Iterator.ctor): Save unsafe modifier.
10823         (MoveNextMethod.DoEmit): Restore unsafe context.
10824
10825         * namespace.cs (UsingAlias): Better error message.
10826
10827 2005-03-03  Dan Winship  <danw@novell.com>
10828
10829         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10830         the warning message [#73219]
10831
10832 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10833
10834         Fix compile with MCS 1.0.0.0.
10835         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10836         w_restore to not depend on string constant folding.
10837
10838 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10839
10840         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
10841         CS0246 check to users who passed 'silent = false'.
10842         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10843         check.
10844         (SimpleName.SimpleNameResolve): Update.
10845         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10846         (MemberAccess.IdenticalNameAndTypeName): Update.
10847         * doc.cs (FindDocumentedTypeNonArray): Update.
10848
10849 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
10850
10851         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10852         * parameters.cs (ComputeAndDefineParameters): Remove.
10853         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10854         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10855         Use GetParameterInfo.
10856
10857 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
10858
10859         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10860
10861 2005-03-02  Raja R Harinath  <rharinath@novell.com>
10862
10863         Unify DeclSpace.LookupType and DeclSpace.FindType.
10864         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
10865         is in charge of defining nested types on demand.
10866         (DeclSpace.LookupType): Use it when the current_type is a
10867         TypeBuilder.  Use LookupTypeDirect for reflected types.
10868         (DeclSpace.FindType): Remove.
10869         (DeclSpace.LookupInterfaceOrClass): Likewise.
10870         (DeclSpace.DefineTypeAndParents): Likewise.
10871         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10872         DeclSpace.LookupType.
10873         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10874         * typemanager.cs (LookupType): Simplify.
10875         (AddUserType): Remove type from negative_hits.
10876         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10877         * class.cs (TypeContainer.FindMembers): Move handling of nested
10878         types ...
10879         (TypeContainer.FindMembers_NestedTypes): ... here.
10880         (TypeContainer.FindNestedType): Implement override.
10881         (ClassPart.FindNestedType): Delegate to PartialContainer.
10882         (ClassPart.PartFindNestedType): Looks up the nested types of the
10883         part alone.
10884
10885 2005-03-02  Martin Baulig  <martin@ximian.com>
10886
10887         * class.cs (TypeContainer.DoDefineMembers): We also need a default
10888         static constructor in static classes.
10889
10890 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
10891
10892         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10893         sizeParamIndex is not specified.
10894
10895 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
10896
10897         Fix #73117
10898         * report.cs (WarningMessage.IsEnabled): Missing null check.
10899
10900 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10901
10902         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10903         in the fields and not in the properties.
10904
10905 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
10906
10907         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
10908         fields as well.
10909
10910 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10911
10912         * attribute.cs: Small refactoring (improved robustness).
10913         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10914         (ValidateGuid): Removed.
10915         (Resolve): Removed referenced to above mentioned.
10916         (GetAttributeUsage): Made private and changed to work without
10917         class assistance.
10918         (GetIndexerAttributeValue): Don't crash.
10919         (GetConditionalAttributeValue): Ditto.
10920         (GetClsCompliantAttributeValue): Ditto.
10921         (ExtractSecurityPermissionSet): All attributes exceptions are
10922         error 648.
10923         (GetPropertyValue): New helper.
10924         (GetMethodImplOptions): New method.
10925         (DefinePInvokeMethod): Reuse common code. Implemented handling of
10926         some missing properties.
10927         
10928         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10929         (Method.ApplyAttributeBuilder): Updated.
10930         
10931         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10932         exception.
10933
10934 2005-02-28  Raja R Harinath  <rharinath@novell.com>
10935
10936         Fix #73052.
10937         * report.cs (Report.SymbolRelatedToPreviousError): Handle
10938         non-simple types (array, pointer, reference).
10939
10940 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10941
10942         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10943
10944         * class.cs (MethodCore.IsDuplicateImplementation): Special error
10945         for operators.
10946         (Method.CheckBase): Catch wrong destructor here.
10947         (MethodData.Define): Add errors 550, 668.
10948
10949         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10950
10951         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10952
10953         * pending.cs (VerifyPendingMethods): Add error 551.
10954
10955         * typemanager.cs (CSharpName): Next error report helper.
10956
10957 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
10958
10959         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10960         attributes. Removed useless attribute double check.
10961         It saves almost 2MBs for corlib.
10962
10963 2005-02-25  Raja R Harinath  <rharinath@novell.com>
10964
10965         Fix #72924.
10966         * statement.cs (ExpressionStatement.Resolve): Make robust to being
10967         called twice in case of error.
10968
10969 2005-02-23  Chris Toshok  <toshok@ximian.com>
10970
10971         Fix compiler portions of #72827.
10972         * statement.cs (Block.Emit): call Begin/EndScope on the
10973         EmitContext instead of the ILGenerator.
10974
10975         * codegen.cs (EmitContext.BeginScope): new method, call
10976         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10977         we have one.)
10978         (EmitContext.BeginScope): same, but EndScope and CloseScope
10979
10980         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10981         offset and call the superclass's OpenScope(int) with it.
10982         (SymbolWriter.CloseScope): get the current il
10983         offset and call superclass's CloseScope(int) with it.
10984
10985 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
10986
10987         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
10988         CS1677 for out and ref as well.
10989
10990         * class.cs (Method.Define): Add error CS1599 detection.
10991         
10992         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
10993         
10994         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
10995         
10996         * delegate.cs (Delegate.Define): Add error CS1599 detection.
10997         
10998         * support.cs.cs (ModifierDesc): New helper method.
10999
11000 2005-02-23  Raja R Harinath  <rharinath@novell.com>
11001             Abin Thomas  <projectmonokochi@rediffmail.com>
11002             Anoob V E  <projectmonokochi@rediffmail.com>
11003             Harilal P R  <projectmonokochi@rediffmail.com>
11004
11005         Fix #57851, #72718.
11006         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
11007         MemberLookup (used for error reporting) actually returns a result.
11008         Fix error report number (122, not 112).
11009
11010 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
11011             Anoob V E  <projectmonokochi@rediffmail.com>
11012             Harilal P R  <projectmonokochi@rediffmail.com>
11013
11014         Fix #71134.
11015         * pending.cs (PendingImplementation.GetAbstractMethods):
11016         Find NonPublic members too.
11017
11018 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
11019
11020         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
11021         Fixed error 217.
11022         
11023         * class.cs (MethodCore.CheckMethodAgainstBase):
11024         Add error 239 report.
11025
11026 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11027
11028         Fix #68955.
11029         * expression.cs (Invocation.IsApplicable): Make public.
11030         (Invocation.IsParamsMethodApplicable): Likewise.
11031         * delegate.cs (Delegate.VerifyApplicability): Don't use
11032         Invocation.VerifyArgumentCompat for parameter applicability
11033         testing.  Use Invocation.IsApplicable and
11034         Invocation.IsParamsMethodApplicable.
11035
11036 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
11037
11038         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
11039         
11040         * class.cs (Operator.Define): Add error 217 report.
11041         
11042 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11043
11044         * namespace.cs (UsingEntry.Resolve): Undo change below.
11045
11046 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11047
11048         Fix #72756.
11049         * ecore.cs (Expression.MemberLookupFailed): Add argument to
11050         disable the error message when the extended MemberLookup also
11051         fails.
11052         (Expression.MemberLookupFinal): Update.
11053         (SimpleName.DoSimpleNameResolve): Update.
11054         * expression.cs (MemberAccess.ResolveNamespaceOrType):
11055         Don't use MemberLookupFinal.
11056         (New.DoResolve): Update.
11057         (BaseAccess.CommonResolve): Update.
11058
11059 2005-02-21  Raja R Harinath  <rharinath@novell.com>
11060
11061         Fix #72732.
11062         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
11063         occured previously, don't resolve again.
11064
11065 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
11066
11067         Fix #69949
11068         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
11069         argument. Call ResolveAttributeUsage for unresolved.
11070         when types doesn't match ctor arguments.
11071         
11072         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
11073         for nested attribute classes.
11074         (Class.attribute_usage): Removed.
11075         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
11076         for attribute class.
11077         
11078         * ecore.cs (IsAttribute): Removed.
11079         
11080         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
11081         
11082         * rootcontext.cs (RegisterAttribute): Removed, attributes are
11083         now normal types.
11084         (attribute_types): Removed.
11085         (EmitCode): Global attributes are emited as the latest.
11086
11087 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
11088
11089         * class.cs (EmitFieldInitializers): Don't emit field initializer
11090         for default values when optimilization is on.
11091         
11092         * constant.cs (Constant.IsDefaultValue): New property.
11093         
11094         * driver.cs: Add /optimize handling.
11095         
11096         * constant.cs,
11097         * ecore.cs,
11098         * literal.cs: Implement new IsDefaultValue property.
11099         
11100         * rootcontext.cs (Optimize): New field, holds /optimize option.
11101
11102 2005-02-18  Raja R Harinath  <rharinath@novell.com>
11103
11104         Fix crasher in re-opened #72347.
11105         * namespace.cs (Namespace.Lookup): Return null if
11106         DeclSpace.DefineType returns null.
11107
11108         Fix #72678.
11109         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
11110
11111 2005-02-18  Raja R Harinath  <rharinath@novell.com>
11112
11113         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
11114         now returns null if it cannot resolve to an lvalue.
11115         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
11116         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
11117         returned null.  Remove check for SimpleName.
11118         (EventExpr.DoResolveLValue): New.
11119         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
11120         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
11121         error from ...
11122         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
11123         avoid CS0131 error.
11124         (Unary.ResolveOperator): Move CS0211 check ...
11125         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
11126         CS0131 error.
11127         (Unary.DoResolveLValue): Simplify.
11128         (AddressOf.DoResolveLValue): New.
11129         (ArrayAccess.DoResolveLValue): New.
11130
11131 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
11132
11133         * attribute.cs (Attribute.Resolve): Add arguments casting for
11134         when types doesn't match ctor arguments.
11135
11136 2005-02-16  Raja R Harinath  <rharinath@novell.com>
11137
11138         Fix parts of #63202.
11139         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
11140         lookup of operator in base type.  Ensure that all checks happen
11141         when the operator resolves to an "op_..." method.
11142
11143 2005-02-15  Raja R Harinath  <rharinath@novell.com>
11144
11145         Fix #71992.
11146         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
11147         'ignore_cs0104' parameter.  Pass it to ...
11148         (NamespaceEntry.Lookup): ... this.
11149         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
11150         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
11151         (TypeLookupExpression.DoResolveAsTypeStep): Update.
11152         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
11153         Update.  Request that cs0104 errors be ignored.
11154         (ComposedCast.ResolveAsTypeStep): Update.
11155
11156 2005-02-14  Raja R Harinath  <rharinath@novell.com>
11157
11158         Fix #59209.
11159         * expression.cs (Invocation.BetterFunction): Remove support for
11160         comparing virtual functions and their overrides.
11161         (Invocation.IsOverride): New.
11162         (Invocation.OverloadResolve): Don't consider 'override' functions
11163         during candidate selection.  Store them in a lookaside list.
11164         If the selected method is a 'virtual' function, use the list to
11165         find any overrides that are closer to the LHS type.
11166
11167 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
11168
11169         * expression.cs (New.DoResolve): Add complex core type reduction.
11170         (New.Constantify): Converts complex core type syntax like 'new int ()'
11171         to simple constant.
11172         
11173 2005-02-14  Raja R Harinath  <rharinath@novell.com>
11174
11175         * decl.cs (EntryType.EntryType): New constructor to create an
11176         updated copy of a cache entry.
11177         (MemberCache.AddMethods): Use it.
11178         (MemberCache.ClearDeclaredOnly): Remove.
11179         (MemberCache.MemberCache): Update.
11180
11181 2005-02-11  Miguel de Icaza  <miguel@novell.com>
11182
11183         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
11184         variable.  This one is represents the actual low-level declaration
11185         of the method, as opposed to the semantic level `IsStatic'.   
11186
11187         An anonymous method which is hosted into a static method might be
11188         actually an instance method.  IsStatic would reflect the
11189         container, while MethodIsStatic represents the actual code
11190         generated.
11191
11192         * expression.cs (ParameterReference): Use the new MethodIsStatic
11193         instead of IsStatic.
11194
11195         * anonymous.cs (AnonymousMethod.Compatible): Pass the
11196         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
11197         set on the current EmitContext. 
11198
11199         * expression.cs (Cast): Overload DoResolveLValue so we can pass
11200         resolve our casted expression as an LValue.  This triggers the
11201         proper LValue processing that is later required by Assign.
11202
11203         This fixes 72347.
11204
11205         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
11206
11207 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
11208
11209         C# 2.0 Fixed buffer implementation
11210
11211         * anonymous.cs: Update after RegisterHelperClass renaming.
11212
11213         * attribute.cs (AttributeTester.fixed_buffer_cache):
11214         Cache of external fixed buffers.
11215         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
11216         implementation if field is fixed buffer else null.
11217
11218         * class.cs
11219         (TypeContainer.AddField): Accept FieldMember instead of Field.
11220         (FieldBase.IsFieldClsCompliant): Extracted code from
11221         VerifyClsCompliance descendant customization.
11222         (FixedField): New class handles fixed buffer fields.
11223         (FixedFieldExternal): Keeps information about imported fixed
11224         buffer.
11225         (IFixedField): Make access to internal or external fixed buffer
11226         same.
11227
11228         * cs-parser.jay: Add fixed buffer parsing.
11229
11230         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
11231         buffer.
11232
11233         * expression.cs (Indirection): Extended implementation to accept
11234         fixed buffer field.
11235         (PointerArithmetic.Emit): Get element from fixed buffer as well.
11236         (ElementAccess.MakePointerAccess): Get type as parameter.
11237         (DoResolve): Add fixed buffer field expression conversion.
11238         (DoResolveLValue): Ditto.
11239         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
11240         (ArrayPtr): Derives from FixedBufferPtr.
11241         (ArrayPtr.Emit): Add extra emit for array elements.
11242
11243         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
11244
11245         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
11246         for compiler generated types.
11247         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
11248
11249         * statement.cs (Fixed): Refactored to be easier add fixed buffer
11250         and consume less memory.
11251         (Fixed.Resolve): Add fixed buffer case.
11252
11253         * typemanager.cs (compiler_generated_attr_ctor,
11254         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
11255         (HasElementType): Add our own implementation to work on every
11256         runtime.
11257
11258 2005-02-11  Miguel de Icaza  <miguel@novell.com>
11259
11260         * anonymous.cs (CaptureContext): Track whether `this' has been
11261         referenced.   
11262
11263         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
11264         only captured `this' if it was implicitly done (instance
11265         methods/variables were used). 
11266
11267         * codegen.cs (EmitContext.CaptureThis): New method to flag that
11268         `this' must be captured.
11269
11270 2005-01-30  Miguel de Icaza  <miguel@novell.com>
11271  
11272         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
11273         is null it means that there has been no need to capture anything,
11274         so we just create a sibling.
11275
11276         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
11277
11278         Just a partial fix.  The other half is fairly elusive.
11279         
11280 2005-02-10  Raja R Harinath  <rharinath@novell.com>
11281
11282         Fix #52586, cs0121-4.cs.
11283         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
11284         and return a hashtable.
11285         (MemberCache.ClearDeclaredOnly): New.
11286         (MemberCache.MemberCache): Update to change.  Make a deep copy of
11287         the method_hash of a base type too.
11288         (MemberCache.AddMethods): Adapt to having a deep copy of the base
11289         type methods.  Overwrite entries with the same MethodHandle so
11290         that the ReflectedType is correct.  The process leaves in base
11291         virtual functions and their overrides as distinct entries.
11292         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
11293         matters since it was boxed in a ArrayList before.
11294         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
11295         modifier.
11296         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
11297         case of a virtual function and its override (choose the overload
11298         as better).
11299         (Invocation.OverloadResolve): Avoid 'override' members during
11300         'applicable_type' calculation.
11301
11302 2005-02-09  Raja R Harinath  <rharinath@novell.com>
11303
11304         Combine two near-redundant caches.
11305         * typemanager.cs (method_params): Rename from method_internal_params.
11306         (TypeManager.GetParameterData): New.  Replace
11307         Invocation.GetParameterData.
11308         (TypeManager.LookupParametersByBuilder): Remove.
11309         * expression.cs (Invocation.method_parameter_cache): Remove.
11310         (Invocation.GetParameterData): Remove.
11311         Update to changes.
11312         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11313         Update to changes.
11314
11315 2005-02-08  Raja R Harinath  <rharinath@novell.com>
11316
11317         Fix #72015.
11318         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11319         TypeManager.multicast_delegate_type is null, resolve it by looking
11320         up "System.MulticastDelegate".
11321         * rootcontext.cs (RootContext.ResolveCore): Simplify.
11322
11323 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
11324             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
11325             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
11326
11327         Fix cs0164.cs.
11328         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11329         (LabeledStatement.AddReference): New.  Set 'referenced'.
11330         (Goto.Resolve): Use it.
11331
11332 2005-02-05  John Luke  <john.luke@gmail.com>
11333
11334         * driver.cs: remove duplicate -doc line in Usage ()
11335
11336 2005-02-04  Raja R Harinath  <rharinath@novell.com>
11337
11338         * location.cs (Location.AddFile): Fix CS2002 error report.
11339
11340 2005-02-02  Martin Baulig  <martin@ximian.com>
11341
11342         * delegate.cs (Delegate.DefineType): Report an internal error if
11343         TypeManager.multicast_delegate_type is null.  See bug #72015 for
11344         details.        
11345
11346 2005-02-02  Raja R Harinath  <rharinath@novell.com>
11347
11348         Fix a crasher in a variant of #31984.
11349         * const.cs (Constant.CheckBase): New override that defers the
11350         new-or-override check in case the base type hasn't been populated
11351         yet.
11352         (Constant.Define): Ensure the new-or-override check is performed.
11353
11354 2005-02-01  Duncan Mak  <duncan@ximian.com>
11355
11356         * const.cs (LookupConstantValue): Check that `ce' is not null
11357         before calling GetValue ().
11358
11359 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11360
11361         Fix test-334.cs (#69519).
11362         * cs-parser.jay (using_alias_directive): Pass in an expression to
11363         NamespaceEntry.UsingAlias.
11364         (using_namespace_directive): Pass in an expression to
11365         NamespaceEntry.Using.
11366         (namespace_name): Don't flatten to a string.
11367         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11368         (NamespaceEntry.AliasEntry.Resolve): Lookup using
11369         ResolveAsTypeStep.
11370         (NamespaceEntry.UsingEntry): Likewise.
11371         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11372         changes.
11373         (NamespaceEntry.LookupForUsing): Remove.
11374         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11375         names.
11376         (NamespaceEntry.Lookup): Remove support for dotted names.
11377
11378 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11379
11380         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11381         split into two.
11382         (NamespaceEntry.ImplicitParent): Compute on demand.
11383         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11384         parallels the current.
11385         (NamespaceEntry.LookupForUsing): Use it.
11386         (NamespaceEntry.Lookup): If the current namespace-entry is
11387         implicit, don't search aliases and using tables.
11388
11389 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11390
11391         Fix #31984.
11392         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11393         BaseCache here.
11394         (TypeContainer.BaseCache): Compute on demand.
11395         (TypeContainer.FindMembers): Define constants and types if they're
11396         not already created.
11397         (FieldMember.Define): Move resetting of ec.InUnsafe before error
11398         check.
11399         * const.cs (Constant.Define): Make idempotent.
11400
11401 2005-01-29  Miguel de Icaza  <miguel@novell.com>
11402
11403         * pending.cs: Produce better code (no nops produced by using Ldarg
11404         + value).
11405         
11406         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11407         i - 1' it should be arg + 1.
11408
11409         Fixes bug #71819.
11410
11411 2005-01-28  Raja R Harinath  <rharinath@novell.com>
11412
11413         * attribute.cs (Attribute.CheckAttributeType): Make private
11414         non-virtual.
11415         (Attribute.ResolveType): Make virtual.
11416         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11417         handling of RootContext.Tree.Types.
11418
11419 2005-01-27  Raja R Harinath  <rharinath@novell.com>
11420
11421         Update attribute-handling to use the SimpleName/MemberAccess
11422         mechanisms.
11423         * cs-parser.jay (attribute): Pass in an expression to the
11424         constructors of Attribute and GlobalAttribute.
11425         * attribute.cs (Attribute): Take an expression for the name.
11426         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
11427         passed in attribute name expression.
11428         (Attribute.CheckAttributeType): Use it.
11429         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11430         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11431         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
11432         argument to prevent error messages if the lookup fails.
11433
11434 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
11435
11436         * expression.cs (Indirection): Implemented IVariable interface
11437         to support indirection in AddressOf operator.
11438         (PointerArithmetic.Emit): Add optimalization for case where
11439         result can be precomputed.
11440
11441 2005-01-26  Martin Baulig  <martin@ximian.com>
11442
11443         * class.cs (TypeContainer.AttributeTargets): Return the correct
11444         AttributeTargets depending on our `Kind' instead of throwing an
11445         exception; fixes #71632.
11446
11447 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
11448
11449         Fix #71257
11450         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11451         constant members.
11452
11453 2005-01-25  Raja R Harinath  <rharinath@novell.com>
11454
11455         Fix #71602.
11456         * expression.cs (MemberAccess.DoResolve): Don't complain with
11457         cs0572 when the LHS of a member access has identical name and type
11458         name.
11459
11460 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
11461
11462         Fix #71651, #71675
11463         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11464         CreatePermission.
11465         Create custom PermissionSet only for PermissionSetAttribute.
11466
11467 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
11468
11469         Fix #71649
11470         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11471         delegates in static class.
11472
11473 2005-01-24  Martin Baulig  <martin@ximian.com>
11474
11475         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11476         merging an implicit block, just use its reachability.
11477
11478         * statement.cs (Block.Resolve): Make the unreachable code check
11479         work wrt. implicit blocks; see test-337 from #63842.
11480
11481 2005-01-21  Alp Toker  <alp@atoker.com>
11482  
11483         * cs-parser.jay: destructor_declaration's container is PartialContainer
11484         not Class when partial types are used, so use Kind prop instead of
11485         'is'.
11486         
11487 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
11488
11489         * cs-parser.jay: Improve error reporting when an interface
11490         declares new types.
11491
11492 2005-01-20  Dick Porter  <dick@ximian.com>
11493
11494         * support.cs: SeekableStreamReader fix from Sandor Dobos
11495         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11496         chars are read.  Fixes bug 70369.
11497
11498 2005-01-20  Raja R Harinath  <rharinath@novell.com>
11499
11500         * cs-parser.jay (catch_clause): Simplify current_block handling
11501         somewhat.
11502
11503 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
11504
11505         * convert.cs (ImplicitStandardConversionExists): Synchronize the
11506         code with ImplicitStandardConversion to handle the implicit
11507         conversion of method groups into valid delegate invocations. 
11508
11509         The problem is that in parameter handling we were using this code
11510         path.  Fixes bug #64698
11511
11512 2005-01-19  Raja R Harinath  <rharinath@novell.com>
11513
11514         * cs-parser.jay: Fix several infelicities.
11515         - Avoid assigning to the parser value stack.  Code like 
11516           '$3 = null' is unclean.  Synthesize a value for the code block
11517           instead. 
11518         - Avoid using oob_stack for storing location information.  Use ...
11519         (_mark_): ... this.  New (empty) rule.  Saves the current location
11520         in $$.
11521         (foreach_statement): Avoid using oob_stack for current_block
11522         handling.  Use technique used in for_statement and
11523         using_statement.  Synthesize a value for the code block to store
11524         additional intermediate information.
11525
11526 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
11527
11528         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11529         of a different type is only allowed to private fields of a
11530         containing type, not on fields of a base class.
11531
11532         See test-174.cs and error cs0122-9.cs
11533
11534 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11535
11536         Fix test-335.cs (bug #58126).
11537         * cs-parser.jay (argument): Split out non-expression parts of the
11538         rule into 'non_simple_argument'.
11539         (invocation_expression): Support parenthesized invocations with
11540         multiple arguments, and with single non-simple arguments.
11541
11542 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11543
11544         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11545         places.
11546
11547 2005-01-12  Raja R Harinath  <rharinath@novell.com>
11548
11549         Fix cs0038-1.cs, cs1640-6.cs.
11550         * ecore.cs (Expression.Resolve): Remove special-case for
11551         SimpleName in error-handling.
11552         (Expression.almostMatchedMembers): Relax access permission to
11553         protected.
11554         (Expression.MemberLookupFailed): Handle duplicates in
11555         almostMatchedMembers list.
11556         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11557         * expression.cs (New.DoResolve): Report CS1540 for more cases.
11558         * typemanager.cs (GetFullNameSignature): Use the MethodBase
11559         overload if the passed in MemberInfo is a MethodBase.
11560
11561 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
11562
11563         Fix #70749
11564         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11565         for non-CAS & merge permission sets properly.
11566
11567 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11568
11569         Improve standard-compliance of simple name and member access 
11570         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
11571         * ecore.cs (FullNamedExpression): New abstract base class 
11572         for Namespaces and TypeExpressions.
11573         (ResolveFlags.SimpleName): Remove.
11574         (SimpleName): Remove support for dotted names.
11575         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
11576         DeclSpace.FindType and DeclSpace.LookupType.
11577         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11578         (Expression.ExprClassName): Make member function.
11579         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11580         a namespace.  Remove creation of dotted "SimpleName"s.
11581         (MemberAccess.DoResolve): Likewise.
11582         * decl.cs (DeclSpace.Cache): Make private.
11583         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11584         (DeclSpace.FindType): Update.
11585         (DeclSpace.LookupType): Move here from RootContext.  Return a 
11586         FullNamedExpression.
11587         * namespace.cs (Namespace): Derive from FullNamedExpression
11588         so that it can be part of expression resolution.
11589         (Namespace.Lookup): Return an FullNamedExpression.
11590         (NamespaceEntry.LookupAlias): Lookup aliases only in current
11591         namespace.
11592         * rootcontext.cs (NamespaceLookup): Remove.
11593         (LookupType): Move to DeclSpace.
11594         * attribute.cs (CheckAttributeType): Update.
11595         * doc.cs (FindDocumentedType): Remove allowAlias argument.
11596         (FindDocumentedTypeNonArray): Likewise.
11597
11598 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11599
11600         Fix cs0509.cs, cs1632.cs.
11601         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11602         is the same as IsInterface.
11603         (TypeContainer.GetClassBases): Likewise.
11604         * statement.cs (LabeledStatement.ig): New field.
11605         (LabeledStatement.LabelTarget): Save ILGenerator which created the
11606         label.
11607         (LabeledStatement.DoEmit): Check that the label was created with
11608         the same ILGenerator.
11609
11610 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11611
11612         Fix #71058
11613         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11614         accessors to its properties.
11615
11616         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11617         from accessors to property.
11618         
11619 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11620
11621         Fix #70722
11622         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11623         only for overrides.
11624         
11625 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
11626
11627         * attribute.cs: Check for null and empty strings.  
11628
11629         I have lost another battle to Paolo.
11630
11631 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
11632
11633         Fix #70942
11634         * class.cs (PropertyMethod): Set Parent field in ctors.
11635         (SetMethod.InternalParameters): Add unsafe switch hack.
11636         Override MarkForDuplicationCheck where it is appropriate.
11637
11638         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11639         It says whether container allows members with the same name.
11640         Base default is no.
11641         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11642         Removed is_method parameter.
11643
11644 2005-01-06  Duncan Mak  <duncan@ximian.com>
11645
11646         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11647         because the previous change led to incorrect reporting of CS1032
11648         ("Cannot define/undefine preprocessor symbols after first token in
11649         file"). Instead of using `tokens_seen' as the only flag that
11650         triggers CS1040, introduce `comments_seen'. This new flag is used
11651         to signify having seen comments on the current line, so it is
11652         unset after a newline.
11653
11654 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11655
11656         * doc.cs : When searching for a type, find nested type too.
11657           This fixes bug #71040.
11658
11659 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11660
11661         * doc.cs :
11662           - Warn missing member comment on those classes which also does not
11663             have doc comments. Fixed bug #71041.
11664           - Don't warn missing doc comment on default constructor.
11665             Fixed bug #71042.
11666
11667 2005-01-06  Duncan Mak  <duncan@ximian.com>
11668
11669         * cs-tokenizer.cs (xtoken): After handling traditional C-style
11670         comments, set `tokens_seen' to true. This allows us to detect
11671         misplaced preprocessor directives (i.e. not at the beginning of
11672         the a line, nor after whitespaces). In that case, report error
11673         CS1040. This fixes bug #56460.
11674
11675         * cs-parser.jay (interface_member_declaration): Add checks for
11676         IsExplicitImpl, and report CS0541 error if an interface member is
11677         defined as an explicit interface declaration.
11678
11679 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
11680
11681         Fix #70817
11682         * class.cs (PropertyMethod): Set Parent field in ctors.
11683         (SetMethod.InternalParameters): Add unsafe switch hack.
11684         
11685         * decl.cs (MemberCore.Parent): Cannot be readonly.
11686
11687 2005-01-06  Raja R Harinath  <rharinath@novell.com>
11688
11689         * decl.cs (DeclSpace.ResolveType): Remove.
11690         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11691         Merge in code from ...
11692         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
11693         * class.cs, enum.cs: Update to changes.
11694
11695 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
11696
11697         * anonymous.cs: Ensure that we init the scope of our parent if it
11698         has not been initialized yet.
11699
11700 2004-12-30  Duncan Mak  <duncan@ximian.com>
11701
11702         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11703         if field.FieldBuilder is null. Fixes #70758.
11704
11705         * convert.cs: Fixed some typos and updated some of the comments.
11706         (ImplicitStandardConversionExists):
11707         (TryImplicitIntConversion): If `target_type' is an interface and
11708         the type of `ic' implements this interface, return true or a new
11709         BoxedCast instead of null. This fixes #70468.
11710
11711 2004-12-29  Duncan Mak  <duncan@ximian.com>
11712
11713         * expression.cs (Argument.Emit): Check that Expr is
11714         IMemoryLocation before casting to it, and report CS1510 otherwise.
11715
11716         This fixes #70402.
11717
11718 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
11719
11720         * statement.cs (Block.ThisVariable): remove the recursion here, to
11721         make the --profile more sane.
11722
11723 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
11724
11725         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11726         assembly, by JB Evain.
11727
11728 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11729
11730         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
11731           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11732         "parent" refers to enclosing type/class.  "base" refers to superclass.
11733
11734 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11735
11736         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11737         Ensure that we only have GlobalAttributes.
11738         * attribute.cs (Attribute.Emit): Make non-virtual.
11739         (GlobalAttribute.Emit): Remove.
11740         (Attribute.Resolve): Make virtual.
11741         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
11742         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11743         the argument. Don't create one.
11744         (Attribute.GetObsoleteAttribute): Likewise.
11745         (Attribute.GetClsCompliantAttributeValue): Likewise.
11746         * class.cs, decl.cs: Update to changes.
11747
11748 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
11749
11750         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11751         
11752         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11753         
11754         * statement.cs (Foreach.Resolve): Add error 186 report.
11755
11756 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
11757
11758         * expression.cs (Conditional.DoResolve): Add warning 429.
11759         
11760         * statement.cs (If.Resolve): Add warning 665.
11761
11762 2004-12-16  Raja R Harinath  <rharinath@novell.com>
11763
11764         New invariant: RootContext.Tree.Types.NamespaceEntry == null
11765         except when in the parser, and in GlobalAttribute.
11766         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11767         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11768         RootContext.Tree.Types.NamespaceEntry once work is done.
11769         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
11770         and resets RootContext.Tree.Types.NamespaceEntry.
11771
11772 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
11773
11774         * cs-parser.jay: Don't create a block for every variable.
11775
11776 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
11777
11778         * location.cs: Provide extra information.
11779
11780         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11781         variables from the captured environment, it is the ldarg_0.
11782
11783 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11784
11785         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11786         find a conclusion.
11787         
11788         * class.cs: Changed warning level for 169 to avoid developer
11789         displeasure from warning flooding. It will be changed back when they
11790         fix most of current BCL warnings.
11791         
11792         * RootContext.cs: Pushed default WarningLevel to 3.
11793         
11794         * statement.cs: Removed unused variable.
11795
11796 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11797
11798         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11799         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11800         Add error 502 report.
11801         (StaticClass.DefineType): Add error 441 report.
11802         (Class.AllowedModifiersProp): New virtual property as temporary
11803         extension to AllowedModifiers.
11804         (Class.DefineType): Add error 418 report. Moved ModFlags check here
11805         to share implementation with StaticClass and don't call virtual
11806         methods from ctor.
11807         
11808         * driver.cs (MainDriver): Add error 1558 test.
11809
11810         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11811         report. Moved error 36 test here.
11812
11813         * statement.cs (Throw.Resolve): Add error 724 report.
11814
11815         * typemanager.cs: Add out_attribute_type core type.
11816         
11817 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
11818
11819         * class.cs (TypeContainer.VerifyClsCompliance): Add error
11820         3018 report.
11821         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11822
11823         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11824         3017 report.
11825         
11826         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11827
11828         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
11829         Add error 3023 report.
11830         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11831
11832         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11833         implementation.
11834
11835 2004-12-12  John Luke  <john.luke@gmail.com>
11836
11837         * driver.cs (AddArgs): take -- into account when
11838         adding arguments, fixes bug 65710 
11839
11840 2004-12-12  Martin Baulig  <martin@ximian.com>
11841
11842         * expression.cs (Unary.TryReduceNegative): Added support for
11843         SByteConstant and ByteConstant.
11844         (Unary.Reduce): Check error values from TryReduceNegative().
11845
11846 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
11847
11848         * attributes.cs (Attribute.Resolve): Avoid multiple error report
11849         and report exception as error 182.
11850
11851 2004-12-10  Raja R Harinath  <rharinath@novell.com>
11852
11853         * driver.cs (Main): Fix message when there are warnings.
11854
11855 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
11856
11857         * delegate.cs: Fixed my fix from yesterday, sorry about that.
11858
11859 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
11860
11861         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
11862         Reduced number of warnings.
11863         
11864         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11865
11866 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
11867
11868         * driver.cs: Removed message.
11869
11870         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11871
11872 2004-12-08    <vargaz@freemail.hu>
11873
11874         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11875
11876 2004-12-08  Martin Baulig  <martin@ximian.com>
11877
11878         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11879         instead of a CS3002 for properties and indexer.
11880
11881 2004-12-08  Martin Baulig  <martin@ximian.com>
11882
11883         * decl.cs (MemberName.ToString): Make this work again.
11884
11885 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
11886
11887         * attribute.cs (Resolve): Add error 591 detection.
11888
11889         * class.cs (FieldMember.Define): Add error 1547 detection.
11890         (Indexer.Define): Add error 620 detection.
11891         (Operator.Define): Add error 590 detection.
11892
11893         * ecore.cs: Missing argument for error 79.
11894
11895         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11896         detection.
11897
11898 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
11899
11900         Fix #70106
11901         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11902         only.
11903
11904 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
11905
11906         * cs-parser.jay : handle doc comments on implicit/explicit operators.
11907           Some operator comments were suppressed.
11908         * doc.cs : Implicit/explicit operator name in doc comments are like
11909           "op_Explicit(type)~returnType", so added suffix handling.
11910
11911 2004-12-07  Martin Baulig  <martin@ximian.com>
11912
11913         * decl.cs
11914         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11915         (MemberCore.GetClsCompliantAttributeValue): Likewise.
11916         (DeclSpace.ec): New protected field; store the EmitContext here.
11917         (DeclSpace.EmitContext): New public property; moved here from
11918         `TypeContainer'.
11919         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11920         EmitContext.
11921
11922         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11923         (Enum.Emit): Don't create a new EmitContext.
11924
11925         * delegate.cs (Delegate.DefineType): Always create the
11926         EmitContext.
11927
11928         * iterators.cs (Iterators.DefineIterator): Create a new
11929         EmitContext and store it in `ec'.
11930
11931 2004-08-24  Martin Baulig  <martin@ximian.com>
11932
11933         * typemanager.cs
11934         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11935         this for accessibility checks.
11936         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11937         IsNestedFamilyAccessible.
11938         (TypeManager.IsSubclassOf): New method, do what the name actually
11939         says.   
11940
11941 2004-12-06  Raja R Harinath  <rharinath@novell.com>
11942
11943         Fix crash on cs0657-17.cs.
11944         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11945         Use RootContext.Tree.Types, not 'new RootTypes ()'.
11946         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11947         the case where the NamespaceEntry gets overwritten.
11948
11949 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
11950
11951         Fixed #69195, #56821
11952         * ecore.cs (ResolveBoolean): Tiny refactoring.
11953
11954         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11955         of right expression resolving when left is false constant and
11956         operator is LogicalAnd OR true constant and operator is LogicalOr.
11957
11958         * statement.cs (ResolveUnreachable): Always reports warning.
11959
11960 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
11961
11962         * class.cs: Distinguish between 1721 and 1722 (just a little help
11963         for the programmer).
11964
11965 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
11966
11967         * delegate.cs: Only allow this on new versions of the language. 
11968
11969 2004-12-02  Duncan Mak  <duncan@ximian.com>
11970
11971         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11972         Expression class.
11973         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11974         here as a static method. Take an additional bool out parameter
11975         `must_do_cs1540_check' for signaling to InstanceResolve.
11976         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11977         member field from PropertyExpr class and made it an argument of
11978         the method instead.
11979         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11980         check for MarshalByRefObject, and report CS0122 instead of CS1540.
11981         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11982         and `remove_accessor' as well as InstanceResolve: report CS0122
11983         where applicable.
11984
11985         Fixes #70129.
11986
11987 2004-12-03  Raja R Harinath  <rharinath@novell.com>
11988
11989         Fix test-327.cs, test-328.cs, and put in early infrastructure
11990         for eventually fixing #52697.
11991         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
11992         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
11993         from other methods.
11994         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
11995         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
11996         (VerifyUsing, error246): Update.
11997         * rootcontext.cs (RootContext.NamespaceLookup): Just use
11998         'NamespaceEntry.LookupNamespaceOrType'.
11999
12000 2004-12-03  Martin Baulig  <martin@ximian.com>
12001
12002         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12003         method as our child, call AnonymousMethod.Compatible() on it.
12004
12005 2004-12-03  Raja R Harinath  <rharinath@novell.com>
12006
12007         Disable XML documentation support in 'basic' profile.
12008         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
12009         Redirect XmlElement to System.Object.
12010         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
12011         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
12012         * mcs.exe.sources: Add doc-bootstrap.cs.
12013         * doc-bootstrap.cs: New file.  Contains empty stub implementation
12014         of doc.cs.
12015
12016 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
12017
12018         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
12019           comments are allowed.
12020
12021 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12022
12023         * delegate.cs: Add checks for subtypes in paramaters and return values
12024         in VerifyMethod () to add support for Covariance/Contravariance
12025         in delegates.
12026         
12027 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
12028
12029         * report.cs: Remove extra closing parenthesis.
12030
12031         * convert.cs (Error_CannotImplicitConversion): If the name of the
12032         types are the same, provide some extra information.
12033
12034         * class.cs (FieldBase): Use an unused bit field from the field to
12035         encode the `has_offset' property from the FieldMember.  This saves
12036         a couple of Ks on bootstrap compilation.
12037
12038         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
12039         method as our child, return the AnonymousMethod resolved
12040         expression.
12041
12042         * expression.cs (New.DoResolve): Allow return values from
12043         NewDelegate to also include AnonymousMethods.
12044
12045         Fixes #70150.
12046
12047 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
12048
12049         Fix bug #70102
12050         * attribute.cs (Resolve): Improved implementation of params
12051         attribute arguments.
12052
12053         * support.cs (ParameterData): Add HasParams to be faster.
12054
12055 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
12056
12057         all things are for /doc support:
12058
12059         * doc.cs: new file that supports XML documentation generation.
12060         * mcs.exe.sources: added doc.cs.
12061         * driver.cs:
12062           Handle /doc command line option.
12063           Report error 2006 instead of 5 for missing file name for /doc.
12064           Generate XML documentation when required, after type resolution.
12065         * cs-tokenizer.cs:
12066           Added support for picking up documentation (/// and /** ... */),
12067           including a new XmlCommentState enumeration.
12068         * cs-parser.jay:
12069           Added lines to fill Documentation element for field, constant,
12070           property, indexer, method, constructor, destructor, operator, event
12071           and class, struct, interface, delegate, enum.
12072           Added lines to warn incorrect comment.
12073         * rootcontext.cs :
12074           Added Documentation field (passed only when /doc was specified).
12075         * decl.cs:
12076           Added DocComment, DocCommentHeader, GenerateDocComment() and
12077           OnGenerateDocComment() and some supporting private members for
12078           /doc feature to MemberCore.
12079         * class.cs:
12080           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
12081         * delegate.cs:
12082           Added overriden DocCommentHeader.
12083         * enum.cs:
12084           Added overriden DocCommentHeader and GenerateDocComment().
12085
12086 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
12087
12088         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
12089         unwrapping the enumeration values, chain to
12090         DoConstantNumericPromotions again, so we can promote things to the
12091         fundamental types (takes care of enums that are bytes, sbytes).
12092
12093         Fixes bug #62054.
12094
12095 2004-12-01  Raja R Harinath  <rharinath@novell.com>
12096
12097         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
12098         Fix long-standing bug in type-lookup.  Use FindType instead of
12099         LookupType when ec.ResolvingTypeTree.
12100         (Attribute.ResolveType, Attribute.Resolve)
12101         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
12102         Update to changes.
12103         (Attributes.Search): Remove internal version.  Update.
12104         (Attributes.SearchMulti): Update.
12105         (Attributes.GetClsCompliantAttribute): Remove.
12106         (Attributes.GetIndexerNameAttribute): Remove.
12107         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
12108         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
12109         * class.cs (Indexer.Define): Likewise.
12110
12111 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
12112
12113         Fix bug #68790
12114         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
12115         MarshallByReference members access.
12116
12117         * expression.cs: Use CheckMarshallByRefAccess;
12118         Better error CS0197 message.
12119
12120         * report.cs: Print whole related error message.
12121
12122 2004-11-30  Raja R Harinath  <rharinath@novell.com>
12123
12124         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
12125         the current directory to help debugging.
12126
12127 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
12128
12129         * class (GetClassBases): Better error 60 report.
12130         (EventProperty): Disabled warning 67 detection.
12131
12132 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
12133
12134         Fix bug #60324
12135         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
12136
12137         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
12138         precise values.
12139
12140 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
12141
12142         Fix bug #49488
12143         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
12144
12145         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
12146
12147 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
12148
12149         * attribute.cs (Attribute.Resolve): Refine error reporting and
12150         report a cs0117 if the identifier does not exist, to distinguish
12151         from 0617 which is a miss-use of the actual identifier.
12152
12153         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
12154         between cs0070 and cs0079.
12155
12156         * class.cs (MemberBase.DoDefine): When reporting a wrong
12157         accessibility level, we use MethodCore to compare instead of
12158         Method (this was a regression in some refactoring effort).
12159
12160         So now we correctly report cs0056 again.
12161
12162         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
12163         testing the target_type (which was known to be object_type) and
12164         not the source type (which is anonymous_method).
12165
12166         Fixed reporting of error cs1660.
12167
12168         * expression.cs (UserCast.Source): Expose the underlying cast.
12169
12170         * statement.cs (Switch.SwitchGoverningType): Sort the list of
12171         allowed types to find a match to int32 first (most common).
12172
12173         In addition, it ignores any ImplicitUserConversions that did an
12174         internal implicit conversion (as the switch statement allows only
12175         one integral conversion to exist).
12176
12177         * class.cs (PartialContainer.Create): rename `name' to
12178         `member_name' for clarity.  Then replace the string calls with a
12179         call to MemberName.GetPartialName, as now using
12180         MemberName.ToString is an error (this is due to the side effects
12181         it had, that were fixed in the past).
12182
12183         This will restore the error reporting on a number of partial class
12184         errors that were missusing this (and getting an exception as a
12185         results, which is now just a plain textual warning, because
12186         yyparse debug output would crash otherwise).
12187
12188 2004-11-26  Raja R Harinath  <rharinath@novell.com>
12189
12190         * Makefile (PROGRAM_INSTALL_DIR): Remove.
12191
12192 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
12193
12194         * rootcontext.cs (LookupType): Make sure to cache lookups that
12195         don't give us a negative result. This saves about 5% of corlib
12196         compilation time.
12197
12198 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
12199
12200         * report.cs (AbstractMessage.Print): messages are sent to stderr
12201
12202         * class.cs (TypeContainer.GetClassBases): It is an error to have a
12203         non-interface in the list of interfaces (at this point, either
12204         parent was properly set, or a base class is being listed in the
12205         interfaces section).
12206
12207         This flags error 1722, and resolves the crash from bug 69259.
12208
12209 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
12210
12211         * statement.cs (Using.EmitExpressionFinally): make this work right
12212         for valuetypes. Fixes 69926.
12213
12214 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
12215
12216         * const.cs (Const.ChangeType): Cope with the "0 literal can be
12217         converted to an enum" here, before we try to change the underlying
12218         type.  This code exists, but it is a different code path than the
12219         one used while encoding constants.
12220
12221         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
12222         old bug: when converting from the null literal to a pointer,
12223         return an EmptyCast, not the NullLiteral.
12224
12225         This fixes #69921, the recent null_type changes probably made this
12226         bug more prominent.
12227
12228         (ImplicitReferenceConversionExists): In addition, resynchronized
12229         the code here, so it matches the same code in
12230         ImplicitReferenceConversionExists for the `from any class-type S
12231         to any interface-type T'.
12232         
12233
12234 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
12235
12236         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
12237
12238 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
12239
12240         * cs-parser.jay: Use verbosity accordingly. 
12241
12242 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
12243
12244         * expression.cs (Unary.ResolveOperator): Do not report warning;
12245         AddressOf reads from variable.
12246         
12247         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
12248
12249 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
12250
12251         Fix bug #69462
12252
12253         * attribute.cs (Attributable): Removed CheckTargets.
12254         (Attributes.Emit): Explicit attribute targets are tested here.
12255
12256         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
12257         not enabled for interfaces.
12258
12259         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
12260         (GetAssemblyName): Ouch next bug there.
12261
12262 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12263
12264         * expression.cs: Error 275 added.
12265         
12266 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
12267
12268         Fix bug #69177 (Implemented decimal constant support)
12269
12270         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
12271         (BinaryFold): Add DecimalConstant.
12272
12273         * const.cs (Define): Decimal constant 
12274         (is not constant.
12275         (ChangeType): Add decimal type handling.
12276         (LookupConstantValue): Don't set value for decimal type but
12277         emit DecimalConstantAttribute. Needed for constant optimization.
12278
12279         * constant.cs (ToDecimal): New method.
12280         (ConvertToDecimal): New method.
12281         (IntConstant): Implemented ConvertToDecimal.
12282         (DecimalConstant.Emit): Emit optimized version for decimals in
12283         int range.
12284
12285         * expression.cs (ResolveOperator): Changed order of constant
12286         reduction to work correctly with native types which have
12287         overloaded operators.
12288         (ResolveMemberAccess): Extract constant value from attribute
12289         for decimal type.
12290
12291         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
12292
12293         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
12294         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
12295         (ChangeType): Decimal is special.
12296         (TypeToCoreType): Add decimal type.
12297
12298 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
12299
12300         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
12301         decimal types.
12302
12303 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
12304
12305         * class.cs (EventField.ApplyAttributeBuilder): Fix error
12306         test cs1667-5.cs.
12307
12308 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
12309
12310         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
12311
12312         * pending.cs (PendingImplementation): Grab only interfaces.
12313
12314 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
12315
12316         * statement.cs (ForeachHelperMethods): Add location member and
12317         error 202 detection.
12318
12319 2004-11-19  Raja R Harinath  <rharinath@novell.com>
12320
12321         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
12322         automatically handled by executable.make.
12323         (PROGRAM): Make profile-specific.
12324
12325 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
12326
12327         * expression.cs (DoResolveBase): Fixed wrong warning for out
12328         variables.
12329
12330 2004-11-18  Martin Baulig  <martin@ximian.com>
12331
12332         Merged latest changes into gmcs.  Please keep this comment in
12333         here, it makes it easier for me to see what changed in MCS since
12334         the last time I merged.
12335
12336 2004-11-17  Raja R Harinath  <rharinath@novell.com>
12337
12338         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12339         (TypeHandle.GetMemberCache): New.
12340         (TypeHandle.TypeHandle): Update.
12341         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12342         (TypeManager.LookupParentInterfacesCache):
12343         Rename from LookupInterfaceCache.  Optimize slightly.
12344         (TypeManager.MemberLookup_FindMembers): Update.
12345         * decl.cs (MemberCache.MemberCache): Set Container to null in the
12346         multi-type variant.
12347         (AddCacheContents): Rename from AddHashtable.
12348         * class.cs (TypeContainer.parent_container): Remove.
12349         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12350         (TypeContainer.DoDefineMembers): Don't initialize it.
12351         Update to name changes.
12352         
12353 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
12354
12355         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12356         that factors the code to check access modifiers on override.  
12357
12358         (PropertyBase): Use the code here.
12359
12360         Patch from Lluis S'anchez, fixes bug #69361.
12361
12362 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
12363
12364         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12365         routine that is used to report the use of a captured variable
12366         whose address has been taken.
12367
12368         There are two checks: one when variables are being captured and
12369         the other check is when the address of a variable is taken. 
12370         
12371         (because an anonymous methods might be resolved before *or* after
12372         the address has been taken) and 
12373
12374         * expression.cs (Conditional.DoResolve): Remove the special
12375         casing that Martin added to trueExpr and falseExpr being both
12376         NullLiteral.  We get the right behavior now just by introducing
12377         the null_type into the compiler. 
12378
12379         * convert.cs (ExplicitConversion): Change the code to use
12380         null_type instead of testing `expr is NullLiteral'.
12381         (ImplicitConversionStandard): use null_type too.
12382         (ImplicitReferenceConversionExists): use null_type too.
12383         (ImplicitReferenceConversion): use null_type too.
12384
12385         * literal.cs: The type of `NullLiteral' is now null_type instead
12386         of object_type. 
12387         (Resolve): Set the type here.
12388
12389         * typemanager.cs: Introduce null_type.
12390
12391 2004-11-17  Martin Baulig  <martin@ximian.com>
12392
12393         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12394         direction, like FindMembers() does.  Fixes #69546, testcase is in
12395         test-315.cs.    
12396
12397 2004-11-16  Martin Baulig  <martin@ximian.com>
12398
12399         This is based on a patch from Marek Safar, see bug #69082.
12400         Fixes bugs #63705 and #67130.
12401
12402         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12403         method; create a MemberCache for an interface type and cache the
12404         result.
12405
12406         * decl.cs (IMemberContainer.ParentContainer): Removed.
12407         (IMemberContainer.ParentCache): New property.
12408         (MemberCache.SetupCacheForInterface): Removed.
12409         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12410         to create a cache for an interface's "parent".
12411
12412         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12413         interfaces too.
12414
12415 2004-11-16  Martin Baulig  <martin@ximian.com>
12416
12417         Merged back from gmcs; these changes already went into gmcs a
12418         couple of weeks ago.
12419
12420         * typemanager.cs
12421         (TypeManager.AddUserType): Removed the `ifaces' argument.
12422         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12423         `TypeExpr []'.
12424         (TypeManager.AddUserInterface): Removed.
12425         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12426         `TypeExpr []'.
12427         (TypeManager.GetInterfaces): Likewise.
12428         (TypeManager.GetExplicitInterfaces): Likewise.
12429
12430         * ecore.cs (TypeExpr.GetInterfaces): Removed.
12431
12432         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12433         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12434
12435 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
12436
12437         * statement.cs: Avoid adding bools to a hashtable.
12438
12439 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
12440
12441         * expression.cs (Invocation.OverloadResolve): Flag error if we are
12442         calling an unsafe method from a safe location.
12443
12444 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
12445
12446         Fix #69167
12447         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12448
12449 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
12450
12451         * namespace.cs (VerifyUsing): use GetPartialName instead of
12452         ToString. 
12453
12454 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
12455
12456         * statement.cs (Return.Resolve): Fix regression in typo: if
12457         `in_exc', we have to request a NeedReturnLabel, this was a typo
12458         introduced in the anonymous method check-in.  Fixes #69131.
12459
12460         * Indexers were using the ShortName when defining themselves,
12461         causing a regression in the compiler bootstrap when applying the
12462         patch from 2004-11-02 (first part), now they use their full name
12463         and the bug is gone.
12464
12465 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
12466
12467         * driver.cs: Strip the path from the names of embedded resources. Fixes
12468         #68519.
12469
12470 2004-11-04  Raja R Harinath  <rharinath@novell.com>
12471
12472         Fix error message regression: cs0104-2.cs.
12473         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12474         (AliasEntry.Resolve): Update.
12475         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
12476         'silent' flag.
12477         (RootContext.LookupType): Update.
12478
12479 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
12480
12481         * cs-parser.jay: Add support for handling accessor modifiers
12482         * class: Add support port accessor modifiers and error checking,
12483         define PropertyMethod.Define as virtual (not abstract anymore)
12484         * ecore.cs: Add checking for proeprties access with access modifiers
12485         * iterators.cs: Modify Accessor constructor call based in the modified
12486         constructor
12487 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
12488
12489         * expression.cs (StringConcat): Handle being called twice,
12490         as when we have a concat in a field init with more than two
12491         ctors in the class
12492
12493 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
12494
12495         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12496         special case explicit implementations, we should always produce
12497         the .property or .event declaration.
12498         
12499         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12500         since it will not return correct data if people use this
12501         unresolved in the presence of using statements (see test-313).
12502
12503         * class.cs (MethodData.Define): If we are an explicit interface
12504         implementation, set the method name to the full name of the
12505         interface plus the name of the method.  
12506
12507         Notice that using the method.MethodName.GetFullName() does not
12508         work, as it will only contain the name as declared on the source
12509         file (it can be a shorthand in the presence of using statements)
12510         and not the fully qualifed type name, for example:
12511
12512         using System;
12513
12514         class D : ICloneable {
12515                 object ICloneable.Clone ()  {
12516                 }
12517         }
12518
12519         Would produce a method called `ICloneable.Clone' instead of
12520         `System.ICloneable.Clone'.
12521
12522         * namespace.cs (Alias.Resolve): Use GetPartialName.
12523         
12524 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12525
12526         * cs-parser.jay: Add error 1055 report.
12527
12528 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
12529
12530         * assign.cs (Assign.DoResolve): Only do the transform of
12531         assignment into a New if the types are compatible, if not, fall
12532         through and let the implicit code deal with the errors and with
12533         the necessary conversions. 
12534
12535 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12536
12537         * cs-parser.jay: Add error 1031 report.
12538
12539         * cs-tokenizer.cs: Add location for error 1038.
12540
12541 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12542
12543         * cs-parser.jay: Add error 1016 report.
12544
12545 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12546
12547         * cs-parser.jay: Add errors 1575,1611 report.
12548
12549 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12550
12551         * cs-parser.jay: Add error 1001 report.
12552
12553 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12554
12555         Fix #68850
12556         * attribute.cs (GetMarshal): Add method argument for
12557         caller identification.
12558
12559         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12560         agument for GetMarshal and RuntimeMissingSupport.
12561
12562 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12563
12564         * attribute.cs (ExtractSecurityPermissionSet): Removed
12565         TypeManager.code_access_permission_type.
12566
12567         * typemanager.cs: Removed TypeManager.code_access_permission_type.
12568
12569 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
12570
12571         * expression.cs (LocalVariableReference.DoResolveLValue): Check
12572         for obsolete use of a variable here.   Fixes regression on errors
12573         cs0619-25 and cs0619-26.
12574
12575 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
12576
12577         Fix #62358, implemented security attribute encoding.
12578
12579         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12580         Tests permitted SecurityAction for assembly or other types.
12581         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12582         data from SecurityPermissionAttribute to PermisionSet class.
12583
12584         * class.cs (ApplyAttributeBuilder): Added special handling
12585         for System.Security.Permissions.SecurityAttribute based types.
12586
12587         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12588         special handling for System.Security.Permissions.SecurityAttribute
12589         based types.
12590
12591         * enum.cs (ApplyAttributeBuilder): Added special handling
12592         for System.Security.Permissions.SecurityAttribute based types.
12593
12594         * parameter.cs (ApplyAttributeBuilder): Added special handling
12595         for System.Security.Permissions.SecurityAttribute based types.
12596
12597         * rootcontext.cs: Next 2 core types.
12598
12599         * typemanager.cs (TypeManager.security_permission_attr_type):
12600         Built in type for the SecurityPermission Attribute.
12601         (code_access_permission_type): Build in type.
12602
12603 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
12604
12605         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12606         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12607         all of this information into
12608         EmitContext.EmitCapturedVariableInstance.
12609         
12610         * codegen.cs (EmitCapturedVariableInstance): move here the
12611         funcionality of emitting an ldarg.0 in the presence of a
12612         remapping.   This centralizes the instance emit code.
12613
12614         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12615         then emit a load of this: it means that we have reached the
12616         topmost ScopeInfo: the one that contains the pointer to the
12617         instance of the class hosting the anonymous method.
12618
12619         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12620         captures to the topmost CaptureContext.
12621
12622 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
12623
12624         * expression.cs (LocalVariableReference): Move the knowledge about
12625         the iterators into codegen's EmitCapturedVariableInstance.
12626
12627 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
12628
12629         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12630         all code paths return a value from an anonymous method (it is the
12631         same as the 161 error, but for anonymous methods).
12632
12633 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
12634
12635         The introduction of anonymous methods in the compiler changed
12636         various ways of doing things in the compiler.  The most
12637         significant one is the hard split between the resolution phase
12638         and the emission phases of the compiler.
12639
12640         For instance, routines that referenced local variables no
12641         longer can safely create temporary variables during the
12642         resolution phase: they must do so from the emission phase,
12643         since the variable might have been "captured", hence access to
12644         it can not be done with the local-variable operations from the runtime.
12645         
12646         * statement.cs 
12647
12648         (Block.Flags): New flag `IsTopLevel' to indicate that this block
12649         is a toplevel block.
12650
12651         (ToplevelBlock): A new kind of Block, these are the blocks that
12652         are created by the parser for all toplevel method bodies.  These
12653         include methods, accessors and anonymous methods.
12654
12655         These contain some extra information not found in regular blocks:
12656         A pointer to an optional CaptureContext (for tracking captured
12657         local variables and parameters).  A pointer to the parent
12658         ToplevelBlock.
12659         
12660         (Return.Resolve): Catch missmatches when returning a value from an
12661         anonymous method (error 1662).
12662         Invoke NeedReturnLabel from the Resolve phase instead of the emit
12663         phase.
12664
12665         (Break.Resolve): ditto.
12666
12667         (SwitchLabel): instead of defining the labels during the
12668         resolution phase, we now turned the public ILLabel and ILLabelCode
12669         labels into methods called GetILLabelCode() and GetILLabel() that
12670         only define the label during the Emit phase.
12671
12672         (GotoCase): Track the SwitchLabel instead of the computed label
12673         (its contained therein).  Emit the code by using
12674         SwitchLabel.GetILLabelCode ().
12675
12676         (LocalInfo.Flags.Captured): A new flag has been introduce to track
12677         whether the Local has been captured or not.
12678
12679         (LocalInfo.IsCaptured): New property, used to tell whether the
12680         local has been captured.
12681         
12682         * anonymous.cs: Vastly updated to contain the anonymous method
12683         support.
12684
12685         The main classes here are: CaptureContext which tracks any
12686         captured information for a toplevel block and ScopeInfo used to
12687         track the activation frames for various local variables.   
12688
12689         Each toplevel block has an optional capture context associated
12690         with it.  When a method contains an anonymous method both the
12691         toplevel method and the anonymous method will create a capture
12692         context.   When variables or parameters are captured, they are
12693         recorded on the CaptureContext that owns them, for example:
12694
12695         void Demo () {
12696              int a;
12697              MyDelegate d = delegate {
12698                  a = 1;
12699              }
12700         }
12701
12702         Here `a' will be recorded as captured on the toplevel
12703         CapturedContext, the inner captured context will not have anything
12704         (it will only have data if local variables or parameters from it
12705         are captured in a nested anonymous method.
12706
12707         The ScopeInfo is used to track the activation frames for local
12708         variables, for example:
12709
12710         for (int i = 0; i < 10; i++)
12711                 for (int j = 0; j < 10; j++){
12712                    MyDelegate d = delegate {
12713                         call (i, j);
12714                    }
12715                 }
12716
12717         At runtime this captures a single captured variable `i', but it
12718         captures 10 different versions of the variable `j'.  The variable
12719         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12720         recorded on a child.  
12721
12722         The toplevel ScopeInfo will also track information like the `this'
12723         pointer if instance variables were referenced (this is necessary
12724         as the anonymous method lives inside a nested class in the host
12725         type of the method). 
12726
12727         (AnonymousMethod): Expanded to track the Toplevel, implement
12728         `AnonymousMethod.Compatible' to tell whether an anonymous method
12729         can be converted to a target delegate type. 
12730
12731         The routine now also produces the anonymous method content
12732
12733         (AnonymousDelegate): A helper class that derives from
12734         DelegateCreation, this is used to generate the code necessary to
12735         produce the delegate for the anonymous method that was created. 
12736
12737         * assign.cs: API adjustments for new changes in
12738         Convert.ImplicitStandardConversionExists.
12739
12740         * class.cs: Adjustments to cope with the fact that now toplevel
12741         blocks are of type `ToplevelBlock'. 
12742
12743         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12744         insteda of standard blocks.
12745
12746         Flag errors if params arguments are passed to anonymous methods.
12747
12748         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12749         `CurrentAnonymousMethod' which points to the current Anonymous
12750         Method.  The variable points to the AnonymousMethod class that
12751         holds the code being compiled.  It is set in the new EmitContext
12752         created for the anonymous method.
12753
12754         (EmitContext.Phase): Introduce a variable and an enumeration to
12755         assist in enforcing some rules about when and where we are allowed
12756         to invoke certain methods (EmitContext.NeedsReturnLabel is the
12757         only one that enfonces this right now).
12758
12759         (EmitContext.HaveCaptureInfo): new helper method that returns
12760         whether we have a CapturedContext initialized.
12761
12762         (EmitContext.CaptureVariable): New method used to register that a
12763         LocalInfo must be flagged for capturing. 
12764
12765         (EmitContext.CapturedParameter): New method used to register that a
12766         parameters must be flagged for capturing. 
12767         
12768         (EmitContext.CapturedField): New method used to register that a
12769         field must be flagged for capturing. 
12770
12771         (EmitContext.HaveCapturedVariables,
12772         EmitContext.HaveCapturedFields): Return whether there are captured
12773         variables or fields. 
12774
12775         (EmitContext.EmitMethodHostInstance): This is used to emit the
12776         instance for the anonymous method.  The instance might be null
12777         (static methods), this (for anonymous methods that capture nothing
12778         and happen to live side-by-side with the current method body) or a
12779         more complicated expression if the method has a CaptureContext.
12780
12781         (EmitContext.EmitTopBlock): Routine that drives the emission of
12782         code: it will first resolve the top block, then emit any metadata
12783         and then emit the code.  The split is done so that we can extract
12784         any anonymous methods and flag any captured variables/parameters.
12785         
12786         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12787         during this phase, the ILGenerator should not be used as labels
12788         and local variables declared here might not be accessible to any
12789         code that is part of an anonymous method.  
12790
12791         Exceptions to this include the temporary variables that are
12792         created by some statements internally for holding temporary
12793         variables. 
12794         
12795         (EmitContext.EmitMeta): New routine, in charge of emitting all the
12796         metadata for a cb
12797
12798         (EmitContext.TemporaryReturn): This method is typically called
12799         from the Emit phase, and its the only place where we allow the
12800         ReturnLabel to be defined other than the EmitMeta.  The reason is
12801         that otherwise we would have to duplicate a lot of logic in the
12802         Resolve phases of various methods that today is on the Emit
12803         phase. 
12804
12805         (EmitContext.NeedReturnLabel): This no longer creates the label,
12806         as the ILGenerator is not valid during the resolve phase.
12807
12808         (EmitContext.EmitThis): Extended the knowledge in this class to
12809         work in anonymous methods in addition to iterators. 
12810
12811         (EmitContext.EmitCapturedVariableInstance): This emits whatever
12812         code is necessary on the stack to access the instance to a local
12813         variable (the variable will be accessed as a field).
12814
12815         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12816         EmitContext.EmitAddressOfParameter): Routines to support
12817         parameters (not completed at this point). 
12818         
12819         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
12820         will also remove the parameters.
12821
12822         * convert.cs (Convert): Define a `ConstantEC' which points to a
12823         null.  This is just to prefity some code that uses
12824         ImplicitStandardConversion code and do not have an EmitContext
12825         handy.
12826
12827         The idea is to flag explicitly that at that point in time, it is
12828         known that the conversion will not trigger the delegate checking
12829         code in implicit conversions (which requires a valid
12830         EmitContext). 
12831
12832         Everywhere: pass new EmitContext parameter since
12833         ImplicitStandardConversionExists now requires it to check for
12834         anonymous method conversions. 
12835
12836         (Convert.ImplicitStandardConversionExists): If the type of an
12837         expression is the anonymous_method_type, and the type is a
12838         delegate, we invoke the AnonymousMethod.Compatible method to check
12839         whether an implicit conversion is possible. 
12840
12841         (Convert.ImplicitConversionStandard): Only do implicit method
12842         group conversions if the language level is not ISO_1.
12843
12844         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12845         MethodInfo for the Invoke method.  used by Delegate and
12846         AnonymousDelegate.
12847
12848         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12849         method conversions if the target type is a delegate.
12850
12851         Removed extra debugging nops.
12852
12853         (LocalVariableReference): Turn the `local_info' into a public
12854         field. 
12855
12856         Add `prepared' field, the same hack used for FieldExprs to cope
12857         with composed assignments, as Local variables do not necessarily
12858         operate purely on the stack as they used to: they can be captured
12859         fields. 
12860
12861         Add `temp' for a temporary result, like fields.
12862
12863         Refactor DoResolve and DoResolveLValue into DoResolveBase.
12864
12865         It now copes with Local variables that are captured and emits the
12866         proper instance variable to load it from a field in the captured
12867         case. 
12868
12869         (ParameterReference.DoResolveBase): During the resolve phase,
12870         capture parameters if we are in an anonymous method.
12871
12872         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12873         anonymous method, use the EmitContext helper routines to emit the
12874         parameter reference.
12875
12876         * iterators.cs: Set RemapToProxy to true/false during the
12877         EmitDispose class.
12878
12879         * parameters.cs (GetParameterByName): New helper method. 
12880
12881         * typemanager.cs (anonymous_method_type) a new type that
12882         represents an anonyous method.  This is always an internal type,
12883         used as a fencepost to test against the anonymous-methodness of an
12884         expression. 
12885         
12886 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
12887
12888         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12889         561 report.
12890         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12891
12892 2004-10-18  Martin Baulig  <martin@ximian.com>
12893
12894         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12895         `Type' directly, but call ResolveType() on it.
12896         (Catch.Resolve): Likewise.
12897         (Foreach.Resolve): Likewise.
12898
12899 2004-10-18  Martin Baulig  <martin@ximian.com>
12900
12901         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12902         `Type' directly, but call ResolveType() on it.
12903         (Probe.DoResolve): Likewise.
12904         (ArrayCreation.LookupType): Likewise.
12905         (TypeOf.DoResolve): Likewise.
12906         (SizeOf.DoResolve): Likewise.
12907
12908 2004-10-18  Martin Baulig  <martin@ximian.com>
12909
12910         * expression.cs (Invocation.BetterFunction): Put back
12911         TypeManager.TypeToCoreType().
12912
12913 2004-10-18  Raja R Harinath  <rharinath@novell.com>
12914
12915         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12916         the ResolveType.
12917
12918 2004-10-18  Martin Baulig  <martin@ximian.com>
12919
12920         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
12921         `Type' directly, but call ResolveType() on it.
12922
12923 2004-10-18  Martin Baulig  <martin@ximian.com>
12924
12925         * class.cs (FieldMember.Define): Don't access the TypeExpr's
12926         `Type' directly, but call ResolveType() on it.
12927         (MemberBase.DoDefine): Likewise.
12928
12929         * expression.cs (New.DoResolve): Don't access the TypeExpr's
12930         `Type' directly, but call ResolveType() on it.
12931         (ComposedCast.DoResolveAsTypeStep): Likewise.
12932
12933         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12934         `Type' directly, but call ResolveType() on it.
12935
12936 2004-10-17  John Luke  <john.luke@gmail.com>
12937
12938         * class.cs (Operator.GetSignatureForError): use CSharpName
12939
12940         * parameter.cs (Parameter.GetSignatureForError): Returns
12941         correct name even if was not defined.
12942
12943 2004-10-13  Raja R Harinath  <rharinath@novell.com>
12944
12945         Fix #65816.
12946         * class.cs (TypeContainer.EmitContext): New property.
12947         (DefineNestedTypes): Create an emitcontext for each part.
12948         (MethodCore.DoDefineParameters): Use container's emitcontext.
12949         Pass type array to InternalParameters.
12950         (MemberBase.DoDefine): Use container's emitcontext.
12951         (FieldMember.Define): Likewise.
12952         (Event.Define): Likewise.
12953         (SetMethod.GetParameterInfo): Change argument to EmitContext.
12954         Pass type array to InternalParameters.
12955         (SetIndexerMethod.GetParameterInfo): Likewise.
12956         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12957         * delegate.cs (Define): Pass emitcontext to
12958         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
12959         array to InternalParameters.
12960         * expression.cs (ParameterReference.DoResolveBase): Pass
12961         emitcontext to GetParameterInfo.
12962         (ComposedCast.DoResolveAsTypeStep): Remove check on
12963         ec.ResolvingTypeTree.
12964         * parameter.cs (Parameter.Resolve): Change argument to
12965         EmitContext.  Use ResolveAsTypeTerminal.
12966         (Parameter.GetSignature): Change argument to EmitContext.
12967         (Parameters.ComputeSignature): Likewise.
12968         (Parameters.ComputeParameterTypes): Likewise.
12969         (Parameters.GetParameterInfo): Likewise.
12970         (Parameters.ComputeAndDefineParameterTypes): Likewise.
12971         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
12972         * support.cs (InternalParameters..ctor): Remove variant that takes
12973         a DeclSpace.
12974         * typemanager.cs (system_intptr_expr): New.
12975         (InitExpressionTypes): Initialize it.
12976
12977 2004-10-12  Chris Toshok  <toshok@ximian.com>
12978
12979         * cs-parser.jay: fix location for try_statement and catch_clause.
12980
12981 2004-10-11  Martin Baulig  <martin@ximian.com>
12982
12983         * report.cs: Don't make --fatal abort on warnings, we have
12984         -warnaserror for that.
12985
12986 2004-10-07  Raja R Harinath  <rharinath@novell.com>
12987
12988         More DeclSpace.ResolveType avoidance.
12989         * decl.cs (MemberCore.InUnsafe): New property.
12990         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
12991         with newly created EmitContext.
12992         (FieldMember.Define): Likewise.
12993         * delegate.cs (Delegate.Define): Likewise.
12994         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
12995         only if normal name-lookup fails.
12996         (TypeExpr.DoResolve): Enable error-checking.
12997         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
12998         (SizeOf.DoResolve): Likewise.
12999         (ComposedCast.DoResolveAsTypeStep): Likewise.
13000         (StackAlloc.DoResolve): Likewise.
13001         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
13002         (Block.Unsafe): New property.
13003         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
13004         (Unsafe): Set 'unsafe' flag of contained block.
13005         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
13006         (Fixed.Resolve): Likewise.
13007         (Catch.Resolve): Likewise.
13008         (Using.ResolveLocalVariableDecls): Likewise.
13009         (Foreach.Resolve): Likewise.
13010
13011 2004-10-05  John Luke <john.luke@gmail.com>
13012
13013         * cs-parser.jay: add location to error CS0175
13014
13015 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
13016
13017         * ecore.cs (Expression.Constantity): Add support for turning null
13018         into a constant.
13019
13020         * const.cs (Const.Define): Allow constants to be reference types
13021         as long as the value is Null.
13022
13023 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
13024
13025         * namespace.cs (NamespaceEntry.Using): No matter which warning
13026         level is set, check if this namespace name has already been added.
13027
13028 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
13029
13030         * expression.cs: reftype [!=]= null should always use br[true,false].
13031         # 67410
13032
13033 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
13034
13035         Fix #67108
13036         * attribute.cs: Enum conversion moved to 
13037         GetAttributeArgumentExpression to be applied to the all
13038         expressions.
13039
13040 2004-10-01  Raja R Harinath  <rharinath@novell.com>
13041
13042         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
13043         * class.c (TypeContainer.DefineType): Flag error if
13044         base types aren't accessible due to access permissions.
13045         * decl.cs (DeclSpace.ResolveType): Move logic to
13046         Expression.ResolveAsTypeTerminal.
13047         (DeclSpace.ResolveTypeExpr): Thin layer over
13048         Expression.ResolveAsTypeTerminal.
13049         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
13050         Refactor code into NestedAccess.  Use it.
13051         (DeclSpace.NestedAccess): New.
13052         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
13053         argument to silence errors.  Check access permissions.
13054         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
13055         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
13056         (Cast.DoResolve): Likewise.
13057         (New.DoResolve): Likewise.
13058         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
13059         (TypeOf.DoResolve): Likewise.
13060
13061         * expression.cs (Invocation.BetterConversion): Return the Type of
13062         the better conversion.  Implement section 14.4.2.3 more faithfully.
13063         (Invocation.BetterFunction): Make boolean.  Make correspondence to
13064         section 14.4.2.2 explicit.
13065         (Invocation.OverloadResolve): Update.
13066         (Invocation): Remove is_base field.
13067         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
13068         (Invocation.Emit): Likewise.
13069
13070 2004-09-27  Raja R Harinath  <rharinath@novell.com>
13071
13072         * README: Update to changes.
13073
13074 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
13075
13076         * cs-parser.jay: Reverted 642 warning fix.
13077
13078 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13079
13080         Fix bug #66615
13081         * decl.cs (FindMemberWithSameName): Indexer can have more than
13082         1 argument.
13083
13084 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13085
13086         * expression.cs (LocalVariableReference.DoResolveLValue):
13087         Do not report warning 219 for out values.
13088         (EmptyExpression.Null): New member to avoid extra allocations.
13089
13090 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13091
13092         * cs-parser.jay: Fix wrong warning 642 report.
13093
13094         * cs-tokenizer.cs (CheckNextToken): New helper;
13095         Inspect next character if is same as expected.
13096
13097 2004-09-23  Martin Baulig  <martin@ximian.com>
13098
13099         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
13100         (Convert.ImplicitReferenceConversionExists): Likewise.
13101
13102 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
13103
13104         * class.cs (Operator.Define): Add error 448 and 559 report.
13105
13106 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13107
13108         * class.cs (MemberBase.IsTypePermitted): New protected
13109         method for checking error CS0610.
13110
13111 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13112
13113         * class.cs (TypeContainer.HasExplicitLayout): New property
13114         Returns whether container has StructLayout attribute set Explicit.
13115         (FieldMember): New abstract class for consts and fields.
13116         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
13117         (Field): Reuse FieldMember.
13118
13119         * const.cs (Const): Reuse FieldMember.
13120
13121         * rootcontext.cs: EmitConstants call moved to class.
13122
13123 2004-09-22  Martin Baulig  <martin@ximian.com>
13124
13125         Thanks to Peter Sestoft for this bug report.
13126
13127         * expression.cs (Conditional): If both the `trueExpr' and the
13128         `falseExpr' is a NullLiteral, return a NullLiteral.
13129
13130 2004-09-22  Martin Baulig  <martin@ximian.com>
13131
13132         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
13133         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
13134         for the "get_Current" call.
13135
13136 2004-09-22  Martin Baulig  <martin@ximian.com>
13137
13138         Marek and me just fixed one of our oldest bugs: #28562 :-)
13139
13140         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
13141
13142         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
13143         we're an EnumConstant, just return that.
13144         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
13145         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
13146         to get the value which'll actually be written into the attribute.
13147         However, we have to use GetValue() to access the attribute's value
13148         in the compiler.        
13149
13150 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
13151
13152         * constant.cs (Constant.IsNegative): New abstract property
13153         IsNegative.
13154
13155         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
13156         (StackAlloc.DoResolve): Reused IsNegative.
13157
13158 2004-09-21  Martin Baulig  <martin@ximian.com>
13159
13160         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
13161         if we're used in an iterator, we may be called from different
13162         methods.
13163
13164         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
13165         we actually have an exception block.
13166
13167 2004-09-20  John Luke <jluke@cfl.rr.com>
13168
13169         * class.cs, cs-parser.jay: Improve the error report for 1520:
13170         report the actual line where the error happens, not where the
13171         class was declared.
13172
13173         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
13174         Pass location information that was available elsewhere.
13175
13176 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
13177
13178         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
13179         runtime to delay sign assemblies.
13180
13181 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
13182
13183         * cs-parser.jay: Do not report the stack trace, this is barely
13184         used nowadays.
13185
13186 2004-08-22  John Luke  <john.luke@gmail.com>
13187  
13188         * driver.cs : check that a resource id is not already used
13189         before adding it, report CS1508 if it is, bug #63637
13190
13191 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
13192
13193         * ecore.cs: Removed dead code.
13194
13195 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
13196
13197         * class.cs: Do not report warning CS0067 on the interfaces.
13198
13199 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
13200
13201         * cs-parser.jay: Add error 504 report.
13202
13203 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
13204
13205         * rootcontext.cs: WarningLevel is 4 by default now.
13206
13207         * statement.cs (Fixed.Resolve): Do not null
13208         VariableInfo.
13209
13210 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
13211
13212         Fixed bug #55780
13213         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
13214         deep search when property is not virtual.
13215         (PropertyExpr.ResolveAccessors): Make one call for both
13216         accessors.
13217
13218 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13219
13220         Fixed bug #65766
13221         * statement.cs: Error 152 report constains also location.
13222
13223 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13224
13225         Fixed bug #65766
13226         * const.cs: Explicitly set constant as static.
13227
13228 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13229
13230         Fixed bug #64226
13231         * cs-parser.jay: Add error 1017 report.
13232
13233 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13234
13235         Fixed bug #59980, #64224
13236         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
13237
13238         * typemanager.cs (IsSpecialMethod): Simplified
13239
13240 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13241
13242         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
13243         condition with better params.
13244
13245 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13246
13247         Fixed bug #65238
13248         * attribute.cs (Resolve): Property has to have both
13249         accessors.
13250
13251 2004-09-14  Martin Baulig  <martin@ximian.com>
13252
13253         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
13254
13255 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13256
13257         Fixed bug #61902
13258         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
13259         called and is obsolete then this member suppress message
13260         when call is inside next [Obsolete] method or type.
13261
13262         * expression.cs: Use TestObsoleteMethodUsage member.
13263
13264 2004-09-14  Martin Baulig  <martin@ximian.com>
13265
13266         * cs-parser.jay: Sync a bit with the GMCS version.
13267
13268 2004-09-14  Martin Baulig  <martin@ximian.com>
13269
13270         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
13271         (CSharpParser.yacc_verbose_flag): New public field.
13272
13273         * genericparser.cs: Removed.
13274
13275 2004-09-14  Raja R Harinath  <rharinath@novell.com>
13276
13277         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
13278
13279 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
13280
13281         * class.cs (MethodCore.CheckBase): Fix bug #65757.
13282
13283 2004-09-10  Martin Baulig  <martin@ximian.com>
13284
13285         Backported my MemberName changes from GMCS into MCS.
13286
13287         - we are now using a special `MemberName' class instead of using
13288         strings; in GMCS, the `MemberName' also contains the type
13289         arguments.
13290
13291         - changed the grammar rules a bit:
13292           * the old `member_name' is now a `namespace_or_type_name':
13293             The rule is that we use `namespace_or_type_name' everywhere
13294             where we expect either a "member name" (GetEnumerator) or a
13295             "member name" with an explicit interface name
13296             (IEnumerable.GetEnumerator).
13297             In GMCS, the explicit interface name may include type arguments
13298             (IEnumerable<T>.GetEnumerator).
13299           * we use `member_name' instead of just `IDENTIFIER' for
13300             "member names":
13301             The rule is that we use `member_name' wherever a member may
13302             have type parameters in GMCS.       
13303
13304         * decl.cs (MemberName): New public class.
13305         (MemberCore.MemberName): New public readonly field.
13306         (MemberCore.ctor): Take a `MemberName' argument, not a string.
13307         (DeclSpace): Likewise.
13308
13309         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
13310         * enum.cs (Enum.ctor): Likewise.
13311
13312         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13313         MemberName.     
13314         (AliasEntry.ctor): Take a MemberName, not an Expression.
13315         (AliasEntry.UsingAlias): Likewise.
13316
13317         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13318         (IMethodData.MemberName): Changed type from string to MemberName.
13319         (MemberBase.ExplicitInterfaceName): Likewise.
13320         (AbstractPropertyEventMethod.SetupName): Make this private.
13321         (AbstractPropertyEventMethod.ctor): Added `string prefix'
13322         argument; compute the member name here.
13323         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13324         on the `member.MemberName' and the `prefix'.
13325
13326         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13327         not `type_name'.
13328         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13329         thus, we get a `MemberName' instead of a `string'.  These
13330         declarations may have type parameters in GMCS.
13331         (interface_method_declaration, delegate_declaration): Likewise.
13332         (class_declaration, interface_declaration): Likewise.
13333         (method_header): Use `namespace_or_type_name' instead of
13334         `member_name'.  We may be an explicit interface implementation.
13335         (property_declaration, event_declaration): Likewise.
13336         (member_name): This is now just an `IDENTIFIER', not a
13337         `namespace_or_type_name'.
13338         (type_name, interface_type): Removed.
13339         (namespace_or_type_name): Return a MemberName, not an Expression.
13340         (primary_expression): Use `member_name' instead of `IDENTIFIER';
13341         call GetTypeExpression() on the MemberName to get an expression.
13342         (IndexerDeclaration.interface_type): Changed type from string to
13343         MemberName.
13344         (MakeName): Operate on MemberName's instead of string's.
13345
13346 2004-09-13  Raja R Harinath  <rharinath@novell.com>
13347
13348         Fix bug #55770.
13349         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13350         (NamespaceEntry.Lookup): Add new argument to flag if we want the
13351         lookup to avoid symbols introduced by 'using'.
13352         * rootcontext.cs (NamespaceLookup): Update.
13353
13354 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13355
13356         * class.cs (TypeContainer.DoDefineMembers): Do not call
13357         DefineDefaultConstructor for static classes.
13358
13359 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13360
13361         * attribute.cs (Attribute.Resolve): Add error 653 report.
13362
13363         * class.cs (Class.ApplyAttributeBuilder): Add error 641
13364         report.
13365         (Method.ApplyAttributeBuilder): Add error 685 report.
13366         (Operator.Define): Add error 564 report.
13367
13368         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13369
13370         * expression.cs (Invocation.DoResolve): Add error
13371         245 and 250 report.
13372
13373         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13374         error 674 report.
13375
13376 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13377
13378         * class.cs (ConstructorInitializer.Resolve):
13379         Wrong error number (515->516).
13380
13381 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13382
13383         * class.cs (Indexer.Define): Add error 631 report.
13384
13385 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13386
13387         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13388
13389 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13390
13391         * expression.cs (Probe.DoResolve): Add error CS0241 report.
13392
13393 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
13394
13395         * cs-parser.jay: Added error CS0241 report.
13396
13397 2004-09-10  Raja R Harinath  <rharinath@novell.com>
13398
13399         * cs-parser.jay (fixed_statement): Introduce a scope for the
13400         declaration in the 'fixed' statement.
13401
13402 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13403
13404         * cs-parser.jay: Added CS0230 error report.
13405
13406 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13407
13408         * cs-parser.jay: Added errors CS0231 and CS0257 report.
13409
13410 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13411
13412         * expression.cs (Argument.Resolve): Added error CS0192 and
13413         CS0199 report.
13414
13415 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13416
13417         C# 2.0 #pragma warning feature
13418
13419         * cs-tokenizer.cs (PreProcessPragma): New method; 
13420         Handles #pragma directive.
13421
13422         * report.cs (WarningRegions): New class; Support
13423         class for #pragma warning directive. It tests whether
13424         warning is enabled for a given line.
13425
13426 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
13427
13428         * const.cs: Add more descriptive error report, tahnks to
13429         Sebastien. 
13430
13431 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
13432
13433         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13434
13435 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
13436
13437         * expression.cs: Apply patch from Ben: Remove dead code from
13438         ArrayCreation, and remove the TurnintoConstant call in const.cs,
13439         as that code just threw an exception anwyays.
13440
13441         * const.cs: Remove the call to the turnintoconstant, for details
13442         see bug: #63144
13443         
13444         * literal.cs: The type of the null-literal is the null type;  So
13445         we use a placeholder type (literal.cs:System.Null, defined here)
13446         for it.
13447
13448         * expression.cs (Conditional.DoResolve): Remove some old code that
13449         is no longer needed, conversions have been fixed.
13450
13451         (ArrayCreationExpression.DoResolve): Return false if we fail to
13452         resolve the inner expression.
13453
13454 2004-09-07  Raja R Harinath  <rharinath@novell.com>
13455
13456         Fix test-290.cs.
13457         * cs-parser.jay (delegate_declaration): Record a delegate
13458         declaration as a type declaration.
13459         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13460
13461 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
13462
13463         * parameter.cs: Do not crash if the type can not be resolved. 
13464
13465         * expression.cs: Report errors with unsafe pointers, fixes #64896
13466
13467 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
13468
13469         * expression.cs: Pointer arith always needs to do a conv.i
13470         if the operand is a long. fix 65320
13471
13472 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13473
13474         Fixed cs0619-37.cs, cs0619-38.cs
13475
13476         * enum.cs (GetObsoleteAttribute): Removed.
13477
13478         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13479         on Enum member is double staged. The first is tested member
13480         and then enum.
13481
13482 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13483
13484         Fixed #56986, #63631, #65231
13485
13486         * class.cs: (TypeContainer.AddToMemberContainer): New method,
13487         adds member to name container.
13488         (TypeContainer.AddToTypeContainer): New method, adds type to
13489         name container.
13490         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13491         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13492         AddOperator): Simplified by reusing AddToMemberContainer.
13493         (TypeContainer.UserDefinedStaticConstructor): Changed to property
13494         instead of field.
13495         (Method.CheckForDuplications): Fixed implementation to test all
13496         possibilities.
13497         (MemberBase): Detection whether member is explicit interface
13498         implementation is now in constructor.
13499         (MemberBase.UpdateMemberName): Handles IndexerName.
13500         (Accessor): Changed to keep also location information.
13501         (AbstractPropertyEventMethod): Is derived from MemberCore.
13502         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13503         will be emited or not.
13504         (PropertyBase.AreAccessorsDuplicateImplementation):
13505         Tests whether accessors are not in collision with some method.
13506         (Operator): Is derived from MethodCore to simplify common
13507         operations.
13508
13509         * decl.cs (Flags.TestMethodDuplication): Test for duplication
13510         must be performed.
13511         (DeclSpace.AddToContainer): Adds the member to defined_names
13512         table. It tests for duplications and enclosing name conflicts.
13513
13514         * enum.cs (EnumMember): Clean up to reuse the base structures
13515
13516 2004-09-03  Martin Baulig  <martin@ximian.com>
13517
13518         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13519         into TypeContainer, to make partial classes work again.
13520
13521 2004-09-03  Martin Baulig  <martin@ximian.com>
13522
13523         * rootcontext.cs (RootContext.V2): Removed.
13524
13525 2004-03-23  Martin Baulig  <martin@ximian.com>
13526
13527         * expression.cs (Invocation.OverloadResolve): Added `bool
13528         may_fail' argument and use it instead of the Location.IsNull() hack.
13529
13530 2004-09-03  Martin Baulig  <martin@ximian.com>
13531
13532         Merged latest changes into gmcs.  Please keep this comment in
13533         here, it makes it easier for me to see what changed in MCS since
13534         the last time I merged.
13535
13536 2004-09-03  Raja R Harinath  <rharinath@novell.com>
13537
13538         Fix #61128.
13539         * expression.cs (BetterConversion): Don't allow either conversion 
13540         to be null.  Remove redundant implicit conversion test when 'q ==
13541         null' -- when this function is invoked, we already know that the
13542         implicit conversion exists.
13543         (BetterFunction): Assume that 'best' is non-null.  Remove
13544         redundant reimplementation of IsApplicable when 'best' is null.
13545         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13546         number of arguments.
13547         (IsAncestralType): Extract from OverloadResolve.
13548         (OverloadResolve): Make robust to the MethodGroupExpr being
13549         unsorted.  Implement all the logic of Section 14.5.5.1, and
13550         support overloading of methods from multiple applicable types.
13551         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
13552
13553         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13554         (RealError, Warning): Append type of report to related symbol.
13555
13556 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
13557
13558         * enum.cs: Fixed CLS-Compliance checks for enum members.
13559         Error tests cs3008-8.cs, cs3014-8.cs
13560
13561 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13562
13563         Fixed bug #62342, #63102
13564         * class.cs: ImplementIndexer uses member.IsExplicitImpl
13565         like ImplementMethod.
13566
13567 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13568
13569         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13570         Fixed bug #65170.
13571
13572 2004-09-02  Martin Baulig  <martin@ximian.com>
13573
13574         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13575         TypeManager.GetArgumentTypes() rather than calling GetParameters()
13576         on the MethodBase.
13577
13578 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
13579
13580         C# 2.0 Static classes implemented
13581
13582         * class.cs (TypeContainer): instance_constructors,
13583         initialized_fields, initialized_static_fields,
13584         default_constructor, base_inteface_types are protected to be
13585         accessible from StaticClass.
13586         (TypeContainer.DefineDefaultConstructor): New virtual method
13587         for custom default constructor generating
13588         (StaticClass): New class to handle "Static classes" feature.
13589
13590         * cs-parser.jay: Handle static keyword on class like instance
13591         of StaticClass.
13592
13593         * driver.cs: Added "/langversion" command line switch with two
13594         options (iso-1, default).
13595
13596 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
13597
13598         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13599
13600 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
13601
13602         * delegate.cs: Style.
13603
13604 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13605
13606         * delegate.cs: Add seperate instance expr field for miguel.
13607
13608 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13609
13610         * PointerArithmetic (Resolve): make sure we are not doing
13611         pointer arith on void*. Also, make sure we are resolved
13612         by not setting eclass until resolve.
13613
13614         All callers: Make sure that PointerArithmetic gets resolved.
13615
13616 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13617
13618         * ArrayCreation (LookupType): If the type does not resolve 
13619         to an array, give an error.
13620
13621 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
13622
13623         * statement.cs (Try.Resolve): Fixed bug #64222
13624
13625 2004-08-27  Martin Baulig  <martin@ximian.com>
13626
13627         * class.cs
13628         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13629         crash here.     
13630
13631 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13632
13633         * ecore.cs (Constantify): Get underlying type via
13634         System.Enum.GetUnderlyingType to avoid StackOverflow on the
13635         Windows in special cases.
13636
13637 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13638
13639         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13640         for obtaining also private methods.
13641         (GetRemoveMethod): Used GetRemoveMethod (true)
13642         for obtaining also private methods.
13643
13644 2004-08-24  Martin Baulig  <martin@ximian.com>
13645
13646         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13647         MethodAttributes.HideBySig for operators.
13648
13649 2004-08-23  Martin Baulig  <martin@ximian.com>
13650
13651         Back to the old error reporting system :-)
13652
13653         * report.cs (Message): Removed.
13654         (Report.MessageData, ErrorData, WarningData): Removed.
13655         (Report.Error, Warning): Back to the old system.
13656
13657 2004-08-23  Martin Baulig  <martin@ximian.com>
13658
13659         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13660
13661         * class.cs (TypeContainer.ParentContainer): New public virtual
13662         method; replaces the explicit interface implementation.
13663         (ClassPart.ParentContainer): Override.
13664
13665 2004-08-23  Martin Baulig  <martin@ximian.com>
13666
13667         * statement.cs (Switch): Added support for constant switches; see
13668         #59428 or test-285.cs.
13669
13670 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13671
13672         Fixed bug #62740.
13673         * statement.cs (GetEnumeratorFilter): Removed useless
13674         logic because C# specs is strict. GetEnumerator must be
13675         public.
13676
13677 2004-08-22  Martin Baulig  <martin@ximian.com>
13678
13679         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13680         a switch and may break, reset the barrier.  Fixes #59867.
13681
13682 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13683
13684         CLS-Compliance speed up (~5% for corlib)
13685
13686         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13687         New method. Tests container for CLS-Compliant names
13688
13689         * class.cs (TypeContainer.VerifyClsName): New method.
13690         Checks whether container name is CLS Compliant.
13691         (Constructor): Implements IMethodData.
13692
13693         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13694         low-case table for CLS Compliance test.
13695         (MemberCache.VerifyClsParameterConflict): New method.
13696         Checks method parameters for CS3006 error.
13697
13698         * enum.cs (EnumMember): Is derived from MemberCore.
13699         (Enum.VerifyClsName): Optimized for better performance.
13700
13701 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13702
13703         * report.cs: Renamed Error_T to Error and changed all
13704         references.
13705
13706 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13707
13708         * class.cs (TypeContainer.IndexerArrayList): New inner class
13709         container for indexers.
13710         (TypeContainer.DefaultIndexerName): New constant for default
13711         indexer name. Replaced all "Item" with this constant.
13712         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13713
13714         * typemanager.cs (TypeManager.default_member_ctor): Cache here
13715         DefaultMemberAttribute constructor.
13716
13717 2004-08-05  Martin Baulig  <martin@ximian.com>
13718
13719         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13720         Fix bug #59429.
13721
13722 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
13723
13724         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13725         multi platforms problem.
13726
13727         * compiler.csproj: Included shared files.
13728
13729 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13730
13731         Fix bug 60333, 55971 in the more general way
13732         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13733         Added arg_type argument for constant conversion.
13734         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13735
13736 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13737
13738         Fix bug #59760
13739         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
13740         OperatorArrayList, MethodCoreArrayList for typecontainer
13741         containers. Changed class member types to these new types.
13742         (MethodArrayList.DefineMembers): Added test for CS0659.
13743
13744 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
13745
13746         * cfold.cs: Synchronize the folding with the code in expression.cs
13747         Binary.DoNumericPromotions for uint operands.
13748
13749         * attribute.cs: Revert patch from Raja, it introduced a regression
13750         while building Blam-1.2.1 (hard to isolate a test case).
13751
13752 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13753
13754         Fix for #55382
13755         * class.cs:
13756         (TypeContainer.Define): Renamed to DefineContainerMembers because of
13757         name collision.
13758         (MethodCore.parent_method): New member. The method we're overriding
13759         if this is an override method.
13760         (MethodCore.CheckBase): Moved from Method class and made common.
13761         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13762         private.
13763         (MethodCore.CheckForDuplications): New abstract method. For custom
13764         member duplication search in a container
13765         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13766         method and its return type.
13767         (Event.conflict_symbol): New member. Symbol with same name in the
13768         parent class.
13769
13770         * decl.cs:
13771         (MemberCache.FindMemberWithSameName): New method. The method
13772         is looking for conflict with inherited symbols.
13773
13774 2004-08-04  Martin Baulig  <martin@ximian.com>
13775
13776         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13777
13778         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13779
13780 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13781
13782         * report.cs (Message): New enum for better error, warning reference in
13783         the code.
13784         (MessageData): New inner abstract class. It generally handles printing of
13785         error and warning messages.
13786         Removed unused Error, Warning, Message methods.
13787
13788 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13789
13790         Fix for cs0592-8.cs test
13791         * attribute.cs
13792         (Attributable.ValidAttributeTargets): Made public.
13793         (Attribute.ExplicitTarget): New member for explicit target value.
13794         (Attribute.CheckTargets): Now we translate explicit attribute
13795         target to Target here.
13796
13797 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
13798
13799         * ecore.cs (MethodGroupExpr): new IsBase property.
13800
13801         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13802
13803         * delegate.cs (DelegateCreation): store a MethodGroupExpr
13804         rather than an instance expr.
13805
13806         (DelegateCreation.Emit): Use the method group rather than
13807         the instance expression. Also, if you have base.Foo as the
13808         method for a delegate, make sure to emit ldftn, not ldftnvirt.
13809
13810         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
13811
13812         (NewDelegate.DoResolve): Only check for the existance of Invoke
13813         if the method is going to be needed. Use MethodGroupExpr.
13814
13815         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
13816
13817         * expression.cs: For pointer arith., make sure to use
13818         the size of the type, not the size of the pointer to
13819         the type.
13820
13821 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13822
13823         Fix for #60722
13824         * class.cs (Class): Added error CS0502 test.
13825
13826 2004-08-03  John Luke  <jluke@cfl.rr.com>
13827             Raja R Harinath  <rharinath@novell.com>
13828
13829         Fix for #60997.
13830         * attribute.cs (Attribute.complained_before): New flag.
13831         (Attribute.ResolveType, Attribute.Resolve),
13832         (Attribute.DefinePInvokeMethod): Set it.
13833         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13834         
13835 2004-08-03  Martin Baulig  <martin@ximian.com>
13836
13837         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13838         use a user-defined operator; we still need to do numeric
13839         promotions in case one argument is a builtin type and the other
13840         one has an implicit conversion to that type.  Fixes #62322.
13841
13842 2004-08-02  Martin Baulig  <martin@ximian.com>
13843
13844         * statement.cs (LocalInfo.Flags): Added `IsThis'.
13845         (LocalInfo.IsThis): New public property.
13846         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13847
13848 2004-08-01  Martin Baulig  <martin@ximian.com>
13849
13850         * class.cs (TypeContainer.GetClassBases): Don't set the default
13851         here since we may get called from GetPartialBases().
13852         (TypeContainer.DefineType): If GetClassBases() didn't return a
13853         parent, use the default one.
13854
13855 2004-07-30  Duncan Mak  <duncan@ximian.com>
13856
13857         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13858
13859 2004-07-30  Martin Baulig  <martin@ximian.com>
13860
13861         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13862
13863         * class.cs (SourceMethod): New public class, derive from the
13864         symbol writer's ISourceMethod.
13865         (Method): Use the new symbol writer API.
13866
13867         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13868         as argument and use the new symbol writer.
13869
13870         * location.cs
13871         (SourceFile): Implement the symbol writer's ISourceFile.
13872         (Location.SymbolDocument): Removed.
13873         (Location.SourceFile): New public property.
13874
13875         * symbolwriter.cs: Use the new symbol writer API.
13876
13877 2004-07-30  Raja R Harinath  <rharinath@novell.com>
13878
13879         * Makefile (install-local): Remove.  Functionality moved to
13880         executable.make.
13881
13882 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
13883
13884         * Makefile: Install mcs.exe.config file together with mcs.exe.
13885         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13886         correct runtime version.
13887         
13888 2004-07-25  Martin Baulig  <martin@ximian.com>
13889
13890         * class.cs
13891         (TypeContainer.RegisterOrder): Removed, this was unused.
13892         (TypeContainer, interface_order): Removed.
13893         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13894         TypeContainer as argument since we can also be called with a
13895         `PartialContainer' for a partial class/struct/interface.
13896         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13897         of checking whether we're an `Interface' - we could be a
13898         `PartialContainer'.
13899         (PartialContainer.Register): Override; call
13900         AddClass()/AddStruct()/AddInterface() on our parent.
13901
13902         * cs-parser.jay (interface_member_declaration): Add things to the
13903         `current_container', not the `current_class'.
13904
13905         * rootcontext.cs (RegisterOrder): The overloaded version which
13906         takes an `Interface' was unused, removed.
13907
13908         * typemanager.cs (TypeManager.LookupInterface): Return a
13909         `TypeContainer', not an `Interface'.
13910         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13911         contain a `PartialContainer' for an interface, so check it's
13912         `Kind' to figure out what it is.
13913
13914 2004-07-25  Martin Baulig  <martin@ximian.com>
13915
13916         * class.cs (Class.DefaultTypeAttributes): New public constant.
13917         (Struct.DefaultTypeAttributes): Likewise.
13918         (Interface.DefaultTypeAttributes): Likewise.
13919         (PartialContainer.TypeAttr): Override this and add the
13920         DefaultTypeAttributes.
13921
13922 2004-07-25  Martin Baulig  <martin@ximian.com>
13923
13924         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13925         we can just use the `Parent' field instead.
13926
13927 2004-07-25  Martin Baulig  <martin@ximian.com>
13928
13929         * class.cs (TypeContainer.Emit): Renamed to EmitType().
13930
13931 2004-07-25  Martin Baulig  <martin@ximian.com>
13932
13933         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13934         our parts before defining any methods.
13935         (TypeContainer.VerifyImplements): Make this virtual.
13936         (ClassPart.VerifyImplements): Override and call VerifyImplements()
13937         on our PartialContainer.
13938
13939 2004-07-25  Martin Baulig  <martin@ximian.com>
13940
13941         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13942
13943         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13944         argument, we can just use the `Parent' field instead.
13945
13946         * class.cs
13947         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
13948         (MemberBase.DoDefine): Likewise.
13949
13950 2004-07-24  Martin Baulig  <martin@ximian.com>
13951
13952         * decl.cs (MemberCore.Parent): New public field.
13953         (DeclSpace.Parent): Moved to MemberCore.
13954
13955         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13956         (MemberBase.ctor): Added TypeContainer argument, pass it to our
13957         parent's .ctor.
13958         (FieldBase, Field, Operator): Likewise.
13959         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13960         (EventField, Event): Likewise.
13961
13962 2004-07-23  Martin Baulig  <martin@ximian.com>
13963
13964         * class.cs (PartialContainer): New public class.
13965         (ClassPart): New public class.
13966         (TypeContainer): Added support for partial classes.
13967         (TypeContainer.GetClassBases): Splitted some of the functionality
13968         out into GetNormalBases() and GetPartialBases().
13969
13970         * cs-tokenizer.cs (Token.PARTIAL): New token.
13971         (Tokenizer.consume_identifier): Added some hacks to recognize
13972         `partial', but only if it's immediately followed by `class',
13973         `struct' or `interface'.
13974
13975         * cs-parser.jay: Added support for partial clases.
13976
13977 2004-07-23  Martin Baulig  <martin@ximian.com>
13978
13979         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13980         a `DeclSpace' and also made it readonly.
13981         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13982         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
13983         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
13984
13985         * cs-parser.jay: Pass the `current_class', not the
13986         `current_container' (at the moment, this is still the same thing)
13987         to a new Method, Property, Event, Indexer or Constructor.
13988
13989 2004-07-23  Martin Baulig  <martin@ximian.com>
13990
13991         * cs-parser.jay (CSharpParser): Added a new `current_class' field
13992         and removed the `current_interface' one.
13993         (struct_declaration, class_declaration, interface_declaration):
13994         Set `current_class' to the newly created class/struct/interface;
13995         set their `Bases' and call Register() before parsing their body.
13996
13997 2004-07-23  Martin Baulig  <martin@ximian.com>
13998
13999         * class.cs (Kind): New public enum.
14000         (TypeContainer): Made this class abstract.
14001         (TypeContainer.Kind): New public readonly field.
14002         (TypeContainer.CheckDef): New public method; moved here from
14003         cs-parser.jay.
14004         (TypeContainer.Register): New public abstract method.
14005         (TypeContainer.GetPendingImplementations): New public abstract
14006         method.
14007         (TypeContainer.GetClassBases): Removed the `is_class' and
14008         `is_iface' parameters.
14009         (TypeContainer.DefineNestedTypes): Formerly known as
14010         DoDefineType().
14011         (ClassOrStruct): Made this class abstract.
14012
14013         * tree.cs (RootTypes): New public type. 
14014
14015 2004-07-20  Martin Baulig  <martin@ximian.com>
14016
14017         * tree.cs (Tree.RecordNamespace): Removed.
14018         (Tree.Namespaces): Removed.
14019
14020         * rootcontext.cs (RootContext.IsNamespace): Removed.
14021
14022         * cs-parser.jay (namespace_declaration): Just create a new
14023         NamespaceEntry here.
14024
14025 2004-07-20  Martin Baulig  <martin@ximian.com>
14026
14027         * statement.cs (ExceptionStatement): New abstract class.  This is
14028         now used as a base class for everyone who's using `finally'.
14029         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
14030         our local variables before using them.
14031
14032         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
14033         virtual method.  This is used by Yield.Resolve() to "steal" an
14034         outer block's `finally' clauses.
14035         (FlowBranchingException): The .ctor now takes an ExceptionStatement
14036         argument.
14037
14038         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
14039         version which takes an ExceptionStatement.  This version must be
14040         used to create exception branchings.
14041
14042         * iterator.cs
14043         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
14044         (Iterator.EmitMoveNext): Added exception support; protect the
14045         block with a `fault' clause, properly handle 'finally' clauses.
14046         (Iterator.EmitDispose): Run all the `finally' clauses here.
14047
14048 2004-07-20  Martin Baulig  <martin@ximian.com>
14049
14050         * iterator.cs: This is the first of a set of changes in the
14051         iterator code.  Match the spec more closely: if we're an
14052         IEnumerable, then GetEnumerator() must be called.  The first time
14053         GetEnumerator() is called, it returns the current instance; all
14054         subsequent invocations (if any) must create a copy.
14055
14056 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
14057
14058         * expression.cs: Resolve the constant expression before returning
14059         it. 
14060
14061 2004-07-19  Martin Baulig  <martin@ximian.com>
14062
14063         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
14064         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
14065         the return type of the new EmitContext.
14066
14067 2004-07-18  Martin Baulig  <martin@ximian.com>
14068
14069         * class.cs (Property.Define): Fix iterators.
14070
14071         * iterators.cs (Iterator.Define): Moved the
14072         `container.AddInterator (this)' call here from the .ctor; only do
14073         it if we resolved successfully.
14074
14075 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
14076
14077         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
14078         `true' for preprocessing directives that we parse.  The return
14079         value indicates whether we should return to regular tokenizing or
14080         not, not whether it was parsed successfully.
14081
14082         In the past if we were in: #if false ... #line #endif, we would
14083         resume parsing after `#line'.  See bug 61604.
14084
14085         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
14086         building: IsEnumType should return true only for enums, not for
14087         enums or System.Enum itself.  This fixes #61593.
14088
14089         Likely what happened is that corlib was wrong: mcs depended on
14090         this bug in some places.  The bug got fixed, we had to add the
14091         hack, which caused bug 61593.
14092
14093         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
14094         that was a workaround for the older conditions.
14095
14096 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
14097
14098         * assign.cs: IAssignMethod has a new interface, as documented
14099         inline. All assignment code now uses this new api.
14100
14101         * ecore.cs, expression.cs: All classes which implement
14102         IAssignMethod now use the new interface.
14103
14104         * expression.cs (Invocation): add a hack to EmitCall so that
14105         IndexerAccess can be the target of a compound assignment without
14106         evaluating its arguments twice.
14107
14108         * statement.cs: Handle changes in Invocation api.
14109
14110 2004-07-16  Martin Baulig  <martin@ximian.com>
14111
14112         * iterators.cs: Rewrote this.  We're now using one single Proxy
14113         class for both the IEnumerable and the IEnumerator interface and
14114         `Iterator' derives from Class so we can use the high-level API.
14115
14116         * class.cs (TypeContainer.AddIterator): New method.
14117         (TypeContainer.DoDefineType): New protected virtual method, which
14118         is called from DefineType().
14119         (TypeContainer.DoDefineMembers): Call DefineType() and
14120         DefineMembers() on all our iterators.
14121         (TypeContainer.Emit): Call Emit() on all our iterators.
14122         (TypeContainer.CloseType): Call CloseType() on all our iterators.
14123
14124         * codegen.cs (EmitContext.CurrentIterator): New public field.
14125
14126 2004-07-15  Martin Baulig  <martin@ximian.com>
14127
14128         * typemanager.cs
14129         (TypeManager.not_supported_exception_type): New type.   
14130
14131 2004-07-14  Martin Baulig  <martin@ximian.com>
14132
14133         * iterators.cs: Use real error numbers.
14134
14135 2004-07-14  Martin Baulig  <martin@ximian.com>
14136
14137         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
14138         requires this to be a System.Collection.IEnumerable and not a
14139         class implementing that interface.
14140         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
14141
14142 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
14143
14144         * class.cs: Fixed previous fix, it broke some error tests.
14145
14146 2004-07-12  Martin Baulig  <martin@ximian.com>
14147
14148         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
14149         Fixes #61293.
14150
14151 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
14152
14153         * assign.cs (LocalTemporary): Add new argument: is_address,If
14154         `is_address' is true, then the value that we store is the address
14155         to the real value, and not the value itself.
14156         
14157         * ecore.cs (PropertyExpr): use the new local temporary
14158         stuff to allow us to handle X.Y += z (where X is a struct)
14159
14160 2004-07-08  Martin Baulig  <martin@ximian.com>
14161
14162         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
14163         not always return, just like we're doing in Using.Resolve().
14164
14165 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
14166
14167         * cs-parser.jay (fixed_statement): flag this as Pinned.
14168
14169 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
14170
14171         * typemanager.cs (TypeManager): Removed MakePinned method, this
14172         mechanism is replaced with the .NET 2.x compatible mechanism of
14173         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
14174
14175         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
14176         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
14177         `IsFixed' property which has a different meaning.
14178
14179 2004-07-02  Raja R Harinath  <rharinath@novell.com>
14180
14181         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
14182         visible from inside a nested class, not just the names of the
14183         immediately enclosing class.
14184         Fix for bug #60730.
14185
14186 2004-06-24  Raja R Harinath  <rharinath@novell.com>
14187
14188         * expression.cs (BetterConversion): Remove buggy special-case
14189         handling of "implicit constant expression conversions".  At this
14190         point, we already know that the conversion is possible -- we're
14191         only checking to see which is better.
14192
14193 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14194
14195         * cs-parser.jay: Added error CS0210 test.
14196
14197 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14198
14199         * cs-parser.jay: Added error CS0134 test.
14200
14201 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14202
14203         Fix bug #52507
14204         * cs-parser.jay: Added error CS0145 test.
14205
14206 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
14207
14208         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
14209
14210 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
14211         
14212         * expression.cs (StackAlloc.Resolve): The argument may not
14213         be a constant; deal with this case.
14214         
14215 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
14216
14217         * attribute.cs (IndexerName_GetIndexerName): Renamed to
14218         GetIndexerAttributeValue.
14219         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
14220
14221         * class.cs (Indexer.Define): Added error tests for CS0415,
14222         CS0609.
14223
14224 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
14225
14226         * attribute.cs (Attribute.Resolve): Keep field code in sync with
14227         property code.
14228
14229 2004-06-23  Martin Baulig  <martin@ximian.com>
14230
14231         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
14232         neither return nor throw, reset the barrier as well.  Fixes #60457.
14233
14234 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
14235
14236         * class.cs : EventAttributes is now set to None by default.
14237           This fixes bug #60459.
14238
14239 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
14240
14241         Fix bug #60219
14242         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14243         Don't throw exception but return null (it's sufficient now).
14244
14245 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
14246
14247         * typemanager.cs (GetArgumentTypes): Faster implementation.
14248
14249 2004-06-18  Martin Baulig  <martin@ximian.com>
14250
14251         * attribute.cs (Attribute.Resolve): Check whether we're an
14252         EmptyCast which a Constant child.  Fixes #60333.
14253
14254 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
14255
14256         * statement.cs (EmitCollectionForeach): Account for the fact that
14257         not all valuetypes are in areas which we can take the address of.
14258         For these variables, we store to a temporary variable. Also, make
14259         sure that we dont emit a `callvirt' on a valuetype method.
14260
14261 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14262
14263         * expression.cs (StackAlloc.DoReSolve): Added test for
14264         negative parameter (CS0247).
14265
14266 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14267
14268         Fix bug #59792
14269         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
14270
14271 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14272
14273         Fix bug #59781
14274         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
14275         ulong.
14276
14277 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
14278
14279         Fix bug #58254 & cs1555.cs, cs1556.cs
14280         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
14281
14282 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
14283
14284         * cs-parser.jay: Added error CS1669 test for indexers.
14285
14286 2004-06-11  Martin Baulig  <martin@ximian.com>
14287
14288         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
14289         call this twice: for params and varargs methods.
14290
14291 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14292
14293         * class.cs:
14294         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
14295
14296 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14297
14298         * attribute.cs (Attribute.GetValidTargets): Made public.
14299
14300         * class.cs: 
14301         (AbstractPropertyEventMethod): New class for better code sharing.
14302         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
14303         CS1667 report.
14304         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
14305
14306 2004-06-11  Raja R Harinath  <rharinath@novell.com>
14307
14308         Fix bug #59477.
14309         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
14310         that the call to Resolve is part of a MemberAccess.
14311         (Expression.Resolve): Use it for SimpleName resolution.
14312         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14313         Add 'intermediate' boolean argument.
14314         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
14315         error message when the SimpleName can be resolved ambiguously
14316         between an expression and a type.
14317         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14318         public.
14319         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14320         call on the left-side.
14321
14322 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14323
14324         * class.cs:
14325         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14326
14327 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14328
14329         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14330
14331 2004-06-11  Martin Baulig  <martin@ximian.com>
14332
14333         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14334         varargs methods if applicable.
14335
14336 2004-06-11  Martin Baulig  <martin@ximian.com>
14337
14338         * expression.cs (Invocation.EmitCall): Don't use
14339         `method.CallingConvention == CallingConventions.VarArgs' since the
14340         method could also have `CallingConventions.HasThis'.
14341
14342 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14343
14344         * class.cs (Event.GetSignatureForError): Implemented.
14345         Fixed crash in error test cs3010.cs
14346
14347 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
14348
14349         * cs-tokenizer.cs: Change the way we track __arglist to be
14350         consistent with the other keywords.
14351
14352 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14355         tomorrow.
14356
14357 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
14358
14359         * codegen.cs: Check that all referenced assemblies have a strongname
14360         before strongnaming the compiled assembly. If not report error CS1577.
14361         Fix bug #56563. Patch by Jackson Harper.
14362         * typemanager.cs: Added a method to return all referenced assemblies.
14363         Fix bug #56563. Patch by Jackson Harper.
14364
14365 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14366
14367         * class.cs:
14368         (Method.ApplyAttributeBuilder): Moved and added conditional
14369         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14370
14371         * delegate.cs:
14372         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14373
14374 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14375
14376         Fixed #59640
14377         * class.cs: (EventField.attribute_targets): Changed default target.
14378
14379 2004-06-08  Martin Baulig  <martin@ximian.com>
14380
14381         * expression.cs (Invocation.EmitCall): Enable varargs methods.
14382
14383 2004-06-08  Martin Baulig  <martin@ximian.com>
14384
14385         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14386
14387 2004-06-07  Martin Baulig  <martin@ximian.com>
14388
14389         Added support for varargs methods.
14390
14391         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14392         keyword.
14393
14394         * cs-parser.jay: Added support for `__arglist'.
14395
14396         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14397
14398         * expression.cs (Argument.AType): Added `ArgList'.
14399         (Invocation): Added support for varargs methods.
14400         (ArglistAccess): New public class.
14401         (Arglist): New public class.
14402
14403         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14404
14405         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
14406         a method's top-level block if the method has varargs.
14407
14408         * support.cs (ReflectionParameters, InternalParameters): Added
14409         support for varargs methods.    
14410
14411 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
14412
14413         * class.cs: Provide location in indexer error report.
14414
14415         * driver.cs: Use standard names.
14416
14417         * namespace.cs: Catch the use of using after a namespace has been
14418         declared also on using aliases.
14419
14420 2004-06-03  Raja R Harinath  <rharinath@novell.com>
14421
14422         Bug #50820.
14423         * typemanager.cs (closure_private_ok, closure_invocation_type)
14424         (closure_qualifier_type, closure_invocation_assembly)
14425         (FilterWithClosure): Move to ...
14426         (Closure): New internal nested class.
14427         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14428         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14429         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14430         (MemberLookup, MemberLookupFailed): Use it.
14431         * expression.cs (New.DoResolve): Treat the lookup for the
14432         constructor as being qualified by the 'new'ed type.
14433         (Indexers.GetIndexersForTypeOrInterface): Update.
14434
14435 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
14436
14437         * attribute.cs
14438         (GetConditionalAttributeValue): New method. Returns
14439         condition of ConditionalAttribute.
14440         (SearchMulti): New method.  Returns all attributes of type 't'.
14441         Use it when attribute is AllowMultiple = true.
14442         (IsConditionalMethodExcluded): New method.
14443
14444         * class.cs
14445         (Method.IsExcluded): Implemented. Returns true if method has conditional
14446         attribute and the conditions is not defined (method is excluded).
14447         (IMethodData): Extended interface for ConditionalAttribute support.
14448         (PropertyMethod.IsExcluded): Implemented.
14449
14450         * decl.cs
14451         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14452
14453         * expression.cs
14454         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14455         on the method.
14456
14457 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
14458
14459         * expression.cs (ArrayCreationExpression): Make this just an
14460         `expression'. It can't be a statement, so the code here was
14461         dead.
14462
14463 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14464
14465         Fixed #59072
14466         * typemanager.cs (GetFullNameSignature): New method for
14467         MethodBase types.
14468
14469 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14470
14471         Fixed #56452
14472         * class.cs (MemberBase.GetSignatureForError): New virtual method.
14473         Use this method when MethodBuilder is null.
14474         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14475         Added test for error CS0626 (MONO reports error for this situation).
14476         (IMethodData.GetSignatureForError): Extended interface.
14477
14478 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14479
14480         * attribute.cs
14481         (AttributeTester.GetObsoleteAttribute): Returns instance of
14482         ObsoleteAttribute when type is obsolete.
14483
14484         * class.cs
14485         (TypeContainer.VerifyObsoleteAttribute): Override.
14486         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14487         (MethodCode.VerifyObsoleteAttribute): Override.
14488         (MemberBase.VerifyObsoleteAttribute): Override.
14489
14490         * decl.cs
14491         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14492         and report proper error.
14493
14494         *delegate.cs
14495         Delegate.VerifyObsoleteAttribute): Override.
14496
14497         * ecore.cs
14498         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14499         and report proper error.
14500         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14501
14502         * enum.cs
14503         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14504         and enum member.
14505
14506         * expression.cs
14507         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14508         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14509         Added test for ObsoleteAttribute.
14510
14511         * statement.cs
14512         (Catch): Derived from Statement.
14513
14514 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14515  
14516         Fixed bug #59071 & cs0160.cs
14517  
14518         * statement.cs (Try.Resolve): Check here whether order of catch
14519         clauses matches their dependencies.
14520
14521 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
14522
14523         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
14524         caused a regression: #59343.  Referencing nested classes from an
14525         assembly stopped working.
14526
14527 2004-05-31  Martin Baulig  <martin@ximian.com>
14528
14529         MCS is now frozen for beta 2.
14530
14531 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14532
14533         * convert.cs: add a trivial cache for overload operator resolution.
14534
14535 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14536
14537         * decl.cs: If possible, use lookuptypedirect here. We can only do
14538         this if there is no `.' after the namespace. Avoids using
14539         LookupType, which does lots of slow processing.
14540         (FindNestedType) New method, does what it says :-).
14541         * namespace.cs: use LookupTypeDirect.
14542         * rootcontext.cs: use membercache, if possible.
14543         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14544
14545 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14546
14547         * expression.cs:
14548         According to the spec, 
14549
14550         In a member access of the form E.I, if E is a single identifier,
14551         and if the meaning of E as a simple-name (§7.5.2) is a constant,
14552         field, property, localvariable, or parameter with the same type as
14553         the meaning of E as a type-name (§3.8), then both possible
14554         meanings of E are permitted.
14555
14556         We did not check that E as a simple-name had the same type as E as
14557         a type name.
14558
14559         This trivial check gives us 5-7% on bootstrap time.
14560
14561 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14562
14563         * expression.cs (Invocation.OverloadResolve): Avoid the
14564         use of hashtables and boxing here by allocating on demand.
14565
14566 2004-05-30  Martin Baulig  <martin@ximian.com>
14567
14568         * rootcontext.cs (RootContext.LookupType): Don't cache things if
14569         we're doing a silent lookup.  Don't try to lookup nested types in
14570         TypeManager.object_type (thanks to Ben Maurer).
14571
14572 2004-05-30  Martin Baulig  <martin@ximian.com>
14573
14574         Committing a patch from Ben Maurer.
14575
14576         * rootcontext.cs (RootContext.LookupType): Cache negative results.
14577
14578 2004-05-29  Martin Baulig  <martin@ximian.com>
14579
14580         * class.cs (IMethodData.ShouldIgnore): New method.
14581
14582         * typemanager.cs (TypeManager.MethodFlags): Don't take a
14583         `Location' argument, we don't need it anywhere.  Use
14584         `IMethodData.ShouldIgnore ()' instead of
14585         `MethodData.GetMethodFlags ()'.
14586         (TypeManager.AddMethod): Removed.
14587         (TypeManager.AddMethod2): Renamed to AddMethod.
14588
14589 2004-05-29  Martin Baulig  <martin@ximian.com>
14590
14591         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14592
14593         * convert.cs (Convert.ImplicitReferenceConversion): If we're
14594         converting from a class type S to an interface type and we already
14595         have an object on the stack, don't box it again.  Fixes #52578.
14596
14597 2004-05-29  Martin Baulig  <martin@ximian.com>
14598
14599         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14600         Added support for `params' parameters.  Fixes #59267.
14601
14602 2004-05-29  Martin Baulig  <martin@ximian.com>
14603
14604         * literal.cs (NullPointer): Provide a private .ctor which sets
14605         `type' to TypeManager.object_type.  Fixes #59048.
14606
14607 2004-05-29  Martin Baulig  <martin@ximian.com>
14608
14609         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14610         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
14611
14612         * ecore.cs (EventExpr.instance_expr): Make the field private.
14613
14614 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
14615
14616         Fixed bug #50080 & cs0214-2.cs
14617         * expression.cs (Cast.DoResolve): Check unsafe context here.
14618         
14619         * statement.cs (Resolve.DoResolve): Likewise.
14620
14621 2004-05-26  Martin Baulig  <martin@ximian.com>
14622
14623         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14624
14625         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14626         (RootContext.LookupType): Pass down the `silent' flag.
14627
14628 2004-05-25  Martin Baulig  <martin@ximian.com>
14629
14630         * expression.cs
14631         (MethodGroupExpr.IdenticalTypeName): New public property.
14632         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14633         expression actually refers to a type.
14634
14635 2004-05-25  Martin Baulig  <martin@ximian.com>
14636
14637         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14638         for #56176 and made it actually work.
14639
14640 2004-05-25  Martin Baulig  <martin@ximian.com>
14641
14642         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14643         (FieldExpr, PropertyExpr): Override and implement
14644         CacheTemporaries.  Fixes #52279.
14645
14646 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
14647
14648         * location.cs: In the new compiler listing a file twice is a
14649         warning, not an error.
14650
14651 2004-05-24  Martin Baulig  <martin@ximian.com>
14652
14653         * enum.cs (Enum.DefineType): For the `BaseType' to be a
14654         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
14655
14656 2004-05-24  Martin Baulig  <martin@ximian.com>
14657
14658         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14659         walking the `using' list.  Fixes #53921.
14660
14661 2004-05-24  Martin Baulig  <martin@ximian.com>
14662
14663         * const.cs (Const.LookupConstantValue): Added support for
14664         EmptyCast's; fixes #55251.
14665
14666 2004-05-24  Martin Baulig  <martin@ximian.com>
14667
14668         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14669         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14670         which does the CS0135 check.  The reason is that we first need to
14671         check whether the variable actually exists.
14672
14673 2004-05-24  Martin Baulig  <martin@ximian.com>
14674
14675         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14676         than RootContext.LookupType() to find the explicit interface
14677         type.  Fixes #58584.
14678
14679 2004-05-24  Raja R Harinath  <rharinath@novell.com>
14680
14681         * Makefile: Simplify.  Use executable.make.
14682         * mcs.exe.sources: New file.  List of sources of mcs.exe.
14683
14684 2004-05-24  Anders Carlsson  <andersca@gnome.org>
14685
14686         * decl.cs:
14687         * enum.cs:
14688         Use the invariant culture when doing String.Compare for CLS case
14689         sensitivity.
14690         
14691 2004-05-23  Martin Baulig  <martin@ximian.com>
14692
14693         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14694         don't have any dots.  Fixes #52622, added cs0246-8.cs.
14695
14696         * namespace.cs (NamespaceEntry.Lookup): Likewise.
14697         
14698 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14699
14700         * class.cs (MemberBase.Define): Reuse MemberType member for 
14701         resolved type. Other methods can use it too.
14702
14703 2004-05-23  Martin Baulig  <martin@ximian.com>
14704
14705         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14706         the variable also exists in the current block (otherwise, we need
14707         to report a CS0103).  Fixes #58670.
14708
14709 2004-05-23  Martin Baulig  <martin@ximian.com>
14710
14711         * flowanalysis.cs (Reachability.Reachable): Compute this
14712         on-the-fly rather than storing it as a field.
14713
14714 2004-05-23  Martin Baulig  <martin@ximian.com>
14715
14716         * flowanalysis.cs (Reachability.And): Manually compute the
14717         resulting `barrier' from the reachability.      
14718        
14719 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14720
14721         Fix bug #57835
14722         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14723         instance of ObsoleteAttribute when symbol is obsolete.
14724
14725         * class.cs
14726         (IMethodData): Extended interface for ObsoleteAttribute support.
14727
14728 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14729
14730         * attribute.cs: Fix bug #55970
14731
14732 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14733
14734         Fix bug #52705
14735         * attribute.cs
14736         (GetObsoleteAttribute): New method. Creates the instance of
14737         ObsoleteAttribute.
14738         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14739         ObsoleteAttribute when member is obsolete.
14740         (AttributeTester.Report_ObsoleteMessage): Common method for
14741         Obsolete error/warning reporting.
14742
14743         * class.cs
14744         (TypeContainer.base_classs_type): New member for storing parent type.
14745
14746         * decl.cs
14747         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14748         for this MemberCore.
14749
14750 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14751
14752         * attribute.cs, const.cs: Fix bug #58590
14753
14754 2004-05-21  Martin Baulig  <martin@ximian.com>
14755
14756         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14757         out parameters if the end of the method is unreachable.  Fixes
14758         #58098. 
14759
14760 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14761
14762         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14763         Hari was right, why extra method.
14764
14765 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14766
14767         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14768
14769 2004-05-20  Martin Baulig  <martin@ximian.com>
14770
14771         Merged this back from gmcs to keep the differences to a minumum.
14772
14773         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14774         instead of a Declspace.
14775         (Attribute.ResolveType): Likewise.
14776         (Attributes.Search): Likewise.
14777         (Attributes.Contains): Likewise.
14778         (Attributes.GetClsCompliantAttribute): Likewise.
14779
14780         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14781         argument.
14782         (MethodData.ApplyAttributes): Take an EmitContext instead of a
14783         DeclSpace.
14784
14785 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
14786
14787         Fix bug #58688 (MCS does not report error when the same attribute
14788         is assigned twice)
14789
14790         * attribute.cs (Attribute.Emit): Distinction between null and default.
14791
14792 2004-05-19  Raja R Harinath  <rharinath@novell.com>
14793
14794         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14795         of a top-level attribute without an attribute target.
14796         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
14797         Make non-static.
14798         (Attribute.Conditional_GetConditionName), 
14799         (Attribute.Obsolete_GetObsoleteMessage): Update.
14800         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
14801         part of ScanForIndexerName.
14802         (Attribute.CanIgnoreInvalidAttribute): New function.
14803         (Attribute.ScanForIndexerName): Move to ...
14804         (Attributes.ScanForIndexerName): ... here.
14805         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14806         (Attributes.Search): New internal variant that can choose not to
14807         complain if types aren't resolved.  The original signature now
14808         complains.
14809         (Attributes.GetClsCompliantAttribute): Use internal variant, with
14810         complaints suppressed.
14811         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14812         only if it not useful.
14813         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14814         top-level for attributes that are shared between the assembly
14815         and a top-level class.
14816         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14817         * class.cs: Update to reflect changes.
14818         (DefineIndexers): Fuse loops.
14819         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
14820         a couple more variants of attribute names.
14821
14822 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
14823
14824         Fix bug #52585 (Implemented explicit attribute declaration)
14825
14826         * attribute.cs:
14827         (Attributable.ValidAttributeTargets): New abstract method. It gets
14828         list of valid attribute targets for explicit target declaration.
14829         (Attribute.Target): It holds target itself.
14830         (AttributeSection): Removed.
14831         (Attribute.CheckTargets): New method. It checks whether attribute
14832         target is valid for the current element.
14833
14834         * class.cs:
14835         (EventProperty): New class. For events that are declared like
14836         property (with add and remove accessors).
14837         (EventField): New class. For events that are declared like field.
14838         class.cs
14839
14840         * cs-parser.jay: Implemented explicit attribute target declaration.
14841
14842         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
14843         Override ValidAttributeTargets.
14844
14845         * parameter.cs:
14846         (ReturnParameter): Class for applying custom attributes on 
14847         the return type.
14848         (ParameterAtribute): New class. Class for applying custom
14849         attributes on the parameter type.
14850
14851 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
14852
14853         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14854         definitions. 
14855
14856         (Method): Allow UNSAFE here.
14857
14858         * modifiers.cs: Support unsafe reporting.
14859
14860 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
14861
14862         * decl.cs: Fix bug #58478.
14863
14864 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14865
14866         * statement.cs: When checking for unreachable code on an EmptyStatement,
14867         set the location. Fixes bug #58488.
14868
14869 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
14870
14871         * driver.cs: Add -pkg handling.
14872
14873         From Gonzalo: UseShelLExecute=false
14874
14875 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
14876
14877         * attribute.cs:
14878         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14879         for attribute.
14880         (Attribute.IsClsCompliaceRequired): Moved to base for better
14881         accesibility.
14882         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14883         when attribute is AttributeUsageAttribute.
14884         (Attribute.GetValidTargets): Simplified.
14885         (Attribute.GetAttributeUsage): New method returns AttributeUsage
14886         attribute for this type.
14887         (Attribute.ApplyAttributes): Method renamed to Emit and make
14888         non-static.
14889         (GlobalAttributeSection): New class for special handling of global
14890         attributes (assembly, module).
14891         (AttributeSection.Emit): New method.
14892
14893         * class.cs: Implemented Attributable abstract methods.
14894         (MethodCore.LabelParameters): Moved to Parameter class.
14895         (Accessor): Is back simple class.
14896         (PropertyMethod): Implemented Attributable abstract class.
14897         (DelegateMethod): Implemented Attributable abstract class.
14898         (Event): New constructor for disctintion between normal Event
14899         and Event with accessors.
14900
14901         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14902
14903         * codegen.cs, const.cs, decl.cs, delegate.cs:
14904         (CommonAssemblyModulClass): Implemented Attributable abstract class
14905         and simplified.
14906
14907         * enum.cs: Implement IAttributeSupport interface.
14908         (EnumMember): New class for emum members. Implemented Attributable
14909         abstract class
14910
14911         * parameter.cs:
14912         (ParameterBase): Is abstract.
14913         (ReturnParameter): New class for easier [return:] attribute handling.
14914
14915         * typemanager.cs: Removed builder_to_attr.
14916
14917 2004-05-11  Raja R Harinath  <rharinath@novell.com>
14918
14919         Fix bug #57151.
14920         * attribute.cs (Attribute.GetPositionalValue): New function.
14921         * class.cs (TypeContainer.VerifyMembers): New function.
14922         (TypeContainer.Emit): Use it.
14923         (ClassOrStruct): New base class for Class and Struct.
14924         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
14925         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14926         class.
14927         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14928         then each non-static field should have a FieldOffset attribute.
14929         Otherwise, none of the fields should have a FieldOffset attribute.
14930         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
14931         and FieldOffset attributes.
14932         * typemanager.cs (TypeManager.struct_layout_attribute_type)
14933         (TypeManager.field_offset_attribute_type): New core types.
14934         (TypeManager.InitCoreTypes): Initialize them.
14935
14936 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
14937
14938         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14939         Return correct type.
14940         From bug #58270.
14941
14942 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
14943
14944         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14945         be implicitly converted to ulong.
14946         
14947         * expression.cs: The logic for allowing operator &, | and ^ worked
14948         was wrong, it worked before because we did not report an error in
14949         an else branch.  Fixes 57895.
14950
14951         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14952         allow volatile fields to be reference types.
14953
14954 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
14955
14956         * driver.cs: Add support for /debug-
14957
14958 2004-05-07  Raja R Harinath  <rharinath@novell.com>
14959
14960         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
14961         Add a 'complain' parameter to silence errors.
14962         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
14963         silently overlooked type-resolutions.
14964         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14965         to reflect changes.
14966         (Attributes.Search): New function.
14967         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14968         (Attributes.GetAttributeFullName): Remove hack.
14969         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
14970         Update to reflect changes.
14971         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14972         Use Attributes.Search instead of nested loops.
14973
14974 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
14975
14976         * decl.cs:
14977         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14978         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14979         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14980
14981         * report.cs: (Report.Warning): Renamed to Warning_T because of
14982         parameter collision.
14983
14984 2004-05-05  Raja R Harinath  <rharinath@novell.com>
14985
14986         * expression.cs (MemberAccess.ResolveMemberAccess):
14987         Exit with non-zero status after Report.Error.
14988         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
14989         Likewise.
14990         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
14991
14992 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
14993
14994         * support.cs: Don't hang when the file is empty.
14995
14996 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
14997
14998         * support.cs: In SeekableStreamReader, compute the preamble size of the
14999           underlying stream. Position changes should take into account that initial
15000           count of bytes.
15001
15002 2004-05-03  Todd Berman  <tberman@sevenl.net>
15003
15004         * driver.cs: remove unused GetSysVersion function.
15005
15006 2004-05-03  Todd Berman  <tberman@sevenl.net>
15007
15008         * driver.cs: Remove the hack from saturday, as well as the hack
15009         from jackson (LoadAssemblyFromGac), also adds the CWD to the
15010         link_paths to get that bit proper.
15011
15012 2004-05-01  Todd Berman  <tberman@sevenl.net>
15013
15014         * driver.cs: Try a LoadFrom before a Load, this checks the current
15015         path. This is currently a bug in mono that is be fixed, however, this
15016         provides a workaround for now. This will be removed when the bug
15017         is fixed.
15018
15019 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
15020
15021         * CryptoConvert.cs: Updated to latest version. Fix issue with 
15022         incomplete key pairs (#57941).
15023
15024 2004-05-01  Todd Berman  <tberman@sevenl.net>
15025
15026         * driver.cs: Remove '.' from path_chars, now System.* loads properly
15027         from the GAC
15028
15029 2004-04-30  Jackson Harper  <jackson@ximian.com>
15030
15031         * codegen.cs: Open keys readonly.
15032         
15033 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15034
15035         * typemanager.cs: don't report cyclic struct layout when a struct
15036         contains 2 or more fields of the same type. Failed for Pango.AttrShape
15037         which has 2 Pango.Rectangle fields.
15038
15039 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15040
15041         * expression.cs: Handle IntPtr comparisons with IL code
15042         rather than a method call.
15043
15044 2004-04-29  Martin Baulig  <martin@ximian.com>
15045
15046         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
15047         the list of PropertyInfo's in class hierarchy and find the
15048         accessor.  Fixes #56013.
15049
15050 2004-04-29  Martin Baulig  <martin@ximian.com>
15051
15052         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
15053
15054 2004-04-29  Martin Baulig  <martin@ximian.com>
15055
15056         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15057
15058         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
15059
15060 2004-04-29  Martin Baulig  <martin@ximian.com>
15061
15062         * class.cs (ConstructorInitializer.Resolve): Check whether the
15063         parent .ctor is accessible.  Fixes #52146.
15064
15065 2004-04-29  Martin Baulig  <martin@ximian.com>
15066
15067         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
15068
15069         * statement.cs (Using.EmitLocalVariableDecls): Use
15070         TypeManager.idisposable_type, not typeof (IDisposable).
15071         (Foreach.EmitCollectionForeach): Added support for valuetypes.
15072
15073 2004-04-29  Martin Baulig  <martin@ximian.com>
15074
15075         * class.cs (Event.Define): Don't emit the field and don't set
15076         RTSpecialName and SpecialName for events on interfaces.  Fixes
15077         #57703. 
15078
15079 2004-04-29  Raja R Harinath  <rharinath@novell.com>
15080
15081         Refactor Attribute.ApplyAttributes.
15082         * attribute.cs (Attributable): New base class for objects that can
15083         have Attributes applied on them.
15084         (Attribute): Make AttributeUsage fields public.
15085         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
15086         (Attribute.IsInternalCall): New property.
15087         (Attribute.UsageAttr): Convert to a public read-only property.
15088         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
15089         (Attribute.ResolveType, Attribute.Resolve)
15090         (Attribute.ScanForIndexerName): Update to reflect changes.
15091         (Attribute.CheckAttributeTarget): Re-format.
15092         (Attribute.ApplyAttributes): Refactor, to various
15093         Attributable.ApplyAttributeBuilder methods.
15094         * decl.cs (MemberCore): Make Attributable.
15095         * class.cs (Accessor): Make Attributable.
15096         (MethodData.ApplyAttributes): Use proper attribute types, not
15097         attribute names.
15098         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
15099         (TypeContainer.ApplyAttributeBuilder)
15100         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
15101         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
15102         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
15103         (Operator.ApplyAttributeBuilder): New factored-out methods.
15104         * const.cs (Const.ApplyAttributeBuilder): Likewise.
15105         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
15106         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
15107         * parameter.cs (ParameterBase): New Attributable base class
15108         that can also represent Return types.
15109         (Parameter): Update to the changes.
15110
15111 2004-04-29  Jackson Harper  <jackson@ximian.com>
15112
15113         * driver.cs: Prefer the corlib system version when looking for
15114         assemblies in the GAC. This is still a hack, but its a better hack
15115         now.
15116         
15117 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
15118
15119         * decl.cs, enum.cs: Improved error 3005 reporting.
15120   
15121         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
15122         (related_symbols): New private member for list of symbols
15123         related to reported error/warning.
15124         
15125         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
15126
15127 2004-04-29  Martin Baulig  <martin@ximian.com>
15128
15129         * ecore.cs (Expression.Constantify): If we're an enum and
15130         TypeManager.TypeToCoreType() doesn't give us another type, use
15131         t.UnderlyingSystemType.  Fixes #56178.  
15132
15133 2004-04-29  Martin Baulig  <martin@ximian.com>
15134
15135         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
15136         interfaces and for each interface, only add members directly
15137         declared in that interface.  Fixes #53255.
15138
15139 2004-04-28  Martin Baulig  <martin@ximian.com>
15140
15141         * expression.cs (ConditionalLogicalOperator): Use a temporary
15142         variable for `left' to avoid that we evaluate it more than once;
15143         bug #52588.
15144
15145 2004-04-28  Martin Baulig  <martin@ximian.com>
15146
15147         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
15148         `void[]' (CS1547).
15149
15150 2004-04-28  Martin Baulig  <martin@ximian.com>
15151
15152         * statement.cs (LocalInfo.Resolve): Check whether the type is not
15153         void (CS1547).
15154
15155         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
15156         whether the type is not void (CS1547).
15157
15158 2004-04-28  Martin Baulig  <martin@ximian.com>
15159
15160         * expression.cs (Unary.DoResolveLValue): Override this and report
15161         CS0131 for anything but Operator.Indirection.
15162
15163 2004-04-28  Martin Baulig  <martin@ximian.com>
15164
15165         Committing a patch from Ben Maurer; see bug #50820.
15166
15167         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15168         check for classes.
15169
15170         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15171         classes.        
15172
15173 2004-04-28  Martin Baulig  <martin@ximian.com>
15174
15175         Committing a patch from Ben Maurer; see bug #50820.
15176
15177         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
15178         check for classes.
15179
15180         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
15181         classes.        
15182
15183 2004-04-28  Martin Baulig  <martin@ximian.com>
15184
15185         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
15186         (Block.AddLabel): Call DoLookupLabel() to only search in the
15187         current block.
15188
15189 2004-04-28  Martin Baulig  <martin@ximian.com>
15190
15191         * cfold.cs (ConstantFold.BinaryFold): Added special support for
15192         comparing StringConstants and NullLiterals in Equality and Inequality.
15193
15194 2004-04-28  Jackson Harper  <jackson@ximian.com>
15195
15196         * driver.cs: Attempt to load referenced assemblies from the
15197         GAC. This is the quick and dirty version of this method that
15198         doesnt take into account versions and just takes the first
15199         canidate found. Will be good enough for now as we will not have more
15200         then one version installed into the GAC until I update this method.
15201
15202 2004-04-28  Martin Baulig  <martin@ximian.com>
15203
15204         * typemanager.cs (TypeManager.CheckStructCycles): New public
15205         static method to check for cycles in the struct layout.
15206
15207         * rootcontext.cs (RootContext.PopulateTypes): Call
15208         TypeManager.CheckStructCycles() for each TypeContainer.
15209         [Note: We only need to visit each type once.]
15210
15211 2004-04-28  Martin Baulig  <martin@ximian.com>
15212
15213         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
15214
15215         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
15216         success and added `out object value'.  Use a `bool resolved' field
15217         to check whether we've already been called rather than
15218         `ConstantValue != null' since this breaks for NullLiterals.
15219
15220 2004-04-28  Raja R Harinath  <rharinath@novell.com>
15221
15222         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
15223         setting of this flag, since the 'set' method may be non-public.
15224
15225 2004-04-28  Raja R Harinath  <rharinath@novell.com>
15226
15227         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
15228         check on current_vector.Block.
15229
15230 2004-04-27  Martin Baulig  <martin@ximian.com>
15231
15232         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
15233         a field initializer.  Fixes #56459.
15234
15235 2004-04-27  Martin Baulig  <martin@ximian.com>
15236
15237         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
15238         we're not attempting to use an indexer.  Fixes #52154.
15239
15240 2004-04-27  Martin Baulig  <martin@ximian.com>
15241
15242         * statement.cs (Return): Don't create a return label if we don't
15243         need it; reverts my change from January 20th.  Thanks to Ben
15244         Maurer for this.
15245
15246 2004-04-27  Martin Baulig  <martin@ximian.com>
15247
15248         According to the spec, `goto' can only leave a nested scope, but
15249         never enter it.
15250
15251         * statement.cs (Block.LookupLabel): Only lookup in the current
15252         block, don't recurse into parent or child blocks.
15253         (Block.AddLabel): Check in parent and child blocks, report
15254         CS0140/CS0158 if we find a duplicate.
15255         (Block): Removed this indexer for label lookups.
15256         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
15257         this already does the error reporting for us.
15258
15259         * flowanalysis.cs
15260         (FlowBranching.UsageVector.Block): New public variable; may be null.
15261         (FlowBranching.CreateSibling): Added `Block' argument.
15262         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
15263         label for the target of a `goto' and check whether we're not
15264         leaving a `finally'.
15265
15266 2004-04-27  Martin Baulig  <martin@ximian.com>
15267
15268         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15269         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
15270         just for returns).
15271
15272 2004-04-27  Martin Baulig  <martin@ximian.com>
15273
15274         * statement.cs (Block.AddLabel): Also check for implicit blocks
15275         and added a CS0158 check.
15276
15277 2004-04-27  Martin Baulig  <martin@ximian.com>
15278
15279         * flowanalysis.cs (FlowBranchingLoop): New class.
15280         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
15281         UsageVector's instead of an ArrayList.
15282         (FlowBranching.Label): Likewise.
15283         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
15284         (FlowBranching.AddBreakVector): New method.
15285
15286 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
15287
15288         * attribute.cs: Small regression fix: only convert the type if we
15289         the type is different, fixes System.Drawing build.
15290
15291 2004-04-27  Martin Baulig  <martin@ximian.com>
15292
15293         * attribute.cs (Attribute.Resolve): If we have a constant value
15294         for a named field or property, implicity convert it to the correct
15295         type.
15296
15297 2004-04-27  Raja R Harinath  <rharinath@novell.com>
15298
15299         * statement.cs (Block.Block): Implicit blocks share
15300         'child_variable_names' fields with parent blocks.
15301         (Block.AddChildVariableNames): Remove.
15302         (Block.AddVariable): Mark variable as "used by a child block" in
15303         every surrounding block.
15304         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
15305         been used in a child block, complain about violation of "Invariant
15306         meaning in blocks" rule.
15307         * cs-parser.jay (declare_local_variables): Don't use
15308         AddChildVariableNames.
15309         (foreach_statement): Don't create an implicit block: 'foreach'
15310         introduces a scope.
15311
15312 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
15313
15314         * convert.cs (ImplicitNumericConversion): 0 is also positive when
15315         converting from 0L to ulong.  Fixes 57522.
15316
15317 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15318
15319         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15320         derived class hides via 'new' keyword field from base class (test-242.cs).
15321         TODO: Handle this in the more general way.
15322         
15323         * class.cs (CheckBase): Ditto.
15324
15325 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15326
15327         * decl.cs (caching_flags): New member for storing cached values
15328         as bit flags.
15329         (MemberCore.Flags): New enum where bit flags for caching_flags
15330         are defined.
15331         (MemberCore.cls_compliance): Moved to caching_flags.
15332         (DeclSpace.Created): Moved to caching_flags.
15333
15334         * class.cs: Use caching_flags instead of DeclSpace.Created
15335         
15336 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
15337
15338         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15339         if we are only a derived class, not a nested class.
15340
15341         * typemanager.cs: Same as above, but do this at the MemberLookup
15342         level (used by field and methods, properties are handled in
15343         PropertyExpr).   Allow for the qualified access if we are a nested
15344         method. 
15345
15346 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
15347
15348         * class.cs: Refactoring.
15349         (IMethodData): New inteface; Holds links to parent members
15350         to avoid member duplication (reduced memory allocation).
15351         (Method): Implemented IMethodData interface.
15352         (PropertyBase): New inner classes for get/set methods.
15353         (PropertyBase.PropertyMethod): Implemented IMethodData interface
15354         (Event): New inner classes for add/remove methods.
15355         (Event.DelegateMethod): Implemented IMethodData interface.
15356
15357         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15358         EmitContext (related to class.cs refactoring).
15359
15360 2004-04-21  Raja R Harinath  <rharinath@novell.com>
15361
15362         * delegate.cs (Delegate.VerifyApplicability): If the number of
15363         arguments are the same as the number of parameters, first try to
15364         verify applicability ignoring  any 'params' modifier on the last
15365         parameter.
15366         Fixes #56442.
15367
15368 2004-04-16  Raja R Harinath  <rharinath@novell.com>
15369
15370         * class.cs (TypeContainer.AddIndexer): Use
15371         'ExplicitInterfaceName' to determine if interface name was
15372         explicitly specified.  'InterfaceType' is not initialized at this time.
15373         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
15374         Indexers array is already in the required order.  Initialize
15375         'IndexerName' only if there are normal indexers.
15376         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15377         (TypeContainer.Emit): Emit DefaultMember attribute only if
15378         IndexerName is initialized.
15379         Fixes #56300.
15380
15381 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
15382
15383         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15384         Fixes #57007
15385
15386 2004-04-15  Raja R Harinath  <rharinath@novell.com>
15387
15388         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15389         attributes.
15390         Fix for #56456.
15391
15392         * attribute.cs (Attribute.Resolve): Check for duplicate named
15393         attributes.
15394         Fix for #56463.
15395
15396 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
15397
15398         * iterators.cs (MarkYield): track whether we are in an exception,
15399         and generate code accordingly.  Use a temporary value to store the
15400         result for our state.
15401
15402         I had ignored a bit the interaction of try/catch with iterators
15403         since their behavior was not entirely obvious, but now it is
15404         possible to verify that our behavior is the same as MS .NET 2.0
15405
15406         Fixes 54814
15407
15408 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
15409
15410         * iterators.cs: Avoid creating temporaries if there is no work to
15411         do. 
15412
15413         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15414         Enumerations, use TypeManager.EnumToUnderlying and call
15415         recursively. 
15416
15417         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15418         bug #57013
15419
15420         (This.Emit): Use EmitContext.EmitThis to emit our
15421         instance variable.
15422
15423         (This.EmitAssign): Ditto.
15424
15425         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15426         codepaths, we will move all the functionality into
15427         Mono.CSharp.This 
15428
15429         (FieldExpr.EmitAssign): Ditto.
15430
15431         This fixes several hidden bugs that I uncovered while doing a code
15432         review of this today.
15433
15434         * codegen.cs (EmitThis): reworked so the semantics are more clear
15435         and also support value types "this" instances.
15436
15437         * iterators.cs: Changed so that for iterators in value types, we
15438         do not pass the value type as a parameter.  
15439
15440         Initialization of the enumerator helpers is now done in the caller
15441         instead of passing the parameters to the constructors and having
15442         the constructor set the fields.
15443
15444         The fields have now `assembly' visibility instead of private.
15445
15446 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
15447
15448         * expression.cs (Argument.Resolve): Check if fields passed as ref
15449         or out are contained in a MarshalByRefObject.
15450
15451         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15452         another compiler type.
15453
15454 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15455
15456         * class.cs (Indexer.Define): use the new name checking method.
15457         Also, return false on an error.
15458         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15459         (is_identifier_[start/part]_character): make static.
15460
15461 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
15462
15463         * expression.cs (Binary.ResolveOperator): Do no append strings
15464         twice: since we can be invoked more than once (array evaluation)
15465         on the same concatenation, take care of this here.  Based on a fix
15466         from Ben (bug #56454)
15467
15468 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
15469
15470         * codegen.cs: Fix another case where CS1548 must be reported (when 
15471         delay-sign isn't specified and no private is available #56564). Fix
15472         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
15473         error when MCS is used on the MS runtime and we need to delay-sign 
15474         (which seems unsupported by AssemblyBuilder - see #56621).
15475
15476 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
15477
15478         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15479         (TypeManager.ComputeNamespaces): Faster implementation for
15480         Microsoft runtime.
15481
15482         * compiler.csproj: Updated AssemblyName to mcs.
15483
15484 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
15485
15486         * rootcontext.cs: Add new types to the boot resolution.
15487
15488         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15489         MulticastDelegate is not allowed.
15490
15491         * typemanager.cs: Add new types to lookup: System.TypedReference
15492         and ArgIterator.
15493
15494         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15495         check for TypedReference or ArgIterator, they are not allowed. 
15496
15497         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15498         makes us properly catch 1510 in some conditions (see bug 56016 for
15499         details). 
15500
15501 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
15502
15503         * CryptoConvert.cs: update from corlib version
15504         with endian fixes.
15505
15506 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
15507
15508         * class.cs (Indexer.Define): Check indexername declaration
15509
15510 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
15511
15512         * attribute.cs (IsClsCompliant): Fixed problem with handling
15513         all three states (compliant, not-compliant, undetected).
15514
15515 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
15516
15517         * attribute.cs (Attribute): Location is now public.
15518         (Resolve): Store resolved arguments (pos_values) in attribute class.
15519         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15520         (GetClsCompliantAttributeValue): New method that gets
15521         CLSCompliantAttribute value.
15522         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15523         if exists else null.
15524         (AttributeTester): New class for CLS-Compliant verification routines.
15525
15526         * class.cs (Emit): Add CLS-Compliant verification.
15527         (Method.GetSignatureForError): Implemented.
15528         (Constructor.GetSignatureForError): Implemented
15529         (Constructor.HasCompliantArgs): Returns if constructor has
15530         CLS-Compliant arguments.
15531         (Constructor.Emit): Override.
15532         (Construcor.IsIdentifierClsCompliant): New method; For constructors
15533         is needed to test only parameters.
15534         (FieldBase.GetSignatureForError): Implemented.
15535         (TypeContainer): New member for storing base interfaces.
15536         (TypeContainer.FindMembers): Search in base interfaces too.
15537
15538         * codegen.cs (GetClsComplianceAttribute): New method that gets
15539         assembly or module CLSCompliantAttribute value.
15540         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15541         for assembly.
15542         (ModuleClass.Emit): Add error 3012 test.
15543
15544         * const.cs (Emit): Override and call base for CLS-Compliant tests.
15545
15546         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15547         state for all decl types.
15548         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15549         if CLS-Compliant tests are required.
15550         (IsClsCompliaceRequired): New method. Analyze whether code
15551         must be CLS-Compliant.
15552         (IsExposedFromAssembly): New method. Returns true when MemberCore
15553         is exposed from assembly.
15554         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15555         value or gets cached value.
15556         (HasClsCompliantAttribute): New method. Returns true if MemberCore
15557         is explicitly marked with CLSCompliantAttribute.
15558         (IsIdentifierClsCompliant): New abstract method. This method is
15559         used to testing error 3005.
15560         (IsIdentifierAndParamClsCompliant): New method. Common helper method
15561         for identifier and parameters CLS-Compliant testing.
15562         (VerifyClsCompliance): New method. The main virtual method for
15563         CLS-Compliant verifications.
15564         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15565         null. I don't know why is null (too many public members !).
15566         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15567         and get value of first CLSCompliantAttribute that found.
15568
15569         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15570         (VerifyClsCompliance): Override and add extra tests.
15571
15572         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15573         clscheck- disable CLS-Compliant verification event if assembly is has
15574         CLSCompliantAttribute(true).
15575
15576         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15577         ApllyAttribute is now called in emit section as in the other cases.
15578         Possible future Emit integration.
15579         (IsIdentifierClsCompliant): New override.
15580         (VerifyClsCompliance): New override.
15581         (GetEnumeratorName): Returns full enum name.
15582
15583         * parameter.cs (GetSignatureForError): Implemented.
15584
15585         * report.cs (WarningData): New struct for Warning message information.
15586         (LocationOfPreviousError): New method.
15587         (Warning): New method. Reports warning based on the warning table.
15588         (Error_T): New method. Reports error based on the error table.
15589
15590         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15591         verifications are done here.
15592
15593         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15594
15595         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15596         CLSCompliantAttribute.
15597         (all_imported_types): New member holds all imported types from other
15598         assemblies.
15599         (LoadAllImportedTypes): New method fills static table with exported types
15600         from all referenced assemblies.
15601         (Modules): New property returns all assembly modules.
15602
15603 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
15604
15605         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15606         throwing a parser error.
15607
15608         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15609         which removes the hardcoded get_/set_ prefixes for properties, as
15610         IL allows for the properties to be named something else.  
15611
15612         Bug #56013
15613
15614         * expression.cs: Do not override operand before we know if it is
15615         non-null.  Fix 56207
15616
15617 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15618
15619         * typemanager.cs: support for pinned variables.
15620
15621 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15622
15623         * decl.cs, typemanager.cs: Avoid using an arraylist
15624         as a buffer if there is only one result set.
15625
15626 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15627
15628         * expression.cs: Make sure you cant call a static method
15629         with an instance expression, bug #56174.
15630
15631 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
15632
15633         * class.cs (IsDuplicateImplementation): Improve error reporting to
15634         flag 663 (method only differs in parameter modifier).
15635
15636         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15637         in preprocessor directives.
15638
15639         * location.cs (LookupFile): Allow for the empty path.
15640
15641         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
15642         better approach for some of that patch, but its failing with the
15643         CharSet enumeration.  For now try/catch will do.
15644
15645         * typemanager.cs: Do not crash if a struct does not have fields.
15646         Fixes 56150.
15647
15648 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15649
15650         * expression.cs: cs0213, cant fix a fixed expression.
15651         fixes 50231.
15652
15653 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15654
15655         * cs-parser.jay: detect invalid embeded statements gracefully.
15656         bug #51113.
15657
15658 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15659
15660         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15661         As a regex:
15662         s/
15663         the invocation type may not be a subclass of the tye of the item/
15664         The type of the item must be a subclass of the invocation item.
15665         /g
15666
15667         Fixes bug #50820.
15668
15669 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
15670
15671         * attribute.cs: Added methods to get a string and a bool from an
15672         attribute. Required to information from AssemblyKeyFileAttribute,
15673         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15674         * codegen.cs: Modified AssemblyName creation to include support for
15675         strongnames. Catch additional exceptions to report them as CS1548.
15676         * compiler.csproj: Updated include CryptoConvert.cs.
15677         * compiler.csproj.user: Removed file - user specific configuration.
15678         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
15679         Mono.Security assembly. The original class is maintained and tested in
15680         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15681         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15682         like CSC 8.0 (C# v2) supports.
15683         * Makefile: Added CryptoConvert.cs to mcs sources.
15684         * rootcontext.cs: Added new options for strongnames.
15685
15686 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
15687
15688         * driver.cs: For --expect-error, report error code `2'
15689         if the program compiled with no errors, error code `1' if
15690         it compiled with an error other than the one expected.
15691
15692 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
15693
15694         * compiler.csproj: Updated for Visual Studio .NET 2003.
15695         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15696         * compiler.sln: Updated for Visual Studio .NET 2003.
15697
15698 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
15699
15700         * expression.cs: Fix bug #47234. We basically need to apply the
15701         rule that we prefer the conversion of null to a reference type
15702         when faced with a conversion to 'object' (csc behaviour).
15703
15704 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15705
15706         * statement.cs: Shorter form for foreach, eliminates
15707         a local variable. r=Martin.
15708
15709 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15710
15711         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15712         checks if we can use brtrue/brfalse to test for 0.
15713         * expression.cs: use the above in the test for using brtrue/brfalse.
15714         cleanup code a bit.
15715
15716 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15717
15718         * expression.cs: Rewrite string concat stuff. Benefits:
15719
15720         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15721         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15722         rather than a concat chain.
15723
15724         * typemanager.cs: Add lookups for more concat overloads.
15725
15726 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15727
15728         * expression.cs: Emit shorter il code for array init.
15729
15730         newarr
15731         dup
15732         // set 1
15733
15734         // set 2
15735
15736         newarr
15737         stloc.x
15738
15739         ldloc.x
15740         // set 1
15741
15742         ldloc.x
15743         // set 2
15744
15745 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
15746
15747         * statement.cs: Before, two switch blocks would be merged if the
15748         total size of the blocks (end_item - begin_item + 1) was less than
15749         two times the combined sizes of the blocks.
15750
15751         Now, it will only merge if after the merge at least half of the
15752         slots are filled.
15753
15754         fixes 55885.
15755
15756 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
15757
15758         * class.cs : csc build fix for GetMethods(). See bug #52503.
15759
15760 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
15761
15762         * expression.cs: Make sure fp comparisons work with NaN.
15763         This fixes bug #54303. Mig approved this patch a long
15764         time ago, but we were not able to test b/c the runtime
15765         had a related bug.
15766
15767 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
15768
15769         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
15770
15771 2004-03-19  Martin Baulig  <martin@ximian.com>
15772
15773         * class.cs (MemberCore.IsDuplicateImplementation): Report the
15774         error here and not in our caller.
15775
15776 2004-03-19  Martin Baulig  <martin@ximian.com>
15777
15778         * interface.cs: Completely killed this file.
15779         (Interface): We're now a TypeContainer and live in class.cs.
15780
15781         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15782         argument; we're now also called for interfaces.
15783         (TypeContainer.DefineMembers): Allow this method being called
15784         multiple times.
15785         (TypeContainer.GetMethods): New public method; formerly known as
15786         Interface.GetMethod().  This is used by PendingImplementation.
15787         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15788         it's now private and non-static.
15789         (Interface): Moved this here; it's now implemented similar to
15790         Class and Struct.
15791         (Method, Property, Event, Indexer): Added `bool is_interface'
15792         argument to their .ctor's.
15793         (MemberBase.IsInterface): New public field.
15794
15795         * cs-parser.jay: Create normal Method, Property, Event, Indexer
15796         instances instead of InterfaceMethod, InterfaceProperty, etc.
15797         (opt_interface_base): Removed; we now use `opt_class_base' instead.
15798         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15799
15800 2004-03-19  Martin Baulig  <martin@ximian.com>
15801
15802         * class.cs (MethodCore.IsDuplicateImplementation): New private
15803         method which does the CS0111 checking.
15804         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15805         Use IsDuplicateImplementation().
15806
15807 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
15808
15809         * decl.cs (FindMemberToOverride): New method to find the correct
15810         method or property to override in the base class.
15811         * class.cs
15812             - Make Method/Property use the above method to find the
15813               version in the base class.
15814             - Remove the InheritableMemberSignatureCompare as it is now
15815               dead code.
15816
15817         This patch makes large code bases much faster to compile, as it is
15818         O(n) rather than O(n^2) to do this validation.
15819
15820         Also, it fixes bug 52458 which is that nested classes are not
15821         taken into account when finding the base class member.
15822
15823         Reviewed/Approved by Martin.
15824
15825 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
15826
15827         * interface.cs: In all interface classes removed redundant
15828         member initialization.
15829
15830 2004-03-16  Martin Baulig  <martin@ximian.com>
15831
15832         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15833
15834 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
15835
15836         * decl.cs (DefineTypeAndParents): New helper method to define a
15837         type's containers before the type itself is defined;  This is a
15838         bug exposed by the recent changes to Windows.Forms when an
15839         implemented interface was defined inside a class that had not been
15840         built yet.   
15841
15842         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15843
15844         (Check): Loop correctly to report errors modifiers
15845         (UNSAFE was not in the loop, since it was the same as TOP).
15846
15847         * interface.cs: Every interface member now takes a ModFlags,
15848         instead of a "is_new" bool, which we set on the base MemberCore. 
15849
15850         Every place where we called "UnsafeOk" in the interface, now we
15851         call the proper member (InterfaceMethod.UnsafeOK) instead to get
15852         the unsafe settings from the member declaration instead of the
15853         container interface. 
15854
15855         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
15856
15857         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15858         `set_indexer_name' to the pending bits (one per type).
15859
15860         We fixed a bug today that was picking the wrong method to
15861         override, since for properties the existing InterfaceMethod code
15862         basically ignored the method name.  Now we make sure that the
15863         method name is one of the valid indexer names.
15864
15865 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
15866  
15867         * support.cs (SeekableStreamReader): Keep track of stream byte
15868         positions and don't mix them with character offsets to the buffer.
15869
15870         Patch from Gustavo Giráldez
15871
15872 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
15873
15874         * interface.cs (InterfaceSetGetBase): Removed double member
15875         initialization, base class does it as well.
15876
15877 2004-03-13  Martin Baulig  <martin@ximian.com>
15878
15879         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15880         when compiling corlib.
15881
15882 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
15883
15884         * convert.cs (ExplicitConversion): We were reporting an error on
15885         certain conversions (object_type source to a value type, when the
15886         expression was `null') before we had a chance to pass it through
15887         the user defined conversions.
15888
15889         * driver.cs: Replace / and \ in resource specifications to dots.
15890         Fixes 50752
15891
15892         * class.cs: Add check for duplicate operators.  Fixes 52477
15893
15894 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
15895
15896         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15897         that are in the middle of the statements, not only at the end.
15898         Fixes #54987
15899
15900         * class.cs (TypeContainer.AddField): No longer set the
15901         `HaveStaticConstructor' flag, now we call it
15902         `UserDefineStaticConstructor' to diferentiate the slightly
15903         semantic difference.
15904
15905         The situation is that we were not adding BeforeFieldInit (from
15906         Modifiers.TypeAttr) to classes that could have it.
15907         BeforeFieldInit should be set to classes that have no static
15908         constructor. 
15909
15910         See:
15911
15912         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15913
15914         And most importantly Zoltan's comment:
15915
15916         http://bugzilla.ximian.com/show_bug.cgi?id=44229
15917
15918         "I think beforefieldinit means 'it's ok to initialize the type sometime 
15919          before its static fields are used', i.e. initialization does not need
15920          to be triggered by the first access to the type. Setting this flag
15921          helps the JIT to compile better code, since it can run the static
15922          constructor at JIT time, and does not need to generate code to call it
15923          (possibly lots of times) at runtime. Unfortunately, mcs does not set
15924          this flag for lots of classes like String. 
15925          
15926          csc sets this flag if the type does not have an explicit static 
15927          constructor. The reasoning seems to be that if there are only static
15928          initalizers for a type, and no static constructor, then the programmer
15929          does not care when this initialization happens, so beforefieldinit
15930          can be used.
15931          
15932          This bug prevents the AOT compiler from being usable, since it 
15933          generates so many calls to mono_runtime_class_init that the AOT code
15934          is much slower than the JITted code. The JITted code is faster, 
15935          because it does not generate these calls if the vtable is type is
15936          already initialized, which is true in the majority of cases. But the
15937          AOT compiler can't do this."
15938
15939 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
15940
15941         * class.cs (MethodData.Emit): Refactor the code so symbolic
15942         information is generated for destructors;  For some reasons we
15943         were taking a code path that did not generate symbolic information
15944         before. 
15945
15946 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15947
15948         * class.cs: Create a Constructor.CheckBase method that
15949         takes care of all validation type code. The method
15950         contains some code that was moved from Define.
15951
15952         It also includes new code that checks for duplicate ctors.
15953         This fixes bug #55148.
15954
15955 2004-03-09  Joshua Tauberer <tauberer@for.net>
15956
15957         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15958         a { ... }-style array creation invokes EmitStaticInitializers
15959         which is not good for reference-type arrays.  String, decimal
15960         and now null constants (NullCast) are not counted toward
15961         static initializers.
15962
15963 2004-03-05  Martin Baulig  <martin@ximian.com>
15964
15965         * location.cs (SourceFile.HasLineDirective): New public field;
15966         specifies whether the file contains or is referenced by a "#line"
15967         directive.
15968         (Location.DefineSymbolDocuments): Ignore source files which
15969         either contain or are referenced by a "#line" directive.        
15970
15971 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
15972
15973         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15974         direct access to our parent, so check the method inline there.
15975
15976 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15977
15978         * expression.cs (Invocation.EmitCall): Miguel's last commit
15979         caused a regression. If you had:
15980
15981             T t = null;
15982             t.Foo ();
15983
15984         In Foo the implict this would be null.
15985
15986 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
15987
15988         * expression.cs (Invocation.EmitCall): If the method is not
15989         virtual, do not emit a CallVirt to it, use Call.
15990
15991         * typemanager.cs (GetFullNameSignature): Improve the method to
15992         cope with ".ctor" and replace it with the type name.
15993
15994         * class.cs (ConstructorInitializer.Resolve): Now the method takes
15995         as an argument the ConstructorBuilder where it is being defined,
15996         to catch the recursive constructor invocations.
15997
15998 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
15999
16000         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
16001         routines to check if a type is an enumerable/enumerator allow
16002         classes that implement the IEnumerable or IEnumerator interfaces.
16003
16004         * class.cs (Property, Operator): Implement IIteratorContainer, and
16005         implement SetYields.
16006
16007         (Property.Define): Do the block swapping for get_methods in the
16008         context of iterators.   We need to check if Properties also
16009         include indexers or not.
16010
16011         (Operator): Assign the Block before invoking the
16012         OperatorMethod.Define, so we can trigger the Iterator code
16013         replacement. 
16014
16015         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
16016         Property and Operator classes are not created when we parse the
16017         declarator but until we have the block completed, so we use a
16018         singleton SimpleIteratorContainer.Simple to flag whether the
16019         SetYields has been invoked.
16020
16021         We propagate this setting then to the Property or the Operator to
16022         allow the `yield' to function.
16023
16024 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
16025
16026         * codegen.cs: Implemented attribute support for modules.
16027         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
16028         Assembly/Module functionality.
16029
16030         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
16031         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
16032         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
16033
16034 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
16035
16036         * interface.cs (FindMembers): The operation is performed on all base
16037         interfaces and not only on the first. It is required for future CLS Compliance patch.
16038
16039 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
16040
16041         * statement.cs, codegen.cs:
16042         This patch deals with patterns such as:
16043
16044         public class List : IEnumerable {
16045
16046                 public MyEnumerator GetEnumerator () {
16047                         return new MyEnumerator(this);
16048                 }
16049
16050                 IEnumerator IEnumerable.GetEnumerator () {
16051                         ...
16052                 }
16053                 
16054                 public struct MyEnumerator : IEnumerator {
16055                         ...
16056                 }
16057         }
16058
16059         Before, there were a few things we did wrong:
16060         1) we would emit callvirt on a struct, which is illegal
16061         2) we emited ldarg when we needed to emit ldarga
16062         3) we would mistakenly call the interface methods on an enumerator
16063         type that derived from IEnumerator and was in another assembly. For example:
16064
16065         public class MyEnumerator : IEnumerator
16066
16067         Would have the interface methods called, even if there were public impls of the
16068         method. In a struct, this lead to invalid IL code.
16069
16070 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
16071
16072         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
16073           renamed to Emit.
16074
16075         * delegate.cs (Define): Fixed crash when delegate type is undefined.
16076
16077 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
16078
16079         * cs-parser.jay: Fix small regression: we were not testing V2
16080         compiler features correctly.
16081
16082         * interface.cs: If the emit context is null, then create one
16083
16084 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
16085
16086         * decl.cs (GetSignatureForError): New virtual method to get full name
16087           for error messages.
16088
16089         * attribute.cs (IAttributeSupport): New interface for attribute setting.
16090           Now it is possible to rewrite ApplyAttributes method to be less if/else.
16091
16092         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
16093           Duplicated members and code in these classes has been removed.
16094           Better encapsulation in these classes.
16095
16096 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
16097
16098         * assign.cs (Assign.DoResolve): When dealing with compound
16099         assignments, there is a new rule in ECMA C# 2.4 (might have been
16100         there before, but it is documented here) that states that in:
16101
16102         a op= b;
16103
16104         If b is of type int, and the `op' is a shift-operator, then the
16105         above is evaluated as:
16106
16107         a = (int) a op b 
16108
16109         * expression.cs (Binary.ResolveOperator): Instead of testing for
16110         int/uint/long/ulong, try to implicitly convert to any of those
16111         types and use that in pointer arithmetic.
16112
16113         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
16114         method to print information for from the type, not from the
16115         null-method we were given.
16116
16117 2004-02-01  Duncan Mak  <duncan@ximian.com>
16118
16119         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
16120         parsing for cmd, fixes bug #53694.
16121
16122 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
16123
16124         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
16125         in the member name duplication tests. Property and operator name duplication
16126         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
16127
16128 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
16129
16130         * interface.cs (PopulateMethod): Fixed crash when interface method
16131         returns not existing type (error test cs0246-3.cs).
16132
16133 2004-02-02  Ravi Pratap M <ravi@ximian.com>
16134
16135         * cs-parser.jay (interface_accessors): Re-write actions to also
16136         store attributes attached to get and set methods. Fix spelling
16137         while at it.
16138
16139         (inteface_property_declaration): Modify accordingly.
16140
16141         (InterfaceAccessorInfo): New helper class to store information to pass
16142         around between rules that use interface_accessors.
16143
16144         * interface.cs (Emit): Apply attributes on the get and set
16145         accessors of properties and indexers too.
16146
16147         * attribute.cs (ApplyAttributes): Modify accordingly to use the
16148         right MethodBuilder when applying attributes to the get and set accessors.
16149
16150 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
16151
16152         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
16153
16154 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
16155
16156         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
16157
16158 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
16159
16160         * cs-parser.jay: Remove YIELD token, instead use the new grammar
16161         changes that treat `yield' specially when present before `break'
16162         or `return' tokens.
16163
16164         * cs-tokenizer.cs: yield is no longer a keyword.
16165
16166 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
16167
16168         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
16169         setting for default constructors.
16170         For default constructors are almost every time set wrong Modifier. The
16171         generated IL code has been alright. But inside mcs this values was
16172         wrong and this was reason why several of my CLS Compliance tests
16173         failed.
16174
16175 2004-01-22  Martin Baulig  <martin@ximian.com>
16176
16177         * cs-parser.jay (namespace_or_type_name): Return an Expression,
16178         not a QualifiedIdentifier.  This is what `type_name_expression'
16179         was previously doing.
16180         (type_name_expression): Removed; the code is now in
16181         `namespace_or_type_name'.
16182         (qualified_identifier): Removed, use `namespace_or_type_name'
16183         instead.
16184         (QualifiedIdentifier): Removed this class.      
16185
16186 2004-01-22  Martin Baulig  <martin@ximian.com>
16187
16188         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
16189         not a string as alias name.
16190
16191 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
16192
16193         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
16194         #52730 bug, and instead compute correctly the need to use a
16195         temporary variable when requesting an address based on the
16196         static/instace modified of the field and the constructor.
16197  
16198 2004-01-21  Martin Baulig  <martin@ximian.com>
16199
16200         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
16201         class and namespace before looking up aliases.  Fixes #52517.
16202
16203 2004-01-21  Martin Baulig  <martin@ximian.com>
16204
16205         * flowanalysis.cs (UsageVector.Merge): Allow variables being
16206         assinged in a 'try'; fixes exception4.cs.
16207
16208 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16209         * class.cs : Implemented parameter-less constructor for TypeContainer
16210
16211         * decl.cs: Attributes are now stored here. New property OptAttributes
16212
16213         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
16214
16215         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
16216
16217 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16218
16219         * typemanager.cs (CSharpSignature): Now reports also inner class name.
16220           (CSharpSignature): New method for indexer and property signature.
16221
16222 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16223
16224         * pending.cs (IsVirtualFilter): Faster implementation.
16225
16226 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16227
16228         * typemanager.cs: Avoid inclusion of same assembly more than once.
16229
16230 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16231
16232         * cs-parser.jay: Fixed problem where the last assembly attribute
16233           has been applied also to following declaration (class, struct, etc.)
16234           
16235 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16236
16237         * class.cs: Added error CS0538, CS0539 reporting.
16238         Fixed crash on Microsoft runtime when field type is void.
16239
16240         * cs-parser.jay: Added error CS0537 reporting.
16241
16242         * pending.cs: Added error CS0535 reporting.
16243         Improved error report for errors CS0536, CS0534.
16244
16245 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
16246
16247         Merge a few bits from the Anonymous Method MCS tree.
16248
16249         * statement.cs (ToplevelBlock): New class for toplevel methods,
16250         will hold anonymous methods, lifted variables.
16251
16252         * cs-parser.jay: Create toplevel blocks for delegates and for
16253         regular blocks of code. 
16254
16255 2004-01-20  Martin Baulig  <martin@ximian.com>
16256
16257         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
16258         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
16259         and `NeedExplicitReturn'; added `IsLastStatement'.
16260         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
16261         have a `ReturnLabel' or we're not unreachable.
16262
16263         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
16264         child's reachability; don't just override ours with it.  Fixes
16265         #58058 (lluis's example).
16266         (FlowBranching): Added public InTryOrCatch(), InCatch(),
16267         InFinally(), InLoop(), InSwitch() and
16268         BreakCrossesTryCatchBoundary() methods.
16269
16270         * statement.cs (Return): Do all error checking in Resolve().
16271         Unless we are the last statement in a top-level block, always
16272         create a return label and jump to it.
16273         (Break, Continue): Do all error checking in Resolve(); also make
16274         sure we aren't leaving a `finally'.
16275         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
16276         statement in a top-level block.
16277         (Block.Flags): Added `IsDestructor'.
16278         (Block.IsDestructor): New public property.
16279
16280 2004-01-20  Martin Baulig  <martin@ximian.com>
16281
16282         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
16283
16284 2004-01-20  Martin Baulig  <martin@ximian.com>
16285
16286         * statement.cs (Statement.ResolveUnreachable): New public method.
16287         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
16288         (Block.Resolve): Resolve unreachable statements.
16289
16290 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
16291
16292         * expression.cs: We need to fix the case where we do
16293         not have a temp variable here.
16294
16295         * assign.cs: Only expression compound assignments need
16296         temporary variables.
16297
16298 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
16299
16300         * flowanalysis.cs: Reduce memory allocation in a few ways:
16301           - A block with no variables should not allocate a bit
16302             vector for itself.
16303           - A method with no out parameters does not need any tracking
16304             for assignment of the parameters, so we need not allocate
16305             any data for it.
16306           - The arrays:
16307                 public readonly Type[] VariableTypes;
16308                 public readonly string[] VariableNames;
16309             Are redundant. The data is already stored in the variable
16310             map, so we need not allocate another array for it.
16311           - We need to add alot of checks for if (params | locals) == null
16312             due to the first two changes.
16313
16314 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
16315
16316         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16317         implement IMemoryLocation, we store a copy on a local variable and
16318         take the address of it.  Patch from Benjamin Jemlich
16319
16320         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16321         to use a special "type_name_expression" rule which reduces the
16322         number of "QualifiedIdentifier" classes created, and instead
16323         directly creates MemberAccess expressions.
16324
16325 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
16326
16327         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16328         that fixes #52853.  Null literal assignment to ValueType
16329
16330         * class.cs (MethodData.Emit): Instead of checking the name of the
16331         method to determine if its a destructor, create a new derived
16332         class from Method called Destructor, and test for that.  
16333
16334         * cs-parser.jay: Create a Destructor object instead of a Method.  
16335
16336         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16337
16338         Fixes: 52933
16339
16340 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
16341
16342         * expression.cs (Binary.ResolveOperator): Perform an implicit
16343         conversion from MethodGroups to their delegate types on the
16344         Addition operation.
16345
16346         * delegate.cs: Introduce a new class DelegateCreation that is the
16347         base class for `NewDelegate' and `ImplicitDelegateCreation',
16348         factor some code in here.
16349
16350         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16351         conversion from MethodGroups to compatible delegate types. 
16352
16353         * ecore.cs (Expression.Resolve): Do not flag error 654
16354         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16355         we allow conversions from MethodGroups to delegate types now.
16356
16357         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16358         assignments in v2 either.
16359
16360 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
16361
16362         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16363         static read-only fields in ctors.
16364
16365         Applied patch from Benjamin Jemlich 
16366
16367         * expression.cs (UnaryMutator): Avoid leaking local variables. 
16368
16369 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
16370
16371         * cs-tokenizer.cs (IsCastToken): Allow the various native types
16372         here to return true, as they can be used like this:
16373
16374                 (XXX) int.MEMBER ()
16375
16376         Fixed 49836 and all the other dups
16377
16378 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
16379
16380         * driver.cs: Implement /win32res and /win32icon.
16381
16382 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
16383
16384         * cs-parser.jay: Add a rule to improve error handling for the
16385         common mistake of placing modifiers after the type.
16386
16387 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
16388
16389         * cs-parser.jay (interface_event_declaration): Catch
16390         initialization of events on interfaces, and report cs0068
16391
16392         * cs-parser.jay (interface_event_declaration): Catch
16393         initialization of events. 
16394
16395         * ecore.cs: Better report missing constructors.
16396
16397         * expression.cs (Binary.ResolveOperator): My previous bug fix had
16398         the error reporting done in the wrong place.  Fix.
16399
16400         * expression.cs (Binary.ResolveOperator): Catch the 
16401         operator + (E x, E y) error earlier, and later allow for implicit
16402         conversions in operator +/- (E e, U x) from U to the underlying
16403         type of E.
16404
16405         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16406         52596, if the container class is abstract, the default constructor
16407         is protected otherwise its public (before, we were always public).
16408
16409         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16410         fixed statement.
16411
16412         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16413         Jemlich that fixes bug #52597, MCS was generating invalid code for
16414         idisposable structs.   Thanks to Ben for following up with this
16415         bug as well.
16416
16417 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
16418
16419         * driver.cs: Allow assemblies without code to be generated, fixes
16420         52230.
16421
16422 2004-01-07  Nick Drochak <ndrochak@gol.com>
16423
16424         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16425
16426 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
16427
16428         * cs-parser.jay: Add rules to improve error reporting if fields or
16429         methods are declared at the namespace level (error 116)
16430
16431         * Add rules to catch event add/remove
16432
16433 2004-01-04  David Sheldon <dave-mono@earth.li>
16434
16435   * expression.cs: Added matching ")" to error message for 
16436   CS0077
16437
16438 2004-01-03 Todd Berman <tberman@gentoo.org>
16439
16440         * ecore.cs, attribute.cs:
16441         Applying fix from #52429.
16442
16443 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16444
16445         * ecore.cs, expression.cs, statement.cs:
16446         Total rewrite of how we handle branching. We
16447         now handle complex boolean expressions with fewer
16448         jumps. As well if (x == 0) no longer emits a ceq.
16449
16450         if (x is Foo) is much faster now, because we generate
16451         better code.
16452
16453         Overall, we get a pretty big improvement on our benchmark
16454         tests. The code we generate is smaller and more readable.
16455
16456         I did a full two-stage bootstrap. The patch was reviewed
16457         by Martin and Miguel.
16458
16459 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16460
16461         * cs-parser.jay: Make primary_expression not take a QI.
16462         we dont need this because the member_access rule covers
16463         us here. So we replace the rule with just IDENTIFIER.
16464
16465         This has two good effects. First, we remove a s/r conflict.
16466         Second, we allocate many fewer QualifiedIdentifier objects.
16467
16468 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16469
16470         * attribute.cs: Handle MarshalAs attributes as pseudo, and
16471         set the correct information via SRE. This prevents
16472         hanging on the MS runtime. Fixes #29374.
16473
16474 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16475
16476         * convert.cs: correctly handle conversions to value types
16477         from Enum and ValueType as unboxing conversions.
16478
16479         Fixes bug #52569. Patch by Benjamin Jemlich.
16480
16481 2004-01-02  Ravi Pratap  <ravi@ximian.com>
16482
16483         * expression.cs (BetterConversion): Prefer int -> uint
16484         over int -> ulong (csc's behaviour). This fixed bug #52046.
16485
16486 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16487
16488         * decl.cs (MemberCache.FindMembers): now returns a
16489         MemberInfo [].
16490
16491         * typemanager.cs: In general, go with with ^^.
16492         (CopyNewMethods): take an IList.
16493         (RealMemberLookup): Only allocate an arraylist
16494         if we copy from two sets of methods.
16495
16496         This change basically does two things:
16497         1) Fewer array lists allocated due to CopyNewMethods.
16498         2) the explicit cast in MemberList costed ALOT.
16499
16500 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
16501
16502         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16503         a hashtable to avoid needless string allocations when an identifier is
16504         used more than once (the common case).
16505
16506 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16507
16508         * pending.cs: MS's TypeBuilder.GetInterfaces ()
16509         is broken, it will not return anything. So, we
16510         have to use the information we have in mcs to
16511         do the task.
16512
16513         * typemanager.cs: Add a cache for GetInterfaces,
16514         since this will now be used more often (due to ^^)
16515
16516         (GetExplicitInterfaces) New method that gets the
16517         declared, not effective, interfaces on a type
16518         builder (eg, if you have interface IFoo, interface
16519         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16520         { IBar }.
16521
16522         This patch makes MCS able to bootstrap itself on
16523         Windows again.
16524
16525 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16526
16527         * expression.cs: Remove the Nop's that Miguel put
16528         in by mistake.
16529
16530 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16531
16532         * report.cs, codegen.cs: Give the real stack trace to
16533         the error when an exception is thrown.
16534
16535 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16536
16537         * decl.cs: only allocate hashtables for ifaces if 
16538         it is an iface!
16539
16540 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16541
16542         * expression.cs: fix the error from cs0121-2.cs
16543         (a parent interface has two child interfaces that
16544         have a function with the same name and 0 params
16545         and the function is called through the parent).
16546
16547 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16548
16549         * class.cs, rootcontext.cs, typmanager.cs: do not
16550         leak pointers.
16551
16552 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16553
16554         * codegen.cs: remove stack for the ec flow branching.
16555         It is already a linked list, so no need.
16556
16557 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
16558
16559         * Makefile: Allow custom profiler here.
16560
16561 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16562
16563         * typemanager.cs (LookupType):
16564           - Use a static char [], because split takes
16565             a param array for args, so it was allocating
16566             every time.
16567           - Do not store true in a hashtable, it boxes.
16568
16569 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16570
16571         * flowanalysis.cs: bytify common enums.
16572
16573 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16574
16575         * modifiers.cs: Add a new set of flags for the
16576         flags allowed on explicit interface impls.
16577         * cs-parser.jay: catch the use of modifiers in
16578         interfaces correctly.
16579         * class.cs: catch private void IFoo.Blah ().
16580
16581         All related to bug #50572.
16582
16583 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16584
16585         * decl.cs: Rewrite the consistant accessability checking.
16586         Accessability is not linear, it must be implemented in
16587         a tableish way. Fixes #49704.
16588
16589 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16590
16591         * expression.cs: Handle negation in a checked context.
16592         We must use subtraction from zero. Fixes #38674.
16593
16594 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16595
16596         * class.cs: Ignore static void main in DLLs.
16597         * rootcontext.cs: Handle the target type here,
16598         since we are have to access it from class.cs
16599         * driver.cs: account for the above.
16600
16601 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16602
16603         * report.cs: Give line numbers and files if available.
16604
16605 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
16606
16607         * driver.cs: Implement /addmodule.
16608
16609         * typemanager.cs:  Change 'modules' field so it now contains Modules not
16610         ModuleBuilders.
16611
16612 2003-12-20  Martin Baulig  <martin@ximian.com>
16613
16614         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16615         (FieldBase.IsAssigned): Removed this field.
16616         (FieldBase.SetAssigned): New public method.
16617         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16618
16619 2003-12-20  Martin Baulig  <martin@ximian.com>
16620
16621         * expression.cs (LocalVariableReference.DoResolve): Don't set
16622         `vi.Used' if we're called from DoResolveLValue().
16623
16624         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16625         returns the usage vector it just merged into the current one -
16626         pass this one to UsageWarning().
16627         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16628         of the `EmitContext', don't call this recursively on our children.
16629
16630 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
16631
16632         * driver.cs: Implement /target:module.
16633
16634 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
16635
16636         * support.cs (CharArrayHashtable): New helper class.
16637
16638         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
16639         char arrays, not strings, so we can avoid creating a string in
16640         consume_identifier if the identifier is a keyword.
16641
16642 2003-12-16  Martin Baulig  <martin@ximian.com>
16643
16644         * statement.cs (LocalInfo.Assigned): Removed this property.
16645         (LocalInfo.Flags): Removed `Assigned'.
16646         (LocalInfo.IsAssigned): New public method; takes the EmitContext
16647         and uses flow analysis.
16648         (Block.UsageWarning): Made this method private.
16649         (Block.Resolve): Call UsageWarning() if appropriate.
16650
16651         * expression.cs (LocalVariableReference.DoResolve): Always set
16652         LocalInfo.Used here.
16653
16654 2003-12-13  Martin Baulig  <martin@ximian.com>
16655
16656         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16657         any value here; we're now using flow analysis to figure out
16658         whether a statement/block returns a value.
16659
16660 2003-12-13  Martin Baulig  <martin@ximian.com>
16661
16662         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16663         working again.
16664         (FlowBranching.MergeFinally): Don't call
16665         `branching.CheckOutParameters()' here, this is called in
16666         MergeTopBlock().
16667         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16668         when adding the `finally' vector.       
16669
16670 2003-12-13  Martin Baulig  <martin@ximian.com>
16671
16672         * flowanalysis.cs
16673         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16674         actually work and also fix #48962.
16675
16676 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
16677
16678         * decl.cs: Do not check System.Object for nested types,
16679         since we know it does not have any. Big bang for buck:
16680
16681         BEFORE:
16682            Run 1:   8.35 seconds
16683            Run 2:   8.32 seconds
16684            corlib:  17.99 seconds
16685         AFTER:
16686            Run 1:   8.17 seconds
16687            Run 2:   8.17 seconds
16688            corlib:  17.39 seconds
16689
16690 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
16691
16692         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16693         time we are returning 0 members, so we save alot here.
16694
16695 2003-12-11  Martin Baulig  <martin@ximian.com>
16696
16697         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16698         `MergeChild()', also just take the `FlowBranching' as argument;
16699         call Merge() on it and return the result.
16700         (FlowBranching.Merge): We don't need to do anything if we just
16701         have one sibling.
16702
16703 2003-12-11  Martin Baulig  <martin@ximian.com>
16704
16705         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16706         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
16707         Maurer for this idea.
16708
16709 2003-12-11  Martin Baulig  <martin@ximian.com>
16710
16711         * flowanalysis.cs (MergeResult): This class is now gone; we now
16712         use the `UsageVector' for this.  The reason for this is that if a
16713         branching just has one sibling, we don't need to "merge" them at
16714         all - that's the next step to do.
16715         (FlowBranching.Merge): We now return a `UsageVector' instead of a
16716         `MergeResult'.
16717
16718 2003-12-11  Martin Baulig  <martin@ximian.com>
16719
16720         Reworked flow analyis and made it more precise and bug-free.  The
16721         most important change is that we're now using a special `Reachability'
16722         class instead of having "magic" meanings of `FlowReturns'.  I'll
16723         do some more cleanups and optimizations and also add some more
16724         documentation this week.
16725
16726         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16727         largely reworked this class.
16728         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16729         the new `Reachability' class instead of having "magic" values here.
16730         (FlowBranching): We're now using an instance of `Reachability'
16731         instead of having separate `Returns', `Breaks' etc. fields.
16732
16733         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16734         based on flow analysis; ignore the return value of block.Emit ().
16735
16736 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
16737
16738         * driver.cs typemanager.cs: Find the mono extensions to corlib even
16739         if they are private.
16740
16741 2003-12-09  Martin Baulig  <martin@ximian.com>
16742
16743         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16744         call them directly on the UsageVector.
16745
16746 2003-12-09  Martin Baulig  <martin@ximian.com>
16747
16748         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16749         Changed return type from `FlowReturns' to `Reachability'.
16750
16751 2003-12-09  Martin Baulig  <martin@ximian.com>
16752
16753         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16754         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16755         `Reachable' fields with a single `Reachability' one.
16756
16757 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16758
16759         * class.cs (FindMembers): Remove foreach's.
16760
16761         Bootstrap times:
16762
16763         BEFORE
16764                 Run 1:   8.74 seconds
16765                 Run 2:   8.71 seconds
16766
16767         AFTER
16768                 Run 1:   8.64 seconds
16769                 Run 2:   8.58 seconds
16770
16771
16772 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16773
16774         * cs-parser.jay:
16775         * gen-treedump.cs:
16776         * statement.cs:
16777         This patch does a few things:
16778                 1. EmptyStatement is now a singleton, so it is never reallocated.
16779                 2. All blah is EmptyStatement constructs have been changed to
16780                    blah == EmptyStatement.Value, which is much faster and valid
16781                    now that EmptyStatement is a singleton.
16782                 3. When resolving a block, rather than allocating a new array for
16783                    the non-empty statements, empty statements are replaced with
16784                    EmptyStatement.Value
16785                 4. Some recursive functions have been made non-recursive.
16786         Mainly the performance impact is from (3), however (1) and (2) are needed for
16787         this to work. (4) does not make a big difference in normal situations, however
16788         it makes the profile look saner.
16789
16790         Bootstrap times:
16791
16792         BEFORE
16793         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16794         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16795         Total memory allocated: 56397 KB
16796
16797         AFTER
16798         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16799         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16800         Total memory allocated: 55666 KB
16801
16802 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16803
16804         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16805         than the hashtable in a hashtable version
16806
16807         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16808         we always end up concating a string. This results in a huge perf
16809         loss, because many strings have to be tracked by the GC. In this
16810         patch, we first use a hashtable that works with two keys, so that
16811         the strings do not need to be concat'ed.
16812
16813         Bootstrap times:
16814         BEFORE
16815                 Run 1:   8.74 seconds
16816                 Run 2:   8.71 seconds
16817
16818         AFTER
16819                 Run 1:   8.65 seconds
16820                 Run 2:   8.56 seconds
16821
16822 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16823
16824         * Makefile: Add a new target `do-time' that does a quick and simple
16825         profile, leaving easy to parse output.
16826
16827 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
16828
16829         * codegen.cs (Init): Create the dynamic assembly with 
16830         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16831
16832 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16833
16834         * support.cs: Make the PtrHashtable use only one
16835         instance of its comparer.
16836
16837 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
16838
16839         * typemanager.cs: Fix lookup of GetNamespaces.
16840
16841 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
16842
16843         * expression.cs: Removed redundant line.
16844
16845         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16846         ArrayLists, use for loops with bounds.  
16847
16848         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16849         arraylist.
16850
16851         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16852         arraylists, use for loop with bounds.
16853
16854         The above three changes give us a 0.071 second performance
16855         improvement out of 3.294 seconds down to 3.223.  On my machine
16856         the above changes reduced the memory usage by 1,387 KB during
16857         compiler bootstrap.
16858
16859         * cs-parser.jay (QualifiedIdentifier): New class used to represent
16860         QualifiedIdentifiers.  Before we created a new string through
16861         concatenation, and mostly later on, the result would be
16862         manipulated by DecomposeQI through string manipulation.
16863
16864         This reduced the compiler memory usage for bootstrapping from
16865         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16866         compile times in 0.05 seconds.
16867
16868 2003-11-28  Dick Porter  <dick@ximian.com>
16869
16870         * support.cs: Do string compares with the Invariant culture.
16871
16872         * rootcontext.cs: 
16873         * gen-treedump.cs: 
16874         * expression.cs: 
16875         * driver.cs: 
16876         * decl.cs: 
16877         * codegen.cs: 
16878         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16879         the comparison is done with the Invariant culture.
16880
16881 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
16882
16883         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16884         GetEnumerator method.
16885
16886         (ProbeCollectionType): Iterate starting at the most specific type
16887         upwards looking for a GetEnumerator
16888
16889         * expression.cs: Shift count can be up to 31 for int/uint and 63
16890         for long/ulong.
16891
16892 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
16893
16894         * statement.cs (Block.LookupLabel): Also look for the label on the
16895         children blocks.  Use a hash table to keep track of visited
16896         nodes. 
16897
16898         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16899         we actually did transform the other operand, otherwise fall back
16900         to the common codepath that casts to long.
16901
16902         * cs-tokenizer.cs: Use the same code pattern as the int case.
16903         Maybe I should do the parsing myself, and avoid depending on the
16904         Parse routines to get this done.
16905
16906 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
16907
16908         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16909         which fixes bug 51347.  This time test it.
16910
16911         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16912         attributes for example can not tell the difference between these.
16913         The difference was only a syntax feature of the language. 
16914
16915         * attribute.cs: Apply attributes to delegates.
16916
16917         * delegate.cs: Call the apply attributes method.
16918
16919 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
16920
16921         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16922         comparing 0 vs Byte.MinValue, not the value
16923
16924         (ImplicitConversionRequired): When reporting a conversion error,
16925         use error 31 to print out the constant error instead of the
16926         simpler 29.
16927
16928         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16929         which fixes bug 51347.
16930
16931 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
16932
16933         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
16934         which fixes the -warnaserror command line option.
16935
16936 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
16937
16938         * cfold.cs (DoNumericPromotions): During constant folding of
16939         additions on UIntConstant, special case intconstants with
16940         IntConstants like we do on the expression binary operator. 
16941
16942 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
16943
16944         * convert.cs (ImplicitReferenceConversion): We were missing a case
16945         (System.Enum are not value types or class types, so we need to
16946         classify them separatedly).
16947
16948         * driver.cs: We do not support error 2007.
16949
16950 2003-11-12 Jackson Harper <jackson@ximian.com>
16951
16952         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16953         system directory. Also use the full file name so users can
16954         libraries names mscorlib-o-tron.dll in a non system dir.
16955
16956 2003-11-10  Martin Baulig  <martin@ximian.com>
16957
16958         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16959         (TypeManager.InitCoreTypes): Initialize them here, but instead of
16960         calling `ResolveType()' on them, directly assign their `Type'.
16961
16962 2003-11-08  Martin Baulig  <martin@ximian.com>
16963
16964         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16965         return value and the `out parent' parameter.
16966         (TypeContainer.DefineType): Moved the CS0644 check into
16967         GetClassBases().  Don't pass the interface types to the
16968         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16969         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16970
16971         * ecore.cs (TypeExpr.IsAttribute): New property.
16972         (TypeExpr.GetInterfaces): New method.
16973
16974         * interface.cs (Interface.GetInterfaceTypeByName): Return a
16975         TypeExpr instead of a Type.
16976         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16977         (Interface.DefineType): Don't pass the interface types to the
16978         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16979         them later and then call `TypeBulider.AddInterfaceImplementation()'.
16980
16981         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16982         instead of a `Type[]'.
16983         (TypeManager.RegisterBuilder): Likewise.
16984         (TypeManager.AddUserInterface): Likewise.
16985         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
16986         `Type[]' and also return a `TypeExpr[]'.
16987         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
16988
16989 2003-11-08  Martin Baulig  <martin@ximian.com>
16990
16991         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
16992         Expression.     
16993
16994 2003-11-08  Martin Baulig  <martin@ximian.com>
16995
16996         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
16997         TypeManager.ResolveExpressionTypes().
16998
16999         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
17000         instead of an Expression.
17001         (TypeExpr): This is now an abstract base class for `TypeExpression'.
17002         (TypeExpression): New public class; formerly known as `TypeExpr'.
17003
17004         * expression.cs (ComposedCast): Derive from TypeExpr.
17005
17006         * typemanager.cs (TypeManager.system_*_expr): These are now
17007         TypExpr's instead of Expression's.
17008         (TypeManager.ResolveExpressionTypes): New public static function;
17009         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
17010         of them.        
17011
17012 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
17013
17014         * expression.cs (New.DoResolve): Do not dereference value that
17015         might be a null return.
17016
17017         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
17018         sure that the constant value has the right type.  Fixes an
17019         unreported bug, similar to 50425.
17020
17021         * const.cs (Const.LookupConstantValue): Call
17022         ImplicitStandardConversionExists before doing a conversion to
17023         avoid havng the TypeManager.ChangeType do conversions.
17024
17025         Reduced the number of casts used
17026
17027         (Const.ChangeType): New routine to enable reuse of the constant
17028         type changing code from statement.
17029
17030         * typemanager.cs (ChangeType): Move common initialization to
17031         static global variables.
17032
17033         Fixes #50425.
17034
17035         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
17036         every value type to go through, even if it was void.  Fix that. 
17037
17038         * cs-tokenizer.cs: Use is_identifier_start_character on the start
17039         character of the define, and the is_identifier_part_character for
17040         the rest of the string.
17041
17042 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
17043
17044         * expression.cs (UnaryMutator.EmitCode): When I updated
17045         LocalVariableReference.DoResolve, I overdid it, and dropped an
17046         optimization done on local variable references.
17047
17048 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
17049
17050         * ecore.cs: Convert the return from Ldlen into an int.
17051
17052 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
17053
17054         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
17055         the accessibility, this is a special case for toplevel non-public
17056         classes (internal for instance).
17057
17058 2003-10-20  Nick Drochak <ndrochak@gol.com>
17059
17060         * ecore.cs: Fix typo and build.  Needed another right paren.
17061
17062 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
17063
17064         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
17065         `internal' case regular and protected, but not allowing protected
17066         to be evaluated later.  Bug 49840
17067
17068 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
17069
17070         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
17071         to kb.Nlast, and not the kb.nFirst to isolate the switch
17072         statement.
17073
17074         Extract the underlying type, so enumerations of long/ulong are
17075         treated like long/ulong.
17076
17077 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
17078
17079         * expression.cs (New): Overload the meaning of RequestedType to
17080         track the possible creation of the NewDelegate type, since
17081         DoResolve is invoked more than once for new constructors on field
17082         initialization.
17083
17084         See bugs: #48800 and #37014
17085
17086         * cs-parser.jay (declare_local_constants): Take an arraylist
17087         instead of a single constant.
17088
17089         (local_constant_declaration): It should take a
17090         constant_declarators, not a constant_declarator.  Fixes 49487
17091
17092         * convert.cs: Fix error report.
17093
17094 2003-10-13 Jackson Harper <jackson@ximian.com>
17095
17096         * typemanager.cs (TypeToCoreType): Add float and double this fixes
17097         bug #49611
17098
17099 2003-10-09  Martin Baulig  <martin@ximian.com>
17100
17101         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
17102         to the .ctor.
17103         (MethodCore.DoDefineParameters): Removed the TypeContainer
17104         argument; use the DeclSpace which was passed to the .ctor instead.
17105         (MethodCore.CheckParameter): Take a DeclSpace instead of a
17106         TypeContainer; we only need a DeclSpace here.
17107
17108 2003-10-09  Martin Baulig  <martin@ximian.com>
17109
17110         * class.cs (MethodData): Added additional `DeclSpace ds' argument
17111         to the .ctor.
17112         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
17113         EmitContext's .ctor.    
17114
17115 2003-10-09  Martin Baulig  <martin@ximian.com>
17116
17117         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
17118         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
17119         AsAccessible(), moved them as well.
17120
17121         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
17122
17123 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
17124
17125         * cs-parser.jay : Renamed yyName to yyNames related to jay.
17126
17127 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
17130         generation for >=, as spotted by Paolo, bug 48679.  
17131         Patch from David Waite.
17132
17133         * cs-tokenizer.cs: Add handling for #pragma.
17134
17135         * cs-parser.jay: Allow for both yield and yield return in the
17136         syntax.  The anti-cobolization of C# fight will go on!
17137
17138         * class.cs (TypeBuilder.DefineType): Catch error condition here
17139         (Parent.DefineType erroring out and returning null).
17140
17141         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17142         coping with enumerations variables, we were mistakenly processing
17143         them as a regular value type instead of built-in types.  Fixes the
17144         bug #48063
17145
17146         * typemanager.cs (IsBuiltinOrEnum): New method.
17147
17148 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
17149
17150         * cs-parser.jay: Upgrade: yield now needs the return clause.
17151
17152 2003-09-19  Martin Baulig  <martin@ximian.com>
17153
17154         * decl.cs (MemberCache.SetupCacheForInterface): Take a
17155         `MemberCache parent' argument.  Normally, an interface doesn't
17156         have a parent type except System.Object, but we use this in gmcs
17157         for generic type parameters.
17158
17159 2003-09-18  Martin Baulig  <martin@ximian.com>
17160
17161         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
17162         on `type.IsInterface'; don't check whether the type has a parent
17163         to determine whether it's an interface.
17164
17165 2003-09-15  Martin Baulig  <martin@ximian.com>
17166
17167         * class.cs (TypeContainer.DefineType): Added an error flag to
17168         avoid reporting duplicate CS0146's ("class definition is
17169         circular.").
17170
17171         * driver.cs (Driver.MainDriver): Abort if
17172         RootContext.ResolveTree() reported any errors.
17173
17174 2003-09-07  Martin Baulig  <martin@ximian.com>
17175
17176         * report.cs (Error, Warning): Added overloaded versions which take
17177         a `params object[] args' and call String.Format().
17178
17179 2003-09-07  Martin Baulig  <martin@ximian.com>
17180
17181         * decl.cs (DeclSpace..ctor): Don't call
17182         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
17183         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
17184         (DeclSpace.RecordDecl): New method.
17185
17186         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
17187
17188 2003-09-02  Ravi Pratap  <ravi@ximian.com>
17189
17190         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
17191         value attributes to be applied to ParameterBuilders.
17192
17193         * class.cs (MethodCore.LabelParameters): Make static and more
17194         generic so that it can be used from other places - like interface
17195         methods, for instance.
17196
17197         * interface.cs (Interface.Emit): Call LabelParameters before
17198         emitting attributes on the InterfaceMethod.
17199
17200 2003-08-26  Martin Baulig  <martin@ximian.com>
17201
17202         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
17203         resolving aliases; fixes #47927.
17204
17205 2003-08-26  Martin Baulig  <martin@ximian.com>
17206
17207         * statement.cs (Using.DoResolve): This is internally emitting a
17208         try/finally clause, so we need to set ec.NeedExplicitReturn if we
17209         do not always return.  Fixes #47681.
17210
17211 2003-08-26  Martin Baulig  <martin@ximian.com>
17212
17213         * decl.cs (MemberCore): Moved WarningNotHiding(),
17214         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
17215         into MemberBase.
17216         (AdditionResult): Make this nested in DeclSpace.
17217         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
17218         argument; call NamespaceEntry.Define() unless we're nested in a
17219         class or struct.
17220
17221         * namespace.cs (Namespace.DefineName): New public function.  This
17222         is called from DeclSpace's .ctor to add 
17223         (Namespace.Lookup): Include DeclSpaces in the lookup.
17224
17225         * class.cs (Operator): Derive from MemberBase, not MemberCore.
17226
17227         * const.cs (Const): Derive from MemberBase, not MemberCore.     
17228
17229 2003-08-25  Martin Baulig  <martin@ximian.com>
17230
17231         * convert.cs (Convert.ExplicitReferenceConversion): When
17232         converting from an interface type to a class, unbox if the target
17233         type is a struct type.  Fixes #47822.
17234
17235 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17236
17237         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
17238         #47854.
17239
17240 2003-08-22  Martin Baulig  <martin@ximian.com>
17241
17242         * class.cs (TypeManager.DefineType): When defining a nested type,
17243         call DefineType() on our parent; fixes #47801.
17244
17245 2003-08-22  Martin Baulig  <martin@ximian.com>
17246
17247         * class.cs (MethodData.Define): While checking if a method is an
17248         interface implementation, improve the test a bit more to fix #47654.
17249
17250 2003-08-22  Martin Baulig  <martin@ximian.com>
17251
17252         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
17253         correctly; fixes #47722.
17254
17255 2003-08-22  Martin Baulig  <martin@ximian.com>
17256
17257         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
17258         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
17259
17260         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
17261
17262 2003-08-22  Martin Baulig  <martin@ximian.com>
17263
17264         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
17265         can only be assigned in static constructors.  Fixes #47161.
17266
17267 2003-08-22  Martin Baulig  <martin@ximian.com>
17268
17269         Rewrote and improved the flow analysis code.
17270
17271         * flowbranching.cs (FlowBranching): Make this class abstract.
17272         (FlowBranching.CreateBranching): New static function to create a
17273         new flow branching.
17274         (FlowBranchingBlock, FlowBranchingException): New classes.
17275         (FlowBranching.UsageVector.Type): New public readonly field.
17276         (FlowBranching.UsageVector.Breaks): Removed the setter.
17277         (FlowBranching.UsageVector.Returns): Removed the setter.
17278         (FlowBranching.UsageVector): Added Break(), Return(),
17279         NeverReachable() and Throw() methods to modify the reachability.
17280         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
17281         done by FlowBranching.Merge().
17282         (FlowBranching.UsageVector.MergeChild): New method; merges the
17283         merge result into the current vector.
17284         (FlowBranching.Merge): New abstract method to merge a branching.
17285
17286 2003-08-12  Martin Baulig  <martin@ximian.com>
17287
17288         * expression.cs (Indirection.CacheTemporaries): Create the
17289         LocalTemporary with the pointer type, not its element type.
17290
17291 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
17292
17293         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
17294         token was a keyword or not.
17295
17296         Add `error' options where an IDENTIFIER was expected;  Provide
17297         CheckToken and CheckIdentifierToken convenience error reporting
17298         functions. 
17299
17300         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
17301
17302         * decl.cs: Rename `NamespaceEntry Namespace' public field into
17303         NameSpaceEntry NameSpaceEntry.
17304
17305         (LookupInterfaceOrClass): Avoid creating a full qualified name
17306         from namespace and name: avoid doing lookups when we know the
17307         namespace is non-existant.   Use new Tree.LookupByNamespace which
17308         looks up DeclSpaces based on their namespace, name pair.
17309
17310         * driver.cs: Provide a new `parser verbose' to display the
17311         exception thrown during parsing.  This is turned off by default
17312         now, so the output of a failure from mcs is more graceful.
17313
17314         * namespace.cs: Track all the namespaces defined in a hashtable
17315         for quick lookup.
17316
17317         (IsNamespace): New method
17318
17319 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
17320
17321         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
17322         we know that we need to concatenate (full typename can never be
17323         null). 
17324
17325         * class.cs: ditto.
17326
17327         * statement.cs: Use a bitfield;  Do not initialize to null things
17328         which are done by the constructor by default.
17329
17330         * cs-parser.jay: bug fix, parameter was 4, not 3.
17331
17332         * expression.cs: Just use the property;
17333
17334         * statement.cs: No need for GetVariableInfo method.
17335
17336 2003-08-08  Martin Baulig  <martin@ximian.com>
17337
17338         * flowanalysis.cs (FlowReturns): This is now nested in the
17339         `FlowBranching' class.
17340         (MyBitVector): Moved this here from statement.cs.
17341         (FlowBranching.SiblingType): New enum type.
17342         (FlowBranching.CreateSibling): Added `SiblingType' argument.
17343
17344 2003-08-07  Martin Baulig  <martin@ximian.com>
17345
17346         * flowanalysis.cs (FlowBranchingType): This is now nested in the
17347         `FlowBranching' class and called `BranchingType'.
17348
17349 2003-08-07  Martin Baulig  <martin@ximian.com>
17350
17351         * flowanalysis.cs: Moved all the control flow analysis code into
17352         its own file.
17353
17354 2003-08-07  Martin Baulig  <martin@ximian.com>
17355
17356         * assign.cs (Assign.DoResolve): `target' must either be an
17357         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
17358         #37319.
17359
17360 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
17361
17362         * expression.cs (BinaryMethod): This kind of expression is created by the
17363         Binary class if it determines that the operator has to be handled
17364         by a method.
17365
17366         (BinaryDelegate): This kind of expression is created if we are
17367         dealing with a + or - operator on delegates.
17368
17369         (Binary): remove method, argumetns, and DelegateOperator: when
17370         dealing with methods, 
17371
17372         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17373
17374         * statement.cs (Block): use bitfields for the three extra booleans
17375         we had in use.   Remove unused topblock parameter.
17376
17377         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17378
17379         * assign.cs: Drop extra unneeded tests.
17380
17381 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
17382
17383         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17384
17385         * statement.cs (Foreach): Use VariableStorage instead of
17386         LocalBuilders.   
17387
17388         * codegen.cs (VariableStorage): New class used by clients that
17389         require a variable stored: locals or fields for variables that
17390         need to live across yield.
17391
17392         Maybe provide a convenience api for EmitThis+EmitLoad?
17393
17394         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17395         these bad boys.
17396
17397 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
17398
17399         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17400         RemapParameterLValue): New methods that are used to turn a
17401         precomputed FieldInfo into an expression like this:
17402
17403                 instance.FieldInfo
17404
17405         The idea is to use this instead of making LocalVariableReference
17406         have more than one meaning.
17407
17408         * cs-parser.jay: Add error production to BASE.
17409
17410         * ecore.cs: Deal with TypeManager.GetField returning null, which
17411         is now a valid return value.
17412
17413         (FieldExprNoAddress): New expression for Fields whose address can
17414         not be taken.
17415
17416         * expression.cs (LocalVariableReference): During the resolve
17417         phases, create new expressions if we are in a remapping context.
17418         Remove code that dealt with remapping here.
17419
17420         (ParameterReference): same.
17421
17422         (ProxyInstance): New expression, like the `This' expression, but
17423         it is born fully resolved.  We know what we are doing, so remove
17424         the errors that are targeted to user-provided uses of `this'.
17425
17426         * statement.cs (Foreach): our variable is now stored as an
17427         Expression;  During resolution, follow the protocol, dont just
17428         assume it will return this.
17429
17430 2003-08-06  Martin Baulig  <martin@ximian.com>
17431
17432         * support.cs (SeekableStreamReader.cs): New public class.
17433
17434         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17435         SeekableStreamReader instead of the normal StreamReader.
17436
17437 2003-08-04  Martin Baulig  <martin@ximian.com>
17438
17439         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17440         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17441         deambiguate casts and delegate invocations.
17442         (parenthesized_expression): Use the new tokens to ensure this is
17443         not a cast of method invocation.
17444
17445         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17446         when reading a `)' and Deambiguate_CloseParens () was previously
17447         called.
17448
17449         * expression.cs (ParenthesizedExpression): New class.  This is
17450         just used for the CS0075 test.
17451         (Binary.DoResolve): Check for CS0075.   
17452
17453 2003-07-29  Ravi Pratap  <ravi@ximian.com>
17454
17455         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17456         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17457         reference comparison.
17458
17459         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17460         examine the ReturnType for equality - this is necessary in the
17461         cases of implicit and explicit operators whose signature also
17462         includes the return type.
17463
17464 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
17465
17466         * namespace.cs: Cache the result of the namespace computation,
17467         instead of computing it every time.
17468
17469 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
17470
17471         * decl.cs: Use a global arraylist that we reuse over invocations
17472         to avoid excesive memory consumption.  Reduces memory usage on an
17473         mcs compile by one meg (45 average).
17474
17475         * typemanager.cs (LookupTypeReflection): In .NET pointers are
17476         private, work around that.
17477
17478 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
17479
17480         * literal.cs (IntLiteral): Define Zero and One static literals. 
17481
17482         * cs-parser.jay (integer_literal): use static literals to reduce
17483         memory usage for the most used literals (0, 1 and -1).  211kb
17484         reduced in memory usage.
17485
17486         Replace all calls to `new ArrayList' with `new
17487         ArrayList(4)' which is a good average number for most allocations,
17488         and also requires only 16 bytes of memory for its buffer by
17489         default. 
17490
17491         This reduced MCS memory usage in seven megabytes for the RSS after
17492         bootstrapping.
17493
17494 2003-07-28  Ravi Pratap  <ravi@ximian.com>
17495
17496         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17497         handle params methods the correct way by forming only one
17498         applicable set with params and normal methods in them. Earlier we
17499         were looking at params methods only if we found no normal methods
17500         which was not the correct thing to do.
17501
17502         (Invocation.BetterFunction): Take separate arguments indicating
17503         when candidate and the best method are params methods in their
17504         expanded form.
17505
17506         This fixes bugs #43367 and #46199.
17507
17508         * attribute.cs: Documentation updates.
17509
17510         (CheckAttribute): Rename to CheckAttributeTarget.
17511         (GetValidPlaces): Rename to GetValidTargets.
17512
17513         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17514         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17515
17516         Fixes bug #44468.
17517
17518 2003-07-28  Martin Baulig  <martin@ximian.com>
17519
17520         * class.cs (TypeContainer.DefineMembers): Use the base type's full
17521         name when looking up the base class of a nested class.  Fixes #46977.
17522
17523 2003-07-26  Martin Baulig  <martin@ximian.com>
17524
17525         * expression.cs (Indexers.Indexer): New nested struct; contains
17526         getter, setter and the indexer's type.
17527         (Indexers.Properties): This is now an ArrayList of
17528         Indexers.Indexer's.
17529         (IndexerAccess.DoResolveLValue): Correctly set the type if the
17530         indexer doesn't have any getters.
17531
17532         * assign.cs (Assign.DoResolve): Also do the implicit conversions
17533         for embedded property and indexer assignments.
17534
17535 2003-07-26  Martin Baulig  <martin@ximian.com>
17536
17537         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17538         preprocessor directive is not the first non-whitespace character
17539         on a line.
17540
17541 2003-07-26  Martin Baulig  <martin@ximian.com>
17542
17543         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17544         namespace parsing, follow the spec more closely.
17545
17546         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17547         NamespaceEntry.Lookup().
17548
17549 2003-07-25  Martin Baulig  <martin@ximian.com>
17550
17551         * MethodCore.cs (OverridesSomething): New public field; it's set
17552         from TypeContainer.DefineMembers if this method overrides
17553         something (which doesn't need to be a method).  Fix #39462.
17554
17555 2003-07-25  Ravi Pratap  <ravi@ximian.com>
17556
17557         * typemanager.cs (GetMembers): Ensure that the list of members is
17558         reversed. This keeps things in sync.
17559
17560         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17561         find an AttributeUsage attribute.
17562
17563         * expression.cs (Invocation.OverloadResolve): Perform the check
17564         which disallows Invoke to be directly called on a Delegate.
17565
17566         (Error_InvokeOnDelegate): Report error cs1533.
17567
17568 2003-07-25  Martin Baulig  <martin@ximian.com>
17569
17570         * expression.cs (Indexers.GetIndexersForType): Only look in the
17571         interface hierarchy if the requested type is already an
17572         interface.  Fixes #46788 while keeping #46502 fixed.
17573
17574 2003-07-25  Martin Baulig  <martin@ximian.com>
17575
17576         * class.cs (TypeContainer.DefineMembers): Check whether all
17577         readonly fields have been assigned and report warning CS0649 if
17578         not.
17579
17580         * statement.cs (LocalInfo.IsFixed): Always return true if this is
17581         a valuetype.
17582
17583 2003-07-24  Ravi Pratap  <ravi@ximian.com>
17584
17585         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17586         returned from GetMethods to make things consistent with the
17587         assumptions MCS makes about ordering of methods.
17588
17589         This should comprehensively fix bug #45127 and it does :-)
17590
17591         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17592         ordering is actually reverse.
17593
17594         * Clean up some debug messages I left lying around.
17595
17596         * interface.cs (Populate*): Get rid of code which emits attributes
17597         since the stage in which we emit attributes is the 'Emit' stage,
17598         not the define stage.
17599
17600         (Emit): Move attribute emission for interface members here.
17601
17602 2003-07-22  Ravi Pratap  <ravi@ximian.com>
17603
17604         * expression.cs (Invocation.OverloadResolve): Follow the spec more
17605         closely: we eliminate methods in base types when we have an
17606         applicable method in a top-level type.
17607
17608         Please see section 14.5.5.1 for an exact description of what goes
17609         on. 
17610
17611         This fixes bug #45127 and a host of other related to corlib compilation.
17612
17613         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17614         array is the method corresponding to the top-level type (this is
17615         because of the changes made to icall.c) so we change this
17616         accordingly.
17617
17618         (MethodGroupExpr.Name): This too.
17619
17620         * typemanager.cs (GetElementType): New method which does the right
17621         thing when compiling corlib. 
17622
17623         * everywhere: Make use of the above in the relevant places.
17624
17625 2003-07-22  Martin Baulig  <martin@ximian.com>
17626
17627         * cs-parser.jay (invocation_expression): Moved
17628         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17629         `cast_expression', but create a InvocationOrCast which later
17630         resolves to either an Invocation or a Cast.
17631
17632         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17633         method; call this before EmitStatement() to make sure that this
17634         expression can be used as a statement.
17635
17636         * expression.cs (InvocationOrCast): New class; resolves to either
17637         an Invocation or a Cast.
17638
17639         * statement.cs (StatementExpression): Call ResolveStatement() on
17640         the ExpressionStatement before emitting it.
17641
17642 2003-07-21  Martin Baulig  <martin@ximian.com>
17643
17644         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17645         `ref' and `out' attributes match; fixes #46220.
17646         (MemberAccess.ResolveMemberAccess): You can't reference a type
17647         through an expression; fixes #33180.
17648         (Indexers.GetIndexersForType): Don't return the indexers from
17649         interfaces the class implements; fixes #46502.
17650
17651 2003-07-21  Martin Baulig  <martin@ximian.com>
17652
17653         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17654         CS0661 checks; fixes bug #30442.
17655
17656 2003-07-21  Martin Baulig  <martin@ximian.com>
17657
17658         * decl.cs (AdditionResult): Added `Error'.
17659
17660         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17661
17662         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17663         makes cs0031.cs actually work.
17664
17665 2003-07-20  Martin Baulig  <martin@ximian.com>
17666
17667         * namespace.cs: Fixed that bug which caused a crash when compiling
17668         the debugger's GUI.
17669
17670 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
17671
17672         * typemanager.cs (LookupTypeReflection): Never expose types which
17673         are NotPublic, NestedPrivate, NestedAssembly, or
17674         NestedFamANDAssem.  We used to return these, and later do a check
17675         that would report a meaningful error, but the problem is that we
17676         would not get the real match, if there was a name override.
17677
17678 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
17679
17680         * namespace.cs (Namespace, Name): Do not compute the namespace
17681         name dynamically, compute it in the constructor.  This reduced
17682         memory usage by 1697 KB.
17683
17684         * driver.cs: Use --pause to pause at the end.
17685
17686 2003-07-17  Peter Williams  <peter@newton.cx>
17687
17688         * Makefile: Change the name of the test target so that it doesn't
17689         conflict with the recursive test target.
17690
17691 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
17692
17693         * expression.cs (LocalVariableReference.Emit, EmitAssign,
17694         AddressOf): Do not use EmitThis, that was wrong, use the actual
17695         this pointer.
17696
17697 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
17698
17699         * class.cs (MethodData.Define): While checking if a method is an
17700         interface implementation, improve the test: If we are not public
17701         (use new test here: use the computed MethodAttributes directly,
17702         instead of the parsed modifier flags) check if the `implementing'
17703         method comes from an interface or not.
17704
17705         * pending.cs (VerifyPendingMethods): Slightly better error
17706         message.
17707
17708         * makefile: add test target that does the mcs bootstrap.
17709
17710 2003-07-16  Ravi Pratap  <ravi@ximian.com>
17711
17712         * interface.cs (Define): Do nothing here since there are no
17713         members to populate etc. Move the attribute emission out of here
17714         since this was just totally the wrong place to put it. Attribute
17715         application happens during the 'Emit' phase, not in the 'Define'
17716         phase.
17717
17718         (Emit): Add this method and move the attribute emission here
17719
17720         * rootcontext.cs (EmitCode): Call the Emit method on interface
17721         types too.
17722
17723 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17724
17725         * expression.cs (OverloadResolve): Report error only if Location
17726         is not 'Null' which means that there was a probe going on.
17727
17728 2003-07-14  Martin Baulig  <martin@ximian.com>
17729
17730         * expression.cs (ConditionalLogicalOperator): New public class to
17731         implement user defined conditional logical operators.
17732         This is section 14.11.2 in the spec and bug #40505.
17733
17734 2003-07-14  Martin Baulig  <martin@ximian.com>
17735
17736         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17737
17738 2003-07-14  Martin Baulig  <martin@ximian.com>
17739
17740         * codegen.cs (EmitContext.InFixedInitializer): New public field.
17741
17742         * ecore.cs (IVariable.VerifyFixed): New interface method.
17743
17744         * expression.cs (Unary.ResolveOperator): When resolving the `&'
17745         operator, check whether the variable is actually fixed.  Fixes bug
17746         #36055.  Set a variable definitely assigned when taking its
17747         address as required by the spec.
17748
17749         * statement.cs (LocalInfo.IsFixed): New field.
17750         (LocalInfo.MakePinned): Set `IsFixed' to true.
17751
17752 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17753
17754         * attribute.cs (Attribute.Resolve): While doing a Member lookup
17755         for .ctors, ensure that we only ask for members declared in the
17756         attribute type (BindingFlags.DeclaredOnly).
17757
17758         Fixes bug #43632.
17759
17760         * expression.cs (Error_WrongNumArguments): Report error 1501
17761         correctly the way CSC does.
17762
17763 2003-07-13  Martin Baulig  <martin@ximian.com>
17764
17765         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17766         lookup on the fully qualified name, to make things like "X.X" work
17767         where "X.X" is a fully qualified type name, but we also have a
17768         namespace "X" in the using list.  Fixes #41975.
17769
17770 2003-07-13  Martin Baulig  <martin@ximian.com>
17771
17772         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17773         function. If we're a CompoundAssign, we need to create an embedded
17774         CompoundAssign, not an embedded Assign.
17775         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17776         Fixes #45854.
17777
17778 2003-07-13  Martin Baulig  <martin@ximian.com>
17779
17780         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17781         work to fix bug #46088.
17782
17783 2003-07-13  Ravi Pratap <ravi@ximian.com>
17784
17785         * class.cs (Operator.Emit): Do not emit attributes here - it is
17786         taken care of by the Method class that we delegate too. This takes
17787         care of bug #45876.
17788
17789 2003-07-10  Martin Baulig  <martin@ximian.com>
17790
17791         * expression.cs (TypeOfVoid): New class.
17792         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
17793
17794 2003-07-10  Martin Baulig  <martin@ximian.com>
17795
17796         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17797         bug #35957.
17798
17799 2003-07-10  Martin Baulig  <martin@ximian.com>
17800
17801         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17802         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17803
17804         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17805
17806         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17807
17808 2003-07-10  Martin Baulig  <martin@ximian.com>
17809
17810         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17811         of decimal.  Fixes #42850.
17812
17813         NOTE: I also fixed the created byte blob, but this doesn't work on
17814         the MS runtime and csc never produces any byte blobs for decimal
17815         arrays.
17816
17817 2003-07-10  Martin Baulig  <martin@ximian.com>
17818
17819         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17820         structs; fixes #32068.
17821         (Block.AddChildVariableNames): Fixed #44302.
17822
17823 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17824
17825         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17826
17827 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17828
17829         * attribute.cs: And this test is onger needed.
17830
17831 2003-07-08  Martin Baulig  <martin@ximian.com>
17832
17833         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17834         inaccessible types.  Fixes #36313.
17835
17836         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17837
17838         * namespace.cs (NamespaceEntry): Create implicit entries for all
17839         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17840         implicit entries for N1.N2 and N1.
17841
17842 2003-07-08  Martin Baulig  <martin@ximian.com>
17843
17844         Rewrote the handling of namespaces to fix a lot of the issues
17845         wrt. `using' aliases etc.
17846
17847         * namespace.cs (Namespace): Splitted this class into a
17848         per-assembly `Namespace' and a per-file `NamespaceEntry'.
17849
17850         * typemanager.cs (TypeManager.IsNamespace): Removed.
17851         (TypeManager.ComputeNamespaces): Only compute namespaces from
17852         loaded assemblies here, not the namespaces from the assembly we're
17853         currently compiling.
17854
17855 2003-07-08  Martin Baulig  <martin@ximian.com>
17856
17857         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17858
17859 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17860
17861         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17862         already fixed it.  
17863
17864         I thought about the memory savings here, but LookupTypeReflection
17865         is used under already very constrained scenarios.  Compiling
17866         corlib or mcs only exposes one hit, so it would not really reduce
17867         any memory consumption.
17868
17869 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17870
17871         * typemanager.cs: fixes bug #45889 by only adding public types from
17872         other assemblies to the list of known types.
17873
17874 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17875
17876         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17877         on the type we resolved.
17878
17879 2003-07-05  Martin Baulig  <martin@ximian.com>
17880
17881         * pending.cs (PendingImplementation.ParentImplements): Don't
17882         create the proxy if the parent is abstract.
17883
17884         * class.cs (TypeContainer.DefineIndexers): Process explicit
17885         interface implementations first.  Fixes #37714.
17886
17887 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
17888
17889         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17890         defined recursively;  but since we modify the input parameters
17891         (left is set to `this' temporarily), we reset this value if the
17892         left_is_explicit is false, which gives the original semantics to
17893         the code.  
17894
17895         * literal.cs (NullPointer): new class used to represent a null
17896         literal in a pointer context.
17897
17898         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17899         type is a pointer, use a NullPointer object instead of a
17900         NullLiteral.   Closes 43687
17901
17902         (ExplicitConversion): Convert pointer values using
17903         the conv opcode to the proper type.
17904
17905         * ecore.cs (New): change ValueTypeVariable property into a method,
17906         that returns whether the valuetype is suitable for being used.
17907
17908         * expression.cs (Binary.DoNumericPromotions): Only return if we
17909         the int constant was a valid uint, and we can return both left and
17910         right as uints.  If not, we continue processing, to trigger the
17911         type conversion.  This fixes 39018.
17912
17913         * statement.cs (Block.EmitMeta): During constant resolution, set
17914         the CurrentBlock property on the emitcontext, so that we resolve
17915         constants propertly.
17916
17917 2003-07-02  Martin Baulig  <martin@ximian.com>
17918
17919         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17920         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17921
17922         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17923         than emitting it here.
17924
17925         * statement.cs: Fixed some more flow analysis bugs.
17926
17927 2003-07-02  Martin Baulig  <martin@ximian.com>
17928
17929         * class.cs (MethodData.Define): When implementing interface
17930         methods, set Final unless we're Virtual.
17931
17932         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17933         check work for interface methods.
17934
17935 2003-07-01  Martin Baulig  <martin@ximian.com>
17936
17937         * ecore.cs (EmitContext.This): Replaced this property with a
17938         GetThis() method which takes a Location argument.  This ensures
17939         that we get the correct error location for a CS0188.
17940
17941 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
17942
17943         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17944         ImplicitStandardConversion.
17945
17946         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17947
17948 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
17949
17950         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17951         optimization.
17952
17953 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
17954
17955         * class.cs (Constructor.Define): Turn off initlocals for unsafe
17956         constructors.
17957
17958         (MethodData.Define): Turn off initlocals for unsafe methods.
17959
17960 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
17961
17962         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17963         complete;  Fixes #37521.
17964
17965         * delegate.cs: Use Modifiers.TypeAttr to compute the
17966         TypeAttributes, instead of rolling our own.  This makes the flags
17967         correct for the delegates.
17968
17969 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
17970
17971         * class.cs (Constructor.Define): Set the private flag for static
17972         constructors as well.
17973
17974         * cs-parser.jay (statement_expression): Set the return value to
17975         null, to avoid a crash when we catch an error.
17976
17977 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
17978
17979         * cs-parser.jay: Applied patch from Jackson that adds support for
17980         extern and unsafe modifiers to destructor declarations.
17981
17982         * expression.cs: Report error 21 if the user is trying to index a
17983         System.Array.
17984
17985         * driver.cs: Add an error message, suggested by the bug report.
17986
17987         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
17988         if we do not have a ": this ()" constructor initializer.  Fixes 45149
17989
17990 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
17991
17992         * namespace.cs: Add some information to reduce FAQs.
17993
17994 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
17995
17996         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
17997         underlying enumeration types.  Fixes #43915.
17998
17999         * expression.cs: Treat ushort/short as legal values to be used in
18000         bitwise operations.
18001
18002 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
18003
18004         * delegate.cs: transfer custom attributes for paramenters from
18005         the delegate declaration to Invoke and BeginInvoke.
18006
18007 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
18008
18009         * attribute.cs: handle custom marshalers and emit marshal info
18010         for fields, too.
18011
18012 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
18013
18014         * makefile.gnu: Added anonymous.cs to the compiler sources.
18015
18016 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
18017
18018         * iterators.cs: Change the name of the proxy class to include two
18019         underscores.
18020
18021         * cs-parser.jay: Update grammar to include anonymous methods.
18022
18023         * anonymous.cs: new file.
18024
18025 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
18026
18027         * class.cs (Field.Define): Add missing test for pointers and
18028         safety. 
18029
18030 2003-05-27  Ravi Pratap  <ravi@ximian.com>
18031
18032         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
18033         we use the stobj opcode.
18034
18035         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
18036         since it wasn't the correct fix. 
18037
18038         It still is puzzling that we are required to use stobj for IntPtr
18039         which seems to be a ValueType.
18040
18041 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
18042
18043         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
18044         during regular simple name resolution.   Now, the trick is that
18045         instead of returning for processing the simplename, we do a
18046         TypeManager.LookupType (ie, a rooted lookup as opposed to a
18047         contextual lookup type).   If a match is found, return that, if
18048         not, return for further composition.
18049
18050         This fixes long-standing 30485.
18051
18052         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
18053         using the address to initialize an object, do an Stobj instead of
18054         using the regular Stelem.
18055
18056         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
18057         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
18058         Because if we are a BaseIndexerAccess that value will be true.
18059         Fixes 43643.
18060
18061         * statement.cs (GotoCase.Resolve): Return after reporting an
18062         error, do not attempt to continue. 
18063
18064         * expression.cs (PointerArithmetic.Emit): If our operand is a
18065         long, convert our constants to match the operand before
18066         multiplying.  Convert to I type before adding.   Fixes 43670.
18067
18068 2003-05-14  Ravi Pratap  <ravi@ximian.com>
18069
18070         * enum.cs (ImplicitConversionExists) : Rename to
18071         ImplicitEnumConversionExists to remove ambiguity. 
18072
18073         * ecore.cs (NullCast): New type of cast expression class which
18074         basically is very similar to EmptyCast with the difference being
18075         it still is a constant since it is used only to cast a null to
18076         something else
18077         (eg. (string) null)
18078
18079         * convert.cs (ImplicitReferenceConversion): When casting a null
18080         literal, we return a NullCast.
18081
18082         * literal.cs (NullLiteralTyped): Remove - I don't see why this
18083         should be around anymore.
18084
18085         The renaming (reported was slightly wrong). Corrections:
18086
18087         ConvertImplicitStandard -> ImplicitConversionStandard
18088         ConvertExplicitStandard -> ExplicitConversionStandard
18089
18090         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
18091         before passing them in !
18092
18093         * convert.cs (ImplicitConversionStandard): When comparing for
18094         equal expr and target types, ensure that expr is not a
18095         NullLiteral.
18096
18097         In general, we must not be checking (expr_type ==
18098         target_type) in the top level conversion methods
18099         (ImplicitConversion, ExplicitConversion etc). This checking is
18100         done in the methods that they delegate to.
18101
18102 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
18103
18104         * convert.cs: Move Error_CannotConvertType,
18105         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
18106         ImplicitNumericConversion, ImplicitConversionExists,
18107         ImplicitUserConversionExists, StandardConversionExists,
18108         FindMostEncompassedType, FindMostSpecificSource,
18109         FindMostSpecificTarget, ImplicitUserConversion,
18110         ExplicitUserConversion, GetConversionOperators,
18111         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
18112         TryImplicitIntConversion, Error_CannotConvertImplicit,
18113         ConvertImplicitRequired, ConvertNumericExplicit,
18114         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
18115         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
18116         its own file.
18117
18118         Perform the following renames:
18119
18120         StandardConversionExists -> ImplicitStandardConversionExists
18121         ConvertImplicit -> ImplicitConversion
18122         ConvertImplicitStandard -> ImplicitStandardConversion
18123         TryImplicitIntConversion -> ImplicitIntConversion
18124         ConvertImplicitRequired -> ImplicitConversionRequired
18125         ConvertNumericExplicit -> ExplicitNumericConversion
18126         ConvertReferenceExplicit -> ExplicitReferenceConversion
18127         ConvertExplicit -> ExplicitConversion
18128         ConvertExplicitStandard -> ExplicitStandardConversion
18129
18130 2003-05-19  Martin Baulig  <martin@ximian.com>
18131
18132         * statement.cs (TypeInfo.StructInfo): Made this type protected.
18133         (TypeInfo): Added support for structs having structs as fields.
18134
18135         * ecore.cs (FieldExpr): Implement IVariable.
18136         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
18137         VariableInfo for the field.
18138
18139 2003-05-18  Martin Baulig  <martin@ximian.com>
18140
18141         * expression.cs (This.DoResolve): Report a CS0027 if we're
18142         emitting a field initializer.
18143
18144 2003-05-18  Martin Baulig  <martin@ximian.com>
18145
18146         * expression.cs (This.ResolveBase): New public function.
18147         (This.DoResolve): Check for CS0188.
18148
18149         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
18150         This.Resolve().
18151
18152         * ecore.cs (MethodGroupExpr.DoResolve): Set the
18153         `instance_expression' to null if we don't have any non-static
18154         methods.
18155
18156 2003-05-18  Martin Baulig  <martin@ximian.com>
18157
18158         Reworked the way how local variables and parameters are handled by
18159         the flow analysis code.
18160
18161         * statement.cs (TypeInfo, VariableMap): New public classes.
18162         (VariableInfo): New public class.  This is now responsible for
18163         checking whether a variable has been assigned.  It is used for
18164         parameters and local variables.
18165         (Block.EmitMeta): Take the InternalParameters as argument; compute
18166         the layout of the flow vectors here.
18167         (Block.LocalMap, Block.ParameterMap): New public properties.
18168         (FlowBranching): The .ctor doesn't get the InternalParameters
18169         anymore since Block.EmitMeta() now computes the layout of the flow
18170         vector.
18171         (MyStructInfo): This class is now known as `StructInfo' and nested
18172         in `TypeInfo'; we don't access this directly anymore.
18173
18174         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
18175         property and removed IsAssigned(), IsFieldAssigned(),
18176         SetAssigned() and SetFieldAssigned(); we now call them on the
18177         VariableInfo so we don't need to duplicate this code everywhere.
18178
18179         * expression.cs (ParameterReference): Added `Block block' argument
18180         to the .ctor.
18181         (LocalVariableReference, ParameterReference, This): The new
18182         VariableInfo class is now responsible for all the definite
18183         assignment stuff.
18184
18185         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
18186         IsParameterAssigned, SetParameterAssigned): Removed.
18187
18188 2003-05-18  Martin Baulig  <martin@ximian.com>
18189
18190         * typemanager.cs (InitCoreTypes): Try calling
18191         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
18192         the 3-args-version.  Corlib now also needs our `void_type'.
18193         (GetMethod): Added overloaded version which takes an optional
18194         `bool report_errors' to allow lookups of optional methods.
18195
18196 2003-05-12  Martin Baulig  <martin@ximian.com>
18197
18198         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
18199         only used for locals and not for parameters.
18200
18201 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
18202
18203         * support.cs (InternalParameters.ParameterType): Return the
18204         ExternalType of the parameter.
18205
18206         * parameter.cs (Parameter.ExternalType): drop the two arguments,
18207         they were unused.
18208
18209 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
18210
18211         * class.cs (MethodData.Define): Do not set the `newslot' on
18212         interface members, if they are also flagged as "override".
18213
18214         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
18215         better code for ++i and i++.  This only works for static fields
18216         and local variables.
18217
18218         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
18219         want to pull the DeclSpace out of the builder_to_declspace instead
18220         of the TypeBuilder (like in TypeContainer.FindMembers).
18221
18222         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
18223         instead of LookupTypeContainer.  Fixes the crash on .NET for
18224         looking up interface members.
18225
18226         * const.cs: Create our own emit context during the Definition
18227         stage, so that constants are evaluated in the proper context, when
18228         a recursive definition happens.
18229
18230 2003-05-11  Martin Baulig  <martin@ximian.com>
18231
18232         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
18233         new block for a switch section.
18234         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
18235         the adding/lookup in the switch block.  Fixes #39828.
18236
18237 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
18238
18239         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
18240         functionality: I needed to convert the data after I had performed
18241         the add/sub operation into the operands type size.
18242
18243         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
18244         pass the type for the box operation, otherwise the resulting
18245         object would have been of type object.
18246
18247         (BoxedCast): Add constructor to specify the type to box as.
18248
18249 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
18250
18251         * iterators.cs: I was reusing the `count' variable inadvertently,
18252         take steps to not allow this to happen.
18253
18254 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
18255
18256         * attribute.cs (Attribute.Resolve): Params attributes are encoded
18257         by creating an array at the point where the params starts and
18258         putting all those arguments there, then adjusting the size of the
18259         array.
18260
18261 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
18262
18263         * expression.cs (New.AddressOf): Implement interface
18264         IMemoryLocation.  This is used when the `new' operator is used in
18265         the context of an invocation to a method on a value type.
18266
18267         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
18268         example. 
18269
18270         * namespace.cs: Also check the using aliases here.
18271
18272         * driver.cs: Move the test for using validity after the types have
18273         been entered, so we do a single pass that also includes the using
18274         aliases. 
18275
18276         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
18277         in the regular case.   CreateSiblingForFinally is doing extra
18278         error checking.
18279
18280         * attribute.cs (GetAttributeArgumentExpression): Store the result
18281         on an out value, and use the return value to indicate failure
18282         instead of using null (which is a valid return for Constant.GetValue).
18283
18284         * statement.cs: Perform the analysis flow for the increment
18285         portion after the statement, because this will be the real flow of
18286         execution.  Fixes #42385
18287
18288         * codegen.cs (EmitContext.EmitArgument,
18289         EmitContext.EmitStoreArgument): New helper functions when the
18290         RemapToProxy flag is set.
18291
18292         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
18293         function.
18294
18295         Add support for remapping parameters. 
18296
18297         * iterators.cs: Propagate parameter values;  Store parameter
18298         values in the proxy classes.
18299
18300 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
18301
18302         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
18303         need a proxy reference;  I do not know what I was thinking
18304
18305         * cs-parser.jay (constructor_initializer): catch another error,
18306         and display nice message.
18307
18308         (field_declaration): catch void field declaration
18309         to flag a better error. 
18310
18311         * class.cs (MemberBase.CheckBase): Report an error instead of a
18312         warning if a new protected member is declared in a struct. 
18313         (Field.Define): catch the error of readonly/volatile.
18314
18315         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18316
18317         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
18318         volatile variable is taken
18319
18320 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
18321
18322         * statement.cs (Fixed.Resolve): Report an error if we are not in
18323         an unsafe context.
18324
18325 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
18326
18327         * typemanager.cs: reuse the code that handles type clashes for
18328         delegates and enumerations.
18329
18330         * class.cs (Report28): Always report.
18331
18332         * expression.cs (EncodeAsAttribute): Allow nulls here.
18333
18334 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
18335
18336         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18337         the functionality for testing whether an expression is valid for
18338         an attribute here.  Also handle the case of arrays of elements
18339         being stored. 
18340
18341         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18342         encoding a linear array into an array of objects that are suitable
18343         to be passed to an CustomAttributeBuilder.
18344
18345         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18346
18347         * ecore.cs: (FieldExpr): Handle field remapping here.
18348
18349         * iteratators.cs: Pass the instance variable (if the method is an
18350         instance method) to the constructors, so we can access the field
18351         variables on the class.
18352
18353         TODO: Test this with structs.  I think the THIS variable on
18354         structs might have to be a pointer, and not a refenrece
18355
18356 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
18357
18358         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18359         local variables to fields in a proxy class.
18360
18361         * iterators.cs (PopulateProxy): Rename our internal fields to
18362         <XXX>.  
18363         Create a <THIS> field if we are an instance method, so we can
18364         reference our parent container variables.
18365         (MapVariable): Called back from the EmitContext code to enter a
18366         new variable to field mapping into the proxy class (we just create
18367         a FieldBuilder).
18368
18369         * expression.cs
18370         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18371         for using the remapped locals to fields.
18372
18373         I placed the code here, because that gives the same semantics to
18374         local variables, and only changes the Emit code.
18375
18376         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18377         statements inside iterators.
18378         (VariableInfo): Add a FieldBuilder for the cases when we are
18379         remapping local variables to fields in a proxy class
18380
18381         * ecore.cs (SimpleNameResolve): Avoid testing two times for
18382         current_block != null.
18383
18384         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18385         not cope with strings, as it has been moved to the
18386         TableSwitchEmit.  Fixed bug in switch generation.
18387
18388         * expression.cs (New.DoResolve): Provide more context for the user
18389         when reporting an error.
18390
18391         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18392         pointers. 
18393
18394         * expression.cs (MemberAccess.DoResolve): When we get a type back,
18395         check the permissions for it.  Note than in a type-resolution
18396         context the check was already present in DeclSpace.ResolveType,
18397         but was missing from the MemberAccess.
18398
18399         (ArrayCreation.CheckIndices): warn if the user has
18400         more nested levels of expressions, but there are no more
18401         dimensions specified.  Avoids crash on bug 41906.
18402
18403 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
18404
18405         * statement.cs (Block): replace Implicit bool, for a generic
18406         flags.   
18407         New flag: `Unchecked'.  This is used during the EmitMeta phase
18408         (which is out-of-line with the regular Resolve/Emit process for a
18409         statement, as this is done ahead of time, but still gets a chance
18410         to call constant resolve).
18411
18412         (Block.Flags): new enum for adding a new flag.
18413
18414         (Block.EmitMeta): track the state of unchecked.
18415
18416         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18417         to enable constant resolution to work there as well.
18418
18419 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
18420
18421         * typemanager.cs (ienumerable_type): Also look up
18422         System.Collections.IEnumerable. 
18423
18424 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
18425
18426         TODO: Test more than one conditional per method.
18427
18428         * class.cs (Indexer.Define): Report the location where the user is
18429         referencing the unsupported feature.
18430
18431         (MethodData): Overload the use of `conditionals' to
18432         minimize the creation of needless ArrayLists.   This saves roughly
18433         212kb on my machine.
18434
18435         (Method): Implement the new IIteratorContainer interface.
18436         (Method.SetYields): Implement the method by setting the ModFlags
18437         to contain METHOD_YIELDS.
18438
18439         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18440         which just got set to null.
18441
18442         * iterators.cs: New file.
18443
18444         (Yield, YieldBreak): New statements.
18445
18446         * statement.cs (Return.Resolve): Flag an error if we are used in
18447         an iterator method.
18448
18449         * codegen.cs (InIterator): New flag set if the code is being
18450         compiled in an iterator method.
18451
18452         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
18453         internal modifier, and we just use it to avoid adding extra
18454         fields, as this is seldom used.  
18455
18456         * cs-parser.jay: Add yield_statement (yield and yield break).
18457
18458         * driver.cs: New flag -v2 to turn on version 2 features. 
18459
18460         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18461         hashtable when v2 is enabled.
18462
18463 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
18464
18465         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18466         there is already a namespace defined with this name.
18467
18468         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18469         people upgraded their corlibs.
18470
18471         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18472         always use fully qualified types, no need to use the compiler
18473         front end.
18474
18475         (TypeManager.IsNamespace): Use binarysearch.
18476
18477         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18478         AddDelegate): I did not quite use the new IsValid API properly: I
18479         have to pass the short-name and the fullname.  I was passing only
18480         the basename instead of the fullname sometimes. 
18481
18482         (TypeContainer.DefineType): call NamespaceClash.
18483
18484         * interface.cs (Interface.DefineType): use NamespaceClash before
18485         defining the type.
18486
18487         * delegate.cs (Delegate.DefineType): use NamespaceClash before
18488         defining the type.
18489
18490         * enum.cs: (Enum.DefineType): use NamespaceClash before
18491         defining the type.
18492
18493         * typemanager.cs (: 3-line patch that gives us some tasty 11%
18494         speed increase.  First, use the negative_hits cache when we get a
18495         negative.  Second, add the type with its full original name
18496         instead of the new . and + encoded name (reflection uses + to
18497         separate type from a nested type).  Use LookupTypeReflection
18498         directly which bypasses the type->name hashtable (that we already
18499         know does not contain the type.
18500
18501         * decl.cs (DeclSpace.ResolveTypeExpr): track the
18502         location/container type. 
18503
18504         * driver.cs: When passing utf8, use directly the UTF8Encoding.
18505
18506 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
18507
18508         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18509
18510         * delegate.cs (NewDelegate.Resolve): Test whether an instance
18511         method is being referenced in the method group from a static
18512         context, and report error 120 if so.
18513
18514         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18515         Error118. 
18516
18517         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18518         is created, we create the A namespace).
18519
18520         * cs-parser.jay: A namespace also introduces a DeclarationFound.
18521         Fixes #41591
18522
18523 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
18524
18525         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18526         invocation to ModuleBuilder.GetType with the same values will
18527         return a new type instance, so we need to cache its return
18528         values. 
18529
18530         * expression.cs (Binary.ResolveOperator): Only allow the compare
18531         operators on enums if they are of the same type.
18532
18533         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18534         types of ValueType on their own case.  Before we were giving them
18535         the same treatment as objects.
18536
18537         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18538         fullname.  Short name is used to compare against container name.
18539         Fullname is used to check against defined namespace names.
18540
18541         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18542         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18543
18544         (Method.CheckBase): Call parent.
18545         (MemberBase.CheckBase): Check for protected members on sealed
18546         classes.
18547         (PropertyBase.CheckBase): Call parent.
18548         (Field.Define): Call parent.
18549
18550         * report.cs: Negative error codes are now mapped to 8000 - code,
18551         so that the display is render more nicely.
18552
18553         * typemanager.cs: Do not use try/catch, instead report a regular
18554         error. 
18555
18556         (GetPointerType, GetReferenceType): These methods provide
18557         mechanisms to obtain the T* and T& from a T.  We had the code
18558         previously scattered around the code base, and it also used
18559         TypeManager.LookupType that would go through plenty of caches.
18560         This one goes directly to the type source.
18561
18562         In some places we did the Type.GetType followed by
18563         ModuleBuilder.GetType, but not in others, so this unifies the
18564         processing as well.
18565
18566         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18567         statements now that we have namespace information.
18568
18569         * typemanager.cs (IsNamespace): New method, returns whether the
18570         string presented is a namespace or not.
18571
18572         (ComputeNamespaces): New public entry point, computes the list of
18573         available namespaces, using the GetNamespaces API call in Mono, or
18574         the slower version in MS.NET.   
18575
18576         Now before we start the semantic analysis phase, we have a
18577         complete list of namespaces including everything that the user has
18578         provided.
18579
18580         Deleted old code to cache namespaces in .nsc files.
18581
18582 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
18583
18584         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18585         class/struct location definition Location for the implicit
18586         constructor location.
18587
18588         (Operator.Define): Use the location of the operator for the
18589         implicit Method definition.
18590
18591         (Constructor.Emit): use the constructor location for the implicit
18592         base initializer constructor.
18593
18594         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
18595         and the Expression class now contains two new methods:
18596
18597         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
18598         isolate type lookup from the rest of the resolution process.
18599
18600         Since we use Expressions to hold type definitions due to the way
18601         we parse the input we have historically overloaded Resolve to
18602         perform the Type lookups if a special flag is passed.  Now this is
18603         eliminated and two methods take their place. 
18604
18605         The differences in the two methods between xStep and xTerminal is
18606         that xStep is involved in our current lookup system that uses
18607         SimpleNames to compose a name, while xTerminal is used just to
18608         catch the case where the simplename lookup failed.
18609
18610 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
18611
18612         * expression.cs (ResolveMemberAccess): Remove redundant code.
18613         TypeExpr expressions are always born fully resolved.
18614
18615         * interface.cs (PopulateMethod): Do not lookup the types twice.
18616         We were doing it once during SemanticAnalysis and once during
18617         PopulateMethod.
18618
18619         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18620         in local variable type definitions, were being returned as a
18621         SimpleName (we decomposed everything into a string), that is
18622         because primary_expression was being used instead of a type in the
18623         grammar (reduce/reduce conflicts).
18624
18625         The part that was wrong is that we converted the expression into a
18626         string (an oversimplification in one hand, compounded with primary
18627         expressions doing string concatenation).
18628
18629         So things like:
18630
18631         A.B.C [] x;
18632
18633         Would return "A.B.C[]" as a SimpleName.  This stopped things like
18634         using clauses from working on this particular context.  And a type
18635         was being matched directly against "A.B.C[]".
18636
18637         We now use the correct approach, and allow for ComposedCast to be
18638         part of the unary expression.  So the "A.B.C []" become a composed
18639         cast of "A.B.C" (as a nested group of MemberAccess with a
18640         SimpleName at the end) plus the rank composition "[]". 
18641
18642         Also fixes 35567
18643
18644 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
18645
18646         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18647         for the access level checking.
18648
18649         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
18650         `TypeContainer container', because I kept getting confused when I
18651         was debugging this code.
18652
18653         * expression.cs (Indexers): Instead of tracking getters/setters,
18654         we now track them in parallel.  We create one arraylist less, but
18655         most importantly it is possible now for the LValue code to find a
18656         matching get for a set.
18657
18658         (IndexerAccess.DoResolveLValue): Update the code.
18659         GetIndexersForType has been modified already to extract all the
18660         indexers from a type.  The code assumed it did not.
18661
18662         Also make the code set the correct return type for the indexer.
18663         This was fixed a long time ago for properties, but was missing for
18664         indexers.  It used to be void_type.
18665
18666         (Binary.Emit): Test first for doubles instead of
18667         floats, as they are more common.
18668
18669         (Binary.EmitBranchable): Use the .un version of the branch opcodes
18670         when dealing with floats and the <=, >= operators.  This fixes bug
18671         #39314 
18672
18673         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18674         to load the array value by emitting a load on the foreach variable
18675         type.  This was incorrect.  
18676
18677         We now emit the code to load an element using the the array
18678         variable type, and then we emit the conversion operator.
18679
18680         Fixed #40176
18681
18682 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
18683
18684         * attribute.cs: Avoid allocation of ArrayLists in the common case.
18685
18686 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
18687
18688         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18689         test for protection before we test for signatures. 
18690
18691         (MethodSignature.ToString): implement.
18692
18693         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18694         to the case where we reduced into a LongConstant.
18695
18696         * decl.cs (CheckAccessLevel): If the type is an array, we can not
18697         depend on whether the information is acurrate, because the
18698         Microsoft runtime will always claim that the array type is public,
18699         regardless of the real state.
18700
18701         If the type is a pointer, another problem happens: the type is
18702         reported as non-public in Microsoft.  
18703
18704         In both cases we have to call CheckAccessLevel recursively with
18705         the underlying type as the argument to be tested.
18706
18707 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
18708
18709         * assign.cs (Assign.Emit): If we are dealing with a compound
18710         assignment expression, we should use the code path that stores the
18711         intermediate result in a temporary value.  This fixes #40903.
18712
18713         *expression.cs (Indirection.ToString): Provide ToString method for
18714         debugging. 
18715
18716 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
18717
18718         * class.cs: Null out fields holding references to Block objects so
18719         they can be garbage collected.
18720
18721         * expression.cs (OverloadResolve): Remove unused local.
18722
18723 2003-04-07  Martin Baulig  <martin@ximian.com>
18724
18725         * codegen.cs (EmitContext.CurrentFile): New public field.
18726         (EmitContext.Mark): Use the CurrentFile to check whether the
18727         location is in the correct file.
18728         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18729
18730 2003-04-07  Martin Baulig  <martin@ximian.com>
18731
18732         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18733
18734         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18735         location.  [FIXME: The location argument which gets passed to this
18736         method is sometimes wrong!]
18737
18738 2003-04-07  Nick Drochak <ndrochak@gol.com>
18739
18740         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18741
18742 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
18743
18744         * expression.cs (Indirection.EmitAssign): We were using the
18745         temporary, but returning immediately instead of continuing the
18746         EmitAssing flow.
18747
18748 2003-04-06  Martin Baulig  <martin@ximian.com>
18749
18750         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18751         if it's a nested child, but also deriving from the outer class.
18752         See test 190.cs.
18753
18754         * typemanager.cs (IsNestedChildOf): Make this work if it's a
18755         nested child, but also deriving from the outer class.  See
18756         test-190.cs.
18757         (FilterWithClosure): We may access private members of the outer
18758         class if we're a nested child and deriving from the outer class.
18759         (RealMemberLookup): Only set `closure_private_ok' if the
18760         `original_bf' contained BindingFlags.NonPublic.
18761
18762 2003-04-05  Martin Baulig  <martin@ximian.com>
18763
18764         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18765
18766 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
18767
18768         * class.cs (Event.Define): Do not allow abstract events to have
18769         initializers. 
18770
18771 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
18772
18773         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18774         block in event declarations.
18775
18776         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18777         value type, get its address.
18778
18779         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18780         leaving a class on the stack instead of a boolean value (int
18781         0/1).  Change the code so we compare against null, and then the
18782         result against zero.
18783
18784         * class.cs (TypeContainer.GetClassBases): We were checking for the
18785         parent class being sealed too late.
18786
18787         * expression.cs (Binary.Emit): For <= and >= when dealing with
18788         floating point values, use cgt.un and clt.un instead of cgt and
18789         clt alone.
18790
18791 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
18792
18793         * statement.cs: Apply the same optimization as MS: skip the 
18794         GetEnumerator returning an IEnumerator, and use the one returning a 
18795         CharEnumerator instead. This allows us to avoid the try-finally block 
18796         and the boxing.
18797
18798 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
18799
18800         * cs-parser.jay: Attributes cannot be applied to
18801                          namespaces. Fixes #40473
18802
18803 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18804
18805         * class.cs:
18806         (Add*): check if the name is valid using the full name for constants,
18807         fields, properties and events.
18808
18809 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
18810
18811         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18812         char constants to be part of the enumeration.
18813
18814         * expression.cs (Conditional.DoResolve): Add support for operator
18815         true. Implements the missing functionality from 14.12
18816
18817         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18818         operator true/false as required by the spec.
18819
18820         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18821         implicit conversion to boolean.
18822
18823         * statement.cs (Statement.ResolveBoolean): A boolean expression is
18824         also one where the type implements `operator true'. 
18825
18826         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18827         get an expression that will invoke operator true based on an
18828         expression.  
18829
18830         (GetConversionOperators): Removed the hack that called op_True
18831         here.  
18832
18833         (Expression.ResolveBoolean): Move this from Statement.
18834
18835 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
18836
18837         * ecore.cs (FieldExpr): do not allow initialization of initonly
18838         fields on derived classes
18839
18840 2003-03-13  Martin Baulig  <martin@ximian.com>
18841
18842         * statement.cs (Block.Emit): Call ig.BeginScope() and
18843         ig.EndScope() when compiling with debugging info; call
18844         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18845
18846 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
18847
18848         * expression.cs (Indexers): Do not construct immediately, allow
18849         for new members to be appended as we go.  Fixes 38143
18850
18851 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18852
18853         * expression.cs: save/restore context when resolving an unchecked
18854         expression.
18855
18856 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
18857
18858         * cfold.cs: Catch division by zero in modulus operator during
18859         constant folding.
18860
18861 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
18862
18863         * interface.cs (Interface.DefineMembers): Avoid defining members
18864         twice. 
18865
18866 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
18867
18868         * driver.cs: handle the +/- options for -noconfig
18869
18870         * statement.cs (Unckeched.Resolve): Also track the state of
18871         unchecked in the Resolve phase.
18872
18873 2003-02-27  Martin Baulig  <martin@ximian.com>
18874
18875         * ecore.cs (Expression.MemberLookup): Don't create a
18876         MethodGroupExpr for something which is not a method.  Fixes #38291.
18877
18878 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
18879
18880         * class.cs (MemberBase.CheckParameters): Also check that the type
18881         is unmanaged if it is a pointer.
18882
18883         * expression.cs (SizeOf.Resolve): Add location information.
18884
18885         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18886         a managed type is declared.
18887
18888         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18889         parameter modifiers as well.  Fixes bug 38606
18890
18891         * class.cs: Very sad.  Am backing out the speed up changes
18892         introduced by the ArrayList -> Array in the TypeContainer, as they
18893         were not actually that much faster, and introduced a bug (no error
18894         reports on duplicated methods).
18895
18896         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18897         source first, this will guarantee that we have a valid expression
18898         before calling in lower levels functions that will require a
18899         resolved object.  Then use this original_source in the
18900         target.ResolveLValue instead of the original source that was
18901         passed to us.
18902
18903         Another change.  Use target.Resolve instead of LValueResolve.
18904         Although we are resolving for LValues, we will let the Assign code
18905         take care of that (it will be called again from Resolve).  This
18906         basically allows code like this:
18907
18908         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18909         class Y { void A (X x) { x [0] += o; }
18910
18911         The problem was that the indexer was trying to resolve for
18912         set_Item (idx, object o) and never finding one.  The real set_Item
18913         was set_Item (idx, X).  By delaying the process we get the right
18914         semantics. 
18915
18916         Fixes bug 36505
18917
18918 2003-02-23  Martin Baulig  <martin@ximian.com>
18919
18920         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18921         while calling DoEmit ().
18922
18923         * codegen.cs (EmitContext.Mark): Don't mark locations in other
18924         source files; if you use the #line directive inside a method, the
18925         compiler stops emitting line numbers for the debugger until it
18926         reaches the end of the method or another #line directive which
18927         restores the original file.
18928
18929 2003-02-23  Martin Baulig  <martin@ximian.com>
18930
18931         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18932
18933 2003-02-23  Martin Baulig  <martin@ximian.com>
18934
18935         * statement.cs (Block.AddChildVariableNames): We need to call this
18936         recursively, not just for our immediate children.
18937
18938 2003-02-23  Martin Baulig  <martin@ximian.com>
18939
18940         * class.cs (Event.Define): Always make the field private, like csc does.
18941
18942         * typemanager.cs (TypeManager.RealMemberLookup): Make events
18943         actually work, fixes bug #37521.
18944
18945 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
18946
18947         * delegate.cs: When creating the various temporary "Parameters"
18948         classes, make sure that we call the ComputeAndDefineParameterTypes
18949         on those new parameters (just like we do with the formal ones), to
18950         allow them to be resolved in the context of the DeclSpace.
18951
18952         This fixes the bug that Dick observed in Bugzilla #38530.
18953
18954 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
18955
18956         * expression.cs (ResolveMemberAccess): When resolving a constant,
18957         do not attempt to pull a constant if the value was not able to
18958         generate a valid constant.
18959
18960         * const.cs (LookupConstantValue): Do not report more errors than required.
18961
18962 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18963
18964         * expression.cs: fixes bug #38328.
18965
18966 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
18967
18968         * class.cs: Changed all the various members that can be part of a
18969         class from being an ArrayList to be an Array of the right type.
18970         During the DefineType type_list, interface_list, delegate_list and
18971         enum_list are turned into types, interfaces, delegates and enums
18972         arrays.  
18973
18974         And during the member population, indexer_list, event_list,
18975         constant_list, field_list, instance_constructor_list, method_list,
18976         operator_list and property_list are turned into their real arrays.
18977
18978         Although we could probably perform this operation earlier, for
18979         good error reporting we need to keep the lists and remove the
18980         lists for longer than required.
18981
18982         This optimization was triggered by Paolo profiling the compiler
18983         speed on the output of `gen-sample-program.pl' perl script. 
18984
18985         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
18986         not crash in methods like MemberLookupFailed that use this field.  
18987
18988         This problem arises when the compiler fails to resolve a type
18989         during interface type definition for example.
18990
18991 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
18992
18993         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
18994         inherit from System.Object, so we have to stop at null, not only
18995         when reaching System.Object.
18996
18997 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
18998
18999         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
19000         DeclaredOnly because the parent indexer might have had a different
19001         name, but did not loop until the top of the hierarchy was reached.
19002
19003         The problem this one fixes is 35492: when a class implemented an
19004         indexer from an interface, we were getting the interface method
19005         (which was abstract) and we were flagging an error (can not invoke
19006         abstract method).
19007
19008         This also keeps bug 33089 functioning, and test-148 functioning.
19009
19010         * typemanager.cs (IsSpecialMethod): The correct way of figuring
19011         out if a method is special is to see if it is declared in a
19012         property or event, or whether it is one of the predefined operator
19013         names.   This should fix correctly #36804.
19014
19015 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
19016
19017         The goal here is to remove the dependency on EmptyCast.Peel ().
19018         Killing it completely.
19019
19020         The problem is that currently in a number of places where
19021         constants are expected, we have to "probe" for an EmptyCast, and
19022         Peel, which is not the correct thing to do, as this will be
19023         repetitive and will likely lead to errors. 
19024
19025         The idea is to remove any EmptyCasts that are used in casts that
19026         can be reduced to constants, so we only have to cope with
19027         constants. 
19028
19029         This bug hunt was triggered by Bug 37363 and the desire to remove
19030         the duplicate pattern where we were "peeling" emptycasts to check
19031         whether they were constants.  Now constants will always be
19032         constants.
19033
19034         * ecore.cs: Use an enumconstant here instead of wrapping with
19035         EmptyCast.  
19036
19037         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
19038         throwing me off.  By handling this we can get rid of a few hacks.
19039
19040         * statement.cs (Switch): Removed Peel() code.
19041
19042 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
19043
19044         * class.cs: Location information for error 508
19045
19046         * expression.cs (New.DoResolve): Add a guard against double
19047         resolution of an expression.  
19048
19049         The New DoResolve might be called twice when initializing field
19050         expressions (see EmitFieldInitializers, the call to
19051         GetInitializerExpression will perform a resolve on the expression,
19052         and later the assign will trigger another resolution
19053
19054         This leads to bugs (#37014)
19055
19056         * delegate.cs: The signature for EndInvoke should contain any ref
19057         or out parameters as well.  We were not doing this in the past. 
19058
19059         * class.cs (Field.Define): Do not overwrite the type definition
19060         inside the `volatile' group.  Turns out that volatile enumerations
19061         were changing the type here to perform a validity test, which
19062         broke conversions. 
19063
19064 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
19065
19066         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
19067         and structs, we do not want to load the instance variable
19068
19069         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
19070         enum_type has to be handled like an object reference (implicit
19071         conversions exists from this to object), but the regular IsClass
19072         and IsValueType tests will never return true for this one.
19073
19074         Also we use TypeManager.IsValueType instead of type.IsValueType,
19075         just for consistency with the rest of the code (this is only
19076         needed if we ever use the construct exposed by test-180.cs inside
19077         corlib, which we dont today).
19078
19079 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
19080
19081         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
19082         just InternalCall.
19083
19084 2003-02-09  Martin Baulig  <martin@ximian.com>
19085
19086         * namespace.cs (Namespace..ctor): Added SourceFile argument.
19087         (Namespace.DefineNamespaces): New static public method; this is
19088         called when we're compiling with debugging to add all namespaces
19089         to the symbol file.
19090
19091         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
19092         pass it to the Namespace's .ctor.
19093
19094         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
19095         and MethodBase arguments; pass the namespace ID to the symwriter;
19096         pass the MethodBase instead of the token to the symwriter.
19097         (SymbolWriter.DefineNamespace): New method to add a namespace to
19098         the symbol file.
19099
19100 2003-02-09  Martin Baulig  <martin@ximian.com>
19101
19102         * symbolwriter.cs: New file.  This is a wrapper around
19103         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
19104         methods here in near future.
19105
19106 2003-02-09  Martin Baulig  <martin@ximian.com>
19107
19108         * codegen.cs (EmitContext.Mark): Just pass the arguments to
19109         ILGenerator.MarkSequencePoint() which are actually used by the
19110         symbol writer.
19111
19112 2003-02-09  Martin Baulig  <martin@ximian.com>
19113
19114         * location.cs (SourceFile): New public sealed class.  This
19115         contains the name and an index which is used in the location's token.
19116         (Location): Reserve an appropriate number of bits in the token for
19117         the source file instead of walking over that list, this gives us a
19118         really huge performance improvement when compiling with debugging.
19119
19120         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
19121         `SourceFile' argument instead of a string.
19122         (Driver.ProcessFile): Add all the files via Location.AddFile(),
19123         but don't parse/tokenize here, we need to generate the list of all
19124         source files before we do that.
19125         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
19126         the files.
19127
19128         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
19129         instead of a string.
19130
19131         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
19132         of a string.
19133
19134 2003-02-09  Martin Baulig  <martin@ximian.com>
19135
19136         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
19137         filename on `#line default'.
19138
19139 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
19140
19141         * statement.cs: don't clear the pinned var when the fixed statement
19142         returns from the method (fixes bug#37752).
19143
19144 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
19145
19146         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
19147         to IsValueType.
19148
19149 2003-02-07  Martin Baulig  <martin@ximian.com>
19150
19151         * driver.cs: Removed the `--debug-args' command line argument.
19152
19153         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
19154         automatically by the AsssemblyBuilder.
19155         (CodeGen.InitializeSymbolWriter): We don't need to call any
19156         initialization function on the symbol writer anymore.  This method
19157         doesn't take any arguments.
19158
19159 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
19160
19161         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
19162         from referenced assemblies as well.
19163
19164 2003-02-02  Martin Baulig  <martin@ximian.com>
19165
19166         * class.cs (MethodData.Emit): Generate debugging info for external methods.
19167
19168 2003-02-02  Martin Baulig  <martin@ximian.com>
19169
19170         * class.cs (Constructor.Emit): Open the symbol writer before
19171         emitting the constructor initializer.
19172         (ConstructorInitializer.Emit): Call ec.Mark() to allow
19173         single-stepping through constructor initializers.
19174
19175 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
19176
19177         * class.cs: Handle error 549: do not allow virtual methods in
19178         sealed classes. 
19179
19180 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
19181
19182         * decl.cs: Check access levels when resolving types
19183
19184 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
19185
19186         * statement.cs: Add parameters and locals set in catch blocks that might 
19187         return to set vector
19188
19189 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
19190
19191         * class.cs (Operator): Set the SpecialName flags for operators.
19192
19193         * expression.cs (Invocation.DoResolve): Only block calls to
19194         accessors and operators on SpecialName methods.
19195
19196         (Cast.TryReduce): Handle conversions from char constants.
19197
19198
19199 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
19200
19201         * statement.cs: small memory and time optimization in FlowBranching.
19202
19203 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
19204
19205         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
19206         problem that the last fix but in the other sid (Set).
19207
19208         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
19209         access when there is no indexer in the hierarchy.
19210
19211 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
19212
19213         * class.cs: Combine some if statements.
19214
19215 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19216
19217         * driver.cs: fixed bug #37187.
19218
19219 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
19220
19221         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
19222         any indexer, it's needed to build a list with all the indexers in the
19223         hierarchy (AllGetters), else we have problems. Fixes #35653.
19224
19225 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
19226
19227         * class.cs (MethodData.Define): It is wrong for an interface
19228         implementation to be static in both cases: explicit and implicit.
19229         We were only handling this in one case.
19230
19231         Improve the if situation there to not have negations.
19232
19233         * class.cs (Field.Define): Turns out that we do not need to check
19234         the unsafe bit on field definition, only on usage.  Remove the test.
19235
19236 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19237
19238         * driver.cs: use assembly.Location instead of Codebase (the latest
19239         patch made mcs fail when using MS assemblies).
19240
19241 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
19242
19243         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
19244         get the path to *corlib.dll.
19245
19246 2003-01-21  Nick Drochak <ndrochak@gol.com>
19247
19248         * cs-tokenizer.cs:
19249         * pending.cs:
19250         * typemanager.cs: Remove compiler warnings
19251
19252 2003-01-20  Duncan Mak  <duncan@ximian.com>
19253
19254         * AssemblyInfo.cs: Bump the version number to 0.19.
19255
19256 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19257
19258         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
19259
19260 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
19261
19262         * class.cs (Constructor::Emit): Emit debugging info for constructors.
19263
19264 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
19265
19266         * cs-parser.jay: Small fix: we were not comparing the constructor
19267         name correctly.   Thanks to Zoltan for the initial pointer.
19268
19269 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
19270
19271         * cs-tokenizer.cs: Set file name when specified with #line
19272
19273 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
19274
19275         * cs-parser.jay: Only perform the constructor checks here if we
19276         are named like the class;  This will help provider a better
19277         error.  The constructor path is taken when a type definition is
19278         not found, but most likely the user forgot to add the type, so
19279         report that rather than the constructor error.
19280
19281 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
19282
19283         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
19284         allocations.
19285
19286 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19287
19288         * cs-parser.jay: Add cleanup call.
19289
19290 2003-01-13  Duncan Mak  <duncan@ximian.com>
19291
19292         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
19293         consistent with other methods.
19294
19295 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19296
19297         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
19298
19299 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
19300
19301         * attribute.cs: only set GuidAttr to true when we have a
19302         GuidAttribute.
19303
19304 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19305
19306         * ecore.cs:
19307         * expression.cs:
19308         * typemanager.cs: fixes to allow mcs compile corlib with the new
19309         Type.IsSubclassOf fix.
19310
19311 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
19312
19313         * expression.cs (LocalVariableReference.DoResolve): Classify a
19314         constant as a value, not as a variable.   Also, set the type for
19315         the variable.
19316
19317         * cs-parser.jay (fixed_statement): take a type instead of a
19318         pointer_type, so we can produce a better error message later.
19319
19320         * statement.cs (Fixed.Resolve): Flag types that are not pointers
19321         as an error.  
19322
19323         (For.DoEmit): Make inifinite loops have a
19324         non-conditional branch back.
19325
19326         (Fixed.DoEmit): First populate the pinned variables, then emit the
19327         statement, then clear the variables.  Before I was emitting the
19328         code once for each fixed piece.
19329
19330
19331 2003-01-08  Martin Baulig  <martin@ximian.com>
19332
19333         * statement.cs (FlowBranching.MergeChild): A break in a
19334         SWITCH_SECTION does not leave a loop.  Fixes #36155.
19335
19336 2003-01-08  Martin Baulig  <martin@ximian.com>
19337
19338         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19339         lives in the same number space than `param_map'.  Fixes #36154.
19340
19341 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
19342
19343         * cs-parser.jay (constructor_declaration): Set the
19344         Constructor.ModFlags before probing for it.  This makes the
19345         compiler report 514, 515 and 132 (the code was there, but got
19346         broken). 
19347
19348         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19349         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19350         (GotoCase.Resolve): Set `Returns' to ALWAYS.
19351
19352 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19353
19354         * enum.cs: create the enum static fields using the enum type.
19355
19356 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19357
19358         * class.cs: don't try to create the ParamBuilder for the return
19359         type if it's not needed (and handle it breaking for the ms runtime
19360         anyway).
19361
19362 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19363
19364         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19365
19366 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
19367
19368         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19369         the command.   This showed up while compiling the JANET source
19370         code, which used \r as its only newline separator.
19371
19372 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
19373
19374         * class.cs (Method.Define): If we are an operator (because it
19375         reuses our code), then set the SpecialName and HideBySig.  #36128
19376
19377 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
19378
19379         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19380         exception, report error 120 `object reference required'.
19381
19382         * driver.cs: Add --pause option, used during to measure the size
19383         of the process as it goes with --timestamp.
19384
19385         * expression.cs (Invocation.DoResolve): Do not allow methods with
19386         SpecialName to be invoked.
19387
19388 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
19389
19390         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19391         number before adding it.
19392
19393 2002-12-21  Ravi Pratap  <ravi@ximian.com>
19394
19395         * ecore.cs (StandardImplicitConversion): When in an unsafe
19396         context, we allow conversion between void * to any other pointer
19397         type. This fixes bug #35973.
19398
19399 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19400
19401         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19402         is not thrown when extensionless outputs are used 
19403
19404 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19405
19406         * rootcontext.cs: fixed compilation of corlib.
19407
19408 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
19409
19410         * attribute.cs (Attributes.Contains): Add new method.
19411
19412         * class.cs (MethodCore.LabelParameters): if the parameter is an
19413         `out' parameter, check that no attribute `[In]' has been passed.
19414
19415         * enum.cs: Handle the `value__' name in an enumeration.
19416
19417 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
19418
19419         * decl.cs: Added special case to allow overrides on "protected
19420         internal" methods
19421
19422 2002-12-18  Ravi Pratap  <ravi@ximian.com>
19423
19424         * attribute.cs (Attributes.AddAttributeSection): Rename to this
19425         since it makes much more sense.
19426
19427         (Attributes.ctor): Don't require a Location parameter.
19428
19429         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19430
19431         * attribute.cs (ApplyAttributes): Remove extra Location parameters
19432         since we already have that information per attribute.
19433
19434         * everywhere : make appropriate changes.
19435
19436         * class.cs (LabelParameters): Write the code which actually
19437         applies attributes to the return type. We can't do this on the MS
19438         .NET runtime so we flag a warning in the case an exception is
19439         thrown.
19440
19441 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
19442
19443         * const.cs: Handle implicit null conversions here too.
19444
19445 2002-12-17  Ravi Pratap  <ravi@ximian.com>
19446
19447         * class.cs (MethodCore.LabelParameters): Remove the extra
19448         Type [] parameter since it is completely unnecessary. Instead
19449         pass in the method's attributes so that we can extract
19450         the "return" attribute.
19451
19452 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
19453
19454         * cs-parser.jay (parse): Use Report.Error to flag errors instead
19455         of ignoring it and letting the compile continue.
19456
19457         * typemanager.cs (ChangeType): use an extra argument to return an
19458         error condition instead of throwing an exception.
19459
19460 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
19461
19462         * expression.cs (Unary.TryReduce): mimic the code for the regular
19463         code path.  Perform an implicit cast in the cases where we can
19464         implicitly convert to one of the integral types, and then reduce
19465         based on that constant.   This fixes bug #35483.
19466
19467 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19468
19469         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19470
19471 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19472
19473         * namespace.cs: fixed bug #35489.
19474
19475 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
19476
19477         * class.cs: Remove some dead code.
19478
19479         * cs-parser.jay: Estimate the number of methods needed
19480         (RootContext.MethodCount);
19481
19482         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19483         numbers instead of StringBuilders.
19484
19485         * support.cs (PtrHashtable): Add constructor with initial size;
19486         We can now reduce reallocations of the method table.
19487
19488 2002-12-10  Ravi Pratap  <ravi@ximian.com>
19489
19490         * attribute.cs (ApplyAttributes): Keep track of the emitted
19491         attributes on a per-target basis. This fixes bug #35413.
19492
19493 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
19494
19495         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19496         default to the Windows 1252 encoding.
19497
19498         (UnixParseOption): Support version, thanks to Alp for the missing
19499         pointer. 
19500
19501         * AssemblyInfo.cs: Add nice assembly information.
19502
19503         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19504         (bug 35169).
19505
19506         * cs-parser.jay: Allow a trailing comma before the close bracked
19507         in the attribute_section production.
19508
19509         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19510         address of the instance was being taken, I will take this out,
19511         because we take the address of the object immediately here.
19512
19513 2002-12-09  Ravi Pratap  <ravi@ximian.com>
19514
19515         * typemanager.cs (AreMultipleAllowed): Take care of the most
19516         obvious case where attribute type is not in the current assembly -
19517         stupid me ;-)
19518
19519 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
19520
19521         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19522         definitions, instead of doing that afterwards.  
19523
19524         Also we use a nice little hack, depending on the constructor, we
19525         know if we are a "composed" name or a simple name.  Hence, we
19526         avoid the IndexOf test, and we avoid 
19527
19528         * codegen.cs: Add code to assist in a bug reporter to track down
19529         the source of a compiler crash. 
19530
19531 2002-12-07  Ravi Pratap  <ravi@ximian.com>
19532
19533         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19534         types have been emitted for a given element and flag an error
19535         if something which does not have AllowMultiple set is used more
19536         than once.
19537
19538         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19539         attribute types and their corresponding AllowMultiple properties
19540
19541         (AreMultipleAllowed): Check the property for a given type.
19542
19543         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19544         property in the case we have a TypeContainer.
19545
19546         (Attributes.AddAttribute): Detect duplicates and just skip on
19547         adding them. This trivial fix catches a pretty gross error in our
19548         attribute emission - global attributes were being emitted twice!
19549
19550         Bugzilla bug #33187 is now fixed.
19551
19552 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
19553
19554         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19555         instead of pp_and).
19556
19557         * expression.cs (Binary.ResolveOperator): I can only use the
19558         Concat (string, string, string) and Concat (string, string,
19559         string, string) if the child is actually a concatenation of
19560         strings. 
19561
19562 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
19563
19564         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19565         context where we need a 2-character lookahead.
19566
19567         * pending.cs (PendingImplementation): Rework so we can keep track
19568         of interface types all the time, and flag those which were
19569         implemented by parents as optional.
19570
19571 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
19572
19573         * expression.cs (Binary.ResolveOperator): Use
19574         String.Concat(string,string,string) or
19575         String.Concat(string,string,string,string) when possible. 
19576
19577         * typemanager: More helper methods.
19578
19579
19580 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19581
19582         * pending.cs: remove the bogus return from GetMissingInterfaces()
19583         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19584
19585 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19586
19587         * namespace.cs: avoid duplicated 'using xxx' being added to
19588         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19589         when we get more than one 'using' statement for the same namespace.
19590         Report a CS0105 warning for it.
19591
19592 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
19593
19594         * cs-tokenizer.cs (consume_identifier): use read directly, instead
19595         of calling getChar/putback, uses internal knowledge of it.    
19596
19597         (xtoken): Reorder tokenizer so most common patterns are checked
19598         first.  This reduces the compilation time in another 5% (from 8.11s
19599         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19600
19601         The parsing time is 22% of the compilation in mcs, and from that
19602         64% is spent on the tokenization process.  
19603
19604         I tried using a binary search for keywords, but this is slower
19605         than the hashtable.  Another option would be to do a couple of
19606         things:
19607
19608                 * Not use a StringBuilder, instead use an array of chars,
19609                   with a set value.  Notice that this way we could catch
19610                   the 645 error without having to do it *afterwards*.
19611
19612                 * We could write a hand-parser to avoid the hashtable
19613                   compares altogether.
19614
19615         The identifier consumption process takes 37% of the tokenization
19616         time.  Another 15% is spent on is_number.  56% of the time spent
19617         on is_number is spent on Int64.Parse:
19618
19619                 * We could probably choose based on the string length to
19620                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
19621                   computations. 
19622
19623         Another 3% is spend on wrapping `xtoken' in the `token' function.
19624
19625         Handle 0xa0 as whitespace (#34752)
19626
19627 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
19628
19629         * typemanager.cs (IsCLRType): New routine to tell whether a type
19630         is one of the builtin types.  
19631
19632         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
19633         typecode in more places instead of doing pointer comparissions.
19634         We could leverage some knowledge about the way the typecodes are
19635         laid out.
19636
19637         New code to cache namespaces in assemblies, it is currently not
19638         invoked, to be used soon.
19639
19640         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19641
19642         * expression.cs (Binary.ResolveOperator): specially handle
19643         strings, and do not perform user-defined operator overloading for
19644         built-in types.
19645
19646 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
19647
19648         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19649         internalcall as it is a pretty simple operation;  Avoid whenever
19650         possible to call Char.IsLetter.
19651
19652         (consume_identifier): Cut by half the number of
19653         hashtable calls by merging the is_keyword and GetKeyword behavior.
19654
19655         Do not short-circuit, because if we do, we
19656         report errors (ie, #if false && true would produce an invalid
19657         directive error);
19658
19659
19660 2002-11-24  Martin Baulig  <martin@ximian.com>
19661
19662         * expression.cs (Cast.TryReduce): If we're in checked syntax,
19663         check constant ranges and report a CS0221.  Fixes #33186.
19664
19665 2002-11-24  Martin Baulig  <martin@ximian.com>
19666
19667         * cs-parser.jay: Make this work for uninitialized variable
19668         declarations in the `for' initializer.  Fixes #32416.
19669
19670 2002-11-24  Martin Baulig  <martin@ximian.com>
19671
19672         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19673         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
19674
19675 2002-11-24  Martin Baulig  <martin@ximian.com>
19676
19677         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19678         argument; if true, we also check for user-defined conversions.
19679         This is only needed if both arguments are of a user-defined type.
19680         Fixes #30443, added test-175.cs.
19681         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19682
19683         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19684
19685 2002-11-24  Martin Baulig  <martin@ximian.com>
19686
19687         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19688         function to get the store opcode.
19689         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19690         only emit the Ldelema if the store opcode is Stobj.  You must run
19691         both test-34 and test-167 to test this.  Fixes #34529.
19692
19693 2002-11-23  Martin Baulig  <martin@ximian.com>
19694
19695         * ecore.cs (Expression.MemberLookup): Added additional
19696         `qualifier_type' argument which is used when we're being called
19697         from MemberAccess.DoResolve() and null if we're called from a
19698         SimpleName lookup.
19699         (Expression.MemberLookupFailed): New method to report errors; this
19700         does the CS1540 check and reports the correct error message.
19701
19702         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19703         argument for the CS1540 check and redone the way how we're dealing
19704         with private members.  See the comment in the source code for details.
19705         (FilterWithClosure): Reverted this back to revision 1.197; renamed
19706         `closure_start_type' to `closure_qualifier_type' and check whether
19707         it's not null.  It was not this filter being broken, it was just
19708         being called with the wrong arguments.
19709
19710         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19711         and pass it the correct `qualifier_type'; this also does the error
19712         handling for us.
19713
19714 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
19715
19716         * expression.cs (Invocation.EmitParams): If the we are dealing
19717         with a non-built-in value type, load its address as well.
19718
19719         (ArrayCreation): Use a a pretty constant instead
19720         of the hardcoded value 2.   Use 6 instead of 2 for the number of
19721         static initializers.  
19722
19723         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19724         because they are not really value types, just glorified integers. 
19725
19726         * driver.cs: Do not append .exe, the CSC compiler does not do it.
19727
19728         * ecore.cs: Remove redundant code for enumerations, make them use
19729         the same code path as everything else, fixes the casting issue
19730         with enumerations in Windows.Forms.
19731
19732         * attribute.cs: Do only cast to string if it is a string, the
19733         validation happens later.
19734
19735         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19736         people upgrade their corlibs.
19737
19738         * ecore.cs: Oops, enumerations were not following the entire code path
19739
19740 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
19741
19742         * typemanager.cs (FilterWithClosure): Commented out the test for
19743         1540 in typemanager.cs, as it has problems when accessing
19744         protected methods from a parent class (see test-174.cs). 
19745
19746         * attribute.cs (Attribute.ValidateGuid): new method.
19747         (Attribute.Resolve): Use above.
19748
19749 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
19750
19751         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19752
19753         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19754         handling for enumerations, as we only needed the TypeContainer
19755         functionality to begin with (this is required for the fix below to
19756         work for enums that reference constants in a container class for
19757         example). 
19758
19759         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19760
19761         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19762         a valid TypeBuilder to perform lookups on.o
19763
19764         * class.cs (InheritableMemberSignatureCompare): Use true in the
19765         call to GetGetMethod and GetSetMethod, because we are comparing
19766         the signature, and we need to get the methods *even* if they are
19767         private. 
19768
19769         (PropertyBase.CheckBase): ditto.
19770
19771         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19772         GotoCase.Resolve): Use Peel on EmpytCasts.
19773
19774         * ecore.cs (EmptyCast): drop child, add Peel method.
19775
19776 2002-11-17  Martin Baulig  <martin@ximian.com>
19777
19778         * ecore.cs (EmptyCast.Child): New public property.
19779
19780         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19781         label resolved to an EmptyCast.  Fixes #34162.
19782         (GotoCase.Resolve): Likewise.
19783         (Block.EmitMeta): Likewise.
19784
19785 2002-11-17  Martin Baulig  <martin@ximian.com>
19786
19787         * expression.cs (Invocation.BetterConversion): Prefer int over
19788         uint; short over ushort; long over ulong for integer literals.
19789         Use ImplicitConversionExists instead of StandardConversionExists
19790         since we also need to check for user-defined implicit conversions.
19791         Fixes #34165.  Added test-173.cs.
19792
19793 2002-11-16  Martin Baulig  <martin@ximian.com>
19794
19795         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19796         with the `true' and `false' literals.  Fixes #33151.
19797
19798 2002-11-16  Martin Baulig  <martin@ximian.com>
19799
19800         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19801         October 22nd; don't do the cs1540 check for static members.
19802
19803         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19804         now using our own filter here and doing the cs1540 check again.
19805
19806 2002-11-16  Martin Baulig  <martin@ximian.com>
19807
19808         * support.cs (InternalParameters): Don't crash if we don't have
19809         any fixed parameters.  Fixes #33532.
19810
19811 2002-11-16  Martin Baulig  <martin@ximian.com>
19812
19813         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19814         when looking up static methods to make this work on Windows.
19815         Fixes #33773.
19816
19817 2002-11-16  Martin Baulig  <martin@ximian.com>
19818
19819         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19820         a setter rather than using PropertyInfo.CanWrite.
19821
19822 2002-11-15  Nick Drochak  <ndrochak@gol.com>
19823
19824         * class.cs: Allow acces to block member by subclasses. Fixes build
19825         breaker.
19826
19827 2002-11-14  Martin Baulig  <martin@ximian.com>
19828
19829         * class.cs (Constructor.Emit): Added the extern/block check.
19830         Fixes bug #33678.
19831
19832 2002-11-14  Martin Baulig  <martin@ximian.com>
19833
19834         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19835         iteration while looking for indexers, this is needed because the
19836         indexer may have a different name in our base classes.  Fixed the
19837         error reporting (no indexers at all, not get accessor, no
19838         overloaded match).  Fixes bug #33089.
19839         (IndexerAccess.DoResolveLValue): Likewise.
19840
19841 2002-11-14  Martin Baulig  <martin@ximian.com>
19842
19843         * class.cs (PropertyBase.CheckBase): Make this work for multiple
19844         indexers.  Fixes the first part of bug #33089.
19845         (MethodSignature.InheritableMemberSignatureCompare): Added support
19846         for properties.
19847
19848 2002-11-13  Ravi Pratap  <ravi@ximian.com>
19849
19850         * attribute.cs (Attribute.Resolve): Catch the
19851         NullReferenceException and report it since it isn't supposed to
19852         happen. 
19853
19854 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
19855
19856         * expression.cs (Binary.EmitBranchable): Also handle the cases for
19857         LogicalOr and LogicalAnd that can benefit from recursively
19858         handling EmitBranchable.  The code now should be nice for Paolo.
19859
19860 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
19861
19862         * typemanager.cs (LookupType): Added a negative-hit hashtable for
19863         the Type lookups, as we perform quite a number of lookups on
19864         non-Types.  This can be removed once we can deterministically tell
19865         whether we have a type or a namespace in advance.
19866
19867         But this might require special hacks from our corlib.
19868
19869         * TODO: updated.
19870
19871         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19872         and double which avoids a conversion from an integer to a double.
19873
19874         * expression.cs: tiny optimization, avoid calling IsConstant,
19875         because it effectively performs the lookup twice.
19876
19877 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
19878
19879         But a bogus return here to keep the semantics of the old code
19880         until the Mono runtime is fixed.
19881
19882         * pending.cs (GetMissingInterfaces): New method used to remove all
19883         the interfaces that are already implemented by our parent
19884         classes from the list of pending methods. 
19885
19886         * interface.cs: Add checks for calls after ResolveTypeExpr.
19887
19888 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
19889
19890         * class.cs (Class.Emit): Report warning 67: event not used if the
19891         warning level is beyond 3.
19892
19893         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19894         being a NullLiteral.
19895
19896         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19897         specifiers. 
19898
19899         * class.cs (TypeContainer.GetClassBases): Cover a missing code
19900         path that might fail if a type can not be resolved.
19901
19902         * expression.cs (Binary.Emit): Emit unsigned versions of the
19903         operators. 
19904
19905         * driver.cs: use error 5.
19906
19907 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19908
19909         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19910
19911 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
19912
19913         * cs-parser.jay (switch_section): A beautiful patch from Martin
19914         Baulig that fixed 33094.
19915
19916 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
19917
19918         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19919         Check whether the base is abstract and report an error if so.
19920
19921         * expression.cs (IndexerAccess.DoResolveLValue,
19922         IndexerAccess.DoResolve): ditto. 
19923
19924         (Invocation.DoResolve): ditto.
19925
19926         (Invocation.FullMethodDesc): Improve the report string.
19927
19928         * statement.cs (Block): Eliminate IsVariableDefined as it is
19929         basically just a wrapper for GetVariableInfo.
19930
19931         * ecore.cs (SimpleName): Use new 
19932
19933         * support.cs (ReflectionParamter.ParameterType): We unwrap the
19934         type, as we return the actual parameter ref/unref state on a
19935         different call.
19936
19937 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
19938
19939         * support.cs: Return proper flags REF/OUT fixing the previous
19940         commit.  
19941
19942         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
19943         not used to mean `ref' but `ref or out' in ParameterReference
19944
19945         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19946         full type signature instead of calling TypeManger.CSharpName
19947         ourselves. 
19948
19949         * support.cs (InternalParameters.ParameterDesc): Do not compare
19950         directly to the modflags, because REF/OUT will actually be bitsets
19951         if set. 
19952
19953         * delegate.cs (VerifyMethod): Check also the modifiers.
19954
19955         * cs-tokenizer.cs: Fix bug where floating point values with an
19956         exponent where a sign was missing was ignored.
19957
19958         * driver.cs: Allow multiple assemblies to be specified in a single
19959         /r: argument
19960
19961 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
19962
19963         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
19964         because identifiers after a parenthesis would end up in this kind
19965         of production, and we needed to desamiguate it for having casts
19966         like:
19967
19968                 (UserDefinedType *) xxx
19969
19970 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
19971
19972         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19973         we should set on the Bindingflags.NonPublic, but not turn on
19974         private_ok.  private_ok controls whether a Private member is
19975         returned (this is chekced on the filter routine), while the
19976         BindingFlags.NonPublic just controls whether private/protected
19977         will be allowed.   This fixes the problem part of the problem of
19978         private properties being allowed to be used in derived classes.
19979
19980         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19981         so we can call the children DoResolveLValue method (this will
19982         properly signal errors on lvalue assignments to base properties)
19983
19984         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
19985         getter are null, and we have a property info, we know that this
19986         happened because the lookup failed, so we report an error 122 for
19987         protection level violation.
19988
19989         We also silently return if setter and getter are null in the
19990         resolve functions, this condition only happens if we have flagged
19991         the error before.  This is the other half of the problem. 
19992
19993         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
19994         not have accessibility information, that is why we were returning
19995         true in the filter function in typemanager.cs.
19996
19997         To properly report 122 (property is inaccessible because of its
19998         protection level) correctly, we report this error in ResolveAccess
19999         by failing if both the setter and the getter are lacking (ie, the
20000         lookup failed). 
20001
20002         DoResolve and DoLResolve have been modified to check for both
20003         setter/getter being null and returning silently, the reason being
20004         that I did not want to put the knowledge about this error in upper
20005         layers, like:
20006
20007         int old = Report.Errors;
20008         x = new PropertyExpr (...);
20009         if (old != Report.Errors)
20010                 return null;
20011         else
20012                 return x;
20013
20014         So the property expr is returned, but it is invalid, so the error
20015         will be flagged during the resolve process. 
20016
20017         * class.cs: Remove InheritablePropertySignatureCompare from the
20018         class, as we no longer depend on the property signature to compute
20019         whether it is possible to implement a method or not.
20020
20021         The reason is that calling PropertyInfo.GetGetMethod will return
20022         null (in .NET, in Mono it works, and we should change this), in
20023         cases where the Get Method does not exist in that particular
20024         class.
20025
20026         So this code:
20027
20028         class X { public virtual int A { get { return 1; } } }
20029         class Y : X { }
20030         class Z : Y { public override int A { get { return 2; } } }
20031
20032         Would fail in Z because the parent (Y) would not have the property
20033         defined.  So we avoid this completely now (because the alternative
20034         fix was ugly and slow), and we now depend exclusively on the
20035         method names.
20036
20037         (PropertyBase.CheckBase): Use a method-base mechanism to find our
20038         reference method, instead of using the property.
20039
20040         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
20041         routines are gone now.
20042
20043         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
20044         names, they were incorrectly named.
20045
20046         * cs-tokenizer.cs: Return are more gentle token on failure. 
20047
20048         * pending.cs (PendingImplementation.InterfaceMethod): This routine
20049         had an out-of-sync index variable, which caused it to remove from
20050         the list of pending methods the wrong method sometimes.
20051
20052 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
20053
20054         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
20055         CanWrite, because those refer to this particular instance of the
20056         property, and do not take into account the fact that we can
20057         override single members of a property.
20058
20059         Constructor requires an EmitContext.  The resolution process does
20060         not happen here, but we need to compute the accessors before,
20061         because the resolution does not always happen for properties.
20062
20063         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
20064         subclass, before we did not update this flag, but we did update
20065         bindingflags. 
20066
20067         (GetAccessors): Drop this routine, as it did not work in the
20068         presence of partially overwritten set/get methods. 
20069
20070         Notice that this broke the cs1540 detection, but that will require
20071         more thinking. 
20072
20073 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20074
20075         * class.cs:
20076         * codegen.cs:
20077         * driver.cs: issue a warning instead of an error if we don't support
20078         debugging for the platform. Also ignore a couple of errors that may
20079         arise when trying to write the symbols. Undo my previous patch.
20080
20081 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20082
20083         * driver.cs: ignore /debug switch except for Unix platforms.
20084
20085 2002-10-23  Nick Drochak  <ndrochak@gol.com>
20086
20087         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
20088
20089 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
20090
20091         * driver.cs: Do not make mcs-debug conditional, so we do not break
20092         builds that use it.
20093
20094         * statement.cs (UsageVector.MergeChildren): I would like Martin to
20095         review this patch.  But basically after all the children variables
20096         have been merged, the value of "Breaks" was not being set to
20097         new_breaks for Switch blocks.  I think that it should be set after
20098         it has executed.  Currently I set this to the value of new_breaks,
20099         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
20100         conservative, but I do not understand this code very well.
20101
20102         I did not break anything in the build, so that is good ;-)
20103
20104         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
20105
20106 2002-10-20  Mark Crichton  <crichton@gimp.org>
20107
20108         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
20109
20110 2002-10-20  Nick Drochak  <ndrochak@gol.com>
20111
20112         * cfold.cs: Fixed compile blocker.
20113
20114 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
20115
20116         * driver.cs: I was chekcing the key, not the file.
20117
20118 2002-10-19  Ravi Pratap  <ravi@ximian.com>
20119
20120         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
20121         message that we were generating - we just need to silently return
20122         a null.
20123
20124 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
20125
20126         * class.cs (Event.Define): Change my previous commit, as this
20127         breaks the debugger.  This is a temporary hack, as it seems like
20128         the compiler is generating events incorrectly to begin with.
20129
20130         * expression.cs (Binary.ResolveOperator): Added support for 
20131         "U operator - (E x, E y)"
20132
20133         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
20134         y)".
20135
20136         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
20137         init-only variables, but this path did not take into account that
20138         there might be also instance readonly variables.  Correct this
20139         problem. 
20140
20141         This fixes bug 32253
20142
20143         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
20144         delegates as well.
20145
20146         * driver.cs: Change the extension for modules to `netmodule'
20147
20148         * cs-parser.jay: Improved slightly the location tracking for
20149         the debugger symbols.
20150
20151         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
20152         modifiers that were specified instead of the hardcoded value
20153         (FamAndAssem).  This was basically ignoring the static modifier,
20154         and others.  Fixes 32429.
20155
20156         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
20157         fixed a bug in the process (32476)
20158
20159         * expression.cs (ArrayAccess.EmitAssign): Patch from
20160         hwang_rob@yahoo.ca that fixes bug 31834.3
20161
20162 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
20163
20164         * driver.cs: Make the module extension .netmodule.
20165
20166 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
20167
20168         * driver.cs: Report an error if the resource file is not found
20169         instead of crashing.
20170
20171         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
20172         false, like Emit does.
20173
20174 2002-10-16  Nick Drochak  <ndrochak@gol.com>
20175
20176         * typemanager.cs: Remove unused private member.  Also reported mcs
20177         bug to report this as a warning like csc.
20178
20179 2002-10-15  Martin Baulig  <martin@gnome.org>
20180
20181         * statement.cs (Statement.Emit): Made this a virtual method; emits
20182         the line number info and calls DoEmit().
20183         (Statement.DoEmit): New protected abstract method, formerly knows
20184         as Statement.Emit().
20185
20186         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
20187
20188 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
20189
20190         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
20191         have fixed a remaining problem: not every AddXXXX was adding a
20192         fully qualified name.  
20193
20194         Now everyone registers a fully qualified name in the DeclSpace as
20195         being defined instead of the partial name.  
20196
20197         Downsides: we are slower than we need to be due to the excess
20198         copies and the names being registered this way.  
20199
20200         The reason for this is that we currently depend (on the corlib
20201         bootstrap for instance) that types are fully qualified, because
20202         we dump all the types in the namespace, and we should really have
20203         types inserted into the proper namespace, so we can only store the
20204         basenames in the defined_names array.
20205
20206 2002-10-10  Martin Baulig  <martin@gnome.org>
20207
20208         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
20209         from bug #31834, see the bug report for a testcase which is
20210         miscompiled.
20211
20212 2002-10-10  Martin Baulig  <martin@gnome.org>
20213
20214         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
20215         flow analysis code for this.
20216
20217         * statement.cs (Do, While, For): Tell the flow analysis code about
20218         infinite loops.
20219         (FlowBranching.UsageVector): Added support for infinite loops.
20220         (Block.Resolve): Moved the dead code elimination here and use flow
20221         analysis to do it.
20222
20223 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
20224
20225         * class.cs (Field.Define): Catch cycles on struct type
20226         definitions. 
20227
20228         * typemanager.cs (IsUnmanagedtype): Do not recursively check
20229         fields if the fields are static.  We only need to check instance
20230         fields. 
20231
20232         * expression.cs (As.DoResolve): Test for reference type.
20233
20234         * statement.cs (Using.ResolveExpression): Use
20235         ConvertImplicitRequired, not ConvertImplicit which reports an
20236         error on failture
20237         (Using.ResolveLocalVariableDecls): ditto.
20238
20239         * expression.cs (Binary.ResolveOperator): Report errors in a few
20240         places where we had to.
20241
20242         * typemanager.cs (IsUnmanagedtype): Finish implementation.
20243
20244 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
20245
20246         * expression.cs: Use StoreFromPtr instead of extracting the type
20247         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
20248
20249         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
20250         an enumeration value to a System.Enum, but System.Enum is not a
20251         value type, but an class type, so we need to box.
20252
20253         (Expression.ConvertExplicit): One codepath could return
20254         errors but not flag them.  Fix this.  Fixes #31853
20255
20256         * parameter.cs (Resolve): Do not allow void as a parameter type.
20257
20258 2002-10-06  Martin Baulig  <martin@gnome.org>
20259
20260         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
20261         if it's a class type and not a struct.  Fixes #31815.
20262
20263 2002-10-06  Martin Baulig  <martin@gnome.org>
20264
20265         * statement.cs: Reworked the flow analysis code a bit to make it
20266         usable for dead code elimination.
20267
20268 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20269
20270         * cs-parser.jay: allow empty source files. Fixes bug #31781.
20271
20272 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
20273
20274         * expression.cs (ComposedCast.DoResolveType): A quick workaround
20275         to fix the test 165, will investigate deeper.
20276
20277 2002-10-04  Martin Baulig  <martin@gnome.org>
20278
20279         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
20280         finally blocks actually work.
20281         (Try.Resolve): We don't need to create a sibling for `finally' if
20282         there is no finally block.
20283
20284 2002-10-04  Martin Baulig  <martin@gnome.org>
20285
20286         * class.cs (Constructor.Define): The default accessibility for a
20287         non-default constructor is private, not public.
20288
20289 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * class.cs (Constructor): Make AllowedModifiers public, add
20292         EXTERN.
20293
20294         * cs-parser.jay: Perform the modifiers test here, as the
20295         constructor for the Constructor class usually receives a zero
20296         because of the way we create it (first we create, later we
20297         customize, and we were never checking the modifiers).
20298
20299         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
20300         is a version of LookupTypeReflection that includes the type-name
20301         cache.  This can be used as a fast path for functions that know
20302         the fully qualified name and are only calling into *.GetType() to
20303         obtain a composed type.
20304
20305         This is also used by TypeManager.LookupType during its type
20306         composition.
20307
20308         (LookupType): We now also track the real type name, as sometimes
20309         we can get a quey for the real type name from things like
20310         ComposedCast.  This fixes bug 31422.
20311
20312         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20313         complete type fullname, it does not have to go through the type
20314         resolution system to obtain the composed version of the type (for
20315         obtaining arrays or pointers).
20316
20317         (Conditional.Emit): Use the EmitBoolExpression to
20318         generate nicer code, as requested by Paolo.
20319
20320         (ArrayCreation.CheckIndices): Use the patch from
20321         hwang_rob@yahoo.ca to validate the array initializers. 
20322
20323 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
20324
20325         * class.cs (ConstructorInitializer.Emit): simplify code by using
20326         Invocation.EmitCall, and at the same time, fix the bugs in calling
20327         parent constructors that took variable arguments. 
20328
20329         * ecore.cs (Expression.ConvertNumericExplicit,
20330         Expression.ImplicitNumericConversion): Remove the code that
20331         manually wrapped decimal (InternalTypeConstructor call is now gone
20332         as well).
20333
20334         * expression.cs (Cast.TryReduce): Also handle decimal types when
20335         trying to perform a constant fold on the type.
20336
20337         * typemanager.cs (IsUnmanagedtype): Partially implemented.
20338
20339         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20340         that only turned off an error report, and did nothing else. 
20341
20342 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
20343
20344         * driver.cs: Handle and ignore /fullpaths
20345
20346 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
20347
20348         * expression.cs (Binary.ResolveOperator): Catch the case where
20349         DoNumericPromotions returns true, 
20350
20351         (Binary.DoNumericPromotions): Simplify the code, and the tests.
20352
20353 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
20354
20355         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20356         report error 70.
20357
20358 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
20359
20360         * ecore.cs (ConvertNumericExplicit): It is not enough that the
20361         conversion exists, but it is also required that the conversion be
20362         performed.  This manifested in "(Type64Enum) 2".  
20363
20364         * class.cs (TypeManager.AddMethod): The fix is not to change
20365         AddEnum, because that one was using a fully qualified name (every
20366         DeclSpace derivative does), but to change the AddMethod routine
20367         that was using an un-namespaced name.  This now correctly reports
20368         the duplicated name.
20369
20370         Revert patch until I can properly fix it.  The issue
20371         is that we have a shared Type space across all namespaces
20372         currently, which is wrong.
20373
20374         Options include making the Namespace a DeclSpace, and merge
20375         current_namespace/current_container in the parser.
20376
20377 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
20378
20379         * cs-parser.jay: Improve error reporting when we get a different
20380         kind of expression in local_variable_type and
20381         local_variable_pointer_type. 
20382
20383         Propagate this to avoid missleading errors being reported.
20384
20385         * ecore.cs (ImplicitReferenceConversion): treat
20386         TypeManager.value_type as a target just like object_type.   As
20387         code like this:
20388
20389         ValueType v = 1;
20390
20391         Is valid, and needs to result in the int 1 being boxed before it
20392         is assigned to the value type v.
20393
20394         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20395         to validate the enumeration name.
20396
20397         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20398         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
20399         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20400
20401         * ecore.cs (TryImplicitIntConversion): When doing an
20402         implicit-enumeration-conversion, check if the type is 64-bits and
20403         perform a conversion before passing to EnumConstant.
20404
20405 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
20406
20407         * decl.cs (Error_AmbiguousTypeReference); New routine used to
20408         report ambiguous type references.  Unlike the MS version, we
20409         report what the ambiguity is.   Innovation at work ;-)
20410
20411         (DeclSpace.FindType): Require a location argument to
20412         display when we display an ambiguous error.
20413
20414         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20415
20416         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20417
20418         * expression.cs (EmitDynamicInitializers): Apply patch from
20419         hwang_rob@yahoo.ca that fixes the order in which we emit our
20420         initializers. 
20421
20422 2002-09-21  Martin Baulig  <martin@gnome.org>
20423
20424         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20425         delegate takes no arguments.
20426
20427 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
20428
20429         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20430         from integers.
20431
20432         * expression.cs: Extract the underlying type.
20433
20434         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20435
20436         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20437
20438 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
20439
20440         * class.cs (TypeContainer.DefineType): We can not use the nice
20441         PackingSize with the size set to 1 DefineType method, because it
20442         will not allow us to define the interfaces that the struct
20443         implements.
20444
20445         This completes the fixing of bug 27287
20446
20447         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20448         means also structs.  This fixes part of the problem. 
20449         (Expresion.ImplicitReferenceConversionExists): ditto.
20450
20451         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20452         error if there were no errors reported during the type lookup
20453         process, to avoid duplicates or redundant errors.  Without this
20454         you would get an ambiguous errors plus a type not found.  We have
20455         beaten the user enough with the first error.  
20456
20457         (DeclSparce.FindType): Emit a warning if we have an ambiguous
20458         reference. 
20459
20460         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20461         during the resolution process, stop the lookup, this avoids
20462         repeated error reports (same error twice).
20463
20464         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20465
20466         * typemanager.cs (LookupType): Redo the type lookup code to match
20467         the needs of System.Reflection.  
20468
20469         The issue is that System.Reflection requires references to nested
20470         types to begin with a "+" sign instead of a dot.  So toplevel
20471         types look like: "NameSpace.TopLevelClass", and nested ones look
20472         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20473         levels. 
20474
20475 2002-09-19  Martin Baulig  <martin@gnome.org>
20476
20477         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20478         says that a method always returns or always throws an exception,
20479         don't report the CS0161.
20480
20481         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20482         set `Returns = new_returns'.
20483
20484 2002-09-19  Martin Baulig  <martin@gnome.org>
20485
20486         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20487         to an enum constant, check for a CS0176.
20488
20489 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
20490
20491         * class.cs (TypeContainer.CheckPairedOperators): Now we check
20492         for operators that must be in pairs and report errors.
20493
20494         * ecore.cs (SimpleName.DoResolveType): During the initial type
20495         resolution process, when we define types recursively, we must
20496         check first for types in our current scope before we perform
20497         lookups in the enclosing scopes.
20498
20499         * expression.cs (MakeByteBlob): Handle Decimal blobs.
20500
20501         (Invocation.VerifyArgumentsCompat): Call
20502         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20503         I thought we were supposed to always call this, but there are a
20504         few places in the code where we dont do it.
20505
20506 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
20507
20508         * driver.cs: Add support in -linkres and -resource to specify the
20509         name of the identifier.
20510
20511 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20512
20513         * ecore.cs (StandardConversionExists): Sync with the conversion
20514         code: allow anything-* to void* conversions.
20515
20516         (FindMostSpecificSource): Use an Expression argument
20517         instead of a Type, because we might be handed over a Literal which
20518         gets a few more implicit conversions that plain types do not.  So
20519         this information was being lost.
20520
20521         Also, we drop the temporary type-holder expression when not
20522         required.
20523
20524 2002-09-17  Martin Baulig  <martin@gnome.org>
20525
20526         * class.cs (PropertyBase.CheckBase): Don't check the base class if
20527         this is an explicit interface implementation.
20528
20529 2002-09-17  Martin Baulig  <martin@gnome.org>
20530
20531         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20532         different `IndexerName' attributes.
20533
20534         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20535         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20536         virtual CommonResolve().
20537
20538 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20539
20540         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20541         and convert that to the UnderlyingType.
20542
20543         * statement.cs (Foreach.Resolve): Indexers are just like variables
20544         or PropertyAccesses.
20545
20546         * cs-tokenizer.cs (consume_string): Track line numbers and columns
20547         inside quoted strings, we were not doing this before.
20548
20549 2002-09-16  Martin Baulig  <martin@gnome.org>
20550
20551         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20552         resolve it.  This is needed for the definite assignment check of the
20553         instance expression, fixes bug #29846.
20554         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20555
20556 2002-09-16  Nick Drochak  <ndrochak@gol.com>
20557
20558         * parameter.cs: Fix compile error.  Cannot reference static member
20559         from an instance object.  Is this an mcs bug?
20560
20561 2002-09-14  Martin Baulig  <martin@gnome.org>
20562
20563         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20564         multiple times.  Fixes bug #30295, added test-166.cs.
20565
20566 2002-09-14  Martin Baulig  <martin@gnome.org>
20567
20568         * statement.cs (Block.Emit): Don't emit unreachable code.
20569         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20570         `break' statements.
20571         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20572
20573 2002-09-14  Martin Baulig  <martin@gnome.org>
20574
20575         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20576         is set.
20577
20578 2002-09-14  Martin Baulig  <martin@gnome.org>
20579
20580         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20581         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20582         be false on the ms runtime.
20583
20584 2002-09-13  Martin Baulig  <martin@gnome.org>
20585
20586         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20587         the CS0038 error message.
20588
20589 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
20590
20591         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20592         constant inside, return it.
20593
20594 2002-09-12  Martin Baulig  <martin@gnome.org>
20595
20596         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20597         implicit conversion can be done between enum types.
20598
20599         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20600         check whether an implicit conversion to the current enum's UnderlyingType
20601         exists and report an error if not.
20602
20603         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20604         without debugging support.
20605
20606         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20607         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
20608
20609 2002-09-12  Martin Baulig  <martin@gnome.org>
20610
20611         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20612
20613         * ecore.cs (IMemberExpr.DeclaringType): New property.
20614         (SimpleName.SimpleNameResolve): Check whether we're accessing a
20615         nonstatic member of an outer type (CS0038).
20616
20617 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
20618
20619         * driver.cs: Activate the using-error detector at warning level
20620         4 (at least for MS-compatible APIs).
20621
20622         * namespace.cs (VerifyUsing): Small buglett fix.
20623
20624         * pending.cs (PendingImplementation): pass the container pointer. 
20625
20626         * interface.cs (GetMethods): Allow for recursive definition.  Long
20627         term, I would like to move every type to support recursive
20628         definitions, not the current ordering mechanism that we have right
20629         now.
20630
20631         The situation is this: Attributes are handled before interfaces,
20632         so we can apply attributes to interfaces.  But some attributes
20633         implement interfaces, we will now handle the simple cases
20634         (recursive definitions will just get an error).  
20635
20636         * parameter.cs: Only invalidate types at the end if we fail to
20637         lookup all types.  
20638
20639 2002-09-09  Martin Baulig  <martin@gnome.org>
20640
20641         * ecore.cs (PropertyExpr.Emit): Also check for
20642         TypeManager.system_int_array_get_length so this'll also work when
20643         compiling corlib.  Fixes #30003.
20644
20645 2002-09-09  Martin Baulig  <martin@gnome.org>
20646
20647         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20648         and throw an exception if we can't get the type's size.  Fixed #30040,
20649         added test-165.cs.
20650
20651 2002-09-09  Martin Baulig  <martin@gnome.org>
20652
20653         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20654
20655         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20656         context.  Fixes bug #30027.
20657
20658         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20659         virtual functions.  Fixes bug #30043, added test-164.cs.
20660
20661 2002-09-08  Ravi Pratap  <ravi@ximian.com>
20662
20663         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20664
20665 2002-09-08  Nick Drochak  <ndrochak@gol.com>
20666
20667         * driver.cs: Use an object to get the windows codepage since it's not a
20668         static property.
20669
20670 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
20671
20672         * statement.cs (For.Emit): for infinite loops (test == null)
20673         return whether there is a break inside, not always "true".
20674
20675         * namespace.cs (UsingEntry): New struct to hold the name of the
20676         using definition, the location where it is defined, and whether it
20677         has been used in a successful type lookup.
20678
20679         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20680         strings.
20681
20682         * decl.cs: ditto.
20683
20684 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20685
20686         * attribute.cs : Fix incorrect code which relied on catching
20687         a NullReferenceException to detect a null being passed in
20688         where an object was expected.
20689
20690 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
20691
20692         * statement.cs (Try): flag the catch variable as assigned
20693
20694         * expression.cs (Cast): Simplified by using ResolveType instead of
20695         manually resolving.
20696
20697         * statement.cs (Catch): Fix bug by using ResolveType.
20698
20699 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20700
20701         * expression.cs (BetterConversion): Special case for when we have
20702         a NullLiteral as the argument and we have to choose between string
20703         and object types - we choose string the way csc does.
20704
20705         * attribute.cs (Attribute.Resolve): Catch the
20706         NullReferenceException and report error #182 since the Mono
20707         runtime no more has the bug and having this exception raised means
20708         we tried to select a constructor which takes an object and is
20709         passed a null.
20710
20711 2002-09-05  Ravi Pratap  <ravi@ximian.com>
20712
20713         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20714         message (1502, 1503) when we can't locate a method after overload
20715         resolution. This is much more informative and closes the bug
20716         Miguel reported.
20717
20718         * interface.cs (PopulateMethod): Return if there are no argument
20719         types. Fixes a NullReferenceException bug.
20720
20721         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20722         expressions too. Previously we were checking only in one place for
20723         positional arguments leaving out named arguments.
20724
20725         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20726         type to the enum type is not allowed. Remove code corresponding to
20727         that.
20728
20729         (ConvertNumericExplicit): Allow explicit conversions from
20730         the underlying type to enum type. This precisely follows the spec
20731         and closes a bug filed by Gonzalo.
20732
20733 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20734
20735         * compiler.csproj:
20736         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20737
20738 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
20739
20740         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20741         it was important that we stored the right value after the
20742         reduction in `converted'.
20743
20744 2002-09-04  Martin Baulig  <martin@gnome.org>
20745
20746         * location.cs (Location.SymbolDocument): Use full pathnames for the
20747         source files.
20748
20749 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
20750
20751         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20752         of the expression resolve mechanism, because that will catch the
20753         SimpleName error failures.
20754
20755         (Conditional): If we can not resolve the
20756         expression, return, do not crash.
20757
20758 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20759
20760         * cs-tokenizer.cs:
20761         (location): display token name instead of its number.
20762
20763 2002-08-28  Martin Baulig  <martin@gnome.org>
20764
20765         * expression.cs (Binary.ResolveOperator): Don't silently return
20766         but return an error if an operator cannot be applied between two
20767         enum types.
20768
20769 2002-08-28  Martin Baulig  <martin@gnome.org>
20770
20771         * class.cs (Constructor.Define): Set the permission attributes
20772         correctly instead of making all constructors public.
20773
20774 2002-08-28  Martin Baulig  <martin@gnome.org>
20775
20776         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20777         for private members before reporting a CS0103; if we find anything,
20778         it's a CS0122.
20779
20780 2002-08-28  Martin Baulig  <martin@gnome.org>
20781
20782         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20783         to check whether `closure_start_type == closure_invocation_type',
20784         we also need to check whether `m.DeclaringType == closure_invocation_type'
20785         before bypassing the permission checks.  We might be accessing
20786         protected/private members from the base class.
20787         (TypeManager.RealMemberLookup): Only set private_ok if private
20788         members were requested via BindingFlags.NonPublic.
20789
20790         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20791
20792         * expression.cs (MemberAccess.ResolveMemberAccess): Set
20793         MethodGroupExpr.IsExplicitImpl if appropriate.
20794         (Invocation.DoResolve): Don't report the CS0120 for explicit
20795         interface implementations.
20796
20797 2002-08-27  Martin Baulig  <martin@gnome.org>
20798
20799         * expression.cs (Invocation.DoResolve): If this is a static
20800         method and we don't have an InstanceExpression, we must report
20801         a CS0120.
20802
20803 2002-08-25  Martin Baulig  <martin@gnome.org>
20804
20805         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20806         `==' between a valuetype and an object.
20807
20808 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
20809
20810         * ecore.cs (TypeExpr): Provide a ToString method.
20811
20812 2002-08-24  Martin Baulig  <martin@gnome.org>
20813
20814         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20815         now called proggie.dbg and it's a binary file.
20816
20817 2002-08-23  Martin Baulig  <martin@gnome.org>
20818
20819         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20820
20821 2002-08-23  Martin Baulig  <martin@gnome.org>
20822
20823         * struct.cs (MyStructInfo.ctor): Make this work with empty
20824         structs; it's not allowed to use foreach() on null.
20825
20826 2002-08-23  Martin Baulig  <martin@gnome.org>
20827
20828         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20829         writer the full pathname of the generated assembly.
20830
20831 2002-08-23  Martin Baulig  <martin@gnome.org>
20832
20833         * statements.cs (FlowBranching.UsageVector.MergeChildren):
20834         A `finally' block never returns or breaks; improved handling of
20835         unreachable code.
20836
20837 2002-08-23  Martin Baulig  <martin@gnome.org>
20838
20839         * statement.cs (Throw.Resolve): Allow `throw null'.
20840
20841 2002-08-23  Martin Baulig  <martin@gnome.org>
20842
20843         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20844         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20845         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
20846         MemberLookup would return a wrong event if this is an explicit
20847         interface implementation and the class has an event with the same
20848         name.
20849
20850 2002-08-23  Martin Baulig  <martin@gnome.org>
20851
20852         * statement.cs (Block.AddChildVariableNames): New public method.
20853         (Block.AddChildVariableName): Likewise.
20854         (Block.IsVariableNameUsedInChildBlock): Likewise.
20855         (Block.AddVariable): Check whether a variable name has already
20856         been used in a child block.
20857
20858         * cs-parser.jay (declare_local_variables): Mark all variable names
20859         from the current block as being used in a child block in the
20860         implicit block.
20861
20862 2002-08-23  Martin Baulig  <martin@gnome.org>
20863
20864         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20865         find the symbol writer.
20866
20867         * driver.cs: csc also allows the arguments to /define being
20868         separated by commas, not only by semicolons.
20869
20870 2002-08-23  Martin Baulig  <martin@gnome.org>
20871
20872         * interface.cs (Interface.GetMembers): Added static check for events.
20873
20874 2002-08-15  Martin Baulig  <martin@gnome.org>
20875
20876         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20877         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20878
20879         * ecore.cs (Expression.MemberLookup): Added documentation and explained
20880         why the MethodData.EmitDestructor() change was necessary.
20881
20882 2002-08-20  Martin Baulig  <martin@gnome.org>
20883
20884         * class.cs (TypeContainer.FindMembers): Added static check for events.
20885
20886         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20887
20888         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20889         use Type.GetEvents(), not Type.FindMembers().
20890
20891 2002-08-20  Martin Baulig  <martin@gnome.org>
20892
20893         * decl.cs (MemberCache): Added a special method cache which will
20894         be used for method-only searched.  This ensures that a method
20895         search will return a MethodInfo with the correct ReflectedType for
20896         inherited methods.      
20897
20898 2002-08-20  Martin Baulig  <martin@gnome.org>
20899
20900         * decl.cs (DeclSpace.FindMembers): Made this public.
20901
20902 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20903
20904         * delegate.cs: fixed build on windows.
20905         [FIXME:  Filed as bug #29150: MCS must report these errors.]
20906
20907 2002-08-19  Ravi Pratap  <ravi@ximian.com>
20908
20909         * ecore.cs (StandardConversionExists): Return a false
20910         if we are trying to convert the void type to anything else
20911         since that is not allowed.
20912
20913         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20914         we flag error 70 in the event an event is trying to be accessed
20915         directly from outside the declaring type.
20916
20917 2002-08-20  Martin Baulig  <martin@gnome.org>
20918
20919         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20920         MemberCache from typemanager.cs to decl.cs.
20921
20922 2002-08-19  Martin Baulig  <martin@gnome.org>
20923
20924         * class.cs (TypeContainer): Implement IMemberContainer.
20925         (TypeContainer.DefineMembers): Create the MemberCache.
20926         (TypeContainer.FindMembers): Do better BindingFlags checking; only
20927         return public members if BindingFlags.Public was given, check
20928         whether members are static.
20929
20930 2002-08-16  Martin Baulig  <martin@gnome.org>
20931
20932         * decl.cs (DeclSpace.Define): Splitted this in Define and
20933         DefineMembers.  DefineMembers is called first and initializes the
20934         MemberCache.
20935
20936         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
20937         DefineMembers() on all our DeclSpaces.
20938
20939         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20940         but call DefineMembers() on all nested interfaces.  We call their
20941         Define() in our new Define() function.
20942
20943         * interface.cs (Interface): Implement IMemberContainer.
20944         (Interface.Define): Moved all code except the attribute stuf to
20945         DefineMembers().
20946         (Interface.DefineMembers): Initialize the member cache.
20947
20948         * typemanager.cs (IMemberFinder): Removed this interface, we don't
20949         need this anymore since we can use MemberCache.FindMembers directly.
20950
20951 2002-08-19  Martin Baulig  <martin@gnome.org>
20952
20953         * typemanager.cs (MemberCache): When creating the cache for an
20954         interface type, add all inherited members.
20955         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20956         to `out bool used_cache' and documented it.
20957         (TypeManager.MemberLookup): If we already used the cache in the first
20958         iteration, we don't need to do the interfaces check.
20959
20960 2002-08-19  Martin Baulig  <martin@gnome.org>
20961
20962         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
20963         here from IMemberFinder and don't implement this interface anymore.
20964         (DeclSpace.MemberCache): Moved here from IMemberFinder.
20965
20966         * typemanager.cs (IMemberFinder): This interface is now only used by
20967         classes which actually support the member cache.
20968         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20969         since we only put DeclSpaces into this Hashtable.
20970         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20971         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20972
20973 2002-08-16  Martin Baulig  <martin@gnome.org>
20974
20975         * typemanager.cs (ICachingMemberFinder): Removed.
20976         (IMemberFinder.MemberCache): New property.
20977         (TypeManager.FindMembers): Merged this with RealFindMembers().
20978         This function will never be called from TypeManager.MemberLookup()
20979         so we can't use the cache here, just the IMemberFinder.
20980         (TypeManager.MemberLookup_FindMembers): Check whether the
20981         IMemberFinder has a MemberCache and call the cache's FindMembers
20982         function.
20983         (MemberCache): Rewrote larger parts of this yet another time and
20984         cleaned it up a bit.
20985
20986 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
20987
20988         * driver.cs (LoadArgs): Support quoting.
20989
20990         (Usage): Show the CSC-like command line arguments.
20991
20992         Improved a few error messages.
20993
20994 2002-08-15  Martin Baulig  <martin@gnome.org>
20995
20996         * typemanager.cs (IMemberContainer.Type): New property.
20997         (IMemberContainer.IsInterface): New property.
20998
20999         The following changes are conditional to BROKEN_RUNTIME, which is
21000         defined at the top of the file.
21001
21002         * typemanager.cs (MemberCache.MemberCache): Don't add the base
21003         class'es members, but add all members from TypeHandle.ObjectType
21004         if we're an interface.
21005         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
21006         is the current type.
21007         (MemberCache.CacheEntry.Container): Removed this field.
21008         (TypeHandle.GetMembers): Include inherited members.
21009
21010 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21011
21012         * typemanager.cs: fixed compilation and added a comment on a field that
21013         is never used.
21014
21015 2002-08-15  Martin Baulig  <martin@gnome.org>
21016
21017         * class.cs (ConstructorInitializer.Resolve): In the
21018         Expression.MemberLookup call, use the queried_type as
21019         invocation_type.
21020
21021         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
21022         declared' attribute, it's always true.
21023         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
21024         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
21025         temporary wrapper for FindMembers which tells MemberLookup whether
21026         members from the base classes are included in the return value.
21027         This will go away soon.
21028         (TypeManager.MemberLookup): Use this temporary hack here; once the
21029         new MemberCache is completed, we don't need to do the DeclaredOnly
21030         looping here anymore since the MemberCache will take care of this.
21031         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
21032         (MemberCache): When creating the MemberCache for a class, get
21033         members from the current class and all its base classes.
21034         (MemberCache.CacheEntry.Container): New field.  This is a
21035         temporary hack until the Mono runtime is fixed to distinguish
21036         between ReflectedType and DeclaringType.  It allows us to use MCS
21037         with both the MS runtime and the unfixed Mono runtime without
21038         problems and without accecting performance.
21039         (MemberCache.SearchMembers): The DeclaredOnly looping from
21040         TypeManager.MemberLookup is now done here.      
21041
21042 2002-08-14  Martin Baulig  <martin@gnome.org>
21043
21044         * statement.cs (MyStructInfo.MyStructInfo): Don't call
21045         Type.GetFields on dynamic types but get the fields from the
21046         corresponding TypeContainer.
21047         (MyStructInfo.GetStructInfo): Added check for enum types.
21048
21049         * typemanager.cs (MemberList.IsSynchronized): Implemented.
21050         (MemberList.SyncRoot): Implemented.
21051         (TypeManager.FilterWithClosure): No need to check permissions if
21052         closure_start_type == closure_invocation_type, don't crash if
21053         closure_invocation_type is null.
21054
21055 2002-08-13  Martin Baulig  <martin@gnome.org>
21056
21057         Rewrote TypeContainer.FindMembers to use a member cache.  This
21058         gives us a speed increase of about 35% for the self-hosting MCS
21059         build and of about 15-20% for the class libs (both on GNU/Linux).
21060
21061         * report.cs (Timer): New class to get enhanced profiling.  This
21062         whole class is "TIMER" conditional since it remarkably slows down
21063         compilation speed.
21064
21065         * class.cs (MemberList): New class.  This is an IList wrapper
21066         which we're now using instead of passing MemberInfo[]'s around to
21067         avoid copying this array unnecessarily.
21068         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
21069         (ICachingMemberFinder, IMemberContainer): New interface.
21070         (TypeManager.FilterWithClosure): If `criteria' is null, the name
21071         has already been checked, otherwise use it for the name comparision.
21072         (TypeManager.FindMembers): Renamed to RealMemberFinder and
21073         provided wrapper which tries to use ICachingMemberFinder.FindMembers
21074         if possible.  Returns a MemberList, not a MemberInfo [].
21075         (TypeHandle): New class, implements IMemberContainer.  We create
21076         one instance of this class per type, it contains a MemberCache
21077         which is used to do the member lookups.
21078         (MemberCache): New class.  Each instance of this class contains
21079         all members of a type and a name-based hash table.
21080         (MemberCache.FindMembers): This is our new member lookup
21081         function.  First, it looks up all members of the requested name in
21082         the hash table.  Then, it walks this list and sorts out all
21083         applicable members and returns them.
21084
21085 2002-08-13  Martin Baulig  <martin@gnome.org>
21086
21087         In addition to a nice code cleanup, this gives us a performance
21088         increase of about 1.4% on GNU/Linux - not much, but it's already
21089         half a second for the self-hosting MCS compilation.
21090
21091         * typemanager.cs (IMemberFinder): New interface.  It is used by
21092         TypeManager.FindMembers to call FindMembers on a TypeContainer,
21093         Enum, Delegate or Interface.
21094         (TypeManager.finder_to_member_finder): New PtrHashtable.
21095         (TypeManager.finder_to_container): Removed.
21096         (TypeManager.finder_to_delegate): Removed.
21097         (TypeManager.finder_to_interface): Removed.
21098         (TypeManager.finder_to_enum): Removed.
21099
21100         * interface.cs (Interface): Implement IMemberFinder.
21101
21102         * delegate.cs (Delegate): Implement IMemberFinder.
21103
21104         * enum.cs (Enum): Implement IMemberFinder.
21105
21106         * class.cs (TypeContainer): Implement IMemberFinder.
21107
21108 2002-08-12  Martin Baulig  <martin@gnome.org>
21109
21110         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
21111
21112 2002-08-12  Martin Baulig  <martin@gnome.org>
21113
21114         * ecore.cs (ITypeExpression): New interface for expressions which
21115         resolve to a type.
21116         (TypeExpression): Renamed to TypeLookupExpression.
21117         (Expression.DoResolve): If we're doing a types-only lookup, the
21118         expression must implement the ITypeExpression interface and we
21119         call DoResolveType() on it.
21120         (SimpleName): Implement the new ITypeExpression interface.
21121         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
21122         hack, the situation that we're only looking up types can't happen
21123         anymore when this method is called.  Moved the type lookup code to
21124         DoResolveType() and call it.
21125         (SimpleName.DoResolveType): This ITypeExpression interface method
21126         is now doing the types-only lookup.
21127         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
21128         (ResolveFlags): Added MaskExprClass.
21129
21130         * expression.cs (MemberAccess): Implement the ITypeExpression
21131         interface.
21132         (MemberAccess.DoResolve): Added support for a types-only lookup
21133         when we're called via ITypeExpression.DoResolveType().
21134         (ComposedCast): Implement the ITypeExpression interface.
21135
21136         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
21137         Expression.Resolve() with ResolveFlags.Type instead.
21138
21139 2002-08-12  Martin Baulig  <martin@gnome.org>
21140
21141         * interface.cs (Interface.Define): Apply attributes.
21142
21143         * attribute.cs (Attribute.ApplyAttributes): Added support for
21144         interface attributes.
21145
21146 2002-08-11  Martin Baulig  <martin@gnome.org>
21147
21148         * statement.cs (Block.Emit): Only check the "this" variable if we
21149         do not always throw an exception.
21150
21151         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
21152         whether the property has a set accessor.
21153
21154 2002-08-11  Martin Baulig  <martin@gnome.org>
21155
21156         Added control flow analysis support for structs.
21157
21158         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
21159         with control flow analysis turned off.
21160         (IVariable): New interface.
21161         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
21162         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
21163         (FieldExpr.DoResolve): Resolve the instance expression with flow
21164         analysis turned off and do the definite assignment check after the
21165         resolving when we know what the expression will resolve to.
21166
21167         * expression.cs (LocalVariableReference, ParameterReference):
21168         Implement the new IVariable interface, only call the flow analysis
21169         code if ec.DoFlowAnalysis is true.
21170         (This): Added constructor which takes a Block argument.  Implement
21171         the new IVariable interface.
21172         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
21173         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
21174         This does the definite assignment checks for struct members.
21175
21176         * class.cs (Constructor.Emit): If this is a non-static `struct'
21177         constructor which doesn't have any initializer, call
21178         Block.AddThisVariable() to tell the flow analysis code that all
21179         struct elements must be initialized before control returns from
21180         the constructor.
21181
21182         * statement.cs (MyStructInfo): New public class.
21183         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
21184         argument to this indexer.  If non-zero, check an individual struct
21185         member, not the whole struct.
21186         (FlowBranching.CheckOutParameters): Check struct members.
21187         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
21188         overloaded versions of these methods which take an additional
21189         `int field_idx' argument to check struct members.
21190         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
21191         overloaded versions of these methods which take an additional
21192         `string field_name' argument to check struct member.s
21193         (VariableInfo): Implement the IVariable interface.
21194         (VariableInfo.StructInfo): New public property.  Returns the
21195         MyStructInfo instance of the variable if it's a struct or null.
21196         (Block.AddThisVariable): New public method.  This is called from
21197         Constructor.Emit() for non-static `struct' constructor which do
21198         not have any initializer.  It creates a special variable for the
21199         "this" instance variable which will be checked by the flow
21200         analysis code to ensure that all of the struct's fields are
21201         initialized before control returns from the constructor.
21202         (UsageVector): Added support for struct members.  If a
21203         variable/parameter is a struct with N members, we reserve a slot
21204         in the usage vector for each member.  A struct is considered fully
21205         initialized if either the struct itself (slot 0) or all its
21206         members are initialized.
21207
21208 2002-08-08  Martin Baulig  <martin@gnome.org>
21209
21210         * driver.cs (Driver.MainDriver): Only report an error CS5001
21211         if there were no compilation errors.
21212
21213         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
21214         `UnsafeContext' property to determine whether the parent is in
21215         unsafe context rather than checking the parent's ModFlags:
21216         classes nested in an unsafe class are unsafe as well.
21217
21218 2002-08-08  Martin Baulig  <martin@gnome.org>
21219
21220         * statement.cs (UsageVector.MergeChildren): Distinguish between
21221         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
21222         we return.  Added test17() and test18() to test-154.cs.
21223
21224 2002-08-08  Martin Baulig  <martin@gnome.org>
21225
21226         * typemanager.cs (TypeManager.FilterWithClosure): If we have
21227         Family access, make sure the invoking type isn't a subclass of the
21228         queried type (that'd be a CS1540).
21229
21230         * ecore.cs (Expression.MemberLookup): Added overloaded version of
21231         this method which takes an additional `Type invocation_type'.
21232
21233         * expression.cs (BaseAccess.DoResolve): Use the base type as
21234         invocation and query type.
21235         (MemberAccess.DoResolve): If the lookup failed and we're about to
21236         report a CS0122, try a lookup with the ec.ContainerType - if this
21237         succeeds, we must report a CS1540.
21238
21239 2002-08-08  Martin Baulig  <martin@gnome.org>
21240
21241         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
21242         (MethodGroupExpr): Implement the IMemberExpr interface.
21243
21244         * expression (MemberAccess.ResolveMemberAccess): No need to have
21245         any special code for MethodGroupExprs anymore, they're now
21246         IMemberExprs.   
21247
21248 2002-08-08  Martin Baulig  <martin@gnome.org>
21249
21250         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
21251         Family, FamANDAssem and FamORAssem permissions.
21252         (TypeManager.IsSubclassOrNestedChildOf): New public method.
21253
21254 2002-08-08  Martin Baulig  <martin@gnome.org>
21255
21256         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
21257         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
21258         or loop block.
21259
21260 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
21261
21262         * driver.cs: implemented /resource option to embed managed resources.
21263
21264 2002-08-07  Martin Baulig  <martin@gnome.org>
21265
21266         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
21267         (FieldBase.HasFieldInitializer): New public property.
21268         (FieldBase.GetInitializerExpression): New public method.  Resolves and
21269         returns the field initializer and makes sure it is only resolved once.
21270         (TypeContainer.EmitFieldInitializers): Call
21271         FieldBase.GetInitializerExpression to get the initializer, this ensures
21272         that it isn't resolved multiple times.
21273
21274         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
21275         the resolving process (SimpleName/MemberLookup) that we're currently
21276         emitting a field initializer (which must not access any instance members,
21277         this is an error CS0236).
21278
21279         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
21280         argument, if the `IsFieldInitializer' flag is set, we must report and
21281         error CS0236 and not an error CS0120.   
21282
21283 2002-08-07  Martin Baulig  <martin@gnome.org>
21284
21285         * ecore.cs (IMemberExpr): New public interface.
21286         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
21287         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
21288         if the expression is an IMemberExpr.
21289
21290         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
21291         to be null, implicitly default to `this' if we're non-static in
21292         this case.  Simplified the code a lot by using the new IMemberExpr
21293         interface.  Also fixed bug #28176 here.
21294
21295 2002-08-06  Martin Baulig  <martin@gnome.org>
21296
21297         * cs-parser.jay (SimpleLookup): Removed.  We need to create
21298         ParameterReferences during semantic analysis so that we can do a
21299         type-only search when resolving Cast, TypeOf and SizeOf.
21300         (block): Pass the `current_local_parameters' to the Block's
21301         constructor.
21302
21303         * class.cs (ConstructorInitializer): Added `Parameters parameters'
21304         argument to the constructor.
21305         (ConstructorInitializer.Resolve): Create a temporary implicit
21306         block with the parameters.
21307
21308         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
21309         references here if we aren't doing a type-only search.
21310
21311         * statement.cs (Block): Added constructor which takes a
21312         `Parameters parameters' argument.
21313         (Block.Parameters): New public property.
21314
21315         * support.cs (InternalParameters.Parameters): Renamed `parameters'
21316         to `Parameters' and made it public readonly.
21317
21318 2002-08-06  Martin Baulig  <martin@gnome.org>
21319
21320         * ecore.cs (Expression.Warning): Made this public as well.
21321
21322         * report.cs (Report.Debug): Print the contents of collections.
21323
21324 2002-08-06  Martin Baulig  <martin@gnome.org>
21325
21326         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
21327         used to tell Resolve() which kinds of expressions it may return.
21328         (Expression.Resolve): Added overloaded version of this method which
21329         takes a `ResolveFlags flags' argument.  This can be used to tell
21330         Resolve() which kinds of expressions it may return.  Reports a
21331         CS0118 on error.
21332         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21333         ResolveFlags.SimpleName.
21334         (Expression.Error118): Added overloaded version of this method which
21335         takes a `ResolveFlags flags' argument.  It uses the flags to determine
21336         which kinds of expressions are allowed.
21337
21338         * expression.cs (Argument.ResolveMethodGroup): New public method.
21339         Resolves an argument, but allows a MethodGroup to be returned.
21340         This is used when invoking a delegate.
21341
21342         * TODO: Updated a bit.
21343
21344 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21345
21346         Fixed compilation with csc.
21347
21348         * ecore.cs: Expression.Error made public. Is this correct? Should
21349         Warning be made public too?
21350
21351         * expression.cs: use ea.Location instead of ea.loc.
21352         [FIXME:  Filed as bug #28607: MCS must report these errors.]
21353
21354 2002-08-06  Martin Baulig  <martin@gnome.org>
21355
21356         * ecore.cs (Expression.loc): Moved the location here instead of
21357         duplicating it in all derived classes.
21358         (Expression.Location): New public property.
21359         (Expression.Error, Expression.Warning): Made them non-static and
21360         removed the location argument.
21361         (Expression.Warning): Added overloaded version which takes an
21362         `int level' argument.
21363         (Expression.Error118): Make this non-static and removed the
21364         expression and location arguments.
21365         (TypeExpr): Added location argument to the constructor.
21366
21367         * expression.cs (StaticCallExpr): Added location argument to
21368         the constructor.
21369         (Indirection, PointerArithmetic): Likewise.
21370         (CheckedExpr, UnCheckedExpr): Likewise.
21371         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21372         (StringPtr): Likewise.
21373
21374
21375 2002-08-05  Martin Baulig  <martin@gnome.org>
21376
21377         * expression.cs (BaseAccess.DoResolve): Actually report errors.
21378
21379         * assign.cs (Assign.DoResolve): Check whether the source
21380         expression is a value or variable.
21381
21382         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21383         while resolving the corresponding blocks.
21384
21385         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21386         an error, don't silently return null.
21387
21388         * statement.cs (Block.AddVariable): Do the error reporting here
21389         and distinguish between CS0128 and CS0136.
21390         (Block.DoResolve): Report all unused labels (warning CS0164).
21391         (LabeledStatement): Pass the location to the constructor.
21392         (LabeledStatement.HasBeenReferenced): New property.
21393         (LabeledStatement.Resolve): Set it to true here.
21394
21395         * statement.cs (Return.Emit): Return success even after reporting
21396         a type mismatch error (CS0126 or CS0127), this is what csc does and
21397         it avoids confusing the users with any consecutive errors.
21398
21399 2002-08-05  Martin Baulig  <martin@gnome.org>
21400
21401         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21402
21403         * const.cs (Const.LookupConstantValue): Catch circular definitions.
21404
21405         * expression.cs (MemberAccess.DoResolve): Silently return if an
21406         error has already been reported.
21407
21408         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21409         error has already been reported.
21410
21411 2002-08-05  Martin Baulig  <martin@gnome.org>
21412
21413         * statement.cs (UsageVector): Only initialize the `parameters'
21414         vector if we actually have any "out" parameters.
21415
21416 2002-08-05  Martin Baulig  <martin@gnome.org>
21417
21418         * expression.cs (Binary.ResolveOperator): When combining delegates,
21419         they must have the same type.
21420
21421 2002-08-05  Martin Baulig  <martin@gnome.org>
21422
21423         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21424         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21425         work with the ms runtime and we also don't need it: if we're a
21426         PropertyBuilder and not in the `indexer_arguments' hash, then we
21427         are a property and not an indexer.
21428
21429         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21430         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21431         since the latter one doesn't work with the ms runtime.
21432
21433 2002-08-03  Martin Baulig  <martin@gnome.org>
21434
21435         Fixed bugs #27998 and #22735.
21436
21437         * class.cs (Method.IsOperator): New public field.
21438         (Method.CheckBase): Report CS0111 if there's already a method
21439         with the same parameters in the current class.  Report CS0508 when
21440         attempting to change the return type of an inherited method.
21441         (MethodData.Emit): Report CS0179 if a method doesn't have a body
21442         and it's not marked abstract or extern.
21443         (PropertyBase): New abstract base class for Property and Indexer.
21444         (PropertyBase.CheckBase): Moved here from Property and made it work
21445         for indexers.
21446         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21447         the same so we can reuse it there.
21448         (Property, Indexer): Derive from PropertyBase.
21449         (MethodSignature.inheritable_property_signature_filter): New delegate
21450         to find properties and indexers.
21451
21452         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21453         argument and improved error reporting.
21454
21455         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21456         EmptyReadOnlyParameters and made it a property.
21457
21458         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21459         version of this method which takes a `PropertyInfo indexer'.
21460         (TypeManager.RegisterIndexer): New method.
21461
21462         * class.cs: Added myself as author of this file :-)
21463
21464 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21465
21466         * class.cs: fixed compilation on windoze.
21467
21468 2002-08-03  Martin Baulig  <martin@gnome.org>
21469
21470         * interface.cs (Interface.GetInterfaceBases): Check whether all
21471         base interfaces are at least as accessible than the current one.
21472
21473         * class.cs (TypeContainer.GetClassBases): Check whether base types
21474         are at least as accessible than the current type.
21475         (TypeContainer.AsAccessible): Implemented and made non-static.
21476         (MemberBase.CheckParameters): Report errors if the accessibility
21477         checks fail.
21478
21479         * delegate.cs (Delegate.Delegate): The default visibility is
21480         internal for top-level types and private for nested types.
21481         (Delegate.Define): Report errors if the accessibility checks fail.
21482
21483         * enum.cs (Enum.Enum): The default visibility is internal for
21484         top-level types and private for nested types.
21485         (Enum.DefineType): Compute the correct visibility.
21486
21487         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21488         function which takes a `bool is_toplevel' instead of a TypeContainer.
21489
21490         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21491         builtin type.
21492
21493 2002-08-02  Martin Baulig  <martin@gnome.org>
21494
21495         * expression.cs (LocalVariableReferenc): Added constructor which
21496         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21497         (LocalVariableReference.IsReadOnly): New property.
21498         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21499         variable is readonly, use our own readonly flag to do this; you can
21500         use the new constructor to get a writable reference to a read-only
21501         variable.
21502
21503         * cs-parser.jay (foreach_statement, using_statement): Get a writable
21504         reference to the local variable.
21505
21506 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
21507
21508         * rootcontext.cs (ResolveCore): Also include System.Exception
21509
21510         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21511         we reach an EmptyStatement.
21512
21513         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21514         is also fine.
21515
21516         * expression.cs (Binary.ResolveOperator): Check error result in
21517         two places.
21518
21519         use brtrue/brfalse directly and avoid compares to null.
21520
21521 2002-08-02  Martin Baulig  <martin@gnome.org>
21522
21523         * class.cs (TypeContainer.Define): Define all nested interfaces here.
21524         Fixes bug #28407, added test-155.cs.
21525
21526 2002-08-01  Martin Baulig  <martin@gnome.org>
21527
21528         * class.cs (Event.EmitDefaultMethod): Make this work with static
21529         events.  Fixes #28311, added verify-3.cs.
21530
21531 2002-08-01  Martin Baulig  <martin@gnome.org>
21532
21533         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21534         `is_disposable' fields.
21535         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21536         `hm.is_disposable' if we're using the collection pattern.
21537         (Foreach.EmitCollectionForeach): Use the correct type for the
21538         enumerator's local variable, only emit the try/finally block if
21539         necessary (fixes #27713).
21540
21541 2002-08-01  Martin Baulig  <martin@gnome.org>
21542
21543         * ecore.cs (Expression.report118): Renamed to Error118 and made
21544         it public static.
21545
21546         * statement.cs (Throw.Resolve): Check whether the expression is of
21547         the correct type (CS0118) and whether the type derives from
21548         System.Exception (CS0155).
21549         (Catch.Resolve): New method.  Do the type lookup here and check
21550         whether it derives from System.Exception (CS0155).
21551         (Catch.CatchType, Catch.IsGeneral): New public properties.
21552
21553         * typemanager.cs (TypeManager.exception_type): Added.
21554
21555 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
21556
21557         * driver.cs: Updated About function.
21558
21559 2002-07-31  Martin Baulig  <martin@gnome.org>
21560
21561         Implemented Control Flow Analysis.
21562
21563         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21564         (EmitContext.CurrentBranching): Added.
21565         (EmitContext.StartFlowBranching): Added.
21566         (EmitContext.EndFlowBranching): Added.
21567         (EmitContext.KillFlowBranching): Added.
21568         (EmitContext.IsVariableAssigned): Added.
21569         (EmitContext.SetVariableAssigned): Added.
21570         (EmitContext.IsParameterAssigned): Added.
21571         (EmitContext.SetParameterAssigned): Added.
21572         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21573         Added control flow analysis stuff here.
21574
21575         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21576         resolve the expression as lvalue.
21577         (LocalVariableReference.DoResolve): Check whether the variable has
21578         already been assigned.
21579         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21580         the parameter as assigned here.
21581         (ParameterReference.DoResolve): Check whether the parameter has already
21582         been assigned.
21583         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21584         expression as lvalue.
21585
21586         * statement.cs (FlowBranching): New class for the flow analysis code.
21587         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21588         (LabeledStatement.IsDefined): New public property.
21589         (LabeledStatement.AddUsageVector): New public method to tell flow
21590         analyis that the label may be reached via a forward jump.
21591         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21592         flow analysis.
21593         (VariableInfo.Number): New public field.  This is used by flow analysis
21594         to number all locals of a block.
21595         (Block.CountVariables): New public property.  This is the number of
21596         local variables in this block (including the locals from all parent
21597         blocks).
21598         (Block.EmitMeta): Number all the variables.
21599
21600         * statement.cs: Added flow analysis support to all classes.
21601
21602 2002-07-31  Martin Baulig  <martin@gnome.org>
21603
21604         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21605         To get debugging messages, compile mcs with /define:MCS_DEBUG and
21606         then use this argument.
21607
21608         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21609
21610         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21611         use this to specify /define options.
21612
21613 2002-07-29  Martin Baulig  <martin@gnome.org>
21614
21615         * statement.cs (Fixed): Moved all code that does variable lookups
21616         and resolvings from Emit to Resolve.
21617
21618         * statement.cs (For): Moved all code that does variable lookups
21619         and resolvings from Emit to Resolve.
21620
21621         * statement.cs (Using): Moved all code that does variable lookups
21622         and resolvings from Emit to Resolve.
21623
21624 2002-07-29  Martin Baulig  <martin@gnome.org>
21625
21626         * attribute.cs (Attribute.Resolve): Explicitly catch a
21627         System.NullReferenceException when creating the
21628         CustromAttributeBuilder and report a different warning message.
21629
21630 2002-07-29  Martin Baulig  <martin@gnome.org>
21631
21632         * support.cs (ParameterData.ParameterName): Added method to
21633         get the name of a parameter.
21634
21635         * typemanager.cs (TypeManager.IsValueType): New public method.
21636
21637 2002-07-29  Martin Baulig  <martin@gnome.org>
21638
21639         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
21640         is a flag which specifies that it's either ref or out.
21641         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21642         the out parameter to `out Parameter.Modifier mod', also set the
21643         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21644
21645         * support.cs (InternalParameters.ParameterModifier): Distinguish
21646         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21647         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21648
21649         * expression.cs (Argument.GetParameterModifier): Distinguish
21650         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21651         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21652
21653 2002-07-29  Martin Baulig  <martin@gnome.org>
21654
21655         * expression.cs (ParameterReference.ParameterReference): Added
21656         `Location loc' argument to the constructor.
21657
21658         * cs-parser.jay: Pass location to ParameterReference.
21659
21660 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
21661
21662         * statement.cs (Try): Initialize the location.
21663
21664         * cs-parser.jay: pass location to Try.
21665
21666         * expression.cs (Unary.Reduce): Change the prototype to return
21667         whether a constant fold could be performed or not.  The result is
21668         returned in an out parameters.  In the case of Indirection and
21669         AddressOf, we want to perform the full tests.
21670
21671 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
21672
21673         * statement.cs (Statement.Emit): Flag dead code.
21674
21675 2002-07-27  Andrew Birkett  <andy@nobugs.org>
21676
21677         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21678
21679 2002-07-27  Martin Baulig  <martin@gnome.org>
21680
21681         * class.cs (MethodData.Define): Put back call to
21682         TypeManager.AddMethod(), accidentally commented this out.
21683
21684         * report.cs (Debug): New public method to print debugging information,
21685         this is `[Conditional ("DEBUG")]'.
21686
21687 2002-07-26  Martin Baulig  <martin@gnome.org>
21688
21689         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21690         (switch_statement): Push the current_block to the switch_stack and
21691         pop it again when we're done with the switch.
21692         (switch_section): The new block is a child of the current_block.
21693         Fixes bug #24007, added test-152.cs.
21694
21695 2002-07-27  Martin Baulig  <martin@gnome.org>
21696
21697         * expression.cs (Invocation.EmitArguments): When calling a varargs
21698         function with only its fixed arguments, we need to pass an empty
21699         array.
21700
21701 2002-07-27  Martin Baulig  <martin@gnome.org>
21702
21703         Mono 0.13 has been released.
21704
21705 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
21706
21707         * driver.cs: Rename --resource to --linkres, because that is what
21708         we do currently, we dont support --resource yet.
21709
21710         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21711
21712 2002-07-25  Martin Baulig  <martin@gnome.org>
21713
21714         * class.cs (MethodData): New public class.  This is a `method builder'
21715         class for a method or one accessor of a Property/Indexer/Event.
21716         (MethodData.GetMethodFlags): Moved here from MemberBase.
21717         (MethodData.ApplyAttributes): Likewise.
21718         (MethodData.ApplyObsoleteAttribute): Likewise.
21719         (MethodData.ApplyConditionalAttribute): Likewise.
21720         (MethodData.ApplyDllImportAttribute): Likewise.
21721         (MethodData.CheckAbstractAndExternal): Likewise.
21722         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21723         (MethodData.Emit): Formerly known as Method.Emit().
21724         (MemberBase): Moved everything which was specific to a single
21725         accessor/method to MethodData.
21726         (Method): Create a new MethodData and call Define() and Emit() on it.
21727         (Property, Indexer, Event): Create a new MethodData objects for each
21728         accessor and call Define() and Emit() on them.
21729
21730 2002-07-25  Martin Baulig  <martin@gnome.org>
21731
21732         Made MethodCore derive from MemberBase to reuse the code from there.
21733         MemberBase now also checks for attributes.
21734
21735         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21736         (MemberBase.GetMethodFlags): Moved here from class Method and marked
21737         as virtual.
21738         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21739         `CallingConventions cc' and `Attributes opt_attrs' arguments.
21740         (MemberBase.ApplyAttributes): New virtual method; applies the
21741         attributes to a method or accessor.
21742         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21743         (MemberBase.ApplyConditionalAttribute): Likewise.
21744         (MemberBase.ApplyDllImportAttribute): Likewise.
21745         (MemberBase.CheckAbstractAndExternal): Likewise.
21746         (MethodCore.ParameterTypes): This is now a property instead of a
21747         method, it's initialized from DoDefineParameters().
21748         (MethodCore.ParameterInfo): Removed the set accessor.
21749         (MethodCore.DoDefineParameters): New protected virtual method to
21750         initialize ParameterTypes and ParameterInfo.
21751         (Method.GetReturnType): We can now simply return the MemberType.
21752         (Method.GetMethodFlags): Override the MemberBase version and add
21753         the conditional flags.
21754         (Method.CheckBase): Moved some code from Define() here, call
21755         DoDefineParameters() here.
21756         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21757         here to avoid some larger code duplication.
21758         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21759         ensure that abstract and external accessors don't declare a body.
21760
21761         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21762         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21763         lookup in the attribute's parent classes, so we need to abort as soon
21764         as we found the first match.
21765         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21766         the attribute has no arguments.
21767
21768         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21769         of a Method.
21770
21771 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21772
21773         * cs-parser.jay: reverted previous patch.
21774
21775 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21776
21777         * cs-parser.jay: fixed bug #22119.
21778
21779 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21780
21781         * attribute.cs: fixed compilation. The error was:
21782         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
21783         be assigned to before control leaves the current method."
21784         [FIXME:  Filed as bug #28186: MCS must report this error.]
21785
21786 2002-07-25  Martin Baulig  <martin@gnome.org>
21787
21788         * attribute.cs (Attribute.Conditional_GetConditionName): New static
21789         method to pull the condition name ouf of a Conditional attribute.
21790         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21791         the obsolete message and error flag out of an Obsolete attribute.
21792
21793         * class.cs (Method.GetMethodFlags): New public method to get the
21794         TypeManager.MethodFlags for this method.
21795         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21796         private methods.
21797         (Method.Define): Get and apply the Obsolete and Conditional attributes;
21798         if we're overriding a virtual function, set the new private variable
21799         `parent_method'; call the new TypeManager.AddMethod().
21800
21801         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
21802         the MethodBuilder and the Method in a PtrHashtable.
21803         (TypeManager.builder_to_method): Added for this purpose.
21804         (TypeManager.MethodFlags): Added IsObsoleteError.
21805         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
21806         Obsolete and Conditional arguments in MethodBuilders.  If we discover
21807         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21808         the message from the attribute.
21809
21810 2002-07-24  Martin Baulig  <martin@gnome.org>
21811
21812         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21813         preprocessor directives, ensure that the argument to #define/#undef is
21814         exactly one identifier and that it's actually an identifier.
21815
21816         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21817         did not work ....
21818
21819 2002-07-24  Martin Baulig  <martin@gnome.org>
21820
21821         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21822         initialize it to TypeManager.object_type in the constructor.
21823         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21824         of the `hm.get_current' method if we're using the collection pattern.
21825         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21826         for the explicit conversion to make it work when we're using the collection
21827         pattern and the `Current' property has a different return type than `object'.
21828         Fixes #27713.
21829
21830 2002-07-24  Martin Baulig  <martin@gnome.org>
21831
21832         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21833         does not match, but don't report any errors.  This method is called in
21834         order for all methods in a MethodGroupExpr until a matching method is
21835         found, so we don't want to bail out if the first method doesn't match.
21836         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21837         matches, report the 123.  Fixes #28070.
21838
21839 2002-07-24  Martin Baulig  <martin@gnome.org>
21840
21841         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21842         TypeManager.TypeToCoreType() to the top of the method so the
21843         following equality checks will work.  Fixes #28107.
21844
21845 2002-07-24  Martin Baulig  <martin@gnome.org>
21846
21847         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21848         operand is of type uint, and the other operand is of type sbyte,
21849         short or int, the operands are converted to type long." -
21850         Actually do what this comment already told us.  Fixes bug #28106,
21851         added test-150.cs.
21852
21853 2002-07-24  Martin Baulig  <martin@gnome.org>
21854
21855         * class.cs (MethodBase): New abstract class.  This is now a base
21856         class for Property, Indexer and Event to avoid some code duplication
21857         in their Define() and DefineMethods() methods.
21858         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21859         generic methods for Define() and DefineMethods().
21860         (FieldBase): Derive from MemberBase, not MemberCore.
21861         (Property): Derive from MemberBase, not MemberCore.
21862         (Property.DefineMethod): Moved all the code from this method to the
21863         new MethodBase.DefineAccessor(), just call it with appropriate
21864         argumetnts.
21865         (Property.Define): Call the new Property.DoDefine(), this does some
21866         sanity checks and we don't need to duplicate the code everywhere.
21867         (Event): Derive from MemberBase, not MemberCore.
21868         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21869         accessors, this will also make them work with interface events.
21870         (Indexer): Derive from MemberBase, not MemberCore.
21871         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21872         (Indexer.Define): Use the new MethodBase functions.
21873
21874         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21875         argument to the constructor.
21876         (Interface.FindMembers): Added support for interface events.
21877         (Interface.PopluateEvent): Implemented.
21878
21879         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
21880
21881 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
21882
21883         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21884         but this is required to check for a method name being the same as
21885         the containing class.  
21886
21887         Handle this now.
21888
21889 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21890
21891         * interface.cs: initialize variable.
21892
21893 2002-07-23  Martin Baulig  <martin@gnome.org>
21894
21895         Implemented the IndexerName attribute in interfaces.
21896
21897         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21898         name if this is an explicit interface implementation.
21899         (Indexer.InterfaceIndexerName): New public variable.  If we're
21900         implementing an interface indexer, this is the IndexerName in that
21901         interface.  Otherwise, it's the IndexerName.
21902         (Indexer.DefineMethod): If we're implementing interface indexer,
21903         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
21904         and Pending.ImplementIndexer methods.
21905         (Indexer.Define): Also define the PropertyBuilder if we're
21906         implementing an interface indexer and this is neither an explicit
21907         interface implementation nor do the IndexerName match the one in
21908         the interface.
21909
21910         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21911         If a method is defined here, then we always need to create a proxy
21912         for it.  This is used when implementing interface indexers.
21913         (Pending.IsInterfaceIndexer): New public method.
21914         (Pending.ImplementIndexer): New public method.
21915         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21916         This is used when implementing interface indexers to define a proxy
21917         if necessary.
21918         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21919         define a proxy if necessary.
21920
21921         * interface.cs (Interface.IndexerName): New public variable.
21922         (Interface.PopulateIndexer): Set the IndexerName.
21923         (Interface.DefineIndexers): New private method.  Populate all the
21924         indexers and make sure their IndexerNames match.
21925
21926         * typemanager.cs (IndexerPropertyName): Added support for interface
21927         indexers.
21928
21929 2002-07-22  Martin Baulig  <martin@gnome.org>
21930
21931         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21932         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21933         ret if HasReturnLabel.
21934         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21935         variables.
21936
21937         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21938         and set the ec.LoopBeginTryCatchLevel.
21939         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21940         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21941         the current ec.TryCatchLevel, the branch goes out of an exception
21942         block.  In this case, we need to use Leave and not Br.
21943
21944 2002-07-22  Martin Baulig  <martin@gnome.org>
21945
21946         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21947         block unless the block does not always return or it is contained in
21948         another try { ... } catch { ... } block.  Fixes bug #26506.
21949         Added verify-1.cs to the test suite.
21950
21951 2002-07-22  Martin Baulig  <martin@gnome.org>
21952
21953         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21954         then we do not always return.  Fixes bug #24985.
21955
21956 2002-07-22  Martin Baulig  <martin@gnome.org>
21957
21958         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21959         lookup on a per-class level; ie. walk up the class hierarchy until we
21960         found at least one applicable method, then choose the best among them.
21961         Fixes bug #24463 and test-29.cs.
21962
21963 2002-07-22  Martin Baulig  <martin@gnome.org>
21964
21965         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21966         return types of the methods.  The return type is not part of the
21967         signature and we must not check it to make the `new' modifier work.
21968         Fixes bug #27999, also added test-147.cs.
21969         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21970
21971         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21972         on the method's return type.
21973
21974 2002-07-21  Martin Baulig  <martin@gnome.org>
21975
21976         * assign.cs: Make this work if the rightmost source is a constant and
21977         we need to do an implicit type conversion.  Also adding a few more tests
21978         to test-38.cs which should have caught this.
21979
21980         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21981         target in the makefile for this.  The makefile.gnu is primarily intended
21982         for end-users who don't want to debug the compiler.
21983
21984 2002-07-21  Martin Baulig  <martin@gnome.org>
21985
21986         * assign.cs: Improved the Assign class so it can now handle embedded
21987         assignments (X = Y = Z = something).  As a side-effect this'll now also
21988         consume less local variables.  test-38.cs now passes with MCS, added
21989         a few new test cases to that test.
21990
21991 2002-07-20  Martin Baulig  <martin@gnome.org>
21992
21993         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
21994         instructions.  Fixes bug #27977, also added test-146.cs.
21995
21996 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21997
21998         * cs-tokenizer.cs: fixed getHex ().
21999
22000 2002-07-19  Martin Baulig  <martin@gnome.org>
22001
22002         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
22003         not Type.GetType() to lookup the array type.  This is needed when
22004         we're constructing an array of a user-defined type.
22005         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
22006         single-dimensional arrays, but also for single-dimensial arrays of
22007         type decimal.
22008
22009 2002-07-19  Martin Baulig  <martin@gnome.org>
22010
22011         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
22012         this function is called, it's not allowed to share LocalBuilders
22013         among ILGenerators.
22014
22015 2002-07-19  Martin Baulig  <martin@gnome.org>
22016
22017         * expression.cs (Argument.Resolve): Report an error 118 when trying
22018         to pass a type as argument.
22019
22020 2002-07-18  Martin Baulig  <martin@gnome.org>
22021
22022         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
22023         Conv_R_Un for the signed `long' type.
22024
22025 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
22026
22027         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
22028         `expr' for the temporary result, as that will fail if we do
22029         multiple resolves on the same expression.
22030
22031 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
22032
22033         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
22034         ec.TypeContainer for looking up aliases. 
22035
22036         * class.cs (TypeContainer): Remove LookupAlias from here.
22037
22038         * decl.cs (DeclSpace); Move here.
22039
22040 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
22041
22042         * class.cs (FindMembers): Only call filter if the constructor
22043         bulider is not null.
22044
22045         Also handle delegates in `NestedTypes' now.  Now we will perform
22046         type lookups using the standard resolution process.  This also
22047         fixes a bug.
22048
22049         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
22050         This uses Expressions (the limited kind that can be parsed by the
22051         tree) instead of strings.
22052
22053         * expression.cs (ComposedCast.ToString): Implement, used to flag
22054         errors since now we have to render expressions.
22055
22056         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
22057         FormArrayType. 
22058
22059         * ecore.cs (SimpleName.ToString): ditto.
22060
22061         * cs-parser.jay: Instead of using strings to assemble types, use
22062         Expressions to assemble the type (using SimpleName, ComposedCast,
22063         MemberAccess).  This should fix the type lookups in declarations,
22064         because we were using a different code path for this.
22065
22066         * statement.cs (Block.Resolve): Continue processing statements
22067         even when there is an error.
22068
22069 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
22070
22071         * class.cs (Event.Define): Also remove the `remove' method from
22072         the list of pending items.
22073
22074         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
22075         generate more compact code. 
22076
22077 2002-07-17  Martin Baulig  <martin@gnome.org>
22078
22079         * const.cs (Const.LookupConstantValue): Add support for constant
22080         `unchecked' and `checked' expressions.
22081         Also adding test case test-140.cs for this.
22082
22083 2002-07-17  Martin Baulig  <martin@gnome.org>
22084
22085         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
22086         check whether mi.ReturnType implements the IEnumerator interface; the
22087         `==' and the IsAssignableFrom() will fail in this situation.
22088
22089 2002-07-16  Ravi Pratap  <ravi@ximian.com>
22090
22091         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
22092         here too.
22093
22094 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22095
22096         * expression.cs: fixed bug #27811.
22097
22098 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
22099
22100         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
22101         Molaro: when we are a ref, the value already contains a pointer
22102         value, do not take the address of it.
22103
22104 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
22105         * removed mb-parser.jay and mb-tokenizer.cs
22106
22107 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22108
22109         * expression.cs: check against the building corlib void type.
22110
22111 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
22112
22113         * ecore.cs: fix for valuetype static readonly fields: when 
22114         initializing them, we need their address, not the address of a copy.
22115
22116 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
22117
22118         * typemanager.cs: register also enum_type in corlib.
22119
22120 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22121
22122         * class.cs: allow calling this (but not base) initializers in structs.
22123
22124 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
22125
22126         * ecore.cs: make sure we compare against the building base types
22127         in GetTypeSize ().
22128
22129 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
22130
22131         * typemanager.cs: fix TypeToCoreType() to handle void and object
22132         (corlib gets no more typerefs after this change).
22133
22134 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
22135
22136         * expression.cs (ArrayCreation.EmitArrayArguments): use
22137         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
22138
22139         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
22140         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
22141         array indexes, the runtime actually forbids them.
22142
22143         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
22144         for array arguments here.
22145
22146         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
22147         instead of the default for ValueTypes.
22148
22149         (New.DoEmit): Use IsValueType instead of
22150         IsSubclassOf (value_type)
22151         (New.DoResolve): ditto.
22152         (Invocation.EmitCall): ditto.
22153
22154         * assign.cs (Assign): ditto.
22155
22156         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
22157         Statements *are* currently doing part of their resolution during
22158         Emit.  
22159
22160         Expressions do always resolve during resolve, but statements are
22161         only required to propagate resolution to their children.
22162
22163 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
22164
22165         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
22166
22167         (LoadAssembly): Do not add the dll if it is already specified
22168
22169         (MainDriver): Add the System directory to the link path at the end,
22170         after all the other -L arguments. 
22171
22172         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
22173         wrong opcode for loading bytes and bools (ldelem.i1 instead of
22174         ldelem.u1) and using the opposite for sbytes.
22175
22176         This fixes Digger, and we can finally run it.
22177
22178         * driver.cs (UnixParseOption): Move the option parsing here.  
22179         (CSCParseOption): Implement CSC-like parsing of options.
22180
22181         We now support both modes of operation, the old Unix way, and the
22182         new CSC-like way.  This should help those who wanted to make cross
22183         platform makefiles.
22184
22185         The only thing broken is that /r:, /reference: and /lib: are not
22186         implemented, because I want to make those have the same semantics
22187         as the CSC compiler has, and kill once and for all the confussion
22188         around this.   Will be doing this tomorrow.
22189
22190         * statement.cs (Unsafe.Resolve): The state is checked during
22191         resolve, not emit, so we have to set the flags for IsUnsfe here.
22192
22193 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
22194
22195         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
22196         not catch the Error_ObjectRefRequired in SimpleName (as it is
22197         possible to have a class/instance variable name that later gets
22198         deambiguated), we have to check this here.      
22199
22200 2002-07-10  Ravi Pratap  <ravi@ximian.com>
22201
22202         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
22203         make static and put into Expression.
22204
22205         (Event.Define): Register the private field of the event with the 
22206         TypeManager so that GetFieldFromEvent can get at it.
22207
22208         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
22209         keep track of the private field associated with an event which
22210         has no accessors.
22211
22212         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
22213         private field.
22214
22215         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
22216
22217 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
22218
22219         * expression.cs (Binary.EmitBranchable): this routine emits the
22220         Binary expression in a branchable context.  This basically means:
22221         we need to branch somewhere, not just get the value on the stack.
22222
22223         This works together with Statement.EmitBoolExpression.
22224
22225         * statement.cs (Statement.EmitBoolExpression): Use
22226         EmitBranchable. 
22227
22228 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
22229
22230         * statement.cs (For): Reduce the number of jumps in loops.
22231
22232         (For): Implement loop inversion for the For statement.
22233
22234         (Break): We can be breaking out of a Try/Catch controlled section
22235         (foreach might have an implicit try/catch clause), so we need to
22236         use Leave instead of Br.
22237
22238         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
22239         now).  If the instace expression supports IMemoryLocation, we use
22240         the AddressOf method from the IMemoryLocation to extract the
22241         address instead of emitting the instance.
22242
22243         This showed up with `This', as we were emitting the instance
22244         always (Emit) instead of the Address of This.  Particularly
22245         interesting when This is a value type, as we dont want the Emit
22246         effect (which was to load the object).
22247
22248 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
22249
22250         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
22251
22252         * statement.cs (Checked): Set the CheckedState during the resolve
22253         process too, as the ConvCast operations track the checked state on
22254         the resolve process, and not emit.
22255
22256         * cs-parser.jay (namespace_member_declaration): Flag that we have
22257         found a declaration when we do.  This is used to flag error 1529
22258
22259         * driver.cs: Report ok when we display the help only.
22260
22261 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
22262
22263         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
22264
22265 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
22266
22267         * cs-tokenizer.cs (define): We also have to track locally the
22268         defines.  AllDefines is just used for the Conditional Attribute,
22269         but we also need the local defines for the current source code. 
22270
22271 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
22272
22273         * statement.cs (While, For, Do): These loops can exit through a
22274         Break statement, use this information to tell whether the
22275         statement is the last piece of code.
22276
22277         (Break): Flag that we break.
22278
22279         * codegen.cs (EmitContexts): New `Breaks' state variable.
22280
22281 2002-07-03  Martin Baulig  <martin@gnome.org>
22282
22283         * class.cs (TypeContainer.MethodModifiersValid): Allow override
22284         modifiers in method declarations in structs.  Otherwise, you won't
22285         be able to override things like Object.Equals().
22286
22287 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
22288
22289         * class.cs (Method, Property, Indexer): Do not allow the public
22290         modifier to be used in explicit interface implementations.
22291
22292         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
22293         override modifiers in method declarations in structs
22294
22295 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
22296
22297         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
22298         integer or real overflow, report an error
22299
22300 2002-07-02  Martin Baulig  <martin@gnome.org>
22301
22302         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
22303         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
22304         to tell the runtime about our newly created System.Object and
22305         System.ValueType types.
22306
22307 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
22308
22309         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
22310         struct instead of Ldarg/Starg.
22311
22312 2002-07-02  Martin Baulig  <martin@gnome.org>
22313
22314         * expression.cs (Indirection.Indirection): Call
22315         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22316
22317 2002-07-02  Martin Baulig  <martin@gnome.org>
22318
22319         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22320         ValueType, call TypeManager.TypeToCoreType() on it.
22321         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22322         the OpCodes.Newarr argument.
22323
22324 2002-07-02  Martin Baulig  <martin@gnome.org>
22325
22326         * expression.cs (Invocation.EmitCall): When compiling corlib,
22327         replace all calls to the system's System.Array type to calls to
22328         the newly created one.
22329
22330         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22331         System.Array methods.
22332         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22333         from the system's System.Array type which must be replaced.
22334
22335 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22336
22337         * typemanager.cs: load unverifiable_code_ctor so we can build
22338         corlib using the correct type. Avoid using GetTypeCode() with
22339         TypeBuilders.
22340         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22341         TypeManager.object_type to allow building corlib.
22342
22343 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22344
22345         * ecore.cs: handle System.Enum separately in LoadFromPtr().
22346
22347 2002-07-01  Martin Baulig  <martin@gnome.org>
22348
22349         * class.cs: Make the last change actually work, we need to check
22350         whether `ifaces != null' to avoid a crash.
22351
22352 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22353
22354         * class.cs: when we build structs without fields that implement
22355         interfaces, we need to add the interfaces separately, since there is
22356         no API to both set the size and add the interfaces at type creation
22357         time.
22358
22359 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22360
22361         * expression.cs: the dimension arguments to the array constructors
22362         need to be converted if they are a long.
22363
22364 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22365
22366         * class.cs: don't emit ldarg.0 if there is no parent constructor
22367         (fixes showstopper for corlib).
22368
22369 2002-06-29  Martin Baulig  <martin@gnome.org>
22370
22371         MCS now compiles corlib on GNU/Linux :-)
22372
22373         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22374         ie. check for MethodImplOptions.InternalCall.
22375
22376         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22377         and TypeManager.attribute_type are null, so we must explicitly check
22378         whether parent is not null to find out whether it's an attribute type.
22379         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22380         and SetBuilder, not only if the property is neither abstract nor external.
22381         This is necessary to set the MethodImplOptions on the accessor methods.
22382         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22383         SetBuilder, see Property.Emit().
22384
22385         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22386         populate "System.Object", "System.ValueType" and "System.Attribute" since
22387         they've already been populated from BootCorlib_PopulateCoreTypes().
22388
22389 2002-06-29  Martin Baulig  <martin@gnome.org>
22390
22391         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22392         is the NullLiteral, we also need to make sure that target_type is not
22393         an enum type.   
22394
22395 2002-06-29  Martin Baulig  <martin@gnome.org>
22396
22397         * rootcontext.cs (RootContext.ResolveCore): We must initialize
22398         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22399         before calling BootstrapCorlib_ResolveDelegate ().
22400
22401 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22402
22403         * statement.cs: fixed build-breaker. All tests passed ok.
22404
22405 2002-06-27  Martin Baulig  <martin@gnome.org>
22406
22407         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22408         for System.Decimal when compiling corlib.
22409
22410 2002-06-27  Martin Baulig  <martin@gnome.org>
22411
22412         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22413         switch blocks which contain nothing but a default clause.
22414
22415 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
22416
22417        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22418
22419 2002-06-27  Martin Baulig  <martin@gnome.org>
22420
22421         * ecore.cs (PropertyExpr.PropertyExpr): Call
22422         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22423
22424         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22425         is already a TypeBuilder.
22426
22427 2002-06-27  Martin Baulig  <martin@gnome.org>
22428
22429         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22430         `target_type == TypeManager.array_type', not IsAssignableFrom() in
22431         the "from an array-type to System.Array" case.  This makes it work
22432         when compiling corlib.
22433
22434 2002-06-27  Martin Baulig  <martin@gnome.org>
22435
22436         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22437         non-static PropertyExpr, set its InstanceExpression.  This makes
22438         the `ICollection.Count' property work in System/Array.cs.
22439
22440 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
22441
22442         * driver.cs: Made error handling more consistent.  Errors now
22443         tracked by Report class, so many methods which used to return int
22444         now return void.  Main() now prints success/failure and 
22445         errors/warnings message.
22446
22447         Renamed '--probe' compiler argument to '--expect-error'.  Removed
22448         the magic number return values (123 and 124).  Now, if the
22449         expected error occurs, the compiler exits with success (exit value
22450         0).  If the compilation completes without seeing that particular
22451         error, the compiler exits with failure (exit value 1).  The
22452         makefile in mcs/errors has been changed to handle the new behaviour.
22453
22454         * report.cs: Made 'expected error' number a property and renamed
22455         it from 'Probe' to 'ExpectedError'.
22456
22457         * genericparser.cs: Removed error handling support, since it is
22458         now all done by Report class.
22459
22460         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22461         class, so parse() no longer returns an int.
22462
22463         * namespace.cs: Use Report.Error instead of GenericParser.error
22464
22465 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
22466
22467         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22468         TypeContainer.AddOperator): At the front of the list put the
22469         explicit implementations, so they get resolved/defined first. 
22470
22471 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
22472
22473         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22474         interface type is implemented by this TypeContainer.  Used during
22475         explicit interface implementation.
22476
22477         (Property.Define, Indexer.Define, Method.Define): Validate that
22478         the given interface in the explicit implementation is one of the
22479         base classes for the containing type.
22480
22481         Also if we are explicitly implementing an interface, but there is
22482         no match in the pending implementation table, report an error.
22483
22484         (Property.Define): Only define the property if we are
22485         not explicitly implementing a property from an interface.  Use the
22486         correct name also for those properties (the same CSC uses,
22487         although that is really not needed).
22488
22489         (Property.Emit): Do not emit attributes for explicitly implemented
22490         properties, as there is no TypeBuilder.
22491
22492         (Indexer.Emit): ditto.
22493
22494         Hiding then means that we do not really *implement* a pending
22495         implementation, which makes code fail.
22496
22497 2002-06-22  Martin Baulig  <martin@gnome.org>
22498
22499         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22500         the return value of Object.GetType().  [FIXME: we need to do this whenever
22501         we get a type back from the reflection library].
22502
22503 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22504
22505         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22506
22507 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
22508
22509         * attribute.cs: Return null if we can not look up the type.
22510
22511         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22512         the interface types found.
22513
22514         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22515         interface types found.
22516
22517         * typemanager.cs (GetInterfaces): Make this routine returns alll
22518         the interfaces and work around the lame differences between
22519         System.Type and System.Reflection.Emit.TypeBuilder in the results
22520         result for GetInterfaces.
22521
22522         (ExpandInterfaces): Given an array of interface types, expand and
22523         eliminate repeated ocurrences of an interface.  This expands in
22524         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22525         be IA, IB, IC.
22526
22527 2002-06-21  Martin Baulig  <martin@gnome.org>
22528
22529         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22530         on System.Enum.
22531
22532 2002-06-21  Martin Baulig  <martin@gnome.org>
22533
22534         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
22535         and called with one of the core types, return the corresponding typebuilder for
22536         that type.
22537
22538         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22539         element type.
22540
22541 2002-06-21  Martin Baulig  <martin@gnome.org>
22542
22543         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22544         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22545         (Expression.ConvertReferenceExplicit): Likewise.
22546
22547         * expression.cs (ElementAccess.DoResolve): Likewise.
22548         (ElementAccess.DoResolveLValue): Likewise.
22549
22550 2002-06-10  Martin Baulig  <martin@gnome.org>
22551
22552         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22553         add the "value" parameter to the parameter list.
22554
22555         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22556         to our caller.
22557
22558 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
22559
22560         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22561         the argument to an int, uint, long or ulong, per the spec.  Also
22562         catch negative constants in array creation.
22563
22564 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22565
22566         * class.cs: do not allow the same interface to appear twice in
22567         the definition list.
22568
22569 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22570
22571         * ecore.cs: don't use ldlen with System.Array.
22572
22573 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22574
22575         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22576
22577 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22578
22579         * modifiers.cs: produce correct field attributes for protected
22580         internal. Easy fix so miguel can work on ther harder stuff:-)
22581
22582 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
22583
22584         * pending.cs: New file.  Move the code from class.cs here.
22585         Support clearning the pending flag for all methods (when not doing
22586         explicit interface implementation).
22587
22588 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22589
22590         * rootcontext.cs: added a couple more types needed to bootstrap.
22591
22592 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
22593
22594         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22595         constructor in the type, instead of any constructor in the type
22596         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
22597         a bug in the Mono runtime when applying the params attribute). 
22598
22599 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
22600         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22601
22602 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
22603
22604         * expression.cs (Unary.ResolveOperator): Use TypeManager
22605         to resolve the type.
22606
22607 2002-06-13  Ravi Pratap  <ravi@ximian.com>
22608
22609         * cs-parser.jay (enum_member_declaration): Pass in the attributes
22610         attached.
22611
22612         * enum.cs (AddEnumMember): Add support to store the attributes associated 
22613         with each member too.
22614
22615         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22616         field builders too - this takes care of the enum member case.
22617
22618 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
22619
22620         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22621         address-of operator on both value types and pointers.
22622
22623 2002-06-10  Martin Baulig  <martin@gnome.org>
22624
22625         * interface.cs (Interface.PopulateIndexer): Add the indexer's
22626         PropertyBuilder to the `property_builders' list.
22627
22628         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22629         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22630         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
22631         find any indexers which are inherited from an interface.
22632
22633 2002-06-09  Martin Baulig  <martin@gnome.org>
22634
22635         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22636         the same type as the constant if necessary.  There's also a test-130.cs
22637         for this.
22638
22639         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22640
22641         * typemanager.cs (TypeManager.ChangeType): Previously known as
22642         Enum.ChangeEnumType().
22643
22644 2002-06-09  Martin Baulig  <martin@gnome.org>
22645
22646         * expression.cs (Cast.TryReduce): Added support for consts.
22647
22648 2002-06-08  Ravi Pratap  <ravi@ximian.com>
22649
22650         * class.cs (Accessor): Hold attributes information so we can pass
22651         it along.
22652
22653         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22654         Modify to pass in attributes attached to the methods.
22655
22656         (add_accessor_declaration, remove_accessor_declaration): Ditto.
22657
22658         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22659         to handle the Accessor kind :-)
22660
22661         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22662
22663 2002-06-08  Martin Baulig  <martin@gnome.org>
22664
22665         * expression.cs (Unary.TryReduceNegative): Added support for
22666         ULongConstants.
22667
22668 2002-06-08  Martin Baulig  <martin@gnome.org>
22669
22670         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22671         name can't be found in the `defined_names' - the caller will do a
22672         MemberLookup in this case and thus find methods in System.Enum
22673         such as Enum.IsDefined().
22674
22675 2002-06-08  Martin Baulig  <martin@gnome.org>
22676
22677         * enum.cs (Enum.ChangeEnumType): This is a custom version of
22678         Convert.ChangeType() which works with TypeBuilder created types.
22679         (Enum.LookupEnumValue, Enum.Define): Use it here.
22680
22681         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22682         `TypeBuilder.BaseType != null' check.
22683         (TypeContainer.FindMembers): Only lookup parent members if we
22684         actually have a parent.
22685         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22686         (ConstructorInitializer.Resolve): Likewise.
22687
22688         * interface.cs (Interface.FindMembers): Added
22689         `TypeBuilder.BaseType != null' check.
22690
22691         * rootcontext.cs (RootContext.ResolveCore): Added
22692         "System.Runtime.CompilerServices.IndexerNameAttribute" to
22693         classes_second_stage.
22694
22695         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22696         debug_type and trace_type when compiling with --nostdlib.       
22697
22698 2002-06-07  Martin Baulig  <martin@gnome.org>
22699
22700         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22701         (AddField): Set it to true when adding a non-static field.
22702         (DefineType): Use `have_nonstatic_fields' to find out whether we
22703         have non-static fields, not `Fields != null'.
22704
22705 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
22706
22707         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22708         dereferencing a null on the static-field code path)
22709
22710 2002-05-30  Martin Baulig  <martin@gnome.org>
22711
22712         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22713         to take command line arguments.  Use reflection to call the new
22714         custom `Initialize' function on the symbol writer and pass it the
22715         command line arguments.
22716
22717         * driver.cs (--debug-args): New command line argument to pass command
22718         line arguments to the symbol writer.
22719
22720 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
22721
22722         * assign.cs (DoResolve): Forgot to do the implicit conversion to
22723         the target type for indexers and properties.  Thanks to Joe for
22724         catching this.
22725
22726 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
22727
22728         * typemanager.cs (MethodFlags): returns the method flags
22729         (Obsolete/ShouldIgnore) that control warning emission and whether
22730         the invocation should be made, or ignored. 
22731
22732         * expression.cs (Invocation.Emit): Remove previous hack, we should
22733         not do this on matching a base type, we should do this based on an attribute
22734
22735         Only emit calls to System.Diagnostics.Debug and
22736         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22737         on the command line.
22738
22739         * rootcontext.cs: Global settings for tracing and debugging.
22740
22741         * cs-tokenizer.cs (define): New utility function to track
22742         defines.   Set the global settings for TRACE and DEBUG if found.
22743
22744 2002-05-25  Ravi Pratap  <ravi@ximian.com>
22745
22746         * interface.cs (Populate*): Pass in the TypeContainer as well as
22747         the DeclSpace as parameters so that we can create EmitContexts and
22748         then use that to apply attributes etc.
22749
22750         (PopulateMethod, PopulateEvent, PopulateProperty)
22751         (PopulateIndexer): Apply attributes everywhere.
22752
22753         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22754         etc.
22755
22756         (ApplyAttributes): Update accordingly.
22757
22758         We now apply interface attributes for all members too.
22759
22760 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
22761
22762         * class.cs (Indexer.Define); Correctly check if we are explicit
22763         implementation (instead of checking the Name for a ".", we
22764         directly look up if the InterfaceType was specified).
22765
22766         Delay the creation of the PropertyBuilder.
22767
22768         Only create the PropertyBuilder if we are not an explicit
22769         interface implementation.   This means that explicit interface
22770         implementation members do not participate in regular function
22771         lookups, and hence fixes another major ambiguity problem in
22772         overload resolution (that was the visible effect).
22773
22774         (DefineMethod): Return whether we are doing an interface
22775         implementation. 
22776
22777         * typemanager.cs: Temporary hack until we get attributes in
22778         interfaces (Ravi is working on that) and we get IndexerName
22779         support in interfaces.
22780
22781         * interface.cs: Register the indexers as properties.
22782
22783         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22784         warning, I have verified that this is a bug in the .NET runtime
22785         (JavaScript suffers of the same problem).
22786
22787         * typemanager.cs (MemberLookup): When looking up members for
22788         interfaces, the parent of an interface is the implicit
22789         System.Object (so we succeed in searches of Object methods in an
22790         interface method invocation.  Example:  IEnumerable x;  x.ToString
22791         ()) 
22792
22793 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
22794
22795         * class.cs (Event): Events should also register if they do
22796         implement the methods that an interface requires.
22797
22798         * typemanager.cs (MemberLookup); use the new GetInterfaces
22799         method. 
22800
22801         (GetInterfaces): The code used to lookup interfaces for a type is
22802         used in more than one place, factor it here. 
22803
22804         * driver.cs: Track the errors at the bottom of the file, we kept
22805         on going.
22806
22807         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22808         instance if the method we are calling is static!
22809
22810 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
22811
22812         * attribute.cs (ApplyAttributes): Make this function filter out
22813         the IndexerName attribute (as that attribute in reality is never
22814         applied) and return the string constant for the IndexerName
22815         attribute. 
22816
22817         * class.cs (TypeContainer.Emit): Validate that all the indexers
22818         have the same IndexerName attribute, and if so, set the
22819         DefaultName attribute on the class. 
22820
22821         * typemanager.cs: The return value might contain other stuff (not
22822         only methods).  For instance, consider a method with an "Item"
22823         property and an Item method.
22824
22825         * class.cs: If there is a problem with the parameter types,
22826         return. 
22827
22828 2002-05-24  Ravi Pratap  <ravi@ximian.com>
22829
22830         * ecore.cs (ImplicitConversionExists): Wrapper function which also
22831         looks at user defined conversion after making a call to 
22832         StandardConversionExists - we need this for overload resolution.
22833
22834         * expression.cs : Update accordingly the various method calls.
22835
22836         This fixes 2 bugs filed against implicit user defined conversions 
22837
22838 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
22839
22840         * statement.cs: Track the result of the assignment.
22841
22842 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
22843
22844         * expression.cs (MemberAccess): Improved error reporting for
22845         inaccessible members.
22846
22847 2002-05-22  Martin Baulig  <martin@gnome.org>
22848
22849         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
22850         itself with debugging support.
22851
22852 2002-05-22  Martin Baulig  <martin@gnome.org>
22853
22854         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22855         Removed, this isn't needed anymore.
22856
22857 2002-05-20  Martin Baulig  <martin@gnome.org>
22858
22859         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22860         be underlying type for an enum.
22861
22862 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
22863
22864         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22865         that splits out the loading of just the core types.
22866
22867         * rootcontext.cs (ResolveCore): Split the struct resolution in
22868         two, so we can load the enumeration underlying types before any
22869         enums are used.
22870
22871         * expression.cs (Is): Bandaid until we fix properly Switch (see
22872         bug #24985 for details).
22873
22874         * typemanager.cs (ImplementsInterface): The hashtable will contain
22875         a null if there are no interfaces implemented.
22876
22877 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
22878
22879         * cs-parser.jay (indexer_declarator): It is fine to have array
22880         parameters
22881
22882 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22883
22884         * typemanager.cs: (RegisterBuilder): New function used to register
22885         TypeBuilders that implement interfaces.  Since
22886         TypeBuilder.GetInterfaces (as usual) does not work with lame
22887         Reflection.Emit. 
22888         (AddUserType): register interfaces.
22889
22890         (ImplementsInterface): Use the builder_to_ifaces hash if we are
22891         dealing with TypeBuilder.  Also, arrays are showing up as
22892         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22893         methods can not be invoked on them!
22894
22895         * ecore.cs (ExplicitReferenceConversionExists): Made public.
22896         (ImplicitReferenceConversionExists): Split out from
22897         StandardConversionExists. 
22898
22899         * expression.cs (As): We were only implementing one of the three
22900         cases for the as operator.  We now implement them all.
22901         (Is): Implement the various other cases for Is as well.
22902
22903         * typemanager.cs (CACHE): New define used to control if we want or
22904         not the FindMembers cache.  Seems to have a negative impact on
22905         performance currently
22906
22907         (MemberLookup): Nested types have full acess to
22908         enclosing type members
22909
22910         Remove code that coped with instance/static returns for events, we
22911         now catch this in RealFindMembers.
22912
22913         (RealFindMembers): only perform static lookup if the instance
22914         lookup did not return a type or an event.  
22915
22916 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22917
22918         * assign.cs (CompoundAssign): We pass more semantic information
22919         now to Compound Assignments than we did before: now we have all
22920         the information at hand, and now we resolve the target *before* we
22921         do the expression expansion, which allows the "CacheValue" method
22922         to have the effect we intended (before, a [x] += 1 would generate
22923         two differen ArrayAccess expressions from the ElementAccess,
22924         during the resolution process).
22925
22926         (CompoundAssign.DoResolve): Resolve target and original_source here.
22927
22928 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
22929
22930         * expression.cs (ArrayAccess): dropped debugging information. 
22931
22932         * typemanager.cs: Small bug fix: I was always returning i_members,
22933         instead of one of i_members or s_members (depending on which had
22934         the content).
22935
22936         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
22937         method is invoked before any code generation takes place, and it
22938         is a mechanism to inform that the expression will be invoked more
22939         than once, and that the method should use temporary values to
22940         avoid having side effects
22941
22942         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22943
22944         * ecore.cs (Expression.CacheTemporaries): Provide empty default
22945         implementation.
22946
22947         * expression.cs (Indirection, ArrayAccess): Add support for
22948         CacheTemporaries in these two bad boys. 
22949
22950         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22951         ldobj or ldind_ref.  
22952         (StoreFromPtr): Handle stobj as well.
22953
22954         * expression.cs (UnaryMutator): Share more code.
22955
22956         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22957         down: I was not tracking the Filter function as well, which
22958         was affecting the results of the cache.
22959
22960 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
22961
22962         * attribute.cs: Remove the hack to handle the CharSet property on
22963         StructLayouts. 
22964
22965 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
22966
22967         * attribute.cs (DoResolve): More uglyness, we now only try to
22968         resolve the attribute partially, to extract the CharSet
22969         information (only if we are a StructLayout attribute).  Otherwise 
22970
22971         (GetExtraTypeInfo): Add some code to conditionally kill in the
22972         future this.   I am more and more convinced that the .NET
22973         framework has special code to handle the attribute setting on
22974         certain elements.
22975
22976         * expression.cs (IsParamsMethodApplicable): Revert my previous
22977         foreach change here, it was wrong.
22978
22979 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
22980
22981         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22982         (pp_expr): do not abort on unknown input, just return.
22983         (eval): abort if there are pending chars.
22984
22985         * attribute.cs (Attribute.Resolve): Positional parameters are
22986         optional.  Deal with that case.
22987
22988         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
22989         the Ansi/Unicode/Auto information for the type.
22990
22991         (TypeContainer.DefineType): instantiate the EmitContext here, as
22992         we will be using it during the type definition (to resolve
22993         attributes) and during the emit phase.
22994
22995         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
22996         to pull type information out of the attributes
22997
22998         (Attribute.Resolve): track the constructor builder, and allow for
22999         multiple invocations (structs and classes will use this).
23000
23001         * ecore.cs (MemberLookupFinal): new version with all the
23002         parameters customizable.
23003
23004         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
23005         constructors.  Return if the result value is null (as the error
23006         would have been flagged already by MemberLookupFinal)
23007
23008         Do not allow instances of abstract classes or interfaces to be
23009         created.
23010
23011         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
23012         We have to compare the assembly property here when dealing with
23013         FamANDAssem and Assembly access modifiers, because we might be
23014         creating an assembly from *modules* (that means that we are not
23015         getting TypeBuilders for types defined in other modules that are
23016         part of this assembly).
23017
23018         (Method.Emit): If the method is marked abstract and has a body,
23019         emit an error. 
23020
23021         (TypeContainer.DefineMembers): If both the defined member and the
23022         parent name match are methods, then do not emit any warnings: let
23023         the Method.Define routine take care of flagging warnings.  But if
23024         there is a mismatch (method overrides something else, or method is
23025         overriwritten by something, then emit warning).
23026
23027         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
23028         set to null, this means `do not check for the return type on the
23029         signature'. 
23030
23031         (Method.Define): set the return type for the method signature to
23032         null, so that we get methods with the same name and parameters and
23033         different return types.  This is used to flag warning 114 (you are
23034         hiding a method, and you probably want to use the new/override
23035         keywords instead).
23036
23037         * typemanager.cs (MemberLookup): Implemented proper access
23038         control, closing a long standing set of bug reports.  The problem
23039         was that the Framework only has two bits: Public and NonPublic,
23040         and NonPublic includes private and protected methods, but we need
23041         to enforce the FamANDAssem, FamOrAssem and Family. 
23042
23043 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
23044
23045         * statement.cs (GotoCase): Return true: Ammounts to giving up
23046         knowledge on whether we return or not, and letting the other case
23047         be responsible for it.
23048
23049 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
23050
23051         * driver.cs: Do not load directories for each file processed, only
23052         do it if there is a pattern.
23053
23054         * ecore.cs: Report readonly assigns here as well, as we might have
23055         been resolved only by MemberAccess.
23056
23057         (SimpleName.SimpleNameResolve): Also be useful for LValue
23058         resolution.   We need this to propagate assign to local readonly variables
23059
23060         * typemanager.cs: Use a ptrhashtable for the criteria, because we
23061         do not want to reuse potential criteria memory.
23062
23063         * class.cs (MyEventBuilder): Set reflected_type;
23064
23065         * ecore.cs (Constantify): Added support for constifying bools.
23066
23067         (RootContext.LookupType): Added a cache for values looked up in
23068         the declaration space.
23069
23070         * typemanager.cs (FindMembers): Now is a front-end to
23071         RealFindMembers, and provides a two-level hashtable-based cache to
23072         the request.  
23073
23074         15% performance improvement: from 22.5 to 19.2 seconds.
23075
23076         * expression.cs (IsParamsMethodApplicable): use foreach.
23077         (Invocation.DoResolve): ditto.
23078         (New.DoResolve): ditto.
23079         (ArrayCreation.DoResolve): ditto.
23080
23081         * ecore.cs (FindMostEncompassingType): use foreach.
23082
23083         * delegate.cs (NewDelegate.DoResolve): Use foreach
23084
23085         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
23086         (RemoveMethods): use foreach.
23087
23088         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
23089         nested foreach statements instead of for, and also break out of
23090         the inner loop once a match is found.
23091
23092         (Invocation.OverloadResolve): Use foreach, simplify the code. 
23093
23094 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
23095
23096         * cfold.cs (BinaryFold): During an enumeration evaluation context,
23097         we actually unwrap the expression to allow for extra information
23098         to be extracted. 
23099
23100         * expression.cs: Use Shr_Un on unsigned operations. 
23101
23102 2002-05-08  Ravi Pratap  <ravi@ximian.com>
23103
23104         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
23105         applicable operators was not being considered correctly. This closes
23106         the bug Miguel reported.
23107
23108 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
23109
23110         * attribute.cs: check that the type derives from System.Attribute
23111         and report the correct error in that case (moved the duplicate code to
23112         its own method, too).
23113
23114 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
23115
23116         * attribute.cs: lookup attribute type name as the spec says: first the
23117         bare attribute name and then name + "Attribute" (nant compiles with
23118         mcs after this fix).
23119
23120 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
23121
23122         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
23123         Because of the way we parse things, we should try to see if a
23124         UIntConstant can fit in an integer.
23125
23126 2002-05-07  Ravi Pratap  <ravi@ximian.com>
23127
23128         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
23129         when we are in an explicit context.
23130
23131         (ConvertReferenceExplicit): When converting from Iface type S to Class
23132         T make sure the rules are implemented as an OR.
23133
23134         * parameter.cs (ParameterType): Make it a property for now although the
23135         purpose really isn't anything immediate.
23136
23137         * expression.cs (Is*Applicable): Do better checking on the parameter type
23138         of a ref/out parameter. The ones from the system assemblies are already 
23139         marked with the correct type so we don't need to do any correction.
23140
23141         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
23142         the object type is standard too so include that.
23143
23144 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
23145
23146         * ecore.cs (StandardConversionExists): Augment with missing code:
23147         deal with IntConstant, LongConstants and Enumerations.
23148
23149         * assign.cs: Report the error, instead of failing silently
23150
23151         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
23152         typecontainer that they are declared, because the
23153         typecontainer/namespace will have the list of using clauses that
23154         need to be applied.
23155
23156         Assembly Attributes were escaping the normal registration
23157         mechanism. 
23158
23159         (EmitCode): Apply attributes within an EmitContext that represents
23160         the container they were declared on.
23161
23162         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
23163
23164 2002-05-06  Ravi Pratap  <ravi@ximian.com>
23165
23166         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
23167         Revamp completely - make much cleaner as we now operate only
23168         on a set of Types.
23169
23170         (FindMostSpecificSource, FindMostSpecificTarget): New methods
23171         to implement the logic detailed in the spec more correctly.
23172
23173         (UserDefinedConversion): Update accordingly.
23174
23175 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
23176
23177         * statement.cs: Return flow analysis information up.
23178
23179         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
23180         and the default.
23181
23182         (token): Do not consume an extra character before calling
23183         decimal_digits.
23184
23185 2002-05-06  Piers Haken <piersh@friskit.com>
23186
23187         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
23188
23189 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
23190
23191         * class.cs (Constructor.Emit): Set the IsStatic flag in the
23192         EmitContext during the instance constructor initializer
23193         resolution, to stop access to instance variables.
23194
23195         This is mandated by the spec, last paragraph of the `constructor
23196         initializers' section. 
23197
23198 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
23199
23200         * cs-parser.jay, class.cs (Accessor): new class used to represent
23201         an accessor (get or set).  In the past we used `null' to represent
23202         a missing accessor.  But this is ambiguous because there was no
23203         way to tell in abstract indexers/properties if one of them was
23204         specified.
23205
23206         Now there is a way of addressing that.
23207
23208         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
23209         instead of FindMembers.
23210
23211         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
23212         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
23213
23214         * attribute.cs: Treat indexers and properties as the same in terms
23215         of applying attributes
23216
23217         * ecore.cs (FindMostEncompassedType): Use statically initialized
23218         EmptyExpressions()s like we do elsewhere to avoid creating useless
23219         objects (and we take this out of the tight loop).
23220
23221         (GetConversionOperators): Move the code to extract the actual
23222         operators to a separate routine to clean things up.
23223
23224 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
23225
23226         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
23227         events are always registered FieldBuilders.
23228
23229         * class.cs (FieldBase): New class shared by Fields 
23230
23231         * delegate.cs: If we are a toplevel delegate, use our full name.
23232         If we are a nested delegate, then only use our tail name.
23233
23234 2002-05-02  Ravi Pratap  <ravi@ximian.com>
23235
23236         * expression.cs (IsApplicable): Ensure that we add the "&" to
23237         ref/out types before comparing it with the type of the argument.
23238
23239         (IsParamsMethodApplicable): Ditto.
23240
23241         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
23242         silly me ;-)
23243
23244         * delegate.cs : Handle the case when we have more than one applicable
23245         method. Flag an error only when we finish checking all.
23246
23247 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
23248
23249         * expression.cs: Add support for boolean static initializers.
23250
23251 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
23252
23253         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
23254
23255         * parameter.cs (ComputeParameterTypes,
23256         ComputeAndDefineParameterTypes): Better error handling: now we
23257         clear the `types' cache if we fail during any of the type lookups.
23258         We also return the status code correctly to our caller
23259
23260         * delegate.cs: If we fail to define a delegate, abort the extra
23261         steps. 
23262
23263         * expression.cs (Binary.ResolveOperator): for
23264         operator==(object,object) and operator !=(object, object) we also
23265         have to verify that there is an implicit conversion from one to
23266         the other.
23267
23268         (ArrayAccess.DoResolve): Array Access can operate on
23269         non-variables. 
23270
23271 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
23272
23273         * assign.cs (CompoundAssign): A new class used as a "flag" that
23274         the assignment actually is happening as part of a compound
23275         assignment operator.
23276
23277         During compound assignment, a few new rules exist to enable things
23278         like:
23279
23280         byte b |= 1 + 2
23281
23282         From the spec:
23283
23284         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
23285         to the type of x) if y is implicitly convertible to the type of x,
23286         and the operator is a builtin operator and the return type of the
23287         operator is explicitly convertible to the type of x. 
23288
23289         * rootcontext.cs: Reset warning level to 2.  4 catches various
23290         "interesting" features in mcs, we must clean this up at some
23291         point, but currently am trying to kill other bugs ;-)
23292
23293         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
23294         in container classes as well.  
23295
23296         * expression.cs (Binary.ResolveOperator): Handle string case
23297         before anything else (as operator overloading does emit an error
23298         before doing anything else).
23299
23300         This code could go away when we move to a table driven model, but
23301         i could not come up with a good plan last night.
23302
23303 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
23304
23305         * typemanager.cs (CSharpName): reimplementation using regex.
23306         * class.cs: added null check for fields in Emit
23307         * rootcontext.cs: set warninglevel to 4
23308
23309 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
23310
23311         * typemanager.cs (CSharpName): reimplemented with Lupus
23312         suggestion.
23313
23314 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
23315
23316         * statement.cs (If): correclty implement Resolve, because we were
23317         not catching sem errors in there.  The same process is needed
23318         everywhere else. 
23319         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23320
23321
23322         (Statement.Warning_DeadCodeFound): Factorize code.
23323         (While): Report dead code here too.
23324
23325         (Statement): Added Resolve virtual method to allow
23326         for resolution split from the emit code.
23327
23328 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23329
23330         * statement.cs (EmitBoolExpression): No longer try to resolve the
23331         expression here.    
23332         (MakeBoolean): New utility function that resolve, implicitly
23333         converts to boolean and tags the expression. 
23334
23335
23336         (If, Do): Implement dead code elimination.
23337         (While): Implement loop inversion
23338
23339         (Do, While, For, If): Resolve the expression prior to calling our
23340         code generation.
23341
23342 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
23343
23344         * class.cs:
23345           - added method Report28 (warning: program has more than one entry point)
23346           - added method IsEntryPoint, implements paragraph 10.1 of the spec
23347           - modified method Method.Define, the part at the end of the method
23348
23349         * rootcontext.cs: added static public Location EntryPointLocation;
23350           
23351         * ../errors/cs0028.cs : Add test case for the above warning.              
23352
23353         * typemanager.cs:
23354           - modified method CSharpName to allow arrays of primitive type to
23355             be printed nicely (e.g. instead of System.Int32[][] it now prints
23356             int[][])
23357           - added method CSharpSignature: returns the signature of a method
23358             in string format to be used in reporting errors, warnings, etc.
23359
23360         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23361         with String.Empty.
23362
23363 2002-04-26  Ravi Pratap  <ravi@ximian.com>
23364
23365         * delegate.cs (Define): Fix extremely silly bug where I was
23366         setting the type of the 'object' parameter of the BeginInvoke
23367         method to System.IAsyncResult instead of System.Object ;-)
23368
23369 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23370
23371         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23372         here. 
23373
23374         (Constructor.Emit): return if we fail to initialize the
23375         constructor.  Another door closed!  
23376
23377         * expression.cs (New.DoResolve): Improve error message (from -6 to
23378         1501).  Use DeclaredOnly lookup to find the exact constructor.
23379
23380         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23381         loop.  This is useful.
23382
23383         * cs-parser.jay: Adjust the default parameters so that destructors
23384         have the proper signature.
23385
23386 2002-04-26  Martin Baulig  <martin@gnome.org>
23387
23388         * driver.cs (LoadAssembly): If `assembly' contains any characters
23389         which are only valid in path names and not in assembly names
23390         (currently slash, backslash and point), use Assembly.LoadFrom ()
23391         instead of Assembly.Load () on the `assembly' (before iteration
23392         over the link_paths).
23393
23394 2002-04-26  Martin Baulig  <martin@gnome.org>
23395
23396         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23397
23398 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
23399
23400         * class.cs (Property): use the new typemanager.MemberLookup
23401
23402         (TypeContainer.MemberLookup): Implement using the
23403         TypeManager.MemberLookup now. 
23404
23405         * typemanager.cs: Make MemberLookup a function of the TypeManager,
23406         and return MemberInfos, so that these can be used without an
23407         EmitContext (what we had before).
23408
23409 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
23410
23411         * expression.cs: Fix the case where the argument to params if the
23412         type of the params.  I omitted handling this before.   Fixed
23413
23414 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23415
23416         * driver.cs: Call BootCorlib_PopulateCoreType
23417
23418         * class.cs (Property.CheckBase): Check for properties only, not
23419         for all members. 
23420
23421         * interface.cs: Temporary hack: try/catch around the
23422         CustomAttributeBuilder, because I am getting an exception that I
23423         do not understand.
23424
23425         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23426         types whose definitions are required to be there (attributes are
23427         defined before standard types).
23428
23429         Compute definitions as we boot the various types, as they are used
23430         immediately (value_type class will need object_type, but if we do
23431         not initialize object_type, we will pass a null, which will let
23432         the runtime pick the System.Object from the existing corlib, which
23433         is not what we want).
23434
23435 2002-04-22  Patrik Torstensson <totte@labs2.com>
23436
23437         * cs-tokenizer.cs: fixed a number of trim() issues.
23438
23439 2002-04-22  Ravi Pratap  <ravi@ximian.com>
23440
23441         * expression.cs (Argument.Type): Ensure that we return the correct
23442         type when we have out or ref parameters [in which case we 
23443         append a "&"].
23444
23445 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23446
23447         * class.cs (Property, Indexer): Allow extern modifier in there. 
23448
23449         * typemanager.cs (InitBaseTypes): Initializes object_type and
23450         value_type, since those will be used early on during the bootstrap
23451         process to compile corlib.
23452
23453         (InitCoreTypes): Move code from here to InitBaseTypes.
23454
23455 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
23456
23457         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23458         single-dimension arrays as using the ldlen opcode.  
23459
23460         Daniel Lewis discovered this optimization.  
23461
23462         * typemanager.cs: Add signature for System.Array::get_Length
23463
23464 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23465
23466         * statement.cs: report the error when the foreach does not apply to an
23467         array nor a collection.
23468
23469 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
23470
23471         * expression.cs: Add implicit conversions to the operator ~.
23472
23473         * constant.cs (DecimalConstant.Emit): Emit decimal value.
23474
23475         * typemanager.cs: Locate the decimal constructor.
23476
23477 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23478
23479         * attribute.cs: use the new property of TypeOf.
23480         * expression.cs: added 'get' property around typearg.
23481
23482         These changes fix a build breaker reported by NickD. Is this the
23483         correct way to fix?  If not, please, revert my changes and make it
23484         work :-).
23485
23486 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
23487
23488         * attribute.cs: Add support for typeof in attribute invocations.
23489         I am not sure that this is right though.
23490
23491 2002-04-14  Duncan Mak  <duncan@ximian.com>
23492
23493         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23494         Binary.Operator.Division case.
23495
23496 2002-04-13  Ravi Pratap  <ravi@ximian.com>
23497
23498         * class.cs (DefineType): Ensure that we do a proper check on
23499         attribute types and also register it with the TypeManager.
23500
23501         (TypeContainer.Targets): The default for attribute types is
23502         AttributeTargets.All.
23503
23504         * attribute.cs (ApplyAttributes): Registering the attribute type
23505         is done elsewhere, not when we discover we have a Usage attribute.
23506
23507 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23508
23509         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23510         and get rid of is_delegate parameter.
23511
23512         * everywhere : update.
23513
23514 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23515
23516         * cs-parser.jay (compilation_unit): Revamp completely to use
23517         some new ideas that I got from Rhys' grammar to solve the problems
23518         with assembly level attributes.
23519
23520         (outer_declaration): New grammar production.
23521
23522         (attribute_sections): Add.
23523
23524         (opt_attributes): Base on attribute_sections
23525
23526         (namespace_declaration): Allow opt_attributes to tackle the case
23527         when we have assembly level attributes - we are clever in this
23528         regard now ;-)
23529
23530         * attribute.cs (ApplyAttributes): Do not worry about assembly 
23531         attributes in the non-global context.
23532
23533         * rootcontext.cs (AddGlobalAttributes): Go back to using this
23534         instead of SetGlobalAttributes.
23535
23536         * class.cs, rootcontext.cs : Ensure we define and generate 
23537         attribute types before anything else.
23538
23539         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23540         and flag the new error -20 for the case when the attribute type
23541         does not have valid targets specified. csc does not catch this.
23542
23543         * ../errors/errors.txt : update for error # -20
23544
23545 2002-04-11  Ravi Pratap  <ravi@ximian.com>
23546
23547         * support.cs (InternalParameters.ParameterModifier): Do some null
23548         checking and return sane values.
23549
23550         * class.cs (Method.Define): If we are a PInvoke method, ensure
23551         that we are static and extern. Report error # 601
23552
23553         * ../errors/cs0601.cs : Add test case for the above error.
23554
23555 2002-04-07  Ravi Pratap  <ravi@ximian.com>
23556
23557         * rootcontext.cs (attribute_types): We need to keep type of
23558         all attribute types separately and emit code for them first.
23559
23560         (RegisterAttribute) : Implement.
23561
23562         * class.cs (DefineType): Check if the current Type is a custom
23563         attribute type and register it accordingly.
23564
23565         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23566         adding the first attribute twice and rename to
23567
23568         (SetGlobalAttributes): this.
23569
23570         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23571         lookups.
23572
23573         * attribute.cs (ApplyAttributes): Take an additional argument telling us
23574         if we are processing global arguments. Hmm, I am unsure of this.
23575
23576 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23577
23578         * expression.cs: added static array of strings to avoid calling
23579         Enum.ToString () for Operator in Binary. Significant recover of
23580         performance.
23581
23582 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
23583
23584         * class.cs (FindMembers): Allow the Builders of the various
23585         members to be null.  If they are skip them.  This only happens
23586         during the PInvoke declaration.
23587
23588 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
23589
23590         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23591         failure, so we do not keep going afterwards.
23592
23593         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23594         wanted to pass `false' as the `is_delegate' argument.  If this is
23595         the case, why not use delegate_type == null to mean `is_delegate =
23596         false' and anything else as is_delegate = true.
23597
23598 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
23599
23600         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23601         code for the section, not the beginning of the tests.
23602
23603 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
23604
23605         * cfold.cs: Handle operator + (Enum x, Underlying x) 
23606
23607         * expression.cs (Binary): same.  Warn about errors where we have
23608         Enum/Enum in operator + as well.
23609
23610 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
23611
23612         * statement.cs:
23613                 - added support for switch(bool)
23614                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23615                 - add TableSwitchEmit() to handle table-based switch statements
23616
23617 2002-04-05  Ravi Pratap  <ravi@ximian.com>
23618
23619         * expression.cs (Invocation.OverloadResolve): Factor out code which
23620         does parameter compatibility checking with arguments so that we can 
23621         re-use the code even from Delegate.VerifyApplicability
23622
23623         (VerifyArgumentsCompat): Move above code here.
23624
23625         * delegate.cs (VerifyApplicability): Get rid of duplicate code
23626         and instead make a call to the above method.
23627
23628 2002-03-31  Ravi Pratap  <ravi@ximian.com>
23629
23630         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23631         We use it to keep track of classes which are attribute types.
23632
23633 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
23634
23635         * delegate.cs (Delegate.Define): Correctly define the types in the
23636         presence of fixed and array parameters.
23637
23638         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23639         doing FindMembers.
23640
23641         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23642         include NonPublic after the first iteration.
23643
23644         * class.cs (Indexer.CheckBase): Only check if both parents are
23645         non-null. 
23646
23647         * cs-parser.jay (accessor_body): If empty, set to null.
23648
23649         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23650         same code path here to resolve constants names that we did have in
23651         MemberAccess.DoResolve.  There is too much code duplicated here.
23652
23653 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
23654
23655         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23656
23657         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23658         to MakeUnionSet.
23659
23660         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23661         tokens, numbers and strings.
23662
23663         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23664         parenthesis.
23665
23666         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23667         asyncronous parameters and the regular parameters.  
23668
23669         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23670         specify the target directory.
23671
23672         * expression.cs: (This.DoResolve): Simplify
23673         (As.Emit): Optimize, do not generate IsInst if the expression is
23674         always of the given type.
23675
23676         (Is.DoResolve): Bug fix, we were reporting both always/never for
23677         the is expression.
23678
23679         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23680         creating too many unnecessary arrays.
23681
23682 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
23683
23684         * class.cs (EmitFieldInitializer): Use Assign expression to assign
23685         fields instead of rolling our own initializer.   Takes care of all
23686         implicit conversions, and drops unnecessary static checks/argument.
23687
23688 2002-03-31  Dick Porter  <dick@ximian.com>
23689
23690         * driver.cs: use the GetDirectories() return values properly, and
23691         use "/" as path separator.
23692
23693 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
23694
23695         * expression.cs (Unary): Optimize - - expr into expr.
23696         (Binary): Optimize a + (-b) into a -b.
23697
23698         * codegen.cs (CodeGen): Made all methods static.
23699
23700 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
23701
23702         * rootcontext.cs: 
23703
23704         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23705         TypeBuilder property.
23706
23707         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23708         instead. 
23709
23710         * tree.cs: Removed the various RecordXXXX, and replaced with a
23711         single RecordDecl.  Removed all the accessor methods, and just
23712         left a single access point Type 
23713
23714         * enum.cs: Rename DefineEnum to DefineType.
23715
23716         * decl.cs: New abstract method `DefineType' used to unify the
23717         Defines for Enumerations, Interfaces, TypeContainers and
23718         Delegates.
23719
23720         (FindType): Moved LookupInterfaceOrClass here.  Moved the
23721         LookupBaseClasses method that used to live in class.cs and
23722         interface.cs here, and renamed to FindType.
23723
23724         * delegate.cs: Implement DefineType.  Take advantage of the
23725         refactored pattern for locating the parent builder without taking
23726         the parent_builder argument (which we know does not work if we are
23727         nested, and triggering a toplevel definition).
23728
23729 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23730
23731         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23732         accessibility of a member has changed during override and report
23733         an error if so.
23734
23735         * class.cs (Method.Define, Property.Define): Only complain on
23736         overrides if the method is private, any other accessibility is
23737         fine (and since we just checked the permission is the same, we are
23738         good to go).
23739
23740         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23741         and elif are processed always.  The other pre-processing
23742         directives are only processed if we are "taking" the path
23743
23744 2002-03-29  Martin Baulig  <martin@gnome.org>
23745
23746         * class.cs (Method.Emit): Only emit symbolic debugging info if the
23747         current location is not Null.
23748
23749         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23750         a separate method so we can profile it.
23751
23752         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23753         `span.Seconds' are just seconds, but no minutes or hours.
23754         (MainDriver): Profile the CodeGen.SaveSymbols calls.
23755
23756 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23757
23758         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23759         Remove the gratuitous set of Final:
23760
23761                                 // If an interface implementation, then we can set Final.
23762                                 if (((flags & MethodAttributes.Abstract) == 0) &&
23763                                     implementing.DeclaringType.IsInterface)
23764                                         flags |= MethodAttributes.Final;
23765
23766         I do not know what I was smoking when I used that.
23767
23768
23769         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23770         step into fixing the name resolution issues for delegates and
23771         unifying the toplevel name resolution.
23772
23773 2002-03-28  Martin Baulig  <martin@gnome.org>
23774
23775         * class.cs (Method.Emit): If we have a symbol writer, call its
23776         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23777         tell it about the current method.
23778
23779         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23780         writer that we're going to emit the first byte of IL code for a new
23781         statement (a new source line).
23782         (EmitContext.EmitTopBlock): If we have a symbol writer, call
23783         EmitContext.Mark() before emitting any code.
23784
23785         * location.cs (SymbolDocument): Return null when we're Null.
23786
23787         * statement.cs (Statement): Moved the `Location loc' variable here.
23788         (Statement.EmitBoolExpression): If we have a symbol writer, call
23789         ec.Mark() before emitting any code to tell it that we're at the
23790         beginning of a new statement.
23791         (StatementExpression): Added `Location' argument to the constructor.
23792         (Block): Added public readonly variable `StartLocation' and public
23793         variable `EndLocation'.  The latter is to be set using SetEndLocation().
23794         (Block): Added constructor which takes a start and end location.
23795         (Block.SetEndLocation): New method. This sets the end location.
23796         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23797         local variables we create.
23798         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23799         each statement and do also mark the begin and end of the block.
23800
23801         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23802         tell it the current lexer.Location, use Location.Null for the end of the
23803         block.
23804         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23805         current block, set its end location using SetEndLocation().
23806         (statement_expression): StatementExpression constructor now takes the
23807         lexer.Location as additional argument.
23808         (for_statement, declare_local_variables): Likewise.
23809         (declare_local_variables): When creating a new implicit block, use the
23810         new Block constructor and pass it the lexer.Location.
23811
23812 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23813
23814         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23815         members also on the parent interfaces recursively.
23816
23817 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
23818
23819         * report.cs: Use new formats, since Gonzalo finished the missing
23820         bits. 
23821
23822         * expression.cs (Binary.ResolveOperator): added missing operator|
23823         operator& and operator^ for bool/bool.
23824
23825         * cs-parser.jay: CheckDef now takes a Location argument that is
23826         used to report errors more precisly (instead of reporting the end
23827         of a definition, we try to track something which is a lot closer
23828         to the source of the problem).
23829
23830         * cs-tokenizer.cs: Track global token use, so we can properly flag
23831         the use of #define/#undef after the first token has been seen.
23832
23833         Also, rename the reportXXXX to Error_DescriptiveName
23834
23835         * decl.cs (DeclSpace.IsTopLevel): Move property here from
23836         TypeContainer, so that Enum and Interface can use this too.
23837
23838         * class.cs (TypeContainer.LookupInterfaceOrClass,
23839         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23840         `builder' argument.  Typically this was used to pass the parent
23841         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23842         the definition).  
23843
23844         The problem is that a nested class could trigger the definition of
23845         a toplevel class, and the builder would be obviously wrong in that
23846         case. 
23847
23848         So we drop this argument, and we compute dynamically the
23849         TypeBuilder/ModuleBuilder (the correct information was available
23850         to us anyways from DeclSpace.Parent)
23851
23852         * interface.cs (Interface.DefineInterface): Drop builder
23853         parameter cleanup like class.cs
23854
23855         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
23856         like class.cs
23857
23858         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23859         values. 
23860
23861         (Try.Emit): Propagate the returns value from the statement.
23862
23863         (Return.Emit): Even if we are leavning 
23864
23865         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23866
23867         * modifiers.cs: Fix the computation of MethodAttributes flags.
23868
23869 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23870
23871         * driver.cs: allow compilation of files that start with '/'.
23872         Add a default case when checking the argument of --target.
23873
23874 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
23875
23876         * interface.cs: Implement the same search algorithm for types in
23877         the interface code.
23878
23879         * delegate.cs: Do not allow multiple definition.
23880
23881         * Recovered ChangeLog that got accidentally amputated
23882
23883         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23884
23885         * rootcontext.cs: Load manually enum to allow core classes to
23886         contain enumerations.
23887
23888         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23889         Update to new static methods in TypeManager.
23890
23891         * typemanager.cs (GetMethod, GetConstructor): Use our
23892         implementation of FindMembers to find the members, since during
23893         corlib compilation, the types are TypeBuilders and GetMethod and
23894         GetConstructor do not work.
23895
23896         Make all methods in TypeManager static.
23897
23898         (InitCodeHelpers): Split the functionality from
23899         the InitCodeTypes function.
23900
23901         * driver.cs: Call InitCodeHelpers after we have populated the
23902         types. 
23903
23904         * cs-parser.jay (delegate_declaration): we did not used to compute
23905         the delegate name correctly for void delegates.
23906
23907 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
23908
23909         * rootcontext.cs (RootContext): Init the interface_resolve_order
23910         and type_container_resolve_order always.
23911
23912         (ResolveCore, BootstrapCorlib_ResolveClass,
23913         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23914         compiler when compiling with --nostdlib
23915
23916         * class.cs (TypeContainer.DefineType): Check that our parent is
23917         not null.  This test is most important when we are bootstraping
23918         the core types.
23919
23920         * codegen.cs: Split out the symbol writing code.
23921
23922 2002-03-25  Martin Baulig  <martin@gnome.org>
23923
23924         * driver.cs (-g): Made -g an alias for --debug.
23925
23926 2002-03-24  Martin Baulig  <martin@gnome.org>
23927
23928         * codegen.cs (SymbolWriter): New public variable. Returns the
23929         current symbol writer.
23930         (CodeGen): Added `bool want_debugging_support' argument to the
23931          constructor. If true, tell the ModuleBuild that we want debugging
23932         support and ask it for the ISymbolWriter.
23933         (Save): If we have a symbol writer, call it's Close() method after
23934         saving the assembly.
23935
23936         * driver.c (--debug): New command line argument to create a
23937         debugger information file.
23938
23939         * location.cs (SymbolDocument): New public property. Returns an
23940         ISymbolDocumentWriter object for the current source file or null
23941         if we don't have a symbol writer.
23942
23943 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
23944
23945         * driver.cs (LoadAssembly): Correctly return when all the paths
23946         have been tried and not before.
23947
23948         * statement.cs (Switch.Emit): return the actual coverage for this
23949         statement (returns/not-returns)
23950
23951         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23952         switch of the statement if we are the last switch section.  That
23953         kills two problems: try/catch problems (we used to emit an empty
23954         nop at the end) and switch statements where all branches would
23955         return. 
23956
23957 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
23958
23959         * driver.cs: Add default assemblies (the equivalent to the
23960         Microsoft CSC.RSP file)
23961
23962         * cs-tokenizer.cs: When updating `cols and setting it to zero,
23963         also update tokens_seen and set it to false.
23964
23965         * driver.cs: Implement --recurse for Mike.
23966
23967         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23968         correctly splitting out the paths.
23969
23970 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
23971
23972         * interface.cs (Interface.PopulateProperty): Instead of using
23973         `parent' as the declaration space for the set parameters, use
23974         `this' 
23975
23976         * support.cs (InternalParameters): InternalParameters constructor
23977         takes a DeclSpace instead of a TypeContainer.
23978
23979         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23980         types are being initialized, load the address of it before calling
23981         the function.  
23982
23983         (New): Provide a mechanism to disable the generation of local
23984         value type temporaries when the caller will be providing us with
23985         an address to store it.
23986
23987         (ArrayCreation.EmitDynamicInitializers): Use it.
23988
23989 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
23990
23991         * expression.cs (Invocation.EmitArguments): Only probe for array
23992         property if there is more than one argument.  Sorry about that.
23993
23994         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
23995         empty param arrays.
23996
23997         * class.cs (Method.LabelParameters): Fix incorrect code path that
23998         prevented the `ParamArrayAttribute' from being applied to the
23999         params attribute.
24000
24001 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
24002
24003         * support.cs (ReflectionParameters): Correctly compute whether the
24004         last argument is a params array.  Fixes the problem with
24005         string.Split ('a')
24006
24007         * typemanager.cs: Make the assemblies array always be non-null
24008         (empty, but non-null)
24009
24010         * tree.cs (RecordDecl): New function that abstracts the recording
24011         of names.  This reports error 101, and provides a pointer to the
24012         previous declaration.  Fixes a crash in the compiler.
24013
24014         * cs-parser.jay (constructor_declaration): Update to new grammar,
24015         and provide a constructor_body that can be empty.
24016
24017 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
24018
24019         * driver.cs: Add support for --resources.
24020
24021         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
24022         Make all types for the various array helper methods be integer.
24023
24024         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
24025         CheckState to ConvCast.
24026
24027         (ConvCast): Now it takes a `checked' state argument, to avoid
24028         depending on the emit context for the conversion, and just using
24029         the resolve time setting.
24030
24031         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
24032         instead of Invocation.EmitArguments.  We do not emit the original
24033         arguments, instead we emit those which have been converted to
24034         unsigned int expressions.
24035
24036         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
24037
24038         * codegen.cs: ditto.
24039
24040         * expression.cs (LocalVariableReference): Drop the use of the
24041         Store function that depended on the variable index.
24042
24043         * statement.cs (VariableInfo): Drop the `Idx' property from this
24044         class, as this is not taking into account the indexes for
24045         temporaries tat we generate during the execution, getting the
24046         indexes wrong.
24047
24048         * class.cs: First emit class initializers, then call the parent
24049         constructor. 
24050
24051         * expression.cs (Binary): Fix opcode emision.
24052         (UnaryMutator.EmitCode): Support checked code generation
24053
24054         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
24055         matches for events for both the Static and Instance scans,
24056         pointing to the same element.   Fix that.
24057
24058 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
24059
24060         * rootcontext.cs (ResolveTree): Always set the
24061         interface_resolve_order, because nested interfaces will be calling
24062         into us.
24063
24064         * class.cs (GetInterfaceOrClass): Track the same resolution
24065         process used by TypeManager.LookupType.  This fixes the nested
24066         type lookups in class declarations (separate path from
24067         LookupType). 
24068
24069         (TypeContainer.DefineType): Also define nested interfaces.
24070         (TypeContainer.RegisterOrder): New public function used to
24071         register the order in which child interfaces need to be closed.
24072
24073         Nested interfaces need to be closed after their parents have been
24074         created. 
24075
24076         * interface.cs (InterfaceAttr): Put all the logic for computing
24077         the interface attribute here. 
24078
24079         (DefineInterface): Register our interface order with the
24080         RootContext or with the TypeContainer depending on the case.
24081
24082 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
24083
24084         * cs-parser.jay: rework foreach statement to work with the new
24085         changes to the policy on SimpleNames.
24086
24087         * report.cs: support Stacktrace on warnings as well.
24088
24089         * makefile: drop --unsafe and /unsafe from the compile.
24090
24091 2002-03-13  Ravi Pratap  <ravi@ximian.com>
24092
24093         * ecore.cs (StandardConversionExists): Modify to take an Expression
24094         as the first parameter. Ensure we do null -> reference type conversion
24095         checking.
24096
24097         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
24098         temporary Expression objects.
24099
24100 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
24101
24102         * interface.cs: workaround bug in method overloading resolution
24103         (there is already a bugzilla bug for it).
24104
24105 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
24106
24107         We could also solve this problem by having a separate path for
24108         performing type lookups, instead of DoResolve, we could have a
24109         ResolveType entry point, and only participating pieces of the
24110         production (simplename, deref, array) would implement this. 
24111
24112         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
24113         signal SimpleName to only resolve type names and not attempt to
24114         resolve anything else.
24115
24116         * expression.cs (Cast): Set the flag.
24117
24118         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
24119
24120         * class.cs: Only report 108 if there is no `new' modifier.
24121
24122         * cs-parser.jay: rework foreach statement to work with the new
24123         changes to the policy on SimpleNames.
24124
24125         * report.cs: support Stacktrace on warnings as well.
24126
24127         * makefile: drop --unsafe and /unsafe from the compile.
24128
24129 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
24130
24131         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24132         lookups here, instead of doing that at parse time.  This means
24133         that our grammar will not introduce `LocalVariableReferences' as
24134         expressions at this point.  That solves the problem of code like
24135         this:
24136
24137         class X {
24138            static void Main ()
24139            { int X = 1;
24140             { X x = null }}}
24141
24142         This is only half the fix.  The full fix requires parameters to
24143         also be handled in this way.
24144
24145         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
24146         makes the use more obvious of the DeclSpace.  The
24147         ec.TypeContainer.TypeBuilder is now only used to pull the
24148         TypeBuilder for it.
24149
24150         My theory is that I can get rid of the TypeBuilder completely from
24151         the EmitContext, and have typecasts where it is used (from
24152         DeclSpace to where it matters).  
24153
24154         The only pending problem is that the code that implements Aliases
24155         is on TypeContainer, and probably should go in DeclSpace.
24156
24157         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
24158         lookups here, instead of doing that at parse time.  This means
24159         that our grammar will not introduce `LocalVariableReferences' as
24160         expressions at this point.  That solves the problem of code like
24161         this:
24162
24163         class X {
24164            static void Main ()
24165            { int X = 1;
24166             { X x = null }}}
24167
24168         This is only half the fix.  The full fix requires parameters to
24169         also be handled in this way.
24170
24171         * class.cs (Property.DefineMethod): When implementing an interface
24172         method, set newslot, when implementing an abstract method, do not
24173         set the flag (before we tried never setting it, or always setting
24174         it, which is the difference).
24175         (Indexer.DefineMethod): same.
24176         (Method.DefineMethod): same.
24177
24178         * ecore.cs: Only set the status used flag if we get back a Field.
24179
24180         * attribute.cs: Temporary hack, so Paolo can keep working.
24181
24182 2002-03-08  Ravi Pratap  <ravi@ximian.com>
24183
24184         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
24185         the unmanaged type in the case we have a MarshalAs attribute.
24186
24187         (Resolve): Handle the case when we are parsing the special MarshalAs
24188         attribute [we need to store the unmanaged type to use later]
24189
24190         * typemanager.cs (marshal_as_attr_type): Built in type for the 
24191         MarshalAs Attribute.
24192
24193         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
24194         on parameters and accordingly set the marshalling info.
24195
24196 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
24197
24198         * class.cs: Optimizing slightly by removing redundant code after
24199         we switched to the `NoTypes' return value.
24200         (Property.DefineMethod): use NoTypes here too.
24201
24202         This fixes the bug I introduced in my last batch of changes.
24203
24204 2002-03-05  Ravi Pratap  <ravi@ximian.com>
24205
24206         * tree.cs (RecordEnum): Add. We now keep track of enums too.
24207
24208         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
24209         Enums since those are types too. 
24210
24211         * cs-parser.jay (enum_declaration): Record enums as we parse them.
24212
24213         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
24214         thanks to a call during the lookup process.
24215
24216 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
24217
24218         * statement.cs (Foreach): Lots of work to accomodate a particular
24219         kind of foreach statement that I had not kept in mind.  It is
24220         possible to have foreachs on classes that provide a GetEnumerator
24221         method that return objects that implement the "pattern" for using
24222         a foreach, there is no need to support GetEnumerator
24223         specifically. 
24224
24225         This is needed to compile nant.
24226
24227         * decl.cs: Only report 114 if the member is not `Finalize' and if
24228         the warning level is at least 2.
24229
24230         * class.cs: Moved the compare function from Method to
24231         MethodSignature. 
24232
24233         (MethodSignature.InheritableMemberSignatureCompare): Add new
24234         filter function that is used to extract inheritable methods from a
24235         class. 
24236
24237         (Method.Define): Use the new `inheritable_method_signature_filter'
24238         delegate
24239
24240         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
24241         command. 
24242
24243 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
24244
24245         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
24246
24247         * cs-parser.jay: Add opt_semicolon to the interface declaration.
24248
24249         * expression.cs: Pass location information to
24250         ConvertImplicitStandard. 
24251
24252         * class.cs: Added debugging code to track return values from
24253         interfaces. 
24254
24255 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
24256
24257         * expression.cs (Is.DoResolve): If either side of the `is' is an
24258         interface, do not flag the warning.
24259
24260         * ecore.cs (ImplicitReferenceConversion): We need a separate test
24261         for interfaces
24262
24263         * report.cs: Allow for --fatal to be used with --probe.
24264
24265         * typemanager.cs (NoTypes): Move the definition for the empty Type
24266         array here. 
24267
24268         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
24269         properties. 
24270         (TypeContainer.DefineProxy): New function used to proxy to parent
24271         implementations when implementing interfaces.
24272         (TypeContainer.ParentImplements): used to lookup if our parent
24273         implements a public function that is required by an interface.
24274         (TypeContainer.VerifyPendingMethods): Hook this up.
24275
24276         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
24277         `modules' and `assemblies' arraylists into arrays.  We only grow
24278         these are the very early start up of the program, so this improves
24279         the speedof LookupType (nicely measured).
24280
24281         * expression.cs (MakeByteBlob): Replaced unsafe code with
24282         BitConverter, as suggested by Paolo.
24283
24284         * cfold.cs (ConstantFold.Binary): Special case: perform constant
24285         folding of string concatenation, but if either side is a string,
24286         and the other is not, then return null, and let the runtime use
24287         the concatenation on the string plus the object (using
24288         `Object.ToString'). 
24289
24290 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
24291
24292         Constant Folding has been implemented now.
24293
24294         * expression.cs (Unary.Reduce): Do not throw an exception, catch
24295         the error instead on types that are not supported in one's
24296         complement. 
24297
24298         * constant.cs (Constant and all children): New set of functions to
24299         perform implict and explicit conversions.
24300
24301         * ecore.cs (EnumConstant): Implement the new functions to perform
24302         conversion by proxying to the child expression.
24303
24304         * codegen.cs: (ConstantCheckState): Constant evaluation has its
24305         own separate setting that can not be turned off from the command
24306         line using --unchecked or --checked and is only controlled using
24307         the checked/unchecked statements and expressions.  This setting is
24308         used by the constant folder to flag errors.
24309
24310         * expression.cs (CheckedExpr, UncheckedExpr): Set the
24311         ConstantCheckState as well.   
24312
24313         During Resolve, they also have to flag the state, because the
24314         constant folder runs completely in the Resolve phase.
24315
24316         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24317         well.
24318
24319 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24320
24321         * cfold.cs: New file, this file contains the constant folder.
24322
24323         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24324         argument to track whether we are using the resulting address to
24325         load or store a value and provide better error messages. 
24326
24327         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24328         new AddressOf arguments.
24329
24330         * statement.cs (Foreach.EmitCollectionForeach): Update
24331
24332         * expression.cs (Argument.Emit): Call AddressOf with proper
24333         arguments to track usage.
24334
24335         (New.DoEmit): Call AddressOf with new arguments.
24336
24337         (Unary.Emit): Adjust AddressOf call.
24338
24339 2002-03-01  Ravi Pratap  <ravi@ximian.com>
24340
24341         * cs-parser.jay (member_access): Change the case for pre-defined types
24342         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
24343         this suggestion.
24344
24345         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24346         a method body.
24347
24348         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24349         essentially like methods and apply attributes like MethodImplOptions to them too.
24350
24351         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24352         not being null.
24353
24354         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24355         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24356         is the DeclSpace.
24357
24358         * Update code everywhere accordingly.
24359
24360         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24361
24362         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24363
24364 2002-02-28  Ravi Pratap  <ravi@ximian.com>
24365
24366         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24367         try performing lookups against those instead of jumping straight into using
24368         the 'using' clauses.
24369
24370         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24371
24372         (LookupType): Perform lookups in implicit parents too.
24373
24374         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24375         sequence as RootContext.LookupType. 
24376
24377         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
24378         the various cases of namespace lookups into this method.
24379
24380 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24381
24382         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24383         in positional arguments)
24384
24385         * class.cs (Operator): Update the AllowedModifiers to contain
24386         extern. 
24387
24388         * cs-parser.jay: Update operator declaration to allow for the
24389         operator body to be empty.
24390
24391         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24392         values. 
24393
24394 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
24395
24396         * class.cs (Method.Emit): Label parameters.
24397
24398         * driver.cs: Return 1 or 0 as the program exit code.
24399
24400 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
24401
24402         * expression.cs: Special case the `null' object when trying to
24403         auto-compute the type, as anything can be explicitly converted to
24404         that. 
24405
24406         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24407         spotting this Paolo.
24408
24409         (Expression.ImplicitNumericConversion): Perform comparissions of
24410         the type using the underlying type in the case of an enumeration
24411         rather than using the enumeration type for the compare.
24412
24413         Cope with the underlying == type case, which is not possible to
24414         catch before. 
24415
24416         (Expression.ConvertNumericExplicit): Perform comparissions of
24417         the type using the underlying type in the case of an enumeration
24418         rather than using the enumeration type for the compare.
24419
24420         * driver.cs: If the user does not supply an extension, assume .exe
24421
24422         * cs-parser.jay (if_statement): Rewrote so that we can track the
24423         location for the if statement.
24424
24425         * expression.cs (Binary.ConstantFold): Only concat strings when
24426         the operation is "+", not everything ;-)
24427
24428         * statement.cs (Statement.EmitBoolExpression): Take a location
24429         argument. 
24430         (If, While, Do): Track location.
24431
24432         * expression.cs (Binary.ResolveOperator): In the object + string
24433         case, I was missing a call to ConvertImplicit
24434
24435 2002-02-25  Ravi Pratap  <ravi@ximian.com>
24436
24437         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24438         Location arguments. Ensure we use RootContext.LookupType to do our work
24439         and not try to do a direct Type.GetType and ModuleBuilder.GetType
24440
24441         * interface.cs (PopulateMethod): Handle the type of the parameter being
24442         null gracefully.
24443
24444         * expression.cs (Invocation.BetterFunction): Handle the case when we 
24445         have a params method with no fixed arguments and a call is made with no
24446         arguments.
24447
24448 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
24449
24450         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24451         the verbatim-string-literal
24452
24453         * support.cs (InternalParameters.ParameterModifier): handle null
24454         fixed parameters.
24455         (InternalParameters.ParameterType): ditto.
24456
24457         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24458         duplicating the name of the variable parameter.
24459         (GetParameterByName): Fix bug where we were not looking up array
24460         paramters if they were the only present (thanks Paolo!).
24461         (GetParameterInfo): We only have an empty set of types if both
24462         fixed and array are set to null.
24463         (GetParameterInfo-idx): Handle FixedParameter == null
24464
24465         * cs-parser.jay: Handle the case where there is no catch
24466         statements (missing null test).
24467
24468 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
24469
24470         * driver.cs (MainDriver): Be conservative on our command line
24471         handling.
24472
24473         Catch DirectoryNotFoundException when calling GetFiles.
24474
24475         (SplitPathAndPattern): Used to split the input specification into
24476         a path and a pattern that we can feed to Directory.GetFiles.
24477
24478 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
24479
24480         * statement.cs (Fixed): Implement the last case of the Fixed
24481         statement (string handling).
24482
24483         * expression.cs (StringPtr): New class used to return a char * to
24484         a string;  Used by the Fixed statement.
24485
24486         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
24487
24488         * expression.cs (Binary.ResolveOperator): Remove redundant
24489         MemberLookup pn parent type.
24490         Optimize union call, we do not need a union if the types are the same.
24491         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24492         type.
24493
24494         Specialize the use of MemberLookup everywhere, instead of using
24495         the default settings. 
24496
24497         (StackAlloc): Implement stackalloc keyword.
24498
24499         * cs-parser.jay: Add rule to parse stackalloc.
24500
24501         * driver.cs: Handle /h, /help, /?
24502
24503         * expression.cs (MakeByteBlob): Removed the hacks we had in place
24504         before we supported unsafe code.
24505
24506         * makefile: add --unsafe to the self compilation of mcs.
24507
24508 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
24509
24510         * expression.cs (PointerArithmetic): New class that is used to
24511         perform pointer arithmetic.
24512         (Binary.Resolve): Handle pointer arithmetic
24513         Handle pointer comparission.
24514         (ArrayPtr): Utility expression class that is used to take the
24515         address of an array.
24516
24517         (ElementAccess): Implement array access for pointers
24518
24519         * statement.cs (Fixed): Implement fixed statement for arrays, we
24520         are missing one more case before we are done.
24521
24522         * expression.cs (Indirection): Implement EmitAssign and set the
24523         ExprClass to Variable.  This allows pointer dereferences to be
24524         treated as variables, and to have values assigned to them.
24525
24526         * ecore.cs (Expression.StoreFromPtr): New utility function to
24527         store values dereferencing.
24528
24529 2002-02-20  Ravi Pratap  <ravi@ximian.com>
24530
24531         * expression.cs (Binary.ResolveOperator): Ensure that we are
24532         not trying to operate on a void type - this fixes the reported
24533         bug.
24534
24535         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24536         the parent implementation is sealed.
24537
24538         * ../errors/cs0239.cs : Add.
24539
24540         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24541
24542         * typemanager.cs (unverifiable_code_type): Corresponds to 
24543         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24544         which have unsafe code in them.
24545
24546         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
24547         unsafe context.
24548
24549 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
24550
24551         * cs-tokenizer.cs: Add support for @"litreal strings"
24552
24553         Make tokenizer accept pre-processor directives
24554         on any column (remove the old C-like limitation). 
24555
24556         * rootcontext.cs (EmitCode): Emit any global attributes.
24557         (AddGlobalAttributes): Used to keep track of assembly attributes. 
24558
24559         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24560
24561         * cs-parser.jay: Add support for global attributes.  
24562
24563 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
24564
24565         * expression.cs (Indirection): New helper class.  Unary will
24566         create Indirection classes to be able to implement the
24567         IMemoryLocation interface on it.
24568
24569 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
24570
24571         * cs-parser.jay (fixed_statement): reference the right statement.
24572
24573         * statement.cs (Fixed.Emit): Finish implementing the fixed
24574         statement for the &x case.
24575
24576 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
24577
24578         * class.cs (Property.Define, Method.Define): Remove newslot when
24579         `implementing'.  
24580
24581         * modifiers.cs: My use of NewSlot when `Abstract' was set was
24582         wrong.  NewSlot should only be used if the `new' keyword is present.
24583
24584         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24585         locating our system dir.  Sorry about this.
24586
24587 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24588
24589         * driver.cs (GetSystemDir): Compute correctly the location of our
24590         system assemblies.  I was using the compiler directory instead of
24591         the library directory.
24592
24593 2002-02-13  Ravi Pratap  <ravi@ximian.com>
24594
24595         * expression.cs (BetterFunction): Put back in what Miguel commented out
24596         since it is the correct fix. The problem is elsewhere ;-)
24597
24598         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24599         parameters of the parms method are themselves compatible or not !
24600
24601         (StandardConversionExists): Fix very dangerous bug where we were forgetting
24602         to check that a class implements an interface before saying that an implicit
24603         conversion was allowed. Use ImplementsInterface to do the checking.
24604
24605 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24606
24607         * class.cs (Method.Define): Track whether we are an explicit
24608         implementation or not.  And only call DefineMethodOverride if we
24609         are an explicit implementation.
24610
24611         (Property.DefineMethod): Ditto.
24612
24613 2002-02-11  Ravi Pratap  <ravi@ximian.com>
24614
24615         * expression.cs (BetterFunction): Catch hideous bug which was
24616          preventing us from detecting ambiguous calls due to implicit casts i.e
24617         cs0121.
24618
24619 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
24620
24621         * support.cs (Pair): Remove un-needed method.  I figured why I was
24622         getting the error in cs-parser.jay, the variable in a foreach loop
24623         is readonly, and the compiler does not really treat this as a variable.
24624
24625         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
24626         instead of EQUALS in grammar.  
24627
24628         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24629
24630         * expression.cs (Unary.DoResolve): Check whether the argument is
24631         managed or not.
24632
24633 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
24634
24635         * support.cs: Api for Pair to set a value.  Despite the fact that
24636         the variables are public the MS C# compiler refuses to compile
24637         code that accesses the field if the variable is part of a foreach
24638         statement. 
24639
24640         * statement.cs (Fixed): Begin implementation of the fixed
24641         statement.
24642
24643         (Block.AddVariable): Return the VariableInfo on success and null
24644         on failure instead of true/false. 
24645
24646         * cs-parser.jay (foreach): Catch errors on variables already
24647         defined (we were ignoring this value before) and properly unwind
24648         the block hierarchy
24649
24650         (fixed_statement): grammar for the fixed statement.
24651
24652 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
24653
24654         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24655         pointer types to be incretemented.
24656
24657         (SizeOf): Implement.
24658
24659         * cs-parser.jay (pointer_member_access): Implement
24660         expr->IDENTIFIER production.
24661
24662         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24663         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24664         on safe contexts.
24665
24666         (Unary): Implement indirection.
24667
24668         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24669         use in non-unsafe context).
24670
24671         (SimpleName.DoResolve): Check for pointers in field access on safe
24672         contexts. 
24673
24674         (Expression.LoadFromPtr): Factor the load-indirect code in this
24675         function.  This was duplicated in UnboxCast and ParameterReference
24676
24677 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
24678
24679         * expression.cs (ComposedCast): report an error if a pointer cast
24680         is used in a safe region.
24681
24682         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24683         pointer type casts in unsafe context.
24684
24685         * codegen.cs (EmitContext): Set up IsUnsafe.
24686
24687         * cs-parser.jay (non_expression_type): Add productions for pointer
24688         casts. 
24689
24690         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24691         code.  We should not use force into static mode if the method is
24692         not virtual.  Fixes bug in MIS
24693
24694         * statement.cs (Do.Emit, While.Emit, For.Emit,
24695         Statement.EmitBoolExpression): Add support to Do and While to
24696         propagate infinite loop as `I do return' semantics.
24697
24698         Improve the For case to also test for boolean constants.
24699
24700         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24701         to the list of attributes we can add.
24702
24703         Remove `EmitContext' argument.
24704
24705         * class.cs (Method.Define): Apply parameter attributes.
24706         (Constructor.Define): Apply parameter attributes.
24707         (MethodCore.LabelParameters): Move here the core of labeling
24708         parameters. 
24709
24710         * support.cs (ReflectionParameters.ParameterModifier,
24711         InternalParameters.ParameterModifier): Use IsByRef on the type and
24712         only return the OUT bit for these parameters instead of in/out/ref
24713         flags.
24714
24715         This is because I miss-understood things.  The ParameterInfo.IsIn
24716         and IsOut represent whether the parameter has the [In] and [Out]
24717         attributes set.  
24718
24719 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
24720
24721         * ecore.cs (FieldExpr.Emit): Release temporaries.
24722
24723         * assign.cs (LocalTemporary.Release): new function.
24724
24725         * codegen.cs (EmitContext.GetTemporaryStorage,
24726         EmitContext.FreeTemporaryStorage): Rework the way we deal with
24727         temporary storage.  Now we can "put back" localbuilders when we
24728         are done with them
24729
24730 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
24731
24732         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24733         need to make a copy of the variable to generate verifiable code.
24734
24735 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
24736
24737         * driver.cs: Compute dynamically the system directory.
24738
24739         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24740         Slower, but more generally useful.  Used by the abstract
24741         registering implementation. 
24742
24743         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24744         the rules for the special rule on Type/instances.  First check if
24745         we have the same name, and if so, try that special static path
24746         rather than the instance path.
24747
24748 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
24749
24750         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24751         for, while and if.
24752
24753         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24754         Enum, ValueType, Delegate or Array for non-corlib compiles.
24755
24756         * cs-tokenizer.cs: Catch long identifiers (645)
24757
24758         * typemanager.cs (IndexerPropetyName): Ravi never tested this
24759         piece of code.
24760
24761         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24762         fix, we were returning too early, so we were not registering
24763         pending methods from abstract classes.
24764
24765         Do not register pending methods if the class is abstract.
24766
24767         * expression.cs (Conditional.DoResolve): Report circular implicit
24768         conversions when we neecd to compute it for conditional
24769         expressions. 
24770
24771         (Is.DoResolve): If the expression is always of the provided type,
24772         flag warning 183.  If the expression can not ever be of the
24773         provided type flag warning 184.
24774
24775         * class.cs: Catch 169 as well.
24776
24777         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24778         read. 
24779
24780 2002-01-18  Nick Drochak  <ndrochak@gol.com>
24781
24782         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
24783
24784 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
24785
24786         * interface.cs: (PopulateMethod): Check for pointers being defined
24787         only if the unsafe context is active.
24788         (PopulateProperty): ditto.
24789         (PopulateIndexer): ditto.
24790
24791         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24792         specified.  If pointers are present, make sure that they are
24793         present in an unsafe context.
24794         (Constructor, Constructor.Define): ditto.
24795         (Field, Field.Define): ditto.
24796         (Property, Property.Define): ditto.
24797         (Event, Event.Define): ditto.
24798
24799         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24800         hashtable if there are classes or structs defined.
24801
24802         * expression.cs (LocalVariableReference.DoResolve): Simplify this
24803         code, as the constant resolution moved.
24804
24805         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24806         the metadata, so we can flag error 133. 
24807
24808         * decl.cs (MemberCore.UnsafeOK): New function to test that a
24809         pointer is being declared in an unsafe context.
24810
24811 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
24812
24813         * modifiers.cs (Modifiers.Check): Require a Location argument.
24814         Report error 227 for Unsafe use.
24815
24816         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24817
24818         * statement.cs (For.Emit): If the test is null, then report that
24819         we do `return', as we wont reach anything afterwards.
24820
24821         (Switch.SwitchGoverningType): Track the expression that matched
24822         the conversion.
24823
24824         * driver.cs: Allow negative numbers as an error code to flag.
24825
24826         * cs-parser.jay: Handle 1551.
24827
24828         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24829
24830 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24831
24832         * cs-parser.jay: Report 1518 (type declaration can only contain
24833         class, struct, interface, enum or delegate)
24834
24835         (switch_label): Report 1523 (keywords `case' or `default' must
24836         preced code)
24837
24838         (opt_switch_sections): Report 1522 (empty switch)
24839
24840         * driver.cs: Report 1515 (response file specified multiple times)
24841         Report 1516 (Source file specified multiple times).
24842
24843         * expression.cs (Argument.Resolve): Signal 1510
24844
24845         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24846         access not allowed in static code)
24847
24848 2002-01-11  Ravi Pratap  <ravi@ximian.com>
24849
24850         * typemanager.cs (IsPointerType): Utility method which we are going
24851         to need a lot.
24852
24853         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24854         the object type, so we take care of that.
24855
24856         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24857
24858         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24859         added to non-params parameters :-)
24860
24861         * typemanager.cs (CSharpName): Include 'void' type too. 
24862
24863         (void_ptr_type): Include in the set of core types.
24864
24865         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
24866         duplicating code.
24867
24868         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
24869         an unsafe context.
24870
24871         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
24872         completely forgotten about it.
24873
24874 2002-01-10  Ravi Pratap  <ravi@ximian.com>
24875
24876         * cs-parser.jay (pointer_type): Add. This begins our implementation
24877         of parsing rules for unsafe code.
24878
24879         (unsafe_statement): Implement.
24880
24881         (embedded_statement): Modify to include the above.
24882
24883         * statement.cs (Unsafe): Implement new class for unsafe blocks.
24884
24885         * codegen.cs (EmitContext.InUnsafe): Add. This determines
24886         if the current context is an unsafe one.
24887
24888         * cs-parser.jay (local_variable_pointer_type): Since local variable types
24889         are handled differently, we need separate rules for them.
24890
24891         (local_variable_declaration): Update to use local_variable_pointer_type
24892         to allow variable declarations of unmanaged pointer types.
24893
24894         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24895         in unsafe contexts.
24896
24897         * ../errors/cs0214.cs : Add.
24898
24899 2002-01-16  Nick Drochak  <ndrochak@gol.com>
24900
24901         * makefile: remove 'response' file when cleaning.
24902
24903 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24904
24905         * cs-parser.jay: Report 1524.
24906
24907 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
24908
24909         * typemanager.cs (RegisterMethod): drop checking if we have
24910         registered this from here
24911
24912 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
24913
24914         * class.cs (Method.EmitDestructor): Implement calling our base
24915         destructor. 
24916
24917         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24918         value of InFinally.
24919
24920         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24921         this routine and will wrap the call in a try/catch block.  Deal
24922         with the case.
24923
24924 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
24925
24926         * ecore.cs (Expression.MemberLookup): instead of taking a
24927         parameter `same_type' that was used to tell whether we could
24928         access private members we compute our containing type from the
24929         EmitContext.
24930
24931         (FieldExpr): Added partial support for volatile fields.  This does
24932         not work for volatile fields exposed from assemblies, as I can not
24933         figure out how to extract the modreq from it.
24934
24935         Updated all the source files to use this.
24936
24937         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24938         because it is referenced by MemberLookup very often. 
24939
24940 2002-01-09  Ravi Pratap  <ravi@ximian.com>
24941
24942         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24943         TypeBuilder.GetCustomAttributes to retrieve what we need.
24944
24945         Get rid of redundant default_member_attr_type as this is the same as
24946         default_member_type which already exists.
24947
24948         * interface.cs, attribute.cs : Update accordingly.
24949
24950 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
24951
24952         * typemanager.cs: Enable IndexerPropertyName again.  It does not
24953         work for TYpeBuilders though.  Ravi, can you please fix this?
24954
24955         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24956
24957         * expression.cs (Argument.Emit): Handle the case of ref objects
24958         being passed to ref functions;  
24959
24960         (ParameterReference.EmitLoad): Loads the content of the pointer
24961         without dereferencing.
24962
24963 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24964
24965         * cs-tokenizer.cs: Implemented the pre-processing expressions.
24966
24967 2002-01-08  Ravi Pratap  <ravi@ximian.com>
24968
24969         * class.cs (Indexer.DefineMethod): Incorporate the interface
24970         type in the name of the method if we are doing explicit interface
24971         implementation.
24972
24973         * expression.cs (ConversionExists): Remove as it is completely obsolete.
24974
24975         (BetterConversion): Fix extremely trivial bug where we were referring to
24976         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24977         again !
24978
24979         * ../errors/bug16.cs : Add although we have fixed it.
24980
24981 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24982
24983         * expression.cs (BaseIndexer): Begin implementation.
24984
24985         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
24986
24987         * cs-parser.jay (indexer_declarator): Use qualified_identifier
24988         production directly to remove a shift/reduce, and implement
24989         explicit interface implementation.
24990
24991         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
24992         after a floating point suffix.
24993
24994         * expression.cs (DoNumericPromotions): Improved the conversion for
24995         uint/uint.  If we have a constant, we avoid doing a typecast to a
24996         larger type.
24997
24998         * class.cs (Indexer): Implement explicit interface implementation
24999         for indexers.
25000
25001 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
25002
25003         * class.cs: make the default instance constructor public and hidebysig.
25004
25005 2001-01-03  Ravi Pratap  <ravi@ximian.com>
25006
25007         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
25008         so we can call it from elsewhere.
25009
25010         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
25011         we emit it internally if the class has a defined indexer; otherwise the user
25012         emits it by decorating the class definition with the DefaultMemberAttribute.
25013
25014         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
25015         attribute is not used on a type which defines an indexer.
25016
25017         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
25018         character when we skip whitespace.
25019
25020         * ../errors/cs0646.cs : Add.
25021
25022 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
25023
25024         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
25025         again. 
25026
25027         * makefile: Add practical target `mcs3.exe' which builds the third
25028         generation compiler. 
25029
25030         * expression.cs (New): Fix structures constructor calling.
25031
25032         * class.cs (Property, Method, Indexer): Emit Final flag on the
25033         method if we are an interface implementation and we are not
25034         abstract. 
25035
25036         * ecore.cs (PropertyExpr): New public field `IsBase', tells
25037         whether this property is referencing a `base' method.
25038
25039         * expression.cs (Invocation.EmitCall): take an extra argument:
25040         is_base, this is used to determine whether the `call' or
25041         `callvirt' opcode should be used.
25042
25043
25044         * delegate.cs: update EmitCall.
25045
25046         * class.cs (Method.Define): Set NewSlot for the cases where we are
25047         not implementing an interface method.
25048
25049         (Property.Define): ditto.
25050
25051 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
25052
25053         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
25054         'r'.  Allows mcs to parse itself fully.
25055
25056 2002-01-02  Ravi Pratap  <ravi@ximian.com>
25057
25058         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
25059         of the number of initializers that require the InitializeArray method.
25060
25061         (CheckIndices): Store the Expression in all cases - not the plain value. Also
25062         update the above field where necessary.
25063
25064         (MakeByteBlob): Update accordingly.
25065
25066         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
25067         greater than 2.
25068
25069         (EmitDynamicInitializers): Update in accordance with the new optimization.
25070
25071         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
25072         same OpCode applies.
25073
25074         * cs-parser.jay : Fix some glaring errors I introduced.
25075
25076 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
25077
25078         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
25079         so that we can check for name clashes there too.
25080
25081         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
25082         for interface indexers.
25083
25084         * interfaces.cs (Define): Emit the default member attribute.
25085
25086         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
25087         variable was being referred to while setting the value ;-)
25088
25089 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
25090
25091         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
25092         byte-by-byte information when we know the data is zero.
25093
25094         Make the block always a multiple of 4, because
25095         DefineInitializedData has a bug.
25096
25097         * assign.cs: Fix, we should assign from the temporary, not from
25098         the source. 
25099
25100         * expression.cs (MakeByteBlob): Fix my incorrect code.
25101
25102 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
25103
25104         * typemanager.cs (EnumToUnderlying): This function is used to get
25105         the underlying type from an enumeration, because it does not
25106         always work. 
25107
25108         * constant.cs: Use the I4_S form for values between -128 and 127.
25109
25110         * statement.cs (Block.LookupLabel): Looks up a label.
25111         (Block): Drop support for labeled blocks.
25112
25113         (LabeledStatement): New kind of statement that represents a label
25114         only.
25115
25116         (Goto): Finally implement this bad boy.
25117
25118         * cs-parser.jay: Update to reflect new mechanism to implement
25119         labels.
25120
25121 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
25122
25123         * codegen.cs (EmitContext.This): a codegen property that keeps the
25124         a single instance of this instead of creating many different this
25125         instances. 
25126
25127         * delegate.cs (Delegate.DoResolve): Update to use the property;
25128
25129         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
25130
25131         * expression.cs (BaseAccess.DoResolve): Ditto.
25132
25133 2001-12-29  Ravi Pratap  <ravi@ximian.com>
25134
25135         * typemanager.cs (methodimpl_attr_type): Add to hold the type
25136         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
25137
25138         (InitCoreTypes): Update accordingly.
25139
25140         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
25141         so we can quickly store the state.
25142
25143         (ApplyAttributes): Set the correct implementation flags
25144         for InternalCall methods.
25145
25146 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
25147
25148         * expression.cs (EmitCall): if a method is not virtual, then do
25149         not use callvirt on it.
25150
25151         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
25152         user defined stuff) requires the use of stobj, which takes an
25153         address on the stack instead of an array and an index.  So emit
25154         the Ldelema operation for it.
25155
25156         (EmitStoreOpcode): Use stobj for valuetypes.
25157
25158         (UnaryMutator.EmitCode): Use the right 1 value depending on
25159         whether we are dealing with int64/uint64, float or doubles.
25160
25161         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
25162         constructors that I implemented last night.
25163
25164         (Constructor.IsDefault): Fix to work properly for static
25165         constructors.
25166
25167         * cs-parser.jay (CheckDef): report method signature errors.
25168         Update error number 103 to be 132.
25169
25170         * decl.cs: New AdditionResult enumeration value: MethodExists.
25171         Although we do this check for methods later on in the semantic
25172         analysis, catching repeated default constructors is so easy that
25173         we catch these here. 
25174
25175         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
25176         promotions code.
25177
25178         (ParameterReference.EmitAssign, Emit): handle
25179         bools as bytes.
25180
25181         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
25182         (ArrayAccess.EmitStoreOpcode): ditto.
25183
25184         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
25185
25186         * expression.cs (MakeByteBlob): Complete all the missing types
25187         (uint, short, ushort, byte, sbyte)
25188
25189         * class.cs: Only init instance field initializers on instance
25190         constructors. 
25191
25192         Rename `constructors' to instance_constructors. 
25193
25194         (TypeContainer.AddConstructor): Only add constructors to the list
25195         if it is not static.
25196
25197         Make sure that we handle default_static_constructor independently
25198         everywhere where we handle instance_constructors
25199
25200 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
25201
25202         * class.cs: Do not lookup or create a base initializer for a
25203         static constructor.
25204
25205         (ConstructorInitializer.Resolve): use the proper type to lookup
25206         for constructors.
25207
25208         * cs-parser.jay: Report error 1585 (modifiers between type and name).
25209
25210         * enum.cs, interface.cs: Remove CloseType, this is taken care by
25211         in DeclSpace. 
25212
25213         * decl.cs: CloseType is now an virtual method, the default
25214         implementation just closes this type.
25215
25216 2001-12-28  Ravi Pratap  <ravi@ximian.com>
25217
25218         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
25219         to PreserveSig by default. Also emit HideBySig on such methods.
25220
25221         Basically, set the defaults to standard values.
25222
25223         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
25224         argument, if candidate is better, it can't be worse than the best !
25225
25226         (Invocation): Re-write bits to differentiate between methods being
25227         applicable in their expanded form and their normal form - for params
25228         methods of course.
25229
25230         Get rid of use_standard everywhere as only standard conversions are allowed
25231         in overload resolution. 
25232
25233         More spec conformance.
25234
25235 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
25236
25237         * driver.cs: Add --timestamp, to see where the compiler spends
25238         most of its time.
25239
25240         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
25241         `this' in static code.
25242
25243         (SimpleName.DoResolve): Implement in terms of a helper function
25244         that allows static-references to be passed upstream to
25245         MemberAccess.
25246
25247         (Expression.ResolveWithSimpleName): Resolve specially simple
25248         names when called by MemberAccess to implement the special
25249         semantics. 
25250
25251         (Expression.ImplicitReferenceConversion): Handle conversions from
25252         Null to reference types before others, as Null's type is
25253         System.Object. 
25254
25255         * expression.cs (Invocation.EmitCall): Handle the special case of
25256         calling methods declared on a reference type from a ValueType
25257         (Base classes System.Object and System.Enum)
25258
25259         (MemberAccess.Resolve): Only perform lookups on Enumerations if
25260         the left hand side is a TypeExpr, not on every enumeration. 
25261
25262         (Binary.Resolve): If types are reference types, then do a cast to
25263         object on operators != and == of both arguments.
25264
25265         * typemanager.cs (FindMembers): Extract instance and static
25266         members if requested.
25267
25268         * interface.cs (PopulateProperty): Use void_type instead of null
25269         as the return type for the setter method.
25270
25271         (PopulateIndexer): ditto.
25272
25273 2001-12-27  Ravi Pratap  <ravi@ximian.com>
25274
25275         * support.cs (ReflectionParameters): Fix minor bug where we
25276         were examining the wrong parameter for the ParamArray attribute.
25277
25278         Cope with requests for the type of the parameter at position
25279         greater than the params parameter's. We now return the element
25280         type of the params array as that makes more sense.
25281
25282         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
25283         accordingly as we no longer have to extract the element type
25284         ourselves.
25285
25286         (Invocation.OverloadResolve): Update.
25287
25288 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
25289
25290         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
25291         against IEnumerator, test whether the return value is a descendant
25292         of the IEnumerator interface.
25293
25294         * class.cs (Indexer.Define): Use an auxiliary method to implement
25295         the other bits of the method definition.  Begin support for
25296         explicit interface implementation.
25297
25298         (Property.DefineMethod): Use TypeManager.void_type instead of null
25299         for an empty return value.
25300
25301 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
25302
25303         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
25304         dealing with a FieldExpr which is composed of a FieldBuilder, in
25305         the code path we did extract the constant, but we should have
25306         obtained the underlying value to be able to cast it (otherwise we
25307         end up in an infinite loop, this is what Ravi was running into).
25308
25309         (ArrayCreation.UpdateIndices): Arrays might be empty.
25310
25311         (MemberAccess.ResolveMemberAccess): Add support for section
25312         14.5.4.1 that deals with the special case of E.I when E is a type
25313         and something else, that I can be a reference to a static member.
25314
25315         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25316         handle a particular array type to create byte blobs, it is just
25317         something we dont generate byteblobs for.
25318
25319         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25320         arguments. 
25321
25322         * location.cs (Push): remove the key from the hashtable that we
25323         are about to add.   This happens for empty files.
25324
25325         * driver.cs: Dispose files after we have parsed them.
25326
25327         (tokenize): new function that only runs the tokenizer on its
25328         input, for speed testing.
25329
25330 2001-12-26  Ravi Pratap  <ravi@ximian.com>
25331
25332         * class.cs (Event.Define): Define the private field only if there
25333         are no accessors defined.
25334
25335         * expression.cs (ResolveMemberAccess): If there is no associated
25336         field with the event, that means we have an event defined with its
25337         own accessors and we should flag error cs0070 since transforming
25338         ourselves into a field is not valid in that case.
25339
25340         * ecore.cs (SimpleName.DoResolve): Same as above.
25341
25342         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25343         and charset to sane values.
25344
25345 2001-12-25  Ravi Pratap  <ravi@ximian.com>
25346
25347         * assign.cs (DoResolve): Perform check on events only if they 
25348         are being accessed outside the declaring type.
25349
25350         * cs-parser.jay (event_declarations): Update rules to correctly
25351         set the type of the implicit parameter etc.
25352
25353         (add_accessor, remove_accessor): Set current local parameters.
25354
25355         * expression.cs (Binary): For delegate addition and subtraction,
25356         cast the return value from the method into the appropriate delegate
25357         type.
25358
25359 2001-12-24  Ravi Pratap  <ravi@ximian.com>
25360
25361         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25362         of these as the workaround is unnecessary.
25363
25364         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25365         delegate data - none of that is needed at all.
25366
25367         Re-write bits to extract the instance expression and the delegate method
25368         correctly.
25369
25370         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
25371         on delegates too.
25372
25373         * attribute.cs (ApplyAttributes): New method to take care of common tasks
25374         of attaching attributes instead of duplicating code everywhere.
25375
25376         * everywhere : Update code to do attribute emission using the above method.
25377
25378 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25379
25380         * expression.cs (IsParamsMethodApplicable): if there are not
25381         parameters, return immediately.
25382
25383         * ecore.cs: The 0 literal can be implicity converted to an enum
25384         type. 
25385
25386         (SimpleName.DoResolve): First lookup the type, then lookup the
25387         members. 
25388
25389         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25390         want to get its address.  If the InstanceExpression is not
25391         addressable, store the result in a temporary variable, then get
25392         the address of it.
25393
25394         * codegen.cs: Only display 219 errors on warning level or above. 
25395
25396         * expression.cs (ArrayAccess): Make it implement the
25397         IMemoryLocation interface.
25398
25399         (Binary.DoResolve): handle the operator == (object a, object b)
25400         and operator != (object a, object b) without incurring into a
25401         BoxedCast (because 5 != o should never be performed).
25402
25403         Handle binary enumerator operators.
25404
25405         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25406         value type, otherwise use Ldelem_ref.
25407
25408         Use precomputed names;
25409
25410         (AddressOf): Implement address of
25411
25412         * cs-parser.jay (labeled_statement): Fix recursive block
25413         addition by reworking the production.
25414
25415         * expression.cs (New.DoEmit): New has a special case:
25416                 
25417                  If we are dealing with a ValueType, we have a few
25418                  situations to deal with:
25419                 
25420                     * The target of New is a ValueType variable, that is
25421                       easy, we just pass this as the variable reference
25422                 
25423                     * The target of New is being passed as an argument,
25424                       to a boxing operation or a function that takes a
25425                       ValueType.
25426                 
25427                       In this case, we need to create a temporary variable
25428                       that is the argument of New.
25429
25430
25431 2001-12-23  Ravi Pratap  <ravi@ximian.com>
25432
25433         * rootcontext.cs (LookupType): Check that current_type is not null before
25434         going about looking at nested types.
25435
25436         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25437         not implement the IAssignMethod interface any more.
25438
25439         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25440         where we tranform them into FieldExprs if they are being resolved from within
25441         the declaring type.
25442
25443         * ecore.cs (SimpleName.DoResolve): Do the same here.
25444
25445         * assign.cs (DoResolve, Emit): Clean up code considerably. 
25446
25447         * ../errors/bug10.cs : Add.
25448
25449         * ../errors/cs0070.cs : Add.
25450
25451         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25452
25453         * assign.cs : Get rid of EventIsLocal everywhere.
25454
25455 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25456
25457         * ecore.cs (ConvertIntLiteral): finished the implementation.
25458
25459         * statement.cs (SwitchLabel): Convert the value we are using as a
25460         key before looking up the table.
25461
25462 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25463
25464         * codegen.cs (EmitTopBlock): Require a Location argument now.
25465
25466         * cs-parser.jay (constructor_declarator): We need to setup
25467         current_local_parameters before we parse the
25468         opt_constructor_initializer, to allow the variables to be bound
25469         to the constructor arguments.
25470
25471         * rootcontext.cs (LookupType): First lookup nested classes in our
25472         class and our parents before we go looking outside our class.
25473
25474         * expression.cs (ConstantFold): Extract/debox the values at the
25475         beginnning. 
25476
25477         * rootcontext.cs (EmitCode): Resolve the constants first before we
25478         resolve the types.  This is not really needed, but it helps debugging.
25479
25480         * statement.cs: report location.
25481
25482         * cs-parser.jay: pass location to throw statement.
25483
25484         * driver.cs: Small bug fix.
25485
25486         * report.cs: Updated format to be 4-zero filled digits.
25487
25488 2001-12-22  Ravi Pratap  <ravi@ximian.com>
25489
25490         * expression.cs (CheckIndices): Fix minor bug where the wrong
25491         variable was being referred to ;-)
25492
25493         (DoEmit): Do not call EmitStaticInitializers when the 
25494         underlying type is System.Object.
25495
25496 2001-12-21  Ravi Pratap  <ravi@ximian.com>
25497
25498         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25499         and do the usual workaround for SRE.
25500
25501         * class.cs (MyEventBuilder.EventType): New member to get at the type
25502         of the event, quickly.
25503
25504         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25505
25506         * assign.cs (Assign.DoResolve): Handle the case when the target
25507         is an EventExpr and perform the necessary checks.
25508
25509         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25510         interface.
25511
25512         (SimpleName.MemberStaticCheck): Include check for EventExpr.
25513
25514         (EventExpr): Set the type in the constructor itself since we 
25515         are meant to be born fully resolved.
25516
25517         (EventExpr.Define): Revert code I wrote earlier.
25518                 
25519         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25520         instance expression is null. The instance expression is a This in that case
25521         or a null, depending on whether it is a static method or not.
25522
25523         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25524         refers to more than one method.
25525
25526         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25527         and accordingly flag errors.
25528
25529 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25530
25531         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25532
25533 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25534
25535         * location.cs (ToString): Provide useful rutine.
25536
25537 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25538
25539         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25540         objects, return the actual integral boxed.
25541
25542         * statement.cs (SwitchLabel): define an ILLabel for each
25543         SwitchLabel. 
25544
25545         (Switch.CheckSwitch): If the value is a Literal, extract
25546         the underlying literal.
25547
25548         Also in the unused hashtable we had, add the SwitchLabel so we can
25549         quickly look this value up.
25550
25551         * constant.cs: Implement a bunch of new constants.  Rewrite
25552         Literal based on this.  Made changes everywhere to adapt to this.
25553
25554         * expression.cs (Expression.MakeByteBlob): Optimize routine by
25555         dereferencing array only once, and also copes with enumrations.
25556
25557         bytes are two bytes wide, not one.
25558
25559         (Cast): Perform constant conversions.
25560
25561         * ecore.cs (TryImplicitIntConversion): Return literals instead of
25562         wrappers to the literals here.
25563
25564         * expression.cs (DoNumericPromotions): long literals can converted
25565         to ulong implicity (this is taken care of elsewhere, but I was
25566         missing this spot).
25567
25568         * ecore.cs (Expression.Literalize): Make the return type Literal,
25569         to improve type checking.
25570
25571         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25572
25573 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25574
25575         * literal.cs: Revert code from ravi that checked the bounds.  The
25576         bounds are sane by the definition of the type itself. 
25577
25578         * typemanager.cs: Fix implementation of ImplementsInterface.  We
25579         need to actually look up in our parent hierarchy for interfaces
25580         implemented. 
25581
25582         * const.cs: Use the underlying type for enumerations
25583
25584         * delegate.cs: Compute the basename for the delegate creation,
25585         that should fix the delegate test case, and restore the correct
25586         Type Lookup semantics in rootcontext
25587
25588         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
25589         referencing a nested type with the Reflection API is using the "+"
25590         sign. 
25591
25592         * cs-parser.jay: Do not require EOF token at the end.
25593
25594 2001-12-20  Ravi Pratap  <ravi@ximian.com>
25595
25596         * rootcontext.cs (LookupType): Concatenate type names with
25597         a '.' instead of a '+' The test suite passes again.
25598
25599         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25600         field of the enumeration.
25601
25602         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25603         the case when the member is an EventExpr.
25604
25605         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25606         static has an associated instance expression.
25607
25608         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25609
25610         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25611
25612         * class.cs (Event.Define): Register event and perform appropriate checks
25613         for error #111.
25614
25615         We define the Add and Remove methods even if the use provides none because
25616         in that case, we provide default implementations ourselves.
25617
25618         Define a private field of the type of the event. This is done by the CSC compiler
25619         and we should be doing it too ;-)
25620
25621         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25622         More methods we use in code we generate.
25623
25624         (multicast_delegate_type, delegate_type): Two separate types since the distinction
25625         is important.
25626
25627         (InitCoreTypes): Update accordingly for the above.
25628
25629         * class.cs (Event.Emit): Generate code for default accessors that we provide
25630
25631         (EmitDefaultMethod): Do the job in the above.
25632
25633         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
25634         appropriate place.
25635
25636 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25637
25638         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25639         builders even if we were missing one.
25640
25641         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25642         pass the Basename as our class name instead of the Name.  The
25643         basename will be correctly composed for us.
25644
25645         * parameter.cs (Paramters): Now takes a Location argument.
25646
25647         * decl.cs (DeclSpace.LookupType): Removed convenience function and
25648         make all the code call directly LookupType in RootContext and take
25649         this chance to pass the Location information everywhere.
25650
25651         * Everywhere: pass Location information.
25652
25653 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
25654
25655         * class.cs (Constructor.Define): Updated way of detecting the
25656         length of the parameters.
25657
25658         (TypeContainer.DefineType): Use basename as the type name for
25659         nested types.
25660
25661         (TypeContainer.Define): Do not recursively define types here, as
25662         definition is taken care in order by the RootContext.
25663
25664         * tree.cs: Keep track of namespaces in a per-file basis.
25665
25666         * parameter.cs (Parameter.ComputeSignature): Update to use
25667         DeclSpace. 
25668
25669         (Parameters.GetSignature): ditto.
25670
25671         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25672         instead of a TypeContainer.
25673
25674         (Interface.SemanticAnalysis): Use `this' instead of our parent to
25675         resolve names.  Because we need to be resolve in our context, not
25676         our parents.
25677
25678         * driver.cs: Implement response files.
25679
25680         * class.cs (TypeContainer.DefineType): If we are defined, do not
25681         redefine ourselves.
25682
25683         (Event.Emit): Emit the code for add/remove handlers.
25684         (Event.Define): Save the MethodBuilders for add/remove.
25685
25686         * typemanager.cs: Use pair here too.
25687
25688         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25689         DictionaryEntry requires the first argument to be non-null.  
25690
25691         (enum_declaration): Compute full name for registering the
25692         enumeration.
25693
25694         (delegate_declaration): Instead of using
25695         formal_parameter_list, use opt_formal_parameter_list as the list
25696         can be empty.
25697
25698         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25699         (EventParsing): New property that controls whether `add' and
25700         `remove' are returned as tokens or identifiers (for events);
25701
25702 2001-12-19  Ravi Pratap  <ravi@ximian.com>
25703
25704         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25705         use MyEventBuilder only and let it wrap the real builder for us.
25706
25707         (MyEventBuilder): Revamp constructor etc.
25708
25709         Implement all operations that we perform on EventBuilder in precisely the same
25710         way here too.
25711
25712         (FindMembers): Update to use the EventBuilder member.
25713
25714         (Event.Emit): Update accordingly.
25715
25716 2001-12-18  Ravi Pratap  <ravi@ximian.com>
25717
25718         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25719         by calling the appropriate methods.
25720
25721         (GetCustomAttributes): Make stubs as they cannot possibly do anything
25722         useful.
25723
25724         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25725
25726 2001-12-17  Ravi Pratap  <ravi@ximian.com>
25727
25728         * delegate.cs (Delegate.Populate): Check that the return type
25729         and various parameters types are indeed accessible.
25730
25731         * class.cs (Constructor.Define): Same here.
25732
25733         (Field.Define): Ditto.
25734
25735         (Event.Define): Ditto.
25736
25737         (Operator.Define): Check that the underlying Method defined itself
25738         correctly - so it's MethodBuilder should not be null.
25739
25740         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25741         expression happens to be null.
25742
25743         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25744         members but as of now we don't seem to be able to do anything really useful with it.
25745
25746         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25747         not the EventBuilder.
25748
25749 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
25750
25751         * cs-tokenizer.cs: Add support for defines.
25752         Add support for #if, #elif, #else, #endif
25753
25754         (eval_var): evaluates a variable.
25755         (eval): stubbed for evaluating functions.
25756
25757         * cs-parser.jay: Pass the defines information
25758
25759         * driver.cs: Add --define command line option.
25760
25761         * decl.cs: Move MemberCore here.
25762
25763         Make it the base class for DeclSpace.  This allows us to catch and
25764         report 108 and 109 for everything now.
25765
25766         * class.cs (TypeContainer.Define): Extract all the members
25767         before populating and emit the warning 108 (new keyword required
25768         to override) instead of having each member implement this.
25769
25770         (MemberCore.Define): New abstract method, we will be using this in
25771         the warning reporting engine in Populate.
25772
25773         (Operator.Define): Adjust to new MemberCore protocol. 
25774
25775         * const.cs (Const): This does not derive from Expression, it is a
25776         temporary object we use to create fields, it is a MemberCore. 
25777
25778         * class.cs (Method.Define): Allow the entry point to be in a
25779         specific class.
25780
25781         * driver.cs: Rewrite the argument handler to clean it up a bit.
25782
25783         * rootcontext.cs: Made it just an auxiliary namespace feature by
25784         making everything static.
25785
25786         * driver.cs: Adapt code to use RootContext type name instead of
25787         instance variable.
25788
25789         * delegate.cs: Remove RootContext argument.
25790
25791         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25792         argument. 
25793
25794         * class.cs (Event.Define): The lookup can fail.
25795
25796         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
25797
25798         * expression.cs: Resolve the this instance before invoking the code.
25799
25800 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
25801
25802         * cs-parser.jay: Add a production in element_access that allows
25803         the thing to become a "type" reference.  This way we can parse
25804         things like "(string [])" as a type.
25805
25806         Note that this still does not handle the more complex rules of
25807         casts. 
25808
25809
25810         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
25811
25812         * ecore.cs: (CopyNewMethods): new utility function used to
25813         assemble the list of methods from running FindMembers.
25814
25815         (MemberLookup): Rework FindMembers so that 
25816
25817 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
25818
25819         * class.cs (TypeContainer): Remove Delegates who fail to be
25820         defined.
25821
25822         * delegate.cs (Populate): Verify that we dont get null return
25823         values.   TODO: Check for AsAccessible.
25824
25825         * cs-parser.jay: Use basename to emit error 574 (destructor should
25826         have the same name as container class), not the full name.
25827
25828         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25829         possible representation.  
25830
25831         Also implements integer type suffixes U and L.
25832
25833 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
25834
25835         * expression.cs (ArrayCreation.DoResolve): We need to do the
25836         argument resolution *always*.
25837
25838         * decl.cs: Make this hold the namespace.  Hold the root context as
25839         well.
25840         (LookupType): Move here.
25841
25842         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25843
25844         * location.cs (Row, Name): Fixed the code, it was always returning
25845         references to the first file.
25846
25847         * interface.cs: Register properties defined through interfaces.
25848
25849         * driver.cs: Add support for globbing on the command line
25850
25851         * class.cs (Field): Make it derive from MemberCore as well.
25852         (Event): ditto.
25853
25854 2001-12-15  Ravi Pratap  <ravi@ximian.com>
25855
25856         * class.cs (Event::Define): Check that the type of the event is a delegate
25857         type else flag error #66.
25858
25859         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25860         same.
25861
25862         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25863         values of EntryPoint, CharSet etc etc.
25864
25865         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25866
25867         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25868         be null and we should ignore this. I am not sure if this is really clean. Apparently,
25869         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25870         which needs this to do its work.
25871
25872         * ../errors/cs0066.cs : Add.
25873
25874 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
25875
25876         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25877         helper functions.
25878
25879         * class.cs: (MethodSignature.MethodSignature): Removed hack that
25880         clears out the parameters field.
25881         (MemberSignatureCompare): Cleanup
25882
25883         (MemberCore): New base class used to share code between MethodCore
25884         and Property.
25885
25886         (RegisterRequiredImplementations) BindingFlags.Public requires
25887         either BindingFlags.Instace or Static.  Use instance here.
25888
25889         (Property): Refactored code to cope better with the full spec.
25890
25891         * parameter.cs (GetParameterInfo): Return an empty array instead
25892         of null on error.
25893
25894         * class.cs (Property): Abstract or extern properties have no bodies.
25895
25896         * parameter.cs (GetParameterInfo): return a zero-sized array.
25897
25898         * class.cs (TypeContainer.MethodModifiersValid): Move all the
25899         method modifier validation to the typecontainer so we can reuse
25900         this on properties.
25901
25902         (MethodCore.ParameterTypes): return an empty sized array of types.
25903
25904         (Property.Define): Test property modifier validity.
25905
25906         Add tests for sealed/override too.
25907
25908         (Method.Emit): abstract or extern methods have no bodies.
25909
25910 2001-12-14  Ravi Pratap  <ravi@ximian.com>
25911
25912         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25913         thing.
25914
25915         (Method::Define, ::Emit): Modify accordingly.
25916
25917         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25918
25919         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25920
25921         * makefile: Pass in /unsafe.
25922
25923 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
25924
25925         * class.cs (MakeKey): Kill routine.
25926
25927         * class.cs (TypeContainer.Define): Correctly define explicit
25928         method implementations (they require the full interface name plus
25929         the method name).
25930
25931         * typemanager.cs: Deply the PtrHashtable here and stop using the
25932         lame keys.  Things work so much better.
25933
25934         This of course broke everyone who depended on `RegisterMethod' to
25935         do the `test for existance' test.  This has to be done elsewhere.
25936
25937         * support.cs (PtrHashtable): A hashtable that avoid comparing with
25938         the object stupid Equals method (because, that like fails all over
25939         the place).  We still do not use it.
25940
25941         * class.cs (TypeContainer.SetRequiredInterface,
25942         TypeContainer.RequireMethods): Killed these two routines and moved
25943         all the functionality to RegisterRequiredImplementations.
25944
25945         (TypeContainer.RegisterRequiredImplementations): This routine now
25946         registers all the implementations required in an array for the
25947         interfaces and abstract methods.  We use an array of structures
25948         which can be computed ahead of time to reduce memory usage and we
25949         also assume that lookups are cheap as most classes will not
25950         implement too many interfaces.
25951
25952         We also avoid creating too many MethodSignatures.
25953
25954         (TypeContainer.IsInterfaceMethod): Update and optionally does not
25955         clear the "pending" bit if we find that there are problems with
25956         the declaration.
25957
25958         (TypeContainer.VerifyPendingMethods): Update to report errors of
25959         methods that look like implementations but are not.
25960
25961         (TypeContainer.Define): Add support for explicit interface method
25962         implementation. 
25963
25964 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
25965
25966         * typemanager.cs: Keep track of the parameters here instead of
25967         being a feature of the TypeContainer.
25968
25969         * class.cs: Drop the registration of parameters here, as
25970         InterfaceMethods are also interface declarations.
25971
25972         * delegate.cs: Register methods with the TypeManager not only with
25973         the TypeContainer.  This code was buggy.
25974
25975         * interface.cs: Full registation here.
25976
25977 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
25978
25979         * expression.cs: Remove reducer for binary expressions, it can not
25980         be done this way.
25981
25982         * const.cs: Put here the code that used to go into constant.cs
25983
25984         * constant.cs: Put here the code for constants, this is a new base
25985         class for Literals.
25986
25987         * literal.cs: Make Literal derive from Constant.
25988
25989 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
25990
25991         * statement.cs (Return.Emit): Report error 157 if the user
25992         attempts to return from a finally block.
25993
25994         (Return.Emit): Instead of emitting a return, jump to the end of
25995         the function.
25996
25997         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
25998         LocalBuilder to store the result of the function.  ReturnLabel is
25999         the target where we jump.
26000
26001
26002 2001-12-09  Radek Doulik  <rodo@ximian.com>
26003
26004         * cs-parser.jay: remember alias in current namespace
26005
26006         * ecore.cs (SimpleName::DoResolve): use aliases for types or
26007         namespaces
26008
26009         * class.cs (LookupAlias): lookup alias in my_namespace
26010
26011         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
26012         aliases hashtable
26013         (LookupAlias): lookup alias in this and if needed in parent
26014         namespaces
26015
26016 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
26017
26018         * support.cs: 
26019
26020         * rootcontext.cs: (ModuleBuilder) Made static, first step into
26021         making things static.  I need this to avoid passing the
26022         TypeContainer when calling ParameterType.
26023
26024         * support.cs (InternalParameters.ParameterType): Remove ugly hack
26025         that did string manipulation to compute the type and then call
26026         GetType.  Use Parameter.ParameterType instead.
26027
26028         * cs-tokenizer.cs: Consume the suffix for floating values.
26029
26030         * expression.cs (ParameterReference): figure out whether this is a
26031         reference parameter or not.  Kill an extra variable by computing
26032         the arg_idx during emission.
26033
26034         * parameter.cs (Parameters.GetParameterInfo): New overloaded
26035         function that returns whether a parameter is an out/ref value or not.
26036
26037         (Parameter.ParameterType): The type of the parameter (base,
26038         without ref/out applied).
26039
26040         (Parameter.Resolve): Perform resolution here.
26041         (Parameter.ExternalType): The full type (with ref/out applied).
26042
26043         * statement.cs (Using.Emit, Using.EmitExpression): Implement
26044         support for expressions on the using statement.
26045
26046 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
26047
26048         * statement.cs (Using.EmitLocalVariableDecls): Split the
26049         localvariable handling of the using statement.
26050
26051         (Block.EmitMeta): Keep track of variable count across blocks.  We
26052         were reusing slots on separate branches of blocks.
26053
26054         (Try.Emit): Emit the general code block, we were not emitting it. 
26055
26056         Check the type of the declaration to be an IDisposable or
26057         something that can be implicity converted to it. 
26058
26059         Emit conversions if required.
26060
26061         * ecore.cs (EmptyExpression): New utility class.
26062         (Expression.ImplicitConversionExists): New utility function.
26063
26064 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
26065
26066         * statement.cs (Using): Implement.
26067
26068         * expression.cs (LocalVariableReference): Support read only variables.
26069
26070         * statement.cs: Remove the explicit emit for the Leave opcode.
26071         (VariableInfo): Add a readonly field.
26072
26073 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
26074
26075         * ecore.cs (ConvCast): new class used to encapsulate the various
26076         explicit integer conversions that works in both checked and
26077         unchecked contexts.
26078
26079         (Expression.ConvertNumericExplicit): Use new ConvCast class to
26080         properly generate the overflow opcodes.
26081
26082 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
26083
26084         * statement.cs: The correct type for the EmptyExpression is the
26085         element_type, not the variable type.  Ravi pointed this out.
26086
26087 2001-12-04  Ravi Pratap  <ravi@ximian.com>
26088
26089         * class.cs (Method::Define): Handle PInvoke methods specially
26090         by using DefinePInvokeMethod instead of the usual one.
26091
26092         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
26093         above to do the task of extracting information and defining the method.
26094
26095 2001-12-04  Ravi Pratap  <ravi@ximian.com>
26096
26097         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
26098         of the condition for string type.
26099
26100         (Emit): Move that here. 
26101
26102         (ArrayCreation::CheckIndices): Keep string literals in their expression
26103         form.
26104
26105         (EmitDynamicInitializers): Handle strings appropriately.
26106
26107 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
26108
26109         * codegen.cs (EmitContext): Replace multiple variables with a
26110         single pointer to the current Switch statement.
26111
26112         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
26113         EmitContext.
26114
26115 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
26116
26117         * statement.cs 
26118
26119         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
26120         default'.
26121
26122         (Foreach.Emit): Foreach on arrays was not setting
26123         up the loop variables (for break/continue).
26124
26125         (GotoCase): Semi-implented.
26126
26127 2001-12-03  Ravi Pratap  <ravi@ximian.com>
26128
26129         * attribute.cs (CheckAttribute): Handle system attributes by using
26130         Attribute.GetAttributes to examine information we need.
26131
26132         (GetValidPlaces): Same here.
26133
26134         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
26135
26136         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
26137
26138         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
26139
26140         (Method::Define): Set appropriate flags if we have a DllImport attribute.
26141
26142         (Method::Emit): Handle the case when we are a PInvoke method.
26143
26144 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
26145
26146         * expression.cs: Use ResolveWithSimpleName on compound names.
26147
26148 2001-12-02  Ravi Pratap  <ravi@ximian.com>
26149
26150         * constant.cs (EmitConstant): Make sure we resolve the associated expression
26151         before trying to reduce it.
26152
26153         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
26154
26155         * constant.cs (LookupConstantValue): Implement.
26156
26157         (EmitConstant): Use the above in emitting the constant.
26158
26159         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
26160         that are user-defined by doing a LookupConstantValue on them.
26161
26162         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
26163         too, like above.
26164
26165 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
26166
26167         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
26168
26169         (BaseAccess.DoResolve): Implement.
26170
26171         (MemberAccess.DoResolve): Split this routine into a
26172         ResolveMemberAccess routine that can be used independently
26173
26174 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
26175
26176         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
26177         As that share bits of the implementation.  Is returns a boolean,
26178         while As returns the Type that is being probed.
26179
26180 2001-12-01  Ravi Pratap  <ravi@ximian.com>
26181
26182         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
26183         instead of a Literal - much easier.
26184
26185         (EnumInTransit): Remove - utterly useless :-)
26186
26187         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
26188
26189         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
26190
26191         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
26192         chain when we have no associated expression.
26193
26194 2001-11-30  Ravi Pratap  <ravi@ximian.com>
26195
26196         * constant.cs (Define): Use Location while reporting the errror.
26197
26198         Also emit a warning when 'new' is used and there is no inherited
26199         member to hide.
26200
26201         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
26202         populated.
26203
26204         (LookupEnumValue): Implement to lookup an enum member's value and define it
26205         if necessary.
26206
26207         (Populate): Re-write accordingly to use the above routine.
26208
26209 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
26210
26211         * expression.cs (This): Fix prototype for DoResolveLValue to
26212         override the base class DoResolveLValue.
26213
26214         * cs-parser.cs: Report errors cs574 and cs575 (destructor
26215         declarations) 
26216
26217         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
26218         (we need to load the address of the field here).  This fixes
26219         test-22. 
26220
26221         (FieldExpr.DoResolveLValue): Call the DoResolve
26222         function to initialize the Instance expression.
26223
26224         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
26225         correctly the GetEnumerator operation on a value type.
26226
26227         * cs-parser.jay: Add more simple parsing error catches.
26228
26229         * statement.cs (Switch): Add support for string switches.
26230         Handle null specially.
26231
26232         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
26233
26234 2001-11-28  Ravi Pratap  <ravi@ximian.com>
26235
26236         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
26237
26238         (declare_local_constant): New helper function.
26239
26240         * statement.cs (AddConstant): Keep a separate record of constants
26241
26242         (IsConstant): Implement to determine if a variable is a constant.
26243
26244         (GetConstantExpression): Implement.
26245
26246         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
26247
26248         * statement.cs (IsVariableDefined): Re-write.
26249
26250 2001-11-27  Ravi Pratap  <ravi@ximian.com>
26251
26252         * class.cs (TypeContainer::FindMembers): Look for constants
26253         in the case when we are looking for MemberTypes.Field
26254
26255         * expression.cs (MemberAccess::DoResolve): Check that in the
26256         case we are a FieldExpr and a Literal, we are not being accessed
26257         by an instance reference.
26258
26259         * cs-parser.jay (local_constant_declaration): Implement.
26260
26261         (declaration_statement): Implement for constant declarations.
26262
26263 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
26264
26265         * statement.cs (Switch): Catch double defaults.
26266
26267         (Switch): More work on the switch() statement
26268         implementation.  It works for integral values now, need to finish
26269         string support.
26270
26271
26272 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
26273
26274         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
26275         integer literals into other integer literals.  To be used by
26276         switch. 
26277
26278 2001-11-24  Ravi Pratap  <ravi@ximian.com>
26279
26280         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
26281         some memory.
26282
26283         (EmitDynamicInitializers): Cope with the above since we extract data
26284         directly from ArrayData now.
26285
26286         (ExpectInitializers): Keep track of whether initializers are mandatory
26287         or not.
26288
26289         (Bounds): Make it a hashtable to prevent the same dimension being 
26290         recorded for every element in that dimension.
26291
26292         (EmitDynamicInitializers): Fix bug which prevented the Set array method
26293         from being found.
26294
26295         Also fix bug which was causing the indices to be emitted in the reverse
26296         order.
26297
26298 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
26299
26300         * expression.cs (ArrayCreation): Implement the bits that Ravi left
26301         unfinished.  They do not work, because the underlying code is
26302         sloppy.
26303
26304 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26305
26306         * cs-parser.jay: Remove bogus fixme.
26307
26308         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
26309         on Switch statement.
26310
26311 2001-11-23  Ravi Pratap  <ravi@ximian.com>
26312
26313         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26314         the same. 
26315
26316         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26317         parameter. Apparently, any expression is allowed. 
26318
26319         (ValidateInitializers): Update accordingly.
26320
26321         (CheckIndices): Fix some tricky bugs thanks to recursion.
26322
26323         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
26324         I was being completely brain-dead.
26325
26326         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26327         and re-write acordingly.
26328
26329         (DelegateInvocation): Re-write accordingly.
26330
26331         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26332
26333         (MakeByteBlob): Handle types more correctly.
26334
26335         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26336         initialization from expressions but it is incomplete because I am a complete
26337         Dodo :-|
26338
26339 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26340
26341         * statement.cs (If.Emit): Fix a bug that generated incorrect code
26342         on If.  Basically, we have to return `true' (ie, we do return to
26343         our caller) only if both branches of the if return.
26344
26345         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26346         short-circuit operators, handle them as short circuit operators. 
26347
26348         (Cast.DoResolve): Resolve type.
26349         (Cast.Cast): Take an expression as the target type.
26350
26351         * cs-parser.jay (cast_expression): Remove old hack that only
26352         allowed a limited set of types to be handled.  Now we take a
26353         unary_expression and we resolve to a type during semantic
26354         analysis.
26355
26356         Use the grammar productions from Rhys to handle casts (this is
26357         not complete like Rhys syntax yet, we fail to handle that corner
26358         case that C# has regarding (-x), but we will get there.
26359
26360 2001-11-22  Ravi Pratap  <ravi@ximian.com>
26361
26362         * class.cs (EmitFieldInitializer): Take care of the case when we have a
26363         field which is an array type.
26364
26365         * cs-parser.jay (declare_local_variables): Support array initialization too.
26366
26367         * typemanager.cs (MakeKey): Implement.
26368
26369         (everywhere): Use the above appropriately.
26370
26371         * cs-parser.jay (for_statement): Update for array initialization while
26372         declaring variables.
26373
26374         * ecore.cs : The error message was correct, it's the variable's names that
26375         were misleading ;-) Make the code more readable.
26376
26377         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26378         the correct type etc.
26379
26380         (ConvertExplicit): Handle Enum types by examining the underlying type.
26381
26382 2001-11-21  Ravi Pratap  <ravi@ximian.com>
26383
26384         * parameter.cs (GetCallingConvention): Always return
26385         CallingConventions.Standard for now.
26386
26387 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26388
26389         * expression.cs (Binary.ResolveOperator): Update the values of `l'
26390         and `r' after calling DoNumericPromotions.
26391
26392         * ecore.cs: Fix error message (the types were in the wrong order).
26393
26394         * statement.cs (Foreach.ProbeCollectionType): Need to pass
26395         BindingFlags.Instance as well 
26396
26397         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26398         implicit int literal conversion in an empty cast so that we
26399         propagate the right type upstream.
26400
26401         (UnboxCast): new class used to unbox value types.
26402         (Expression.ConvertExplicit): Add explicit type conversions done
26403         by unboxing.
26404
26405         (Expression.ImplicitNumericConversion): Oops, forgot to test for
26406         the target type before applying the implicit LongLiterals to ULong
26407         literal cast.
26408
26409 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
26410
26411         * cs-parser.jay (for_statement): Reworked the way For works: now
26412         we declare manually any variables that are introduced in
26413         for_initializer to solve the problem of having out-of-band code
26414         emition (that is what got for broken).
26415
26416         (declaration_statement): Perform the actual variable declaration
26417         that used to be done in local_variable_declaration here.
26418
26419         (local_variable_declaration): Do not declare anything, just pass
26420         the information on a DictionaryEntry
26421
26422 2001-11-20  Ravi Pratap  <ravi@ximian.com>
26423
26424         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26425         re-write of the logic to now make it recursive.
26426
26427         (UpdateIndices): Re-write accordingly.
26428
26429         Store element data in a separate ArrayData list in the above methods.
26430
26431         (MakeByteBlob): Implement to dump the array data into a byte array.
26432
26433 2001-11-19  Ravi Pratap  <ravi@ximian.com>
26434
26435         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26436         into CheckIndices.
26437
26438         * constant.cs (Define): Implement.
26439
26440         (EmitConstant): Re-write fully.
26441
26442         Pass in location info.
26443
26444         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26445         respectively.
26446
26447         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26448         DictionaryEntry since we need location info too.
26449
26450         (constant_declaration): Update accordingly.
26451
26452         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26453         code into another method : UpdateIndices.
26454
26455 2001-11-18  Ravi Pratap  <ravi@ximian.com>
26456
26457         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26458         some type checking etc.
26459
26460 2001-11-17  Ravi Pratap  <ravi@ximian.com>
26461
26462         * expression.cs (ArrayCreation::ValidateInitializers): Implement
26463         bits to provide dimension info if the user skips doing that.
26464
26465         Update second constructor to store the rank correctly.
26466
26467 2001-11-16  Ravi Pratap  <ravi@ximian.com>
26468
26469         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26470         and try to implement.
26471
26472         * ../errors/cs0150.cs : Add.
26473
26474         * ../errors/cs0178.cs : Add.
26475
26476 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
26477
26478         * statement.cs: Implement foreach on multi-dimensional arrays. 
26479
26480         * parameter.cs (Parameters.GetParameterByName): Also lookup the
26481         name of the params argument.
26482
26483         * expression.cs: Use EmitStoreOpcode to get the right opcode while
26484         initializing the array.
26485
26486         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26487         we can use this elsewhere.
26488
26489         * statement.cs: Finish implementation of foreach for single
26490         dimension arrays.
26491
26492         * cs-parser.jay: Use an out-of-band stack to pass information
26493         around, I wonder why I need this.
26494
26495         foreach_block: Make the new foreach_block the current_block.
26496
26497         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26498         function used to return a static Parameters structure.  Used for
26499         empty parameters, as those are created very frequently.
26500
26501         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26502
26503 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26504
26505         * interface.cs : Default modifier is private, not public. The
26506         make verify test passes again.
26507
26508 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26509
26510         * support.cs (ReflectionParameters): Fix logic to determine
26511         whether the last parameter is a params one. Test 9 passes again.
26512
26513         * delegate.cs (Populate): Register the builders we define with
26514         RegisterParameterForBuilder. Test 19 passes again.
26515
26516         * cs-parser.jay (property_declaration): Reference $6 instead
26517         of $$ to get at the location.
26518
26519         (indexer_declaration): Similar stuff.
26520
26521         (attribute): Ditto.
26522
26523         * class.cs (Property): Register parameters for the Get and Set methods
26524         if they exist. Test 23 passes again.
26525
26526         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26527         call to EmitArguments as we are sure there aren't any params arguments. 
26528         Test 32 passes again.
26529
26530         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26531         IndexOutOfRangeException. 
26532
26533         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26534         Test 33 now passes again.
26535
26536 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
26537
26538         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26539         broke a bunch of things.  Will have to come up with a better way
26540         of tracking locations.
26541
26542         * statement.cs: Implemented foreach for single dimension arrays.
26543
26544 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26545
26546         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26547         an error.  This removes the lookup from the critical path.
26548
26549         * cs-parser.jay: Removed use of temporary_loc, which is completely
26550         broken. 
26551
26552 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
26553
26554         * support.cs (ReflectionParameters.ParameterModifier): Report
26555         whether the argument is a PARAMS argument or not.
26556
26557         * class.cs: Set the attribute `ParamArrayAttribute' on the
26558         parameter argument.
26559
26560         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26561         and cons_param_array_attribute (ConstructorInfo for
26562         ParamArrayAttribute)., 
26563
26564         * codegen.cs: Emit the return using the `Return' statement, that
26565         way we can report the error correctly for missing return values. 
26566
26567         * class.cs (Method.Emit): Clean up.
26568
26569         * expression.cs (Argument.Resolve): Take another argument: the
26570         location where this argument is used.  Notice that this is not
26571         part of the "Argument" class as to reduce the size of the
26572         structure (we know the approximate location anyways).
26573
26574         Test if the argument is a variable-reference, if not, then
26575         complain with a 206.
26576
26577         (Argument.Emit): Emit addresses of variables.
26578
26579         (Argument.FullDesc): Simplify.
26580
26581         (Invocation.DoResolve): Update for Argument.Resolve.
26582
26583         (ElementAccess.DoResolve): ditto.
26584
26585         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26586         method should be virtual, as this method is always virtual.
26587
26588         (NewDelegate.DoResolve): Update for Argument.Resolve.
26589
26590         * class.cs (ConstructorInitializer.DoResolve): ditto.
26591
26592         * attribute.cs (Attribute.Resolve): ditto.
26593
26594 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
26595
26596         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26597
26598         * expression.cs (ParameterReference): Drop IStackStorage and implement
26599         IAssignMethod instead. 
26600
26601         (LocalVariableReference): ditto.
26602
26603         * ecore.cs (FieldExpr): Drop IStackStorage and implement
26604         IAssignMethod instead. 
26605
26606 2001-11-13  Miguel de Icaza <miguel@ximian.com>
26607
26608         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26609         enumerations that are used in heavily used structures derive from
26610         byte in a laughable and pathetic attempt to reduce memory usage.
26611         This is the kind of pre-optimzations that you should not do at
26612         home without adult supervision.
26613
26614         * expression.cs (UnaryMutator): New class, used to handle ++ and
26615         -- separatedly from the other unary operators.  Cleans up the
26616         code, and kills the ExpressionStatement dependency in Unary.
26617
26618         (Unary): Removed `method' and `Arguments' from this class, making
26619         it smaller, and moving it all to SimpleCall, so I can reuse this
26620         code in other locations and avoid creating a lot of transient data
26621         strucutres when not required.
26622
26623         * cs-parser.jay: Adjust for new changes.
26624
26625 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
26626
26627         * enum.cs (Enum.Populate): If there is a failure during
26628         definition, return
26629
26630         * cs-parser.jay (opt_enum_base): we used to catch type errors
26631         here, but this is really incorrect.  The type error should be
26632         catched during semantic analysis.
26633
26634 2001-12-11  Ravi Pratap  <ravi@ximian.com>
26635
26636         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26637         current_local_parameters as expected since I, in my stupidity, had forgotten
26638         to do this :-)
26639
26640         * attribute.cs (GetValidPlaces): Fix stupid bug.
26641
26642         * class.cs (Method::Emit): Perform check on applicability of attributes.
26643
26644         (Constructor::Emit): Ditto.
26645
26646         (Field::Emit): Ditto.
26647
26648         (Field.Location): Store location information.
26649
26650         (Property, Event, Indexer, Operator): Ditto.
26651
26652         * cs-parser.jay (field_declaration): Pass in location for each field.
26653
26654         * ../errors/cs0592.cs : Add.
26655
26656 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26657
26658         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26659
26660         (InitCoreTypes): Update accordingly.
26661
26662         (RegisterAttrType, LookupAttr): Implement.
26663
26664         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26665         info about the same.
26666
26667         (Resolve): Update to populate the above as necessary.
26668
26669         (Error592): Helper.
26670
26671         (GetValidPlaces): Helper to the above.
26672
26673         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26674
26675         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26676
26677 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26678
26679         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26680
26681         * ../errors/cs0617.cs : Add.
26682
26683 2001-11-11  Ravi Pratap  <ravi@ximian.com>
26684
26685         * enum.cs (Emit): Rename to Populate to be more consistent with what
26686         we expect it to do and when exactly it is called.
26687
26688         * class.cs, rootcontext.cs : Update accordingly.
26689
26690         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26691         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26692
26693         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26694
26695         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26696         of a fieldinfo using the above, when dealing with a FieldBuilder.
26697
26698 2001-11-10  Ravi Pratap  <ravi@ximian.com>
26699
26700         * ../errors/cs0031.cs : Add.
26701
26702         * ../errors/cs1008.cs : Add.
26703
26704         * ../errrors/cs0543.cs : Add.
26705
26706         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26707         enum type.
26708
26709         (FindMembers): Implement.
26710
26711         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26712         enums and delegates too.
26713
26714         (enum_types): Rename to builder_to_enum.
26715
26716         (delegate_types): Rename to builder_to_delegate.
26717
26718         * delegate.cs (FindMembers): Implement.
26719
26720 2001-11-09  Ravi Pratap  <ravi@ximian.com>
26721
26722         * typemanager.cs (IsEnumType): Implement.
26723
26724         * enum.cs (Emit): Re-write parts to account for the underlying type
26725         better and perform checking etc.
26726
26727         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26728         of the underlying type.
26729
26730         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26731         value
26732
26733         * enum.cs (error31): Helper to report error #31.
26734
26735         * cs-parser.jay (enum_declaration): Store location of each member too.
26736
26737         * enum.cs (member_to_location): New hashtable. 
26738
26739         (AddEnumMember): Update location hashtable.
26740
26741         (Emit): Use the location of each member while reporting errors.
26742
26743 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26744
26745         * cs-parser.jay: A for_initializer if is a
26746         local_variable_declaration really ammount to have an implicit
26747         block with the variable declaration and no initializer for for.
26748
26749         * statement.cs (For.Emit): Cope with null initializers.
26750
26751         This fixes the infinite loop on for initializers.
26752
26753 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
26754
26755         * enum.cs: More cleanup.
26756
26757         * ecore.cs: Remove dead code.
26758
26759         * class.cs (Property.Emit): More simplification.
26760         (Event.Emit): ditto.
26761
26762         Reworked to have less levels of indentation.
26763
26764 2001-11-08  Ravi Pratap  <ravi@ximian.com>
26765
26766         * class.cs (Property): Emit attributes.
26767
26768         (Field): Ditto.
26769
26770         (Event): Ditto.
26771
26772         (Indexer): Ditto.
26773
26774         (Operator): Ditto.
26775
26776         * enum.cs (Emit): Ditto.
26777
26778         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26779         Enums too.
26780
26781         * class.cs (Field, Event, etc.): Move attribute generation into the
26782         Emit method everywhere.
26783
26784         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26785         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26786         as we had no way of defining nested enums !
26787
26788         * rootcontext.cs : Adjust code accordingly.
26789
26790         * typemanager.cs (AddEnumType): To keep track of enum types separately.
26791
26792 2001-11-07  Ravi Pratap  <ravi@ximian.com>
26793
26794         * expression.cs (EvalConstantExpression): Move into ecore.cs
26795
26796         * enum.cs (Enum): Rename some members and make them public and readonly
26797         according to our convention.
26798
26799         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26800         nothing else.
26801
26802         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26803
26804         (Enum::Emit): Write a simple version for now which doesn't try to compute
26805         expressions. I shall modify this to be more robust in just a while.
26806
26807         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26808
26809         (TypeContainer::CloseType): Create the Enum types too.
26810
26811         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26812
26813         * expression.cs (EvalConstantExpression): Get rid of completely.
26814
26815         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26816         user-defined values and other cases.
26817
26818         (IsValidEnumLiteral): Helper function.
26819
26820         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
26821         out there in the case we had a literal FieldExpr.
26822
26823         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26824
26825         (Literalize): Revamp a bit to take two arguments.
26826
26827         (EnumLiteral): New class which derives from Literal to wrap enum literals.
26828
26829 2001-11-06  Ravi Pratap  <ravi@ximian.com>
26830
26831         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26832
26833         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26834
26835         (Resolve): Use the above to ensure we have proper initializers.
26836
26837 2001-11-05  Ravi Pratap  <ravi@ximian.com>
26838
26839         * expression.cs (Expression::EvalConstantExpression): New method to 
26840         evaluate constant expressions.
26841
26842         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26843
26844 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
26845
26846         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26847         in an array.
26848
26849         (Binary.ResolveOperator): Handle operator != (object a, object b)
26850         and operator == (object a, object b);
26851
26852         (Binary.DoNumericPromotions): Indicate whether the numeric
26853         promotion was possible.
26854
26855         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26856         Implement.  
26857
26858         Made the ArrayAccess implement interface IAssignMethod instead of
26859         IStackStore as the order in which arguments are passed reflects
26860         this.
26861
26862         * assign.cs: Instead of using expr.ExprClass to select the way of
26863         assinging, probe for the IStackStore/IAssignMethod interfaces.
26864
26865         * typemanager.cs: Load InitializeArray definition.
26866
26867         * rootcontext.cs (RootContext.MakeStaticData): Used to define
26868         static data that can be used to initialize arrays. 
26869
26870 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
26871
26872         * expression.cs: Handle operator== and operator!= for booleans.
26873
26874         (Conditioal.Reduce): Implement reducer for the ?: operator.
26875
26876         (Conditional.Resolve): Implement dead code elimination.
26877
26878         (Binary.Resolve): Catch string literals and return a new
26879         concatenated string.
26880
26881         (Unary.Reduce): Implement reduction of unary expressions.
26882
26883         * ecore.cs: Split out the expression core handling here.
26884
26885         (Expression.Reduce): New method used to perform constant folding
26886         and CSE.  This is needed to support constant-expressions. 
26887
26888         * statement.cs (Statement.EmitBoolExpression): Pass true and false
26889         targets, and optimize for !x.
26890
26891 2001-11-04  Ravi Pratap  <ravi@ximian.com>
26892
26893         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26894         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26895         set custom atttributes.
26896
26897         * literal.cs (Literal::GetValue): New abstract method to return the actual
26898         value of the literal, cast as an object.
26899
26900         (*Literal): Implement GetValue method.
26901
26902         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26903         expressions to the arraylist but objects of type Argument.
26904
26905         * class.cs (TypeContainer::Emit): Emit our attributes too.
26906
26907         (Method::Emit, Constructor::Emit): Ditto.
26908
26909         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26910         to be ignoring earlier.
26911
26912 2001-11-03  Ravi Pratap  <ravi@ximian.com>
26913
26914         * attribute.cs (AttributeSection::Define): Implement to do the business
26915         of constructing a CustomAttributeBuilder.
26916
26917         (Attribute): New trivial class. Increases readability of code.  
26918
26919         * cs-parser.jay : Update accordingly.
26920
26921         (positional_argument_list, named_argument_list, named_argument): New rules
26922
26923         (attribute_arguments): Use the above so that we are more correct.
26924
26925 2001-11-02  Ravi Pratap  <ravi@ximian.com>
26926
26927         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26928         to perform all checks for a method with a params parameter.
26929
26930         (Invocation::OverloadResolve): Update to use the above method and therefore
26931         cope correctly with params method invocations.
26932
26933         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
26934         params too.
26935
26936         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26937         constructors in our parent too because we can't afford to miss out on 
26938         protected ones ;-)
26939
26940         * attribute.cs (AttributeSection): New name for the class Attribute
26941
26942         Other trivial changes to improve readability.
26943
26944         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26945         use the new class names.
26946
26947 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26948
26949         * class.cs (Method::Define): Complete definition for params types too
26950
26951         (Indexer::Define): Ditto.
26952
26953         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26954         Cope everywhere with a request for info about the array parameter.
26955
26956 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26957
26958         * tree.cs (RecordNamespace): Fix up to check for the correct key.
26959
26960         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
26961         local_variable_type to extract the string corresponding to the type.
26962
26963         (local_variable_type): Fixup the action to use the new helper method.
26964
26965         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
26966         go.
26967
26968         * expression.cs : Clean out code which uses the above.
26969
26970 2001-10-31  Ravi Pratap  <ravi@ximian.com>
26971
26972         * typemanager.cs (RegisterMethod): Check if we already have an existing key
26973         and bale out if necessary by returning a false.
26974
26975         (RegisterProperty): Ditto.
26976
26977         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26978         and print out appropriate error messages.
26979
26980         * interface.cs (everywhere): Ditto.
26981
26982         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
26983         location to constructor.
26984
26985         * class.cs (Property, Event, Indexer): Update accordingly.
26986
26987         * ../errors/cs111.cs : Added.
26988
26989         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
26990         of a method, as laid down by the spec.
26991
26992         (Invocation::OverloadResolve): Use the above method.
26993
26994 2001-10-31  Ravi Pratap  <ravi@ximian.com>
26995
26996         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
26997         now take a TypeContainer and a Parameters object.
26998
26999         (ParameterData): Modify return type of ParameterModifier method to be 
27000         Parameter.Modifier and not a string.
27001
27002         (ReflectionParameters, InternalParameters): Update accordingly.
27003
27004         * expression.cs (Argument::GetParameterModifier): Same here.
27005
27006         * support.cs (InternalParameters::ParameterType): Find a better way of determining
27007         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
27008         symbol in it at all so maybe this is only for now.
27009
27010 2001-10-30  Ravi Pratap  <ravi@ximian.com>
27011
27012         * support.cs (InternalParameters): Constructor now takes an extra argument 
27013         which is the actual Parameters class.
27014
27015         (ParameterDesc): Update to provide info on ref/out modifiers.
27016
27017         * class.cs (everywhere): Update call to InternalParameters to pass in
27018         the second argument too.
27019
27020         * support.cs (ParameterData): Add ParameterModifier, which is a method 
27021         to return the modifier info [ref/out etc]
27022
27023         (InternalParameters, ReflectionParameters): Implement the above.
27024
27025         * expression.cs (Argument::ParameterModifier): Similar function to return
27026         info about the argument's modifiers.
27027
27028         (Invocation::OverloadResolve): Update to take into account matching modifiers 
27029         too.
27030
27031         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
27032         a new SetFormalParameters object which we pass to InternalParameters.
27033
27034 2001-10-30  Ravi Pratap  <ravi@ximian.com>
27035
27036         * expression.cs (NewArray): Merge into the ArrayCreation class.
27037
27038 2001-10-29  Ravi Pratap  <ravi@ximian.com>
27039
27040         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
27041         NewUserdefinedArray into one as there wasn't much of a use in having
27042         two separate ones.
27043
27044         * expression.cs (Argument): Change field's name to ArgType from Type.
27045
27046         (Type): New readonly property which returns the proper type, taking into 
27047         account ref/out modifiers.
27048
27049         (everywhere): Adjust code accordingly for the above.
27050
27051         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
27052         whether we are emitting for a ref or out parameter.
27053
27054         * expression.cs (Argument::Emit): Use the above field to set the state.
27055
27056         (LocalVariableReference::Emit): Update to honour the flag and emit the
27057         right stuff.
27058
27059         * parameter.cs (Attributes): Set the correct flags for ref parameters.
27060
27061         * expression.cs (Argument::FullDesc): New function to provide a full desc.
27062
27063         * support.cs (ParameterData): Add method ParameterDesc to the interface.
27064
27065         (ReflectionParameters, InternalParameters): Implement the above method.
27066
27067         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
27068         reporting errors.
27069
27070         (Invocation::FullMethodDesc): Ditto. 
27071
27072 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
27073
27074         * cs-parser.jay: Add extra production for the second form of array
27075         creation. 
27076
27077         * expression.cs (ArrayCreation): Update to reflect the above
27078         change. 
27079
27080         * Small changes to prepare for Array initialization.
27081
27082 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
27083
27084         * typemanager.cs (ImplementsInterface): interface might be null;
27085         Deal with this problem;
27086
27087         Also, we do store negative hits on the cache (null values), so use
27088         this instead of calling t.GetInterfaces on the type everytime.
27089
27090 2001-10-28  Ravi Pratap  <ravi@ximian.com>
27091
27092         * typemanager.cs (IsBuiltinType): New method to help determine the same.
27093
27094         * expression.cs (New::DoResolve): Get rid of array creation code and instead
27095         split functionality out into different classes.
27096
27097         (New::FormArrayType): Move into NewBuiltinArray.
27098
27099         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
27100         quite useless.
27101
27102         (NewBuiltinArray): New class to handle creation of built-in arrays.
27103
27104         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
27105         account creation of one-dimensional arrays.
27106
27107         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
27108
27109         (NewUserdefinedArray::DoResolve): Implement.
27110
27111         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
27112
27113         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
27114         we maintain inside the TypeManager. This is necessary to perform lookups on the
27115         module builder.
27116
27117         (LookupType): Update to perform GetType on the module builders too.     
27118
27119         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
27120
27121         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
27122
27123 2001-10-23  Ravi Pratap  <ravi@ximian.com>
27124
27125         * expression.cs (New::DoResolve): Implement guts of array creation.
27126
27127         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
27128
27129 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
27130
27131         * expression.cs: Fix bug I introduced lsat night that broke
27132         Delegates. 
27133
27134         (Expression.Resolve): Report a 246 error (can not resolve name)
27135         if we find a SimpleName in the stream.
27136
27137         (Expression.ResolveLValue): Ditto.
27138
27139         (Expression.ResolveWithSimpleName): This function is a variant of
27140         ResolveName, this one allows SimpleNames to be returned without a
27141         warning.  The only consumer of SimpleNames is MemberAccess
27142
27143 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
27144
27145         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
27146         might arrive here.  I have my doubts that this is correct.
27147
27148         * statement.cs (Lock): Implement lock statement.
27149
27150         * cs-parser.jay: Small fixes to support `lock' and `using'
27151
27152         * cs-tokenizer.cs: Remove extra space
27153
27154         * driver.cs: New flag --checked, allows to turn on integer math
27155         checking. 
27156
27157         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
27158         Threading.Monitor.Exit 
27159
27160 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
27161
27162         * expression.cs (IndexerAccess::DoResolveLValue): Set the
27163         Expression Class to be IndexerAccess.
27164
27165         Notice that Indexer::DoResolve sets the eclass to Value.
27166
27167 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
27168
27169         * class.cs (TypeContainer::Emit): Emit code for indexers.
27170
27171         * assign.cs (IAssignMethod): New interface implemented by Indexers
27172         and Properties for handling assignment.
27173
27174         (Assign::Emit): Simplify and reuse code. 
27175
27176         * expression.cs (IndexerAccess, PropertyExpr): Implement
27177         IAssignMethod, clean up old code. 
27178
27179 2001-10-22  Ravi Pratap  <ravi@ximian.com>
27180
27181         * typemanager.cs (ImplementsInterface): New method to determine if a type
27182         implements a given interface. Provides a nice cache too.
27183
27184         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
27185         method.
27186
27187         (ConvertReferenceExplicit): Ditto.
27188
27189         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
27190         various methods, with correct names etc.
27191
27192         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
27193         Operator.UnaryNegation.
27194
27195         * cs-parser.jay (operator_declarator): Be a little clever in the case where
27196         we have a unary plus or minus operator.
27197
27198         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
27199         UnaryMinus.
27200
27201         * everywhere : update accordingly.
27202
27203         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
27204         respectively.
27205
27206         * class.cs (Method::Define): For the case where we are implementing a method
27207         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
27208         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
27209
27210 2001-10-21  Ravi Pratap  <ravi@ximian.com>
27211
27212         * interface.cs (FindMembers): Implement to work around S.R.E
27213         lameness.
27214
27215         * typemanager.cs (IsInterfaceType): Implement.
27216
27217         (FindMembers): Update to handle interface types too.
27218
27219         * expression.cs (ImplicitReferenceConversion): Re-write bits which
27220         use IsAssignableFrom as that is not correct - it doesn't work.
27221
27222         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
27223         and accordingly override EmitStatement.
27224
27225         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
27226         using the correct logic :-)
27227
27228 2001-10-19  Ravi Pratap  <ravi@ximian.com>
27229
27230         * ../errors/cs-11.cs : Add to demonstrate error -11 
27231
27232 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
27233
27234         * assign.cs (Assign::Resolve): Resolve right hand side first, and
27235         then pass this as a hint to ResolveLValue.
27236
27237         * expression.cs (FieldExpr): Add Location information
27238
27239         (FieldExpr::LValueResolve): Report assignment to readonly
27240         variable. 
27241
27242         (Expression::ExprClassFromMemberInfo): Pass location information.
27243
27244         (Expression::ResolveLValue): Add new method that resolves an
27245         LValue. 
27246
27247         (Expression::DoResolveLValue): Default invocation calls
27248         DoResolve. 
27249
27250         (Indexers): New class used to keep track of indexers in a given
27251         Type. 
27252
27253         (IStackStore): Renamed from LValue, as it did not really describe
27254         what this did.  Also ResolveLValue is gone from this interface and
27255         now is part of Expression.
27256
27257         (ElementAccess): Depending on the element access type
27258
27259         * typemanager.cs: Add `indexer_name_type' as a Core type
27260         (System.Runtime.CompilerServices.IndexerNameAttribute)
27261
27262         * statement.cs (Goto): Take a location.
27263
27264 2001-10-18  Ravi Pratap  <ravi@ximian.com>
27265
27266         * delegate.cs (Delegate::VerifyDelegate): New method to verify
27267         if two delegates are compatible.
27268
27269         (NewDelegate::DoResolve): Update to take care of the case when
27270         we instantiate a delegate from another delegate.
27271
27272         * typemanager.cs (FindMembers): Don't even try to look up members
27273         of Delegate types for now.
27274
27275 2001-10-18  Ravi Pratap  <ravi@ximian.com>
27276
27277         * delegate.cs (NewDelegate): New class to take care of delegate
27278         instantiation.
27279
27280         * expression.cs (New): Split the delegate related code out into 
27281         the NewDelegate class.
27282
27283         * delegate.cs (DelegateInvocation): New class to handle delegate 
27284         invocation.
27285
27286         * expression.cs (Invocation): Split out delegate related code into
27287         the DelegateInvocation class.
27288
27289 2001-10-17  Ravi Pratap  <ravi@ximian.com>
27290
27291         * expression.cs (New::DoResolve): Implement delegate creation fully
27292         and according to the spec.
27293
27294         (New::DoEmit): Update to handle delegates differently.
27295
27296         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
27297         because of which we were printing out arguments in reverse order !
27298
27299         * delegate.cs (VerifyMethod): Implement to check if the given method
27300         matches the delegate.
27301
27302         (FullDelegateDesc): Implement.
27303
27304         (VerifyApplicability): Implement.
27305
27306         * expression.cs (Invocation::DoResolve): Update to accordingly handle
27307         delegate invocations too.
27308
27309         (Invocation::Emit): Ditto.
27310
27311         * ../errors/cs1593.cs : Added.
27312
27313         * ../errors/cs1594.cs : Added.
27314
27315         * delegate.cs (InstanceExpression, TargetMethod): New properties.
27316
27317 2001-10-16  Ravi Pratap  <ravi@ximian.com>
27318
27319         * typemanager.cs (intptr_type): Core type for System.IntPtr
27320
27321         (InitCoreTypes): Update for the same.
27322
27323         (iasyncresult_type, asynccallback_type): Ditto.
27324
27325         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27326         correct.
27327
27328         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27329         too.
27330
27331         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27332         the builders for the 4 members of a delegate type :-)
27333
27334         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27335         type.
27336
27337         * expression.cs (New::DoResolve): Implement guts for delegate creation.
27338
27339         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27340
27341 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
27342
27343         * statement.cs (Break::Emit): Implement.   
27344         (Continue::Emit): Implement.
27345
27346         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27347         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27348         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27349         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
27350         end loop
27351
27352         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27353         properties that track the label for the current loop (begin of the
27354         loop and end of the loop).
27355
27356 2001-10-15  Ravi Pratap  <ravi@ximian.com>
27357
27358         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27359         use of emitting anything at all.
27360
27361         * class.cs, rootcontext.cs : Get rid of calls to the same.
27362
27363         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27364
27365         (Populate): Define the constructor correctly and set the implementation
27366         attributes.
27367
27368         * typemanager.cs (delegate_types): New hashtable to hold delegates that
27369         have been defined.
27370
27371         (AddDelegateType): Implement.
27372
27373         (IsDelegateType): Implement helper method.
27374
27375         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27376
27377         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27378         and accordingly handle it.
27379
27380         * delegate.cs (Populate): Take TypeContainer argument.
27381         Implement bits to define the Invoke method. However, I still haven't figured out
27382         how to take care of the native int bit :-(
27383
27384         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
27385         Qualify the name of the delegate, not its return type !
27386
27387         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27388         conversion.
27389
27390         (StandardConversionExists): Checking for array types turns out to be recursive.
27391
27392         (ConvertReferenceExplicit): Implement array conversion.
27393
27394         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27395
27396 2001-10-12  Ravi Pratap  <ravi@ximian.com>
27397
27398         * cs-parser.jay (delegate_declaration): Store the fully qualified
27399         name as it is a type declaration.
27400
27401         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
27402         readonly.
27403
27404         (DefineDelegate): Renamed from Define. Does the same thing essentially,
27405         as TypeContainer::DefineType.
27406
27407         (Populate): Method in which all the definition of the various methods (Invoke)
27408         etc is done.
27409
27410         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27411         see.
27412
27413         (CloseDelegate): Finally creates the delegate.
27414
27415         * class.cs (TypeContainer::DefineType): Update to define delegates.
27416         (Populate, Emit and CloseType): Do the same thing here too.
27417
27418         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27419         delegates in all these operations.
27420
27421 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
27422
27423         * expression.cs: LocalTemporary: a new expression used to
27424         reference a temporary that has been created.
27425
27426         * assign.cs: Handle PropertyAccess back here, so that we can
27427         provide the proper semantic access to properties.
27428
27429         * expression.cs (Expression::ConvertReferenceExplicit): Implement
27430         a few more explicit conversions. 
27431
27432         * modifiers.cs: `NEW' modifier maps to HideBySig.
27433
27434         * expression.cs (PropertyExpr): Make this into an
27435         ExpressionStatement, and support the EmitStatement code path. 
27436
27437         Perform get/set error checking, clean up the interface.
27438
27439         * assign.cs: recognize PropertyExprs as targets, and if so, turn
27440         them into toplevel access objects.
27441
27442 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
27443
27444         * expression.cs: PropertyExpr::PropertyExpr: use work around the
27445         SRE.
27446
27447         * typemanager.cs: Keep track here of our PropertyBuilders again to
27448         work around lameness in SRE.
27449
27450 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
27451
27452         * expression.cs (LValue::LValueResolve): New method in the
27453         interface, used to perform a second resolution pass for LValues. 
27454
27455         (This::DoResolve): Catch the use of this in static methods.
27456
27457         (This::LValueResolve): Implement.
27458
27459         (This::Store): Remove warning, assigning to `this' in structures
27460         is 
27461
27462         (Invocation::Emit): Deal with invocation of
27463         methods on value types.  We need to pass the address to structure
27464         methods rather than the object itself.  (The equivalent code to
27465         emit "this" for structures leaves the entire structure on the
27466         stack instead of a pointer to it). 
27467
27468         (ParameterReference::DoResolve): Compute the real index for the
27469         argument based on whether the method takes or not a `this' pointer
27470         (ie, the method is static).
27471
27472         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27473         value types returned from functions when we need to invoke a
27474         method on the sturcture.
27475
27476
27477 2001-10-11  Ravi Pratap  <ravi@ximian.com>
27478
27479         * class.cs (TypeContainer::DefineType): Method to actually do the business of
27480         defining the type in the Modulebuilder or Typebuilder. This is to take
27481         care of nested types which need to be defined on the TypeBuilder using
27482         DefineNestedMethod.
27483
27484         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
27485         methods in RootContext, only ported to be part of TypeContainer.
27486
27487         (TypeContainer::GetInterfaceOrClass): Ditto.
27488
27489         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27490
27491         * interface.cs (Interface::DefineInterface): New method. Does exactly
27492         what RootContext.CreateInterface did earlier, only it takes care of nested types 
27493         too.
27494
27495         (Interface::GetInterfaces): Move from RootContext here and port.
27496
27497         (Interface::GetInterfaceByName): Same here.
27498
27499         * rootcontext.cs (ResolveTree): Re-write.
27500
27501         (PopulateTypes): Re-write.
27502
27503         * class.cs (TypeContainer::Populate): Populate nested types too.
27504         (TypeContainer::Emit): Emit nested members too.
27505
27506         * typemanager.cs (AddUserType): Do not make use of the FullName property,
27507         instead just use the name argument passed in as it is already fully
27508         qualified.
27509
27510         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27511         to TypeContainer mapping to see if a type is user-defined.
27512
27513         * class.cs (TypeContainer::CloseType): Implement. 
27514
27515         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27516         the default constructor.
27517
27518         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27519         twice.
27520
27521         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27522
27523         * interface.cs (CloseType): Create the type here.
27524
27525         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27526         the hierarchy.
27527
27528         Remove all the methods which are now in TypeContainer.
27529
27530 2001-10-10  Ravi Pratap  <ravi@ximian.com>
27531
27532         * delegate.cs (Define): Re-write bits to define the delegate
27533         correctly.
27534
27535 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
27536
27537         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27538
27539         * expression.cs (ImplicitReferenceConversion): handle null as well
27540         as a source to convert to any reference type.
27541
27542         * statement.cs (Return): Perform any implicit conversions to
27543         expected return type.  
27544
27545         Validate use of return statement.  
27546
27547         * codegen.cs (EmitContext): Pass the expected return type here.
27548
27549         * class.cs (Method, Constructor, Property): Pass expected return
27550         type to EmitContext.
27551
27552 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
27553
27554         * expression.cs: Make DoResolve take an EmitContext instead of a
27555         TypeContainer.
27556
27557         Replaced `l' and `location' for `loc', for consistency.
27558
27559         (Error, Warning): Remove unneeded Tc argument.
27560
27561         * assign.cs, literal.cs, constant.cs: Update to new calling
27562         convention. 
27563
27564         * codegen.cs: EmitContext now contains a flag indicating whether
27565         code is being generated in a static method or not.
27566
27567         * cs-parser.jay: DecomposeQI, new function that replaces the old
27568         QualifiedIdentifier.  Now we always decompose the assembled
27569         strings from qualified_identifier productions into a group of
27570         memberaccesses.
27571
27572 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
27573
27574         * rootcontext.cs: Deal with field-less struct types correctly now
27575         by passing the size option to Define Type.
27576
27577         * class.cs: Removed hack that created one static field. 
27578
27579 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27580
27581         * statement.cs: Moved most of the code generation here. 
27582
27583 2001-10-09  Ravi Pratap  <ravi@ximian.com>
27584
27585         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27586         seem very right.
27587
27588         (ElementAccess): Remove useless bits for now - keep checks as the spec
27589         says.
27590
27591 2001-10-08  Ravi Pratap  <ravi@ximian.com>
27592
27593         * expression.cs (ElementAccess::DoResolve): Remove my crap code
27594         and start performing checks according to the spec.
27595
27596 2001-10-07  Ravi Pratap  <ravi@ximian.com>
27597
27598         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27599         rank_specifiers instead.
27600
27601         (rank_specifiers): Change the order in which the rank specifiers are stored
27602
27603         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27604
27605         * expression.cs (ElementAccess): Implement the LValue interface too.
27606
27607 2001-10-06  Ravi Pratap  <ravi@ximian.com>
27608
27609         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27610         except that user defined conversions are not included.
27611
27612         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
27613         perform the conversion of the return type, if necessary.
27614
27615         (New::DoResolve): Check whether we are creating an array or an object
27616         and accordingly do the needful.
27617
27618         (New::Emit): Same here.
27619
27620         (New::DoResolve): Implement guts of array creation.
27621
27622         (New::FormLookupType): Helper function.
27623
27624 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27625
27626         * codegen.cs: Removed most of the code generation here, and move the
27627         corresponding code generation bits to the statement classes. 
27628
27629         Added support for try/catch/finalize and throw.
27630
27631         * cs-parser.jay: Added support for try/catch/finalize.
27632
27633         * class.cs: Catch static methods having the flags override,
27634         virtual or abstract.
27635
27636         * expression.cs (UserCast): This user cast was not really doing
27637         what it was supposed to do.  Which is to be born in fully resolved
27638         state.  Parts of the resolution were being performed at Emit time! 
27639
27640         Fixed this code.
27641
27642 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27643
27644         * expression.cs: Implicity convert the result from UserCast.
27645
27646 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27647
27648         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27649         prevented it from working correctly. 
27650
27651         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27652         merely ConvertImplicit.
27653
27654 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27655
27656         * typemanager.cs: Make the LookupTypeContainer function static,
27657         and not per-instance.  
27658
27659         * class.cs: Make static FindMembers (the one that takes a Type
27660         argument). 
27661
27662         * codegen.cs: Add EmitForeach here.
27663
27664         * cs-parser.jay: Make foreach a toplevel object instead of the
27665         inline expansion, as we need to perform semantic analysis on it. 
27666
27667 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27668
27669         * expression.cs (Expression::ImplicitUserConversion): Rename to
27670         UserDefinedConversion.
27671
27672         (Expression::UserDefinedConversion): Take an extra argument specifying 
27673         whether we look for explicit user conversions too.
27674
27675         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27676
27677         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27678
27679         (ExplicitUserConversion): Make it a call to UserDefinedConversion
27680         with the appropriate arguments.
27681
27682         * cs-parser.jay (cast_expression): Record location too.
27683
27684         * expression.cs (Cast): Record location info.
27685
27686         (Expression::ConvertExplicit): Take location argument.
27687
27688         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27689         to determine if we are doing explicit conversions.
27690
27691         (UserCast::Emit): Update accordingly.
27692
27693         (Expression::ConvertExplicit): Report an error if everything fails.
27694
27695         * ../errors/cs0030.cs : Add.
27696
27697 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
27698
27699         * modifiers.cs: If the ABSTRACT keyword is present, also set the
27700         virtual and newslot bits. 
27701
27702         * class.cs (TypeContainer::RegisterRequiredImplementations):
27703         Record methods we need.
27704
27705         (TypeContainer::MakeKey): Helper function to make keys for
27706         MethodBases, since the Methodbase key is useless.
27707
27708         (TypeContainer::Populate): Call RegisterRequiredImplementations
27709         before defining the methods.   
27710
27711         Create a mapping for method_builders_to_methods ahead of time
27712         instead of inside a tight loop.
27713
27714         (::RequireMethods):  Accept an object as the data to set into the
27715         hashtable so we can report interface vs abstract method mismatch.
27716
27717 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27718
27719         * report.cs: Make all of it static.
27720
27721         * rootcontext.cs: Drop object_type and value_type computations, as
27722         we have those in the TypeManager anyways.
27723
27724         Drop report instance variable too, now it is a global.
27725
27726         * driver.cs: Use try/catch on command line handling.
27727
27728         Add --probe option to debug the error reporting system with a test
27729         suite. 
27730
27731         * report.cs: Add support for exiting program when a probe
27732         condition is reached.
27733
27734 2001-10-03  Ravi Pratap  <ravi@ximian.com>
27735
27736         * expression.cs (Binary::DoNumericPromotions): Fix the case when
27737         we do a forcible conversion regardless of type, to check if 
27738         ForceConversion returns a null.
27739
27740         (Binary::error19): Use location to report error.
27741
27742         (Unary::error23): Use location here too.
27743
27744         * ../errors/cs0019.cs : Check in.
27745
27746         * ../errors/cs0023.cs : Check in.
27747
27748         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27749         case of a non-null MethodInfo object with a length of 0 !
27750
27751         (Binary::ResolveOperator): Flag error if overload resolution fails to find
27752         an applicable member - according to the spec :-)
27753         Also fix logic to find members in base types.
27754
27755         (Unary::ResolveOperator): Same here.
27756
27757         (Unary::report23): Change name to error23 and make first argument a TypeContainer
27758         as I was getting thoroughly confused between this and error19 :-)
27759
27760         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27761         (::FindMostEncompassedType): Implement.
27762         (::FindMostEncompassingType): Implement.
27763         (::StandardConversionExists): Implement.
27764
27765         (UserImplicitCast): Re-vamp. We now need info about most specific
27766         source and target types so that we can do the necessary conversions.
27767
27768         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27769         mathematical union with no duplicates.
27770
27771 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27772
27773         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27774         in order from base classes to child classes, so that we can in
27775         child classes look up in our parent for method names and
27776         attributes (required for handling abstract, virtual, new, override
27777         constructs: we need to instrospect our base class, and if we dont
27778         populate the classes in order, the introspection might be
27779         incorrect.  For example, a method could query its parent before
27780         the parent has any methods and would determine that the parent has
27781         no abstract methods (while it could have had them)).
27782
27783         (RootContext::CreateType): Record the order in which we define the
27784         classes.
27785
27786 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
27787
27788         * class.cs (TypeContainer::Populate): Also method definitions can
27789         fail now, keep track of this.
27790
27791         (TypeContainer::FindMembers): Implement support for
27792         DeclaredOnly/noDeclaredOnly flag.
27793
27794         (Constructor::Emit) Return the ConstructorBuilder.
27795
27796         (Method::Emit) Return the MethodBuilder. 
27797         Check for abstract or virtual methods to be public.
27798
27799         * rootcontext.cs (RootContext::CreateType): Register all the
27800         abstract methods required for the class to be complete and the
27801         interface methods that must be implemented. 
27802
27803         * cs-parser.jay: Report error 501 (method requires body if it is
27804         not marked abstract or extern).
27805
27806         * expression.cs (TypeOf::Emit): Implement.
27807
27808         * typemanager.cs: runtime_handle_type, new global type.
27809
27810         * class.cs (Property::Emit): Generate code for properties.
27811
27812 2001-10-02  Ravi Pratap  <ravi@ximian.com>
27813
27814         * expression.cs (Unary::ResolveOperator): Find operators on base type
27815         too - we now conform exactly to the spec.
27816
27817         (Binary::ResolveOperator): Same here.
27818
27819         * class.cs (Operator::Define): Fix minor quirk in the tests.
27820
27821         * ../errors/cs0215.cs : Added.
27822
27823         * ../errors/cs0556.cs : Added.
27824
27825         * ../errors/cs0555.cs : Added.
27826
27827 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27828
27829         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27830         single integer which is really efficient
27831
27832 2001-10-01  Ravi Pratap  <ravi@ximian.com>
27833
27834         *  expression.cs (Expression::ImplicitUserConversion): Use location
27835         even in the case when we are examining True operators.
27836  
27837         * class.cs (Operator::Define): Perform extensive checks to conform
27838         with the rules for operator overloading in the spec.
27839
27840         * expression.cs (Expression::ImplicitReferenceConversion): Implement
27841         some of the other conversions mentioned in the spec.
27842
27843         * typemanager.cs (array_type): New static member for the System.Array built-in
27844         type.
27845
27846         (cloneable_interface): For System.ICloneable interface.
27847
27848         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27849         we start resolving the tree and populating types.
27850
27851         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27852  
27853 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27854
27855         * expression.cs (Expression::ExprClassFromMemberInfo,
27856         Expression::Literalize): Create literal expressions from
27857         FieldInfos which are literals.
27858
27859         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27860         type casts, because they were wrong.  The test suite in tests
27861         caught these ones.
27862
27863         (ImplicitNumericConversion): ushort to ulong requires a widening
27864         cast. 
27865
27866         Int32 constant to long requires widening cast as well.
27867
27868         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27869         for integers because the type on the stack is not i4.
27870
27871 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
27872
27873         * expression.cs (report118): require location argument. 
27874
27875         * parameter.cs: Do not dereference potential null value.
27876
27877         * class.cs: Catch methods that lack the `new' keyword when
27878         overriding a name.  Report warnings when `new' is used without
27879         anything being there to override.
27880
27881         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27882
27883         * class.cs: Only add constructor to hashtable if it is non-null
27884         (as now constructors can fail on define).
27885
27886         (TypeManager, Class, Struct): Take location arguments.
27887
27888         Catch field instance initialization in structs as errors.
27889
27890         accepting_filter: a new filter for FindMembers that is static so
27891         that we dont create an instance per invocation.
27892
27893         (Constructor::Define): Catch errors where a struct constructor is
27894         parameterless 
27895
27896         * cs-parser.jay: Pass location information for various new
27897         constructs. 
27898
27899         * delegate.cs (Delegate): take a location argument.
27900
27901         * driver.cs: Do not call EmitCode if there were problesm in the
27902         Definition of the types, as many Builders wont be there. 
27903
27904         * decl.cs (Decl::Decl): Require a location argument.
27905
27906         * cs-tokenizer.cs: Handle properly hex constants that can not fit
27907         into integers, and find the most appropiate integer for it.
27908
27909         * literal.cs: Implement ULongLiteral.
27910
27911         * rootcontext.cs: Provide better information about the location of
27912         failure when CreateType fails.
27913
27914 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
27915
27916         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27917         as well.
27918
27919         * expression.cs (Binary::CheckShiftArguments): Add missing type
27920         computation.
27921         (Binary::ResolveOperator): Add type to the logical and and logical
27922         or, Bitwise And/Or and Exclusive Or code paths, it was missing
27923         before.
27924
27925         (Binary::DoNumericPromotions): In the case where either argument
27926         is ulong (and most signed types combined with ulong cause an
27927         error) perform implicit integer constant conversions as well.
27928
27929 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
27930
27931         * expression.cs (UserImplicitCast): Method should always be
27932         non-null. 
27933         (Invocation::BetterConversion): Simplified test for IntLiteral.
27934
27935         (Expression::ImplicitNumericConversion): Split this routine out.
27936         Put the code that performs implicit constant integer conversions
27937         here. 
27938
27939         (Expression::Resolve): Become a wrapper around DoResolve so we can
27940         check eclass and type being set after resolve.
27941
27942         (Invocation::Badness): Remove this dead function
27943
27944         (Binary::ResolveOperator): Do not compute the expensive argumnets
27945         unless we have a union for it.
27946
27947         (Probe::Emit): Is needs to do an isinst and then
27948         compare against null.
27949
27950         (::CanConvert): Added Location argument.  If the Location argument
27951         is null (Location.Null), then we do not report errors.  This is
27952         used by the `probe' mechanism of the Explicit conversion.  We do
27953         not want to generate an error for something that the user
27954         explicitly requested to be casted.  But the pipeline for an
27955         explicit cast first tests for potential implicit casts.
27956
27957         So for now, if the Location is null, it means `Probe only' to
27958         avoid adding another argument.   Might have to revise this
27959         strategy later.
27960
27961         (ClassCast): New class used to type cast objects into arbitrary
27962         classes (used in Explicit Reference Conversions).
27963
27964         Implement `as' as well.
27965
27966         Reverted all the patches from Ravi below: they were broken:
27967
27968                 * The use of `level' as a mechanism to stop recursive
27969                   invocations is wrong.  That was there just to catch the
27970                   bug with a strack trace but not as a way of addressing
27971                   the problem.
27972
27973                   To fix the problem we have to *understand* what is going
27974                   on and the interactions and come up with a plan, not
27975                   just get things going.
27976
27977                 * The use of the type conversion cache that I proposed
27978                   last night had an open topic: How does this work across
27979                   protection domains.  A user defined conversion might not
27980                   be public in the location where we are applying the
27981                   conversion, a different conversion might be selected
27982                   (ie, private A->B (better) but public B->A (worse),
27983                   inside A, A->B applies, but outside it, B->A will
27984                   apply).
27985
27986                 * On top of that (ie, even if the above is solved),
27987                   conversions in a cache need to be abstract.  Ie, `To
27988                   convert from an Int to a Short use an OpcodeCast', not
27989                   `To convert from an Int to a Short use the OpcodeCast on
27990                   the variable 5' (which is what this patch was doing).
27991
27992 2001-09-28  Ravi Pratap  <ravi@ximian.com>
27993
27994         * expression.cs (Invocation::ConversionExists): Re-write to use
27995         the conversion cache
27996
27997         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
27998         cache all conversions done, not just user-defined ones.
27999
28000         (Invocation::BetterConversion): The real culprit. Use ConversionExists
28001         to determine if a conversion exists instead of acutually trying to 
28002         perform the conversion. It's faster too.
28003
28004         (Expression::ConvertExplicit): Modify to use ConversionExists to check
28005         and only then attempt the implicit conversion.
28006
28007 2001-09-28  Ravi Pratap  <ravi@ximian.com>
28008
28009         * expression.cs (ConvertImplicit): Use a cache for conversions
28010         already found. Check level of recursion and bail out if necessary.
28011
28012 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
28013
28014         * typemanager.cs (string_concat_string_string, string_concat_object_object):
28015         Export standard methods that we expect for string operations.
28016
28017         * statement.cs (Block::UsageWarning): Track usage of variables and
28018         report the errors for not used variables.
28019
28020         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
28021         operator. 
28022
28023 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
28024
28025         * codegen.cs: remove unnneded code 
28026
28027         * expression.cs: Removed BuiltinTypeAccess class
28028
28029         Fix the order in which implicit conversions are
28030         done.  
28031
28032         The previous fixed dropped support for boxed conversions (adding a
28033         test to the test suite now)
28034
28035         (UserImplicitCast::CanConvert): Remove test for source being null,
28036         that code is broken.  We should not feed a null to begin with, if
28037         we do, then we should track the bug where the problem originates
28038         and not try to cover it up here.
28039
28040         Return a resolved expression of type UserImplicitCast on success
28041         rather than true/false.  Ravi: this is what I was talking about,
28042         the pattern is to use a static method as a "constructor" for
28043         objects. 
28044
28045         Also, do not create arguments until the very last minute,
28046         otherwise we always create the arguments even for lookups that
28047         will never be performed. 
28048
28049         (UserImplicitCast::Resolve): Eliminate, objects of type
28050         UserImplicitCast are born in a fully resolved state. 
28051
28052         * typemanager.cs (InitCoreTypes): Init also value_type
28053         (System.ValueType). 
28054
28055         * expression.cs (Cast::Resolve): First resolve the child expression.
28056
28057         (LValue): Add new method AddressOf to be used by
28058         the `&' operator.  
28059
28060         Change the argument of Store to take an EmitContext instead of an
28061         ILGenerator, because things like FieldExpr need to be able to call
28062         their children expression to generate the instance code. 
28063
28064         (Expression::Error, Expression::Warning): Sugar functions for
28065         reporting errors.
28066
28067         (Expression::MemberLookup): Accept a TypeContainer instead of a
28068         Report as the first argument.
28069
28070         (Expression::ResolvePrimary): Killed.  I still want to improve
28071         this as currently the code is just not right.
28072
28073         (Expression::ResolveMemberAccess): Simplify, but it is still
28074         wrong. 
28075
28076         (Unary::Resolve): Catch errors in AddressOf operators.
28077
28078         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
28079         index to a byte for the short-version, or the compiler will choose
28080         the wrong Emit call, which generates the wrong data.
28081
28082         (ParameterReference::Emit, ::Store): same.
28083
28084         (FieldExpr::AddressOf): Implement.
28085
28086         * typemanager.cs: TypeManager: made public variable instead of
28087         property.
28088
28089         * driver.cs: document --fatal.
28090
28091         * report.cs (ErrorMessage, WarningMessage): new names for the old
28092         Error and Warning classes.
28093
28094         * cs-parser.jay (member_access): Turn built-in access to types
28095         into a normal simplename
28096
28097 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28098
28099         * expression.cs (Invocation::BetterConversion): Fix to cope
28100         with q being null, since this was introducing a bug.
28101
28102         * expression.cs (ConvertImplicit): Do built-in conversions first.
28103
28104 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28105
28106         * expression.cs (UserImplicitCast::Resolve): Fix bug.
28107
28108 2001-09-27  Ravi Pratap  <ravi@ximian.com>
28109
28110         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
28111         I had introduced long ago (what's new ?).
28112
28113         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
28114         the work of all the checking. 
28115         (ConvertImplicit): Call CanConvert and only then create object if necessary.
28116         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
28117
28118         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
28119         that is the right way. 
28120
28121         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
28122         overloading resolution. Use everywhere instead of cutting and pasting code.
28123
28124         (Binary::ResolveOperator): Use MakeUnionSet.
28125
28126         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
28127         we have to convert to bool types. Not complete yet.
28128
28129 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
28130
28131         * typemanager.cs (TypeManager::CSharpName): support ushort.
28132
28133         * expression.cs (Expression::TryImplicitIntConversion): Attempts
28134         to provide an expression that performsn an implicit constant int
28135         conversion (section 6.1.6).
28136         (Expression::ConvertImplicitRequired): Reworked to include
28137         implicit constant expression conversions.
28138
28139         (Expression::ConvertNumericExplicit): Finished.
28140
28141         (Invocation::Emit): If InstanceExpression is null, then it means
28142         that we perform a call on this.
28143
28144 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
28145
28146         * expression.cs (Unary::Emit): Remove some dead code.
28147         (Probe): Implement Resolve and Emit for `is'.
28148         (Expression::ConvertImplicitRequired): Attempt to do constant
28149         expression conversions here.  Maybe should be moved to
28150         ConvertImplicit, but I am not sure.
28151         (Expression::ImplicitLongConstantConversionPossible,
28152         Expression::ImplicitIntConstantConversionPossible): New functions
28153         that tell whether is it possible to apply an implicit constant
28154         expression conversion.
28155
28156         (ConvertNumericExplicit): Started work on explicit numeric
28157         conversions.
28158
28159         * cs-parser.jay: Update operator constants.
28160
28161         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
28162         (Parameters::GetSignature): Hook up VerifyArgs here.
28163         (Parameters::VerifyArgs): Verifies that no two arguments have the
28164         same name. 
28165
28166         * class.cs (Operator): Update the operator names to reflect the
28167         ones that the spec expects (as we are just stringizing the
28168         operator names).
28169
28170         * expression.cs (Unary::ResolveOperator): Fix bug: Use
28171         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
28172         previous usage did only work for our methods.
28173         (Expression::ConvertImplicit): Handle decimal implicit numeric
28174         conversions as well.
28175         (Expression::InternalTypeConstructor): Used to invoke constructors
28176         on internal types for default promotions.
28177
28178         (Unary::Emit): Implement special handling for the pre/post
28179         increment/decrement for overloaded operators, as they need to have
28180         the same semantics as the other operators.
28181
28182         (Binary::ResolveOperator): ditto.
28183         (Invocation::ConversionExists): ditto.
28184         (UserImplicitCast::Resolve): ditto.
28185
28186 2001-09-26  Ravi Pratap  <ravi@ximian.com>
28187
28188         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
28189         operator, return after emitting body. Regression tests pass again !
28190
28191         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
28192         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
28193         (Invocation::OverloadResolve): Ditto.
28194         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
28195
28196         * everywhere : update calls to the above methods accordingly.
28197
28198 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
28199
28200         * assign.cs (Assign): Make it inherit from ExpressionStatement.
28201
28202         * expression.cs (ExpressionStatement): New base class used for
28203         expressions that can appear in statements, so that we can provide
28204         an alternate path to generate expression that do not leave a value
28205         on the stack.
28206
28207         (Expression::Emit, and all the derivatives): We no longer return
28208         whether a value is left on the stack or not.  Every expression
28209         after being emitted leaves a single value on the stack.
28210
28211         * codegen.cs (EmitContext::EmitStatementExpression): Use the
28212         facilties of ExpressionStatement if possible.
28213
28214         * cs-parser.jay: Update statement_expression.
28215
28216 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
28217
28218         * driver.cs: Change the wording of message
28219
28220 2001-09-25  Ravi Pratap  <ravi@ximian.com>
28221
28222         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
28223         the type of the expression to the return type of the method if
28224         we have an overloaded operator match ! The regression tests pass again !
28225         (Unary::ResolveOperator): Ditto.
28226
28227         * expression.cs (Invocation::ConversionExists): Correct the member lookup
28228         to find "op_Implicit", not "implicit" ;-)
28229         (UserImplicitCast): New class to take care of user-defined implicit conversions.
28230         (ConvertImplicit, ForceConversion): Take TypeContainer argument
28231
28232         * everywhere : Correct calls to the above accordingly.
28233
28234         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
28235         (ConvertImplicit): Do user-defined conversion if it exists.
28236
28237 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
28238
28239         * assign.cs: track location.
28240         (Resolve): Use implicit conversions on assignment.
28241
28242         * literal.cs: Oops.  Not good, Emit of short access values should
28243         pass (Bytes) or the wrong argument will be selected.
28244
28245         * expression.cs (Unary::Emit): Emit code for -expr.
28246
28247         (Unary::ResolveOperator): Handle `Substract' for non-constants
28248         (substract from zero from the non-constants).
28249         Deal with Doubles as well. 
28250
28251         (Expression::ConvertImplicitRequired): New routine that reports an
28252         error if no implicit conversion exists. 
28253
28254         (Invocation::OverloadResolve): Store the converted implicit
28255         expressions if we make them
28256
28257 2001-09-24  Ravi Pratap  <ravi@ximian.com>
28258
28259         * class.cs (ConstructorInitializer): Take a Location argument.
28260         (ConstructorBaseInitializer): Same here.
28261         (ConstructorThisInitializer): Same here.
28262
28263         * cs-parser.jay : Update all calls accordingly.
28264
28265         * expression.cs (Unary, Binary, New): Take location argument.
28266         Update accordingly everywhere.
28267
28268         * cs-parser.jay : Update all calls to the above to take a location
28269         argument.
28270
28271         * class.cs : Ditto.
28272
28273 2001-09-24  Ravi Pratap  <ravi@ximian.com>
28274
28275         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
28276         (Invocation::BetterConversion): Same here
28277         (Invocation::ConversionExists): Ditto.
28278
28279         (Invocation::ConversionExists): Implement.
28280
28281 2001-09-22  Ravi Pratap  <ravi@ximian.com>
28282
28283         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
28284         Also take an additional TypeContainer argument.
28285
28286         * All over : Pass in TypeContainer as argument to OverloadResolve.
28287
28288         * typemanager.cs (CSharpName): Update to check for the string type and return
28289         that too.
28290
28291         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
28292         a given method.
28293
28294 2001-09-21  Ravi Pratap  <ravi@ximian.com>
28295
28296         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
28297         (Invocation::BetterFunction): Implement.
28298         (Invocation::BetterConversion): Implement.
28299         (Invocation::ConversionExists): Skeleton, no implementation yet.
28300
28301         Okay, things work fine !
28302
28303 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
28304
28305         * typemanager.cs: declare and load enum_type, delegate_type and
28306         void_type. 
28307
28308         * expression.cs (Expression::Emit): Now emit returns a value that
28309         tells whether a value is left on the stack or not.  This strategy
28310         might be reveted tomorrow with a mechanism that would address
28311         multiple assignments.
28312         (Expression::report118): Utility routine to report mismatches on
28313         the ExprClass.
28314
28315         (Unary::Report23): Report impossible type/operator combination
28316         utility function.
28317
28318         (Unary::IsIncrementableNumber): Whether the type can be
28319         incremented or decremented with add.
28320         (Unary::ResolveOperator): Also allow enumerations to be bitwise
28321         complemented. 
28322         (Unary::ResolveOperator): Implement ++, !, ~,
28323
28324         (Invocation::Emit): Deal with new Emit convetion.
28325
28326         * All Expression derivatives: Updated their Emit method to return
28327         whether they leave values on the stack or not.
28328
28329         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28330         stack for expressions that are statements. 
28331
28332 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28333
28334         * expression.cs (LValue): New interface.  Must be implemented by
28335         LValue objects.
28336         (LocalVariableReference, ParameterReference, FieldExpr): Implement
28337         LValue interface.
28338
28339         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28340         interface for generating code, simplifies the code.
28341
28342 2001-09-20  Ravi Pratap  <ravi@ximian.com>
28343
28344         * expression.cs (everywhere): Comment out return statements in ::Resolve
28345         methods to avoid the warnings.
28346
28347 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28348
28349         * driver.cs (parse): Report error 2001 if we can not open the
28350         source file.
28351
28352         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28353         not resolve it.
28354
28355         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28356         object. 
28357
28358         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28359         otherwise nested blocks end up with the same index.
28360
28361         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28362
28363         * expression.cs:  Instead of having FIXMEs in the Resolve
28364         functions, throw exceptions so it is obvious that we are facing a
28365         bug. 
28366
28367         * cs-parser.jay (invocation_expression): Pass Location information.
28368
28369         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28370         Use a basename for those routines because .NET does not like paths
28371         on them. 
28372
28373         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28374         already defined.
28375
28376 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
28377
28378         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28379         are loading the correct data types (throws an exception if not).
28380         (TypeManager::InitCoreTypes): Use CoreLookupType
28381
28382         * expression.cs (Unary::ResolveOperator): return the child
28383         expression for expressions which are just +expr.
28384         (Unary::ResolveOperator): Return negative literals for -LITERAL
28385         expressions (otherwise they are Unary {Literal}).
28386         (Invocation::Badness): Take into account `Implicit constant
28387         expression conversions'.
28388
28389         * literal.cs (LongLiteral): Implement long literal class.
28390         (IntLiteral): export the `Value' of the intliteral. 
28391
28392 2001-09-19  Ravi Pratap  <ravi@ximian.com>
28393
28394         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28395
28396         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
28397         instead of 'Operator'
28398
28399         * expression.cs (Binary::ResolveOperator): Update accordingly.
28400         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28401         and 'Minus'
28402
28403         * cs-parser.jay (unary_expression): Update to use the new names.
28404
28405         * gen-treedump.cs (GetUnary): Same here.
28406
28407         * expression.cs (Unary::Resolve): Implement.
28408         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
28409         operators are found instead of making noise ;-)
28410         (Unary::ResolveOperator): New method to do precisely the same thing which
28411         Binary::ResolveOperator does for Binary expressions.
28412         (Unary.method, .Arguments): Add.
28413         (Unary::OperName): Implement.   
28414         (Unary::ForceConversion): Copy and Paste !
28415
28416         * class.cs (Operator::Define): Fix a small bug for the case when we have 
28417         a unary operator.
28418
28419         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28420         for the inbuilt operators. Only overloading works for now ;-)
28421
28422 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
28423
28424         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28425         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28426
28427         * expression.cs (This::Emit): Implement. 
28428         (This::Resolve): Implement.
28429         (TypeOf:Resolve): Implement.
28430         (Expression::ResolveSimpleName): Add an implicit this to instance
28431         field references. 
28432         (MemberAccess::Resolve): Deal with Parameters and Fields. 
28433         Bind instance variable to Field expressions.
28434         (FieldExpr::Instance): New field used to track the expression that
28435         represents the object instance.
28436         (FieldExpr::Resolve): Track potential errors from MemberLookup not
28437         binding 
28438         (FieldExpr::Emit): Implement.
28439
28440         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28441         the last instruction contains a return opcode to avoid generating
28442         the last `ret' instruction (this generates correct code, and it is
28443         nice to pass the peverify output).
28444
28445         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28446         initializer for static and instance variables.
28447         (Constructor::Emit): Allow initializer to be null in the case of
28448         static constructors.  Only emit initializer for instance
28449         constructors. 
28450
28451         (TypeContainer::FindMembers): Return a null array if there are no
28452         matches.
28453
28454         Also fix the code for the MemberTypes.Method branch, as it was not
28455         scanning that for operators (or tried to access null variables before).
28456
28457         * assign.cs (Assign::Emit): Handle instance and static fields. 
28458
28459         * TODO: Updated.
28460
28461         * driver.cs: Stop compilation if there are parse errors.
28462
28463         * cs-parser.jay (constructor_declaration): Provide default base
28464         initializer for non-static constructors.
28465         (constructor_declarator): Do not provide a default base
28466         initializers if none was specified.
28467         Catch the fact that constructors should not have parameters.
28468
28469         * class.cs: Do not emit parent class initializers for static
28470         constructors, that should be flagged as an error.
28471
28472 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28473
28474         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28475         Move back code into TypeContainer::Populate.
28476
28477 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28478
28479         * class.cs (TypeContainer::AddConstructor): Fix the check to
28480         compare against Name, not Basename. 
28481         (Operator::OpType): Change Plus and Minus to Add and Subtract.
28482
28483         * cs-parser.jay : Update accordingly.
28484
28485         * class.cs (TypeContainer::FindMembers): For the case where we are searching
28486         for methods, don't forget to look into the operators too.
28487         (RegisterMethodBuilder): Helper method to take care of this for
28488         methods, constructors and operators.
28489         (Operator::Define): Completely revamp.
28490         (Operator.OperatorMethod, MethodName): New fields.
28491         (TypeContainer::Populate): Move the registering of builders into
28492         RegisterMethodBuilder.
28493         (Operator::Emit): Re-write.
28494
28495         * expression.cs (Binary::Emit): Comment out code path to emit method
28496         invocation stuff for the case when we have a user defined operator. I am
28497         just not able to get it right !
28498
28499 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28500
28501         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28502         argument. 
28503
28504         (Expression::MemberLookup): Provide a version that allows to
28505         specify the MemberTypes and BindingFlags. 
28506
28507         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28508         so it was not fetching variable information from outer blocks.
28509
28510         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28511         Beforefieldinit as it was buggy.
28512
28513         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28514         that Ravi put here.  
28515
28516         * class.cs (Constructor::Emit): Only emit if block is not null.
28517         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28518         deal with this by semantically definining it as if the user had
28519         done it.
28520
28521         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28522         constructors as we now "emit" them at a higher level.
28523
28524         (TypeContainer::DefineDefaultConstructor): Used to define the
28525         default constructors if none was provided.
28526
28527         (ConstructorInitializer): Add methods Resolve and Emit. 
28528
28529         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28530
28531 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28532
28533         * class.cs (TypeContainer::EmitDefaultConstructor): Register
28534         the default constructor builder with our hashtable for methodbuilders
28535         to methodcores.
28536
28537         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28538         and argument_count is 0 in which case we have a match.
28539         (Binary::ResolveOperator): More null checking and miscellaneous coding
28540         style cleanup.
28541
28542 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28543
28544         * rootcontext.cs (IsNameSpace): Compare against null.
28545
28546         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28547
28548         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28549         and Unary::Operator.
28550
28551         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28552         accordingly.
28553
28554         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28555         we have overloaded operators.
28556         (Binary::ResolveOperator): Implement the part which does the operator overload
28557         resolution.
28558
28559         * class.cs (Operator::Emit): Implement.
28560         (TypeContainer::Emit): Emit the operators we have too.
28561
28562         * expression.cs (Binary::Emit): Update to emit the appropriate code for
28563         the case when we have a user-defined operator.
28564
28565 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28566
28567         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28568
28569 2001-09-16  Ravi Pratap  <ravi@ximian.com>
28570
28571         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28572         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28573         (Constructor::Emit): Implement.
28574         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28575         if we have no work to do. 
28576         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
28577         Emit method.
28578
28579         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28580         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28581
28582         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28583         of parent.parent.
28584
28585 2001-09-15  Ravi Pratap  <ravi@ximian.com>
28586
28587         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28588         in the source.
28589         (Tree::RecordNamespace): Method to do what the name says ;-)
28590         (Tree::Namespaces): Property to get at the namespaces hashtable.
28591
28592         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
28593         keep track.
28594
28595         * rootcontext.cs (IsNamespace): Fixed it :-)
28596
28597 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28598
28599         * class.cs (TypeContainer::FindMembers): Add support for
28600         constructors. 
28601         (MethodCore): New class that encapsulates both the shared aspects
28602         of a Constructor and a Method.  
28603         (Method, Constructor): Factored pieces into MethodCore.
28604
28605         * driver.cs: Added --fatal which makes errors throw exceptions.
28606         Load System assembly as well as part of the standard library.
28607
28608         * report.cs: Allow throwing exceptions on errors for debugging.
28609
28610         * modifiers.cs: Do not use `parent', instead use the real type
28611         container to evaluate permission settings.
28612
28613         * class.cs: Put Ravi's patch back in.  He is right, and we will
28614         have to cope with the
28615
28616 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28617
28618         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28619         FamORAssem, not FamANDAssem.
28620
28621 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28622
28623         * driver.cs: Added --parse option that only parses its input files
28624         and terminates.
28625
28626         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
28627         incorrect.  IsTopLevel is not used to tell whether an object is
28628         root_types or not (that can be achieved by testing this ==
28629         root_types).  But to see if this is a top-level *class* (not
28630         necessarly our "toplevel" container). 
28631
28632 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28633
28634         * enum.cs (Enum::Define): Modify to call the Lookup method on the
28635         parent instead of a direct call to GetType.
28636
28637 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28638
28639         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28640         Modifiers.TypeAttr. This should just be a call to that method.
28641
28642         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28643         object so that we can determine if we are top-level or not.
28644
28645         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
28646         TypeContainer too.
28647
28648         * enum.cs (Enum::Define): Ditto.
28649
28650         * modifiers.cs (FieldAttr): Re-write.
28651
28652         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28653         (TypeContainer::HaveStaticConstructor): New property to provide access
28654         to precisely that info.
28655
28656         * modifiers.cs (MethodAttr): Re-write.
28657         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28658
28659         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28660         of top-level types as claimed.
28661
28662 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28663
28664         * expression.cs (MemberLookup): Fruitless attempt to lookup
28665         constructors.  Maybe I need to emit default constructors?  That
28666         might be it (currently .NET emits this for me automatically).
28667         (Invocation::OverloadResolve): Cope with Arguments == null.
28668         (Invocation::EmitArguments): new function, shared by the new
28669         constructor and us.
28670         (Invocation::Emit): Handle static and instance methods.  Emit
28671         proper call instruction for virtual or non-virtual invocations.
28672         (New::Emit): Implement.
28673         (New::Resolve): Implement.
28674         (MemberAccess:Resolve): Implement.
28675         (MethodGroupExpr::InstanceExpression): used conforming to the spec
28676         to track instances.
28677         (FieldExpr::Resolve): Set type.
28678
28679         * support.cs: Handle empty arguments.
28680                 
28681         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28682         SimpleLookup): Auxiliary routines to help parse a qualifier
28683         identifier.  
28684
28685         Update qualifier_identifier rule.
28686
28687         * codegen.cs: Removed debugging messages.
28688
28689         * class.cs: Make this a global thing, this acts just as a "key" to
28690         objects that we might have around.
28691
28692         (Populate): Only initialize method_builders_to_methods once.
28693
28694         * expression.cs (PropertyExpr): Initialize type from the
28695         PropertyType. 
28696
28697         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28698         Resolve pattern.  Attempt to implicitly convert value to boolean.
28699         Emit code.
28700
28701         * expression.cs: Set the type for the int32/int32 argument case.
28702         (Binary::ResolveOperator): Set the return type to boolean for
28703         comparission operators
28704
28705         * typemanager.cs: Remove debugging print code.
28706
28707         (Invocation::Resolve): resolve type.
28708
28709         * class.cs: Allocate a MemberInfo of the correct size, as the code
28710         elsewhere depends on the test to reflect the correct contents.
28711
28712         (Method::) Keep track of parameters, due to System.Reflection holes
28713
28714         (TypeContainer::Populate): Keep track of MethodBuilders to Method
28715         mapping here.
28716
28717         (TypeContainer::FindMembers): Use ArrayList and then copy an array
28718         of the exact size and return that.
28719
28720         (Class::LookupMethodByBuilder): New function that maps
28721         MethodBuilders to its methods.  Required to locate the information
28722         on methods because System.Reflection bit us again.
28723
28724         * support.cs: New file, contains an interface ParameterData and
28725         two implementations: ReflectionParameters and InternalParameters
28726         used to access Parameter information.  We will need to grow this
28727         as required.
28728
28729         * expression.cs (Invocation::GetParameterData): implement a cache
28730         and a wrapper around the ParameterData creation for methods. 
28731         (Invocation::OverloadResolve): Use new code.
28732
28733 2001-09-13  Ravi Pratap  <ravi@ximian.com>
28734
28735         * class.cs (TypeContainer::EmitField): Remove and move into 
28736         (Field::Define): here and modify accordingly.
28737         (Field.FieldBuilder): New member.
28738         (TypeContainer::Populate): Update accordingly.
28739         (TypeContainer::FindMembers): Implement.
28740
28741 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28742
28743         * statement.cs: (VariableInfo::VariableType): New field to be
28744         initialized with the full type once it is resolved. 
28745
28746 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
28747
28748         * parameter.cs (GetParameterInfo): Use a type cache to compute
28749         things only once, and to reuse this information
28750
28751         * expression.cs (LocalVariableReference::Emit): Implement.
28752         (OpcodeCast::Emit): fix.
28753
28754         (ParameterReference::Resolve): Implement.
28755         (ParameterReference::Emit): Implement.
28756
28757         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28758         that are expressions need to stay as Expressions.
28759
28760         * typemanager.cs (CSharpName): Returns the C# name of a type if
28761         possible. 
28762
28763         * expression.cs (Expression::ConvertImplicit): New function that
28764         implements implicit type conversions.
28765
28766         (Expression::ImplicitReferenceConversion): Implements implicit
28767         reference conversions.
28768
28769         (EmptyCast): New type for transparent casts.
28770
28771         (OpcodeCast): New type for casts of types that are performed with
28772         a sequence of bytecodes.
28773
28774         (BoxedCast): New type used for casting value types into reference
28775         types.  Emits a box opcode.
28776
28777         (Binary::DoNumericPromotions): Implements numeric promotions of
28778         and computation of the Binary::Type.
28779
28780         (Binary::EmitBranchable): Optimization.
28781
28782         (Binary::Emit): Implement code emission for expressions.
28783
28784         * typemanager.cs (TypeManager): Added two new core types: sbyte
28785         and byte.
28786
28787 2001-09-12  Ravi Pratap  <ravi@ximian.com>
28788
28789         * class.cs (TypeContainer::FindMembers): Method which does exactly
28790         what Type.FindMembers does, only we don't have to use reflection. No
28791         implementation yet.
28792
28793         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28794         typecontainer objects as we need to get at them.
28795         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28796
28797         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28798         typecontainer object.
28799
28800         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28801         of just a Report object.
28802
28803 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28804
28805         * class.cs (Event::Define): Go back to using the prefixes "add_" and
28806         "remove_"
28807         (TypeContainer::Populate): Now define the delegates of the type too.
28808         (TypeContainer.Delegates): Property to access the list of delegates defined
28809         in the type.
28810
28811         * delegates.cs (Delegate::Define): Implement partially.
28812
28813         * modifiers.cs (TypeAttr): Handle more flags.
28814
28815 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28816
28817         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28818         and not <=
28819         (Operator::Define): Re-write logic to get types by using the LookupType method
28820         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28821         (Indexer::Define): Ditto.
28822         (Event::Define): Ditto.
28823         (Property::Define): Ditto.
28824
28825 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28826
28827         * class.cs (TypeContainer::Populate): Now define operators too. 
28828         (TypeContainer.Operators): New property to access the list of operators
28829         in a type.
28830         (Operator.OperatorMethodBuilder): New member to hold the method builder
28831         for the operator we are defining.
28832         (Operator::Define): Implement.
28833
28834 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28835
28836         * class.cs (Event::Define): Make the prefixes of the accessor methods
28837         addOn_ and removeOn_ 
28838
28839         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28840         of the location being passed in too. Ideally, this should go later since all
28841         error reporting should be done through the Report object.
28842
28843         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28844         (Populate): Iterate thru the indexers we have and define them too.
28845         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28846         for the get and set accessors.
28847         (Indexer::Define): Implement.
28848
28849 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
28850
28851         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
28852         my previous implementation, did not work.
28853
28854         * typemanager.cs: Add a couple of missing types (the longs).
28855
28856         * literal.cs: Use TypeManager.bool_type instead of getting it.
28857
28858         * expression.cs (EventExpr): New kind of expressions.
28859         (Expressio::ExprClassFromMemberInfo): finish
28860
28861 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
28862
28863         * assign.cs: Emit stores to static fields differently.
28864
28865 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28866
28867         * Merge in changes and adjust code to tackle conflicts. Backed out my
28868         code in Assign::Resolve ;-) 
28869
28870 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28871
28872         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28873         instead Report.Error and also pass in the location.
28874         (CSharpParser::Lexer): New readonly property to return the reference
28875         to the Tokenizer object.
28876         (declare_local_variables): Use Report.Error with location instead of plain 
28877         old error.
28878         (CheckDef): Ditto.
28879
28880         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28881         (Operator.CheckBinaryOperator): Ditto.
28882
28883         * cs-parser.jay (operator_declarator): Update accordingly.
28884
28885         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28886         (CheckBinaryOperator): Same here.
28887
28888         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28889         on the name without any prefixes of namespace names etc. This is because we
28890         already might have something already fully qualified like 
28891         'System.Console.WriteLine'
28892
28893         * assign.cs (Resolve): Begin implementation. Stuck ;-)
28894
28895 2001-09-07  Ravi Pratap  <ravi@ximian.com>
28896
28897         * cs-tokenizer.cs (location): Return a string which also contains
28898         the file name.
28899
28900         * expression.cs (ElementAccess): New class for expressions of the
28901         type 'element access.'
28902         (BaseAccess): New class for expressions of the type 'base access.'
28903         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28904         respectively.
28905
28906         * cs-parser.jay (element_access): Implement action.
28907         (base_access): Implement actions.
28908         (checked_expression, unchecked_expression): Implement.
28909
28910         * cs-parser.jay (local_variable_type): Correct and implement.
28911         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28912
28913         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28914
28915         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28916         name and the specifiers.
28917
28918         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28919
28920         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
28921         making them all public ;-)
28922
28923         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28924         class anyways.
28925
28926 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
28927
28928         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28929         PropertyExprs.
28930         (FieldExpr, PropertyExprs): New resolved expressions.
28931         (SimpleName::MemberStaticCheck): Perform static checks for access
28932         to non-static fields on static methods. Maybe this should be
28933         generalized for MemberAccesses. 
28934         (SimpleName::ResolveSimpleName): More work on simple name
28935         resolution. 
28936
28937         * cs-parser.jay (primary_expression/qualified_identifier): track
28938         the parameter index.
28939
28940         * codegen.cs (CodeGen::Save): Catch save exception, report error.
28941         (EmitContext::EmitBoolExpression): Chain to expression generation
28942         instead of temporary hack.
28943         (::EmitStatementExpression): Put generic expression code generation.
28944
28945         * assign.cs (Assign::Emit): Implement variable assignments to
28946         local variables, parameters and fields.
28947
28948 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
28949
28950         * statement.cs (Block::GetVariableInfo): New method, returns the
28951         VariableInfo for a variable name in a block.
28952         (Block::GetVariableType): Implement in terms of GetVariableInfo
28953
28954         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28955         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28956
28957 2001-09-06  Ravi Pratap  <ravi@ximian.com>
28958
28959         * cs-parser.jay (operator_declaration): Continue on my quest : update
28960         to take attributes argument.
28961         (event_declaration): Ditto.
28962         (enum_declaration): Ditto.
28963         (indexer_declaration): Ditto.
28964
28965         * class.cs (Operator::Operator): Update constructor accordingly.
28966         (Event::Event): Ditto.
28967
28968         * delegate.cs (Delegate::Delegate): Same here.
28969
28970         * enum.cs (Enum::Enum): Same here.
28971
28972 2001-09-05  Ravi Pratap  <ravi@ximian.com>
28973
28974         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28975
28976         * ../tests/cs0658.cs : New file to demonstrate error 0658.
28977
28978         * attribute.cs (Attributes): New class to encapsulate all attributes which were
28979         being passed around as an arraylist.
28980         (Attributes::AddAttribute): Method to add attribute sections.
28981
28982         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
28983         (struct_declaration): Update accordingly.
28984         (constant_declaration): Update.
28985         (field_declaration): Update.
28986         (method_header): Update.
28987         (fixed_parameter): Update.
28988         (parameter_array): Ditto.
28989         (property_declaration): Ditto.
28990         (destructor_declaration): Ditto.
28991
28992         * class.cs (Struct::Struct): Update constructors accordingly.
28993         (Class::Class): Ditto.
28994         (Field::Field): Ditto.
28995         (Method::Method): Ditto.
28996         (Property::Property): Ditto.
28997         (TypeContainer::OptAttribute): update property's return type.
28998
28999         * interface.cs (Interface.opt_attributes): New member.
29000         (Interface::Interface): Update to take the extra Attributes argument.
29001
29002         * parameter.cs (Parameter::Parameter): Ditto.
29003
29004         * constant.cs (Constant::Constant): Ditto.
29005
29006         * interface.cs (InterfaceMemberBase): New OptAttributes field.
29007         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
29008         the attributes as a parameter.
29009         (InterfaceProperty): Update constructor call.
29010         (InterfaceEvent): Ditto.
29011         (InterfaceMethod): Ditto.
29012         (InterfaceIndexer): Ditto.
29013
29014         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
29015         pass the attributes too.
29016         (interface_event_declaration): Ditto.
29017         (interface_property_declaration): Ditto.
29018         (interface_method_declaration): Ditto.
29019         (interface_declaration): Ditto.
29020
29021 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
29022
29023         * class.cs (Method::Define): Track the "static Main" definition to
29024         create an entry point. 
29025
29026         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
29027         EntryPoint if we find it. 
29028
29029         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
29030         (EmitContext::ig): Make this variable public.
29031
29032         * driver.cs: Make the default output file be the first file name
29033         with the .exe extension.  
29034
29035         Detect empty compilations
29036
29037         Handle various kinds of output targets.  Handle --target and
29038         rename -t to --dumper.
29039
29040         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
29041         methods inherited from Expression return now an Expression.  This
29042         will is used during the tree rewriting as we resolve them during
29043         semantic analysis.
29044
29045         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
29046         the spec.  Missing entirely is the information about
29047         accessability of elements of it.
29048
29049         (Expression::ExprClassFromMemberInfo): New constructor for
29050         Expressions that creates a fully initialized Expression based on
29051         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
29052         a Type.
29053
29054         (Invocation::Resolve): Begin implementing resolution of invocations.
29055
29056         * literal.cs (StringLiteral):  Implement Emit.
29057
29058 2001-09-05  Ravi Pratap  <ravi@ximian.com>
29059
29060         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
29061         member.
29062
29063 2001-09-04  Ravi Pratap  <ravi@ximian.com>
29064
29065         * cs-parser.jay (attribute_arguments): Implement actions.
29066         (attribute): Fix bug in production. Implement action.
29067         (attribute_list): Implement.
29068         (attribute_target): Implement.
29069         (attribute_target_specifier, opt_target_specifier): Implement
29070         (CheckAttributeTarget): New method to check if the attribute target
29071         is valid.
29072         (attribute_section): Implement.
29073         (opt_attributes): Implement.
29074
29075         * attribute.cs : New file to handle attributes.
29076         (Attribute): Class to hold attribute info.
29077
29078         * cs-parser.jay (opt_attribute_target_specifier): Remove production
29079         (attribute_section): Modify production to use 2 different rules to 
29080         achieve the same thing. 1 s/r conflict down !
29081         Clean out commented, useless, non-reducing dimension_separator rules.
29082
29083         * class.cs (TypeContainer.attributes): New member to hold list
29084         of attributes for a type.
29085         (Struct::Struct): Modify to take one more argument, the attribute list.
29086         (Class::Class): Ditto.
29087         (Field::Field): Ditto.
29088         (Method::Method): Ditto.
29089         (Property::Property): Ditto.
29090
29091         * cs-parser.jay (struct_declaration): Update constructor call to
29092         pass in the attributes too.
29093         (class_declaration): Ditto.
29094         (constant_declaration): Ditto.
29095         (field_declaration): Ditto.
29096         (method_header): Ditto.
29097         (fixed_parameter): Ditto.
29098         (parameter_array): Ditto.
29099         (property_declaration): Ditto.
29100
29101         * constant.cs (Constant::Constant): Update constructor similarly.
29102         Use System.Collections.
29103
29104         * parameter.cs (Parameter::Parameter): Update as above.
29105
29106 2001-09-02  Ravi Pratap  <ravi@ximian.com>
29107
29108         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
29109         (TypeContainer.delegates): New member to hold list of delegates.
29110
29111         * cs-parser.jay (delegate_declaration): Implement the action correctly 
29112         this time as I seem to be on crack ;-)
29113
29114 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
29115
29116         * rootcontext.cs (RootContext::IsNamespace): new function, used to
29117         tell whether an identifier represents a namespace.
29118
29119         * expression.cs (NamespaceExpr): A namespace expression, used only
29120         temporarly during expression resolution.
29121         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
29122         utility functions to resolve names on expressions.
29123
29124 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
29125
29126         * codegen.cs: Add hook for StatementExpressions. 
29127
29128         * class.cs: Fix inverted test for static flag in methods.
29129
29130 2001-09-02  Ravi Pratap  <ravi@ximian.com>
29131
29132         * class.cs (Operator::CheckUnaryOperator): Correct error number used
29133         to make it coincide with MS' number.
29134         (Operator::CheckBinaryOperator): Ditto.
29135
29136         * ../errors/errors.txt : Remove error numbers added earlier.
29137
29138         * ../errors/cs1019.cs : Test case for error # 1019
29139
29140         * ../errros/cs1020.cs : Test case for error # 1020
29141
29142         * cs-parser.jay : Clean out commented cruft.
29143         (dimension_separators, dimension_separator): Comment out. Ostensibly not
29144         used anywhere - non-reducing rule.
29145         (namespace_declarations): Non-reducing rule - comment out.
29146
29147         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
29148         with TypeContainer::AddEnum.
29149
29150         * delegate.cs : New file for delegate handling classes.
29151         (Delegate): Class for declaring delegates.
29152
29153         * makefile : Update.
29154
29155         * cs-parser.jay (delegate_declaration): Implement.
29156
29157 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
29158
29159         * class.cs (Event::Define): Implement.
29160         (Event.EventBuilder): New member.
29161
29162         * class.cs (TypeContainer::Populate): Update to define all enums and events
29163         we have.
29164         (Events): New property for the events arraylist we hold. Shouldn't we move to using
29165         readonly fields for all these cases ?
29166
29167 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
29168
29169         * class.cs (Property): Revamp to use the convention of making fields readonly.
29170         Accordingly modify code elsewhere.
29171
29172         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
29173         the Define method of the Property class.
29174
29175         * class.cs : Clean up applied patch and update references to variables etc. Fix 
29176         trivial bug.
29177         (TypeContainer::Populate): Update to define all the properties we have. Also
29178         define all enumerations.
29179
29180         * enum.cs (Define): Implement.
29181
29182 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
29183
29184         * cs-parser.jay (overloadable_operator): The semantic value is an
29185         enum of the Operator class.
29186         (operator_declarator): Implement actions.
29187         (operator_declaration): Implement.
29188
29189         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
29190         validity of definitions.
29191         (Operator::CheckBinaryOperator): Static method to check for binary operators
29192         (TypeContainer::AddOperator): New method to add an operator to a type.
29193
29194         * cs-parser.jay (indexer_declaration): Added line to actually call the
29195         AddIndexer method so it gets added ;-)
29196
29197         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
29198         already taken care of by the MS compiler ?  
29199
29200 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
29201
29202         * class.cs (Operator): New class for operator declarations.
29203         (Operator::OpType): Enum for the various operators.
29204
29205 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
29206
29207         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
29208         ostensibly handle this in semantic analysis.
29209
29210         * cs-parser.jay (general_catch_clause): Comment out
29211         (specific_catch_clauses, specific_catch_clause): Ditto.
29212         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
29213         (catch_args, opt_catch_args): New productions.
29214         (catch_clause): Rewrite to use the new productions above
29215         (catch_clauses): Modify accordingly.
29216         (opt_catch_clauses): New production to use in try_statement
29217         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
29218         and re-write the code in the actions to extract the specific and
29219         general catch clauses by being a little smart ;-)
29220
29221         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
29222         Hooray, try and catch statements parse fine !
29223
29224 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29225
29226         * statement.cs (Block::GetVariableType): Fix logic to extract the type
29227         string from the hashtable of variables.
29228
29229         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
29230         I end up making that mistake ;-)
29231         (catch_clauses): Fixed gross error which made Key and Value of the 
29232         DictionaryEntry the same : $1 !!
29233
29234 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29235
29236         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
29237
29238         * cs-parser.jay (event_declaration): Correct to remove the semicolon
29239         when the add and remove accessors are specified. 
29240
29241 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29242
29243         * cs-parser.jay (IndexerDeclaration): New helper class to hold
29244         information about indexer_declarator.
29245         (indexer_declarator): Implement actions.
29246         (parsing_indexer): New local boolean used to keep track of whether
29247         we are parsing indexers or properties. This is necessary because 
29248         implicit_parameters come into picture even for the get accessor in the 
29249         case of an indexer.
29250         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
29251
29252         * class.cs (Indexer): New class for indexer declarations.
29253         (TypeContainer::AddIndexer): New method to add an indexer to a type.
29254         (TypeContainer::indexers): New member to hold list of indexers for the
29255         type.
29256
29257 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
29258
29259         * cs-parser.jay (add_accessor_declaration): Implement action.
29260         (remove_accessor_declaration): Implement action.
29261         (event_accessors_declaration): Implement
29262         (variable_declarators): swap statements for first rule - trivial.
29263
29264         * class.cs (Event): New class to hold information about event
29265         declarations.
29266         (TypeContainer::AddEvent): New method to add an event to a type
29267         (TypeContainer::events): New member to hold list of events.
29268
29269         * cs-parser.jay (event_declaration): Implement actions.
29270
29271 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
29272
29273         * cs-parser.jay (dim_separators): Implement. Make it a string
29274         concatenating all the commas together, just as they appear.
29275         (opt_dim_separators): Modify accordingly
29276         (rank_specifiers): Update accordingly. Basically do the same
29277         thing - instead, collect the brackets here.
29278         (opt_rank_sepcifiers): Modify accordingly.
29279         (array_type): Modify to actually return the complete type string
29280         instead of ignoring the rank_specifiers.
29281         (expression_list): Implement to collect the expressions
29282         (variable_initializer): Implement. We make it a list of expressions
29283         essentially so that we can handle the array_initializer case neatly too.
29284         (variable_initializer_list): Implement.
29285         (array_initializer): Make it a list of variable_initializers
29286         (opt_array_initializer): Modify accordingly.
29287
29288         * expression.cs (New::NType): Add enumeration to help us
29289         keep track of whether we have an object/delegate creation
29290         or an array creation.
29291         (New:NewType, New::Rank, New::Indices, New::Initializers): New
29292         members to hold data about array creation.
29293         (New:New): Modify to update NewType
29294         (New:New): New Overloaded contructor for the array creation
29295         case.
29296
29297         * cs-parser.jay (array_creation_expression): Implement to call
29298         the overloaded New constructor.
29299
29300 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
29301
29302         * class.cs (TypeContainer::Constructors): Return member
29303         constructors instead of returning null.
29304
29305 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
29306
29307         * typemanager.cs (InitCoreTypes): Initialize the various core
29308         types after we have populated the type manager with the user
29309         defined types (this distinction will be important later while
29310         compiling corlib.dll)
29311
29312         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29313         on Expression Classification.  Now all expressions have a method
29314         `Resolve' and a method `Emit'.
29315
29316         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29317         generation from working.     Also add some temporary debugging
29318         code. 
29319
29320 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
29321
29322         * codegen.cs: Lots of code generation pieces.  This is only the
29323         beginning, will continue tomorrow with more touches of polish.  We
29324         handle the fundamentals of if, while, do, for, return.  Others are
29325         trickier and I need to start working on invocations soon.
29326
29327         * gen-treedump.cs: Bug fix, use s.Increment here instead of
29328         s.InitStatement. 
29329
29330         * codegen.cs (EmitContext): New struct, used during code
29331         emission to keep a context.   Most of the code generation will be
29332         here. 
29333
29334         * cs-parser.jay: Add embedded blocks to the list of statements of
29335         this block.  So code generation proceeds in a top down fashion.
29336
29337 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
29338
29339         * statement.cs: Add support for multiple child blocks.
29340
29341 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
29342
29343         * codegen.cs (EmitCode): New function, will emit the code for a
29344         Block of code given a TypeContainer and its ILGenerator. 
29345
29346         * statement.cs (Block): Standard public readonly optimization.
29347         (Block::Block constructors): Link children. 
29348         (Block::Child): Child Linker.
29349         (Block::EmitVariables): Emits IL variable declarations.
29350
29351         * class.cs: Drop support for MethodGroups here, delay until
29352         Semantic Analysis.
29353         (Method::): Applied the same simplification that I did before, and
29354         move from Properties to public readonly fields.
29355         (Method::ParameterTypes): Returns the parameter types for the
29356         function, and implements a cache that will be useful later when I
29357         do error checking and the semantic analysis on the methods is
29358         performed.
29359         (Constructor::GetCallingConvention): Renamed from CallingConvetion
29360         and made a method, optional argument tells whether this is a class
29361         or a structure to apply the `has-this' bit.
29362         (Method::GetCallingConvention): Implement, returns the calling
29363         convention. 
29364         (Method::Define): Defines the type, a second pass is performed
29365         later to populate the methods.
29366
29367         (Constructor::ParameterTypes): implement a cache similar to the
29368         one on Method::ParameterTypes, useful later when we do semantic
29369         analysis. 
29370
29371         (TypeContainer::EmitMethod):  New method.  Emits methods.
29372
29373         * expression.cs: Removed MethodGroup class from here.
29374
29375         * parameter.cs (Parameters::GetCallingConvention): new method.
29376
29377 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
29378
29379         * class.cs (TypeContainer::Populate): Drop RootContext from the
29380         argument. 
29381
29382         (Constructor::CallingConvention): Returns the calling convention.
29383         (Constructor::ParameterTypes): Returns the constructor parameter
29384         types. 
29385
29386         (TypeContainer::AddConstructor): Keep track of default constructor
29387         and the default static constructor.
29388
29389         (Constructor::) Another class that starts using `public readonly'
29390         instead of properties. 
29391
29392         (Constructor::IsDefault): Whether this is a default constructor. 
29393
29394         (Field::) use readonly public fields instead of properties also.
29395
29396         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29397         track of static constructors;  If none is used, turn on
29398         BeforeFieldInit in the TypeAttributes. 
29399
29400         * cs-parser.jay (opt_argument_list): now the return can be null
29401         for the cases where there are no arguments. 
29402
29403         (constructor_declarator): If there is no implicit `base' or
29404         `this', then invoke the default parent constructor. 
29405
29406         * modifiers.cs (MethodAttr): New static function maps a set of
29407         modifiers flags into a MethodAttributes enum
29408         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
29409         MethodAttr, TypeAttr to represent the various mappings where the
29410         modifiers are used.
29411         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
29412
29413 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
29414
29415         * parameter.cs (GetParameterInfo): Fix bug where there would be no
29416         method arguments.
29417
29418         * interface.cs (PopulateIndexer): Implemented the code generator
29419         for interface indexers.
29420
29421 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
29422
29423         * interface.cs (InterfaceMemberBase): Now we track the new status
29424         here.  
29425
29426         (PopulateProperty): Implement property population.  Woohoo!  Got
29427         Methods and Properties going today. 
29428
29429         Removed all the properties for interfaces, and replaced them with
29430         `public readonly' fields. 
29431
29432 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
29433
29434         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29435         initialize their hashtables/arraylists only when they are needed
29436         instead of doing this always.
29437
29438         * parameter.cs: Handle refs and out parameters.
29439
29440         * cs-parser.jay: Use an ArrayList to construct the arguments
29441         instead of the ParameterCollection, and then cast that to a
29442         Parameter[] array.
29443
29444         * parameter.cs: Drop the use of ParameterCollection and use
29445         instead arrays of Parameters.
29446
29447         (GetParameterInfo): Use the Type, not the Name when resolving
29448         types. 
29449
29450 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
29451
29452         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29453         and instead use public readonly fields.
29454
29455         * class.cs: Put back walking code for type containers.
29456
29457 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
29458
29459         * class.cs (MakeConstant): Code to define constants.
29460
29461         * rootcontext.cs (LookupType): New function.  Used to locate types 
29462
29463
29464 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
29465
29466         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
29467         this System.Reflection code is.  Kudos to Microsoft
29468
29469         * typemanager.cs: Implement a type cache and avoid loading all
29470         types at boot time.  Wrap in LookupType the internals.  This made
29471         the compiler so much faster.  Wow.  I rule!
29472
29473         * driver.cs: Make sure we always load mscorlib first (for
29474         debugging purposes, nothing really important).
29475
29476         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
29477         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
29478
29479         * rootcontext.cs: Lookup types on their namespace;  Lookup types
29480         on namespaces that have been imported using the `using' keyword.
29481
29482         * class.cs (TypeContainer::TypeAttr): Virtualize.
29483         (Class::TypeAttr): Return attributes suitable for this bad boy.
29484         (Struct::TypeAttr): ditto.
29485         Handle nested classes.
29486         (TypeContainer::) Remove all the type visiting code, it is now
29487         replaced with the rootcontext.cs code
29488
29489         * rootcontext.cs (GetClassBases): Added support for structs. 
29490
29491 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
29492
29493         * interface.cs, statement.cs, class.cs, parameter.cs,
29494         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29495         Drop use of TypeRefs, and use strings instead.
29496
29497 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
29498
29499         * rootcontext.cs: 
29500
29501         * class.cs (Struct::Struct): set the SEALED flags after
29502         checking the modifiers.
29503         (TypeContainer::TypeAttr): new property, returns the
29504         TypeAttributes for a class.  
29505
29506         * cs-parser.jay (type_list): Oops, list production was creating a
29507         new list of base types.
29508
29509         * rootcontext.cs (StdLib): New property.
29510         (GetInterfaceTypeByName): returns an interface by type name, and
29511         encapsulates error handling here.
29512         (GetInterfaces): simplified.
29513         (ResolveTree): Encapsulated all the tree resolution here.
29514         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29515         types. 
29516
29517         * driver.cs: Add support for --nostdlib, to avoid loading the
29518         default assemblies.
29519         (Main): Do not put tree resolution here. 
29520
29521         * rootcontext.cs: Beginning of the class resolution.
29522
29523 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
29524
29525         * rootcontext.cs: Provide better error reporting. 
29526
29527         * cs-parser.jay (interface_base): set our $$ to be interfaces.
29528
29529         * rootcontext.cs (CreateInterface): Handle the case where there
29530         are no parent interfaces.
29531
29532         (CloseTypes): Routine to flush types at the end.
29533         (CreateInterface): Track types.
29534         (GetInterfaces): Returns an array of Types from the list of
29535         defined interfaces.
29536
29537         * typemanager.c (AddUserType): Mechanism to track user types (puts
29538         the type on the global type hash, and allows us to close it at the
29539         end). 
29540
29541 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
29542
29543         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29544         RecordInterface instead.
29545
29546         * cs-parser.jay: Updated to reflect changes above.
29547
29548         * decl.cs (Definition): Keep track of the TypeBuilder type that
29549         represents this type here.  Not sure we will use it in the long
29550         run, but wont hurt for now.
29551
29552         * driver.cs: Smaller changes to accomodate the new code.
29553
29554         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29555         when done. 
29556
29557         * rootcontext.cs (CreateInterface):  New method, used to create
29558         the System.TypeBuilder type for interfaces.
29559         (ResolveInterfaces): new entry point to resolve the interface
29560         hierarchy. 
29561         (CodeGen): Property, used to keep track of the code generator.
29562
29563 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
29564
29565         * cs-parser.jay: Add a second production for delegate_declaration
29566         with `VOID'.
29567
29568         (enum_body): Put an opt_comma here instead of putting it on
29569         enum_body or enum_member_declarations so we can handle trailing
29570         commas on enumeration members.  Gets rid of a shift/reduce.
29571
29572         (type_list): Need a COMMA in the middle.
29573
29574         (indexer_declaration): Tell tokenizer to recognize get/set
29575
29576         * Remove old targets.
29577
29578         * Re-add the parser target.
29579
29580 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29581
29582         * cs-parser.jay: Add precendence rules for a number of operators
29583         ot reduce the number of shift/reduce conflicts in the grammar.
29584
29585 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
29586
29587         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29588         and put it here.
29589
29590         Get rid of old crufty code.
29591
29592         * rootcontext.cs: Use this to keep track of the parsed
29593         representation and the defined types available to the program. 
29594
29595         * gen-treedump.cs: adjust for new convention.
29596
29597         * type.cs: Split out the type manager, and the assembly builder
29598         from here. 
29599
29600         * typemanager.cs: the type manager will live here now.
29601
29602         * cil-codegen.cs: And the code generator here. 
29603
29604 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
29605
29606         * makefile: Fixed up for easy making.
29607
29608 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29609
29610         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29611         the 
29612
29613         (unary_expression): Expand pre_increment_expression and
29614         post_decrement_expression to reduce a shift/reduce.
29615
29616 2001-07-11  Simon Cozens
29617
29618         * cs-tokenizer.cs: Hex numbers should begin with a 0.
29619
29620         Improve allow_keyword_as_indent name.
29621
29622 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
29623
29624         * Adjustments for Beta2. 
29625
29626 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
29627
29628         * decl.cs: Added `Define' abstract method.
29629         (InTransit): new property, used to catch recursive definitions. 
29630
29631         * interface.cs: Implement `Define'. 
29632
29633         * modifiers.cs: Map Modifiers.constants to
29634         System.Reflection.TypeAttribute flags.
29635
29636         * class.cs: Keep track of types and user-defined types.
29637         (BuilderInit): New method for creating an assembly
29638         (ResolveType): New function to launch the resolution process, only
29639         used by interfaces for now.
29640
29641         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29642         that are inserted into the name space. 
29643
29644 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
29645
29646         * ARGH.  I have screwed up my tree so many times due to the use of
29647         rsync rather than using CVS.  Going to fix this at once. 
29648
29649         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
29650         load types.
29651
29652 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
29653
29654         * Experiment successful: Use System.Type rather that our own
29655         version of Type.  
29656
29657 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
29658
29659         * cs-parser.jay: Removed nsAliases from here.
29660
29661         Use new namespaces, handle `using XXX;' 
29662
29663         * namespace.cs: Reimplemented namespace handling, use a recursive
29664         definition of the class.  Now we can keep track of using clauses
29665         and catch invalid using clauses.
29666
29667 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
29668
29669         * gen-treedump.cs: Adapted for all the renaming.
29670
29671         * expression.cs (Expression): this class now has a Type property
29672         which returns an expression Type.
29673
29674         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29675         `Type', as this has a different meaning now in the base
29676
29677 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
29678
29679         * interface.cs, class.cs: Removed from all the sources the
29680         references to signature computation, as we can not do method
29681         signature computation during the parsing time, as we are not
29682         trying to solve at that point distinguishing:
29683
29684         class X {
29685                 void a (Blah x) {}
29686                 void a (NS.Blah x) {}
29687         }
29688
29689         Which depending on the context might be valid or not, as we do not
29690         know if Blah is the same thing as NS.Blah at that point.
29691
29692         * Redid everything so the code uses TypeRefs now instead of
29693         Types.  TypeRefs are just temporary type placeholders, that need
29694         to be resolved.  They initially have a pointer to a string and the
29695         current scope in which they are used.  This is used later by the
29696         compiler to resolve the reference to an actual Type. 
29697
29698         * DeclSpace is no longer a CIR.Type, and neither are
29699         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
29700         are all DeclSpaces, but no Types. 
29701
29702         * type.cs (TypeRefManager): This implements the TypeRef manager,
29703         which keeps track of all the types that need to be resolved after
29704         the parsing has finished. 
29705
29706 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
29707
29708         * ARGH.  We are going to have to store `foreach' as a class rather
29709         than resolving it, as we need to verify error 1579 after name
29710         resolution.   *OR* we could keep a flag that says `This request to
29711         IEnumerator comes from a foreach statement' which we can then use
29712         to generate the error.
29713
29714 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
29715
29716         * class.cs (TypeContainer.AddMethod): we now add methods to the
29717         MethodGroup instead of the method hashtable.  
29718
29719         * expression.cs: Add MethodGroup abstraction, which gets us one
29720         step closer to the specification in the way we handle method
29721         declarations.  
29722
29723         * cs-parser.jay (primary_expression): qualified_identifier now
29724         tried to match up an identifier to a local variable reference or
29725         to a parameter reference.
29726
29727         current_local_parameters is now a parser global variable that
29728         points to the current parameters for the block, used during name
29729         lookup.
29730
29731         (property_declaration): Now creates an implicit `value' argument to
29732         the set accessor.
29733
29734 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
29735
29736         * parameter.cs: Do not use `param' arguments as part of the
29737         signature, per the spec.
29738
29739 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
29740
29741         * decl.cs: Base class for classes, structs and interfaces.  This
29742         is the "Declaration Space" 
29743
29744         * cs-parser.jay: Use CheckDef for checking declaration errors
29745         instead of having one on each function.
29746
29747         * class.cs: Factor out some code for handling error handling in
29748         accordance to the "Declarations" section in the "Basic Concepts"
29749         chapter in the ECMA C# spec.
29750
29751         * interface.cs: Make all interface member classes derive from
29752         InterfaceMemberBase.
29753
29754 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
29755
29756         * Many things: all interfaces are parsed and generated in
29757         gen-treedump.  Support for member variables, constructors,
29758         destructors, properties, constants is there.
29759
29760         Beginning of the IL backend, but very little done, just there for
29761         testing purposes. 
29762
29763 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
29764
29765         * cs-parser.jay: Fix labeled statement.
29766
29767         * cs-tokenizer.cs (escape): Escape " and ' always.
29768         ref_line, ref_name: keep track of the line/filename as instructed
29769         by #line by the compiler.
29770         Parse #line.
29771
29772 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
29773
29774         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29775         to match the values in System.CodeDOM.
29776
29777         Divid renamed to Divide.
29778
29779         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29780         statements. 
29781         (Statements.set): remove.
29782
29783         * System.CodeDOM/CodeCatchClause.cs: always have a valid
29784         statements. 
29785
29786         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29787         falseStatements always have valid values. 
29788
29789         * cs-parser.jay: Use System.CodeDOM now.
29790