2008-06-19 Marek Safar <marek.safar@gmail.com>
[mono.git] / mcs / mcs / ChangeLog
1 2008-06-19  Marek Safar  <marek.safar@gmail.com>
2
3         A fix for bug #359611, #359604
4         * anonymous.cs: Mutate all types of hoisted parameters.
5
6 2008-06-19  Marek Safar  <marek.safar@gmail.com>
7
8         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, linq.cs, class.cs
9         delegate.cs, iterators.cs, cs-parser.jay, assign.cs, anonymous.cs, driver.cs
10         expression.cs, codegen.cs, statement.cs
11         
12         Fixes bugs: #318652, #323223, #234779, #325069, #325476, #332532, #334465,
13         #345907, #349190, #353276, #355256, #359617, #378542, #384584, #396530
14         
15         ** Anonymous methods, lambda expressions rewrite **
16         
17         Anonymous expressions are now resolved when an explicit block is resolved 
18         and they don't require any registration procedure anymore. Further,
19         anonymous methods are defined when explicit block is emitted which allows
20         better control of whole process and opens possibilities for more
21         optimizations as well as alternative to reverse whole process.
22         
23         A concept of `MutateHoistedGenericType' was introduced to keep the resolve
24         process consistent and to correctly emit hoisted generic methods when they
25         have at least 1 hoisted variable.
26         
27 2008-06-17  Martin Baulig  <martin@ximian.com>
28
29         * class.cs: Also emit the `[DebuggerHidden]' attribute on the main
30         iterator method.
31         (AbstractPropertyEventMethod.IsDebuggerHidden): New protected
32         virtual property; check it in Emit().
33         (PropertyMethod.IsDebuggerHidden): Override, check whether we're
34         an iterator.
35         (MethodOrOperator.ResolveMethods): Set `DEBUGGER_HIDDEN' if we're
36         an iterator.
37         (Indexer.Define): Likewise.
38
39 2008-06-17  Marek Safar  <marek.safar@gmail.com>
40
41         * convert.cs: Don't use IsInterface on type arguments.
42         
43         * delegate.cs: DelegateInvocation uses MethodInfo.
44         
45         * parameter.cs: Removed IsTypeParameter.
46         
47         * generic-mcs.cs: More missing stuff.
48
49 2008-06-16  Martin Baulig  <martin@ximian.com>
50
51         * modifiers.cs
52         (Modifiers.DEBUGGER_HIDDEN): New public const.
53
54         * typemanager.cs
55         (TypeManager.GetDebuggerHiddenAttribute): New public static method.
56
57         * class.cs
58         (MethodOrOperator.Emit): Check `Modifiers.DEBUGGER_HIDDEN'.
59         (AbstractPropertyEventMethod): Likewise.
60         (Constructor.Emit): Likewise.
61         (SourceMethod.SetCompilerGenerated): Removed.
62
63         * iterator.cs: Set `Modifiers.DEBUGGER_HIDDEN' everywhere except
64         on MoveNext().
65
66         * anonymous.cs
67         (RootScopeInfo.DoDefineMembers): Set `Modifiers.DEBUGGER_HIDDEN'
68         if we're an `IteratorHost'.
69         (AnonymousMethodMethod..ctor): Don't set
70         `Modifiers.COMPILER_GENERATED'; csc only sets this on the class,
71         not on the method.
72
73 2008-06-16  Marek Safar  <marek.safar@gmail.com>
74
75         * statement.cs: Clean-up foreach statements.
76
77 2008-06-12  Marek Safar  <marek.safar@gmail.com>
78
79         * class.cs: Stop using public method which should not exist.
80
81 2008-06-11  Martin Baulig  <martin@ximian.com>
82
83         * location.cs
84         (Location.LookupFile): Add `CompilationUnit' argument; when given
85         a relative file name, make it relative to the directory the .cs
86         file is located in instead of using the current directory.
87
88 2008-06-11  Martin Baulig  <martin@ximian.com>
89
90         * class.cs
91         (IMethodData.EmitExtraSymbolInfo): Added `SourceMethod' argument.
92         (MethodOrOperator.EmitExtraSymbolInfo): Likewise.
93         (SourceMethod.SetRealMethodName): Moved here from the symbol writer.
94         (SourceMethod.SetCompilerGenerated): Likewise.
95
96 2008-06-11  Marek Safar  <marek.safar@gmail.com>
97
98         * codegen.cs, driver: Only write symbol file when it's asked for.
99
100 2008-06-11  Marek Safar  <marek.safar@gmail.com>
101
102         * codegen.cs: Don't use assembly writer error handling for symbol writer.
103
104 2008-06-10  Martin Baulig  <martin@ximian.com>
105
106         * symbolwriter.cs: Reflect latest MarkSequencePoint() API changes.
107
108 2008-06-09  Marek Safar  <marek.safar@gmail.com>
109
110         A fix for bug #316290
111         * expression.cs: Include decimal operators in predefined table.
112         
113         * parameters.cs: More readonlyness.
114
115 2008-06-09  Marek Safar  <marek.safar@gmail.com>
116
117         A fix for bug #397213
118         * cs-parser.jay: One more missing current_local_parameters reset.
119
120 2008-06-09  Marek Safar  <marek.safar@gmail.com>
121
122         A fix for bug #396633
123         * class.cs: Host backing field in partial container.
124
125 2008-06-09  Marek Safar  <marek.safar@gmail.com>
126
127         A fix for bug #397068
128         * expression.cs: Check both operand types when predefined operator is used.
129
130 2008-06-05  Martin Baulig  <martin@ximian.com>
131
132         Merged the `debugger-kahalo' branch.
133
134         * class.cs
135         (MethodData.Emit): Call SymbolWriter.SetCompilerGenerated() if
136         we're an iterator method.
137         (SourceMethod): Reflect latest symbol writer changes;
138         SymbolWriter.OpenMethod() now takes a `ICompileUnit' argument and
139         now `start_row' and `end_row'.
140         (Constructor.Emit): Fix the logic whether to emit symbol information.
141
142         * iterator.cs: Call SymbolWriter.SetCompilerGenerated() on all the
143         generated methods.
144
145         * location.cs
146         (CompilationUnit): New public class; derives from `SourceFile'.
147         (SourceFileEntry.DefineSymbolInfo): New public method.
148         (SourceFileEntry.SetChecksum): New public method.
149         (Location): Encode hidden line numbers by using `column == 255';
150         the .ctor now accepts `column == -1' to mark a hidden line number.
151         (Location.Hidden): New public property.
152         (Location.CheckPoint): Add `CompilationUnit'.
153         (Location.SourceFiles): Change return type to `CompilationUnit[]'.
154         (Location.Push): Add `CompilationUnit compile_unit' argument.
155         (Location.CompilationUnit): New public property.
156
157         * statement.cs
158         (ToplevelBlock.Emit): Add `ec.Mark (EndLocation)'.
159
160         * cs-parser.jay: `SourceFile' -> `CompilationUnit'.
161
162         * driver.cs: `SourceFile' -> `CompilationUnit'.
163
164         * cs-tokenizer.cs: `SourceFile' -> `CompilationUnit'.
165
166         * namespace.cs: `SourceFile' -> `CompilationUnit'.
167
168         * cs-tokenizer.cs: Add support for `#pragma checksum' and
169         `#line hidden'.
170
171         * symbolwriter.cs
172         (SymbolWriter.MarkSequencePoint): Take a `Location' and use the
173         new symbol writer API to also pass the file.
174
175 2008-06-05  Marek Safar  <marek.safar@gmail.com>
176
177         * statement.cs: Emit catch variable assignment using variable expression.
178         
179 2008-06-05  Marek Safar  <marek.safar@gmail.com>
180
181         * ecore.cs, expression.cs, statement.cs: Make TemporaryVariable compatible
182         with other variable types.
183
184 2008-06-04  Marek Safar  <marek.safar@gmail.com>
185
186         * ecore.cs, expression.cs, statement.cs, typemanager.cs: Removed custom
187         GetLength method emit, it breaks resolve rules.
188         
189 2008-06-02  Atsushi Enomoto  <atsushi@ximian.com>
190             Marek Safar  <marek.safar@gmail.com>
191                         
192         A fix for bug #395542
193         * cs-parser.jay: The trailing comma is allowed in anonymous type member
194         declaration.
195         
196 2008-06-02  Marek Safar  <marek.safar@gmail.com>
197
198         A fix for bug #395287
199         * class.cs, modifiers.cs: Automatic properties method base modifiers checks.
200
201 2008-05-31  Marek Safar  <marek.safar@gmail.com>
202
203         A fix for bug #395845
204         * class.cs, nullable.cs: User unary operator is allowed to have nullable and
205         non-nullable parameter type.
206         
207 2008-05-31  Marek Safar  <marek.safar@gmail.com>
208
209         * class.cs: Handle contructor initializer as a statement in top-level block.
210
211 2008-05-30  Marek Safar  <marek.safar@gmail.com>
212
213         * attribute.cs: Don't mix old and new corlib types when emitting corlib
214         security attributes.
215
216 2008-05-24  Marek Safar  <marek.safar@gmail.com>
217
218         * ecore.cs, expression.cs: Small IVariable refactoring.
219
220 2008-05-22  Marek Safar  <marek.safar@gmail.com>
221
222         * assign.cs (LocalTemporary): Implemented CreateExpressionTree.
223
224 2008-05-21  Marek Safar  <marek.safar@gmail.com>
225
226         * cs-parser.jay: Removed redundant catch type check.
227
228 2008-05-21  Marek Safar  <marek.safar@gmail.com>
229
230         A fix for bug #390372
231         * nullable.cs: Set correct return type.
232
233 2008-05-21  Marek Safar  <marek.safar@gmail.com>
234
235         A fix for bug #391062
236         * typemanager.cs: Fixed crash when comparing null types.
237
238 2008-05-21  Marek Safar  <marek.safar@gmail.com>
239
240         A fix for bug #391871
241         * cs-parser.jay: Better error handling for invalid catch type.
242
243 2008-05-20  Marek Safar  <marek.safar@gmail.com>
244
245         A fix for bug #392155
246         * cs-tokenizer.cs: Fixed casting of byte and decimal expression.
247
248 2008-05-15  Marek Safar  <marek.safar@gmail.com>
249
250         A fix for bug #390666
251         * ecore.cs (BetterExpressionConversion): Unwrap each Expression<T>
252         expressions.
253
254 2008-05-15  Marek Safar  <marek.safar@gmail.com>
255
256         * class.cs, expression.cs, statement.cs: Removed a hack, setting block flag
257         in getter.
258
259 2008-05-13  Marek Safar  <marek.safar@gmail.com>
260
261         A fix for bug #389625
262         * delegate.cs, generic.cs: Some progress on method group return type
263         inference.
264
265 2008-05-13  Marek Safar  <marek.safar@gmail.com>
266
267         A fix for bug #378419
268         * namespace.cs: Inspect also parent namespaces not only namespace entries.
269
270 2008-05-12  Marek Safar  <marek.safar@gmail.com>
271
272         * class.cs (Constructor): Added IsCompilerGenerated.
273
274 2008-05-12  Marek Safar  <marek.safar@gmail.com>
275
276         * expression.cs: Enum binary operators can accept non-enum operand only when
277         is implicitly convertible to underlying type.
278
279 2008-05-12  Marek Safar  <marek.safar@gmail.com>
280
281         A fix for bug #389272
282         * support.cs: Workaround System.InvalidOperationException for enums.
283
284 2008-05-12  Marek Safar  <marek.safar@gmail.com>
285
286         A fix for bug #389073
287         * convert.cs: More undocumented explicit IntPtr/UIntPtr conversions.
288
289 2008-05-10  Marek Safar  <marek.safar@gmail.com>
290
291         * driver.cs: Split Parse.
292         
293         * location.cs (LookupFile): Uses string.Empty.
294
295 2008-05-07  Marek Safar  <marek.safar@gmail.com>
296
297         * expression.cs, parameter.cs: Small ParameterReference clean up.
298
299 2008-05-07  Marek Safar  <marek.safar@gmail.com>
300
301         * anonymous.cs, codegen.cs, convert.cs, ecore.cs: Removed uber ugly TempEc
302         hack. Fixes #387502.
303
304 2008-05-06  Martin Baulig  <martin@ximian.com>
305
306         * class.cs (Constructor.Emit): Fix the logic whether to emit
307         symbol information.
308
309 2008-05-06  Raja R Harinath  <harinath@hurrynot.org>
310
311         Fix #385503
312         * iterators.cs (Iterator.CurrentBlock.DoEmit): Don't emit
313         InvalidOperationException when the iterator is before the start or
314         after the end.
315
316 2008-05-06  Marek Safar  <marek.safar@gmail.com>
317
318         * nullable.cs (NullCoalescingOperator): Result is underlying type of left,
319         when left is nullable type.
320
321 2008-05-06  Marek Safar  <marek.safar@gmail.com>
322
323         A fix for bug #386628
324         * expression.cs (LocalVariableReference): Continue in resolving when
325         variable is not assigned.
326
327 2008-05-05  Marek Safar  <marek.safar@gmail.com>
328
329         * nullable.cs, statement.cs (Unwrap): Store non-variable expression in all
330         nullable operations.
331
332 2008-05-04  Marek Safar  <marek.safar@gmail.com>
333
334         * nullable.cs, statement.cs (Unwrap): Don't duplicate variable expressions,
335         it saves many redundant temporary variables for nullable operations.
336
337 2008-05-03  Marek Safar  <marek.safar@gmail.com>
338
339         * assign.cs: EventAddOrRemove is a statement and cannot have a type.
340         
341         * cfold.cs, constant.cs, expression.cs: Share Error_OperatorCannotBeApplied
342         method.
343         
344         * nullable.cs: Constant coalescing operator optimizations.
345
346 2008-05-03  Marek Safar  <marek.safar@gmail.com>
347
348         * constant.cs: Use unsigned conversion for values which are unsigned only.
349
350 2008-05-03  Marek Safar  <marek.safar@gmail.com>
351
352         * convert.cs, literal.cs, nullabel.cs, typemanager.cs: Implemeted null 
353         coalescing operator as it should be.
354
355 2008-05-02  Marek Safar  <marek.safar@gmail.com>
356
357         A fix for bug #371016
358         * expression.cs: All predefined delegate operators require implicit method
359         group conversion.
360         
361 2008-05-02  Marek Safar  <marek.safar@gmail.com>
362
363         * constant.cs: Emit long constant as uint when fits the range.
364         
365         * convert.cs, expression.cs: Fixed few unsafe conversions.
366
367 2008-05-02  Marek Safar  <marek.safar@gmail.com>
368
369         * convert.cs, literal.cs: Don't wrap implicit reference conversion to object
370
371 2008-05-02  Raja R Harinath  <harinath@hurrynot.org>
372
373         Fix #385758
374         * convert.cs (ImplicitNumericConversion): Don't modify the type of
375         'expr'.
376         * ecore.cs (EmptyCast.Create): Flatten nested EmptyCasts.
377
378 2008-05-01  Marek Safar  <marek.safar@gmail.com>
379
380         * constant.cs, literal.cs: IsLiteral property for error reporting.
381         
382         * ecore.cs, expression.cs: Implemented Property expression.
383
384 2008-05-01  Marek Safar  <marek.safar@gmail.com>
385
386         * class.cs, modifiers.cs, flowanalysis.cs: New BACKING_FIELD flag.
387         
388         * nullable.cs: Implemented nullable coalescing null operator.
389
390         * ecore.cs, expression.cs: Expression trees work.
391
392 2008-05-01  Marek Safar  <marek.safar@gmail.com>
393
394         * ecore.cs: CreateExpressionTree is finally abstract.
395
396         * expression.cs, linq.cs: Updated.
397
398 2008-05-01  Marek Safar  <marek.safar@gmail.com>
399
400         * expression.cs, ecore.cs: Block base access expression inside expression
401         tree.
402
403 2008-05-01  Marek Safar  <marek.safar@gmail.com>
404
405         A fix for bug #385058
406         * expression.cs: User-defined operator implementations always take
407         precedence over predefined operator implementations.
408
409 2008-04-30  Marek Safar  <marek.safar@gmail.com>
410
411         * assign.cs, anonymous.cs, lambda.cs, nullable.cs, ecore.cs, linq.cs,
412         class.cs, iterators.cs, expression.cs, attribute.cs: Filled a few more
413         expression tree conversions.
414         
415 2008-04-30  Marek Safar  <marek.safar@gmail.com>
416
417         * typemanager.cs, ecore.cs, class.cs, expression.cs, doc.cs: Merged all
418         operators method details to Operator class.
419
420 2008-04-30  Marek Safar  <marek.safar@gmail.com>
421
422         * anonymous.cs: Pass unsafe flags to anonymous container.
423         
424         * ecore.cs, expression.cs, statement.cs: Block unsafe pointer operations
425         inside expression tree.
426
427 2008-04-29  Martin Baulig  <martin@ximian.com>
428
429         * cs-tokenizer.cs (Tokenizer.Position): Added `line'.
430         (Tokenizer.PopPosition): Also restore the `line'.
431
432 2008-04-29  Marek Safar  <marek.safar@gmail.com>
433
434         * delegate.cs: Implemented Invoke expression.
435
436 2008-04-29  Marek Safar  <marek.safar@gmail.com>
437
438         * expression.cs: Fixed equality reference comparison regression.
439
440 2008-04-29  Marek Safar  <marek.safar@gmail.com>
441
442         * ecore.cs: Clean up EmptyCast hack.
443         
444         * expression.cs, nullable.cs: Implemented enum binary and unary operations
445         using correct conversion rules. Also fixes #383993.
446
447 2008-04-28  Martin Baulig  <martin@ximian.com>
448
449         * class.cs (Constructor.Emit): Don't emit debugging information
450         for generated default .ctor's.
451
452 2008-04-28  Marek Safar  <marek.safar@gmail.com>
453
454         * convert.cs: Empty-cast ushort to int conversion.
455
456 2008-04-28  Marek Safar  <marek.safar@gmail.com>
457
458         A fix for bug #384191
459         * ecore.cs, expression.cs: Fixed expression cloning.
460
461 2008-04-28  Marek Safar  <marek.safar@gmail.com>
462
463         * ecore.cs, delegate.cs, assign.cs: Few tweaks for recent changes.
464
465 2008-04-28  Raja R Harinath  <harinath@hurrynot.org>
466
467         Fix #381559, test-638.cs, test-639.cs
468         * assign.cs (CompoundAssign.Helper): New wrapper.
469         (CompoundAssign.DoResolve): Use it to wrap the nested 'target'
470         access.
471         * ecore.cs (MethodGroupExpr.VerifyArgumentsCompat) <params arguments>:
472         Pass unconverted expressions to the params array creation expression.
473         (FieldExpr.EmitAssign): Don't special-case StringConcat.
474         (PropertyExpr.EmitAssign): Likewise.
475         * expression.cs (ArrayCreation.ResolveArrayElement): Keep track of the
476         element if it is of kind CompoundAssign.Helper.
477         (ArrayCreation.Emit): If we saw a CompoundAssign.Helper, emit it
478         first before anything else.
479         (ArrayAccess.EmitAssign): Don't special-case StringConcat.
480         (ArrayAccess.LoadArrayAndArguments): Simplify.
481
482 2008-04-27  Marek Safar  <marek.safar@gmail.com>
483
484         * expression.cs: Fixed cloning of typeof(void).
485
486 2008-04-27  Raja R Harinath  <harinath@hurrynot.org>
487
488         * assign.cs (Assign.DoResolve): Remove support for EventExprs.
489         (Assign.Emit): Likewise.  Move it to ...
490         (CompoundAssign.DoResolve): ... here and ...
491         (CompoundAssign.Emit): ... here.
492         (EventAddOrRemove): New helper to handle += and -= on events, and
493         avoid the use of BinaryDelegates.
494         * ecore.cs (EventExpr.DoResolveLValue): Emit CS0070 unconditionally.
495         (EventExpr.EmitAddOrRemove): Improve.
496         * delegate.cs (DelegateInvocation.DoResolve): Simplify slightly.
497
498         * cs-parser.jay (type) <namespace_or_type_name variant>: Don't
499         create VarExprs for 'foo.bar.var'.
500         * ecore.cs (VarExpr.InferType): Rename from DoResolveLValue, which
501         is a highly inappropriate name for its functionality.
502
503 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
504
505         Simplify handling of multiple assignments
506         * assign.cs (Assign): Clear out all 'embedded assign' gunk.  Make
507         inheritable-only.
508         (SimpleAssign): New.  Class to be used for normal assignments.
509         * anonymous.cs, class.cs, cs-parser.jay: Update to changes.
510         * expression.cs, parameter.cs, statement.cs: Likewise.
511
512 2008-04-25  Marek Safar  <marek.safar@gmail.com>
513
514         * ecore.cs, expression.cs, nullable.cs: Implemeted enum binary add operation
515         for incompatible underlying types, more to come, uff.
516
517 2008-04-26  Raja R Harinath  <harinath@hurrynot.org>
518
519         Fix gtest-388.cs
520         * expression.cs (VariableReference.EmitAssign) <source is NewInstance>:
521         Handle 'leave_copy'.
522
523 2008-04-25  Marek Safar  <marek.safar@gmail.com>
524
525         * expression.cs, nullable.cs: Implemented UnaryPlus expression.
526
527 2008-04-24  Raja R Harinath  <harinath@hurrynot.org>
528
529         Fix test-636.cs.  Sprinkle a few more 'EmitSideEffect's around
530         * expression.cs (Unary.TryReduceConstant): Unwrap SideEffectConstant.
531         * statement.cs (While, Do, For): Allow test to have side effects.
532         (For.DoEmit): Always emit InitStatement.
533
534         Fix test-635.cs
535         * expression.cs (Binary.DoResolve) <BitwiseAnd with zero constant>:
536         Always create SideEffectConstant.
537         (Binary.EnumLiftUp): Don't assume that the enumeration constant is
538         of type EnumConstant.
539
540         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
541         Handle 'right' being SideEffectConstant of type 'bool'.
542
543         * expression.cs (Binary.EmitBranchable) <Equality with constant>:
544         Use left.EmitBranchable instead of open coding it, so as to
545         improve optimization opportunities.
546
547         * constant.cs (SideEffectConstant.EmitSideEffect): Simplify slightly.
548
549         * ecore.cs (Expression.EmitBranchable): Document some non-obvious
550         assumptions.
551         (Expression.EmitSideEffect): Document.
552
553 2008-04-23  Marek Safar  <marek.safar@gmail.com>
554
555         * expression.cs: Implemented NewArrayBounds, TypeIs, and TypeAs expressions.
556
557 2008-04-23  Marek Safar  <marek.safar@gmail.com>
558
559         * constant.cs, statement.cs: Use EmitSideEffect for constant if statement.
560
561 2008-04-23  Marek Safar  <marek.safar@gmail.com>
562
563         * ecore.cs, expression.cs, delegate.cs: Implemeted delegate instantiation
564         conversion to expression tree.
565
566 2008-04-23  Marek Safar  <marek.safar@gmail.com>
567
568         * ecore.cs: Removed unused expression.
569
570 2008-04-22  Marek Safar  <marek.safar@gmail.com>
571
572         * expression.cs: Implemented NegateChecked and New expressions.
573
574 2008-04-22  Marek Safar  <marek.safar@gmail.com>
575
576         * convert.cs, nullable.cs, expression.cs: Implemented Negate expression.
577
578 2008-04-22  Raja R Harinath  <harinath@hurrynot.org>
579
580         Fix #351102
581         * anonymous.cs (AnonymousMethodExpression.DoResolve): Mark as
582         needing final 'ret' instruction.
583
584 2008-04-22  Marek Safar  <marek.safar@gmail.com>
585
586         * expression.cs: Disabled lifted binary conversion on ISO-1 profiles.
587
588 2008-04-21  Marek Safar  <marek.safar@gmail.com>
589
590         * expression.cs: Emit ldnull and not null expression as an instance argument
591          of static method expression calls.
592
593 2008-04-21  Marek Safar  <marek.safar@gmail.com>
594
595         A fix for bug #378200
596         * expression.cs: Fixed crash when creating parameterless expression tree
597         method call.
598
599 2008-04-21  Marek Safar  <marek.safar@gmail.com>
600
601         A fix for bug #375297
602         * anonymous.cs: Fixed crash when inferring from null argument anonymous
603         method.
604
605 2008-04-21  Marek Safar  <marek.safar@gmail.com>
606
607         A fix for bug #377596
608         * decl.cs, class.cs: Emit delegate type argument attributes.
609
610 2008-04-21  Marek Safar  <marek.safar@gmail.com>
611
612         A fix for bug #365314
613         * generic.cs, ecore.cs: Type parameter declaration cannot be of generic type
614         
615 2008-04-21  Marek Safar  <marek.safar@gmail.com>
616
617         * cs-parser.jay, expression.cs: ComposedCast can work with type expressions
618         only.
619
620 2008-04-21  Marek Safar  <marek.safar@gmail.com>
621
622         * generic.cs (TypeParameter): Removed redundant location.
623
624 2008-04-19  Marek Safar  <marek.safar@gmail.com>
625
626         * generic.cs, parameter.cs, namespace.cs, ecore.cs, class.cs, decl.cs,
627         delegate.cs, iterators.cs, cs-parser.jay, const.cs, enum.cs: Use
628         FullNamedExpression in all declaration type expression, statements will come
629         later.
630
631 2008-04-18  Marek Safar  <marek.safar@gmail.com>
632
633         * generic.cs, namespace.cs, ecore.cs, class.cs, decl.cs, generic-mcs.cs,
634         nullable.cs, expression.cs, enum.cs, doc.cs: Cleaning up type expressions.
635
636 2008-04-18  Marek Safar  <marek.safar@gmail.com>
637
638         * parameter.cs, delegate.cs, cs-parser.jay, expression.cs: Removed unused
639         code.
640
641 2008-04-17  Marek Safar  <marek.safar@gmail.com>
642
643         * decl.cs, class.cs, generic.cs: Verify partial parts type parameters and
644         constraints.
645
646 2008-04-17  Marek Safar  <marek.safar@gmail.com>
647
648         * decl.cs, class.cs, cs-parser.jay, ecore.cs, expression.cs: Unify all type
649         name expressions.
650         Also fixes #340463.
651
652 2008-04-17  Raja R Harinath  <harinath@hurrynot.org>
653
654         Hook up 'EmitSideEffect'
655         * constant.cs (Constant.EmitSideEffect): New.
656         (SideEffectConstant.Emit): Simplify.  Use EmitSideEffect.
657         (SideEffectConstant.EmitSideEffect): New.
658         * ecore.cs (BoxedCast.EmitBranchable): Remove.  We can't use an
659         unconditional branch in EmitBranchable.
660         (FieldExpr.EmitBranchable): New.
661         * expression.cs (Unary.EmitSideEffect): New.
662         (Binary.EmitSideEffect): New.
663         (VariableReference.EmitSideEffect): New.  Do nothing.
664
665 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
666
667         Introduce 'EmitSideEffect'
668         * ecore.cs (Expression.EmitSideEffect): New.
669         (TypeCast): Rename from EmptyCast.
670         (EmptyCast): New.
671         (EmptyCast.EmitBranchable, EmptyCast.EmitSideEffect): Implement.
672         (BoxedCast.EmitBranchable, BoxedCast.EmitSideEffect): Implement.
673         * convert.cs, nullable.cs: Update to changes.
674
675 2008-04-16  Marek Safar  <marek.safar@gmail.com>
676
677         * class.cs, cs-parser.jay: Early check for base types expression.
678
679 2008-04-16  Marek Safar  <marek.safar@gmail.com>
680
681         * decl.cs (MemberName): Declare PrettyName as obsolete.
682
683 2008-04-16  Marek Safar  <marek.safar@gmail.com>
684
685         * namespace.cs: Use MemberName comparison.
686
687 2008-04-16  Raja R Harinath  <harinath@hurrynot.org>
688
689         Fix build break
690         * decl.cs (MemberName.PrettyName): New.  Replaces the misnamed
691         FullName.
692         (MemberName.MethodName, MemberName.GetSignatureForError): Improve.
693         (MemberName.FullyQualifiedName): New.  Provides the functionality
694         that users assume FullName would have.
695         * ecore.cs, namespace.cs: Update to changes.
696
697         * statement.cs (Using.assign): Make into ExpressionStatement.
698         (Using.EmitPreTryBody): Simplify.
699
700 2008-04-16  Marek Safar  <marek.safar@gmail.com>
701
702         * report.cs: ColorFormat is protected.
703         
704         * rootcontext.cs: Unused fields clean-up.
705         
706         * namespace.cs: Made UsingEntry name private.
707
708 2008-04-16  Marek Safar  <marek.safar@gmail.com>
709
710         * cs-tokenizer.cs, location.cs: Removed unused field.
711
712 2008-04-16  Jan Oravec <jan.oravec@6com.sk>
713             Raja R Harinath  <harinath@hurrynot.org>
714
715         Fix #379822
716         * constant.cs (SideEffectConstant.value): Rename from 'left'.
717         (SideEffectConstant.side_effect): Rename from 'right'.
718         (SideEffectConstant..ctor): Normalize 'side_effect'.
719         (SideEffectConstant.Emit): Emit 'value', not 'side_effect' as the
720         value of this constant.
721         * cfold.cs: Update to changes.
722
723 2008-04-15  Marek Safar  <marek.safar@gmail.com>
724
725         * cs-paser.jay: Removed unused variable.
726         
727         * driver.cs: Made Compile instance method.
728
729 2008-04-15  Raja R Harinath  <harinath@hurrynot.org>
730
731         * flowanalysis.cs (FlowBranching.MergeChild): Simplify.
732
733 2008-04-15  Marek Safar  <marek.safar@gmail.com>
734
735         * cs-paser.jay, namespace.cs: Simplified handling of namespace imports. 
736
737 2008-04-13  Jb Evain  <jbevain@novell.com>
738
739         * namespace.cs: update the System.Core fullname for 2.1
740         * driver.cs: update the list of required assemblies for 2.1.
741         Merged from the Moonlight 2 branch.
742
743 2008-04-11  Marek Safar  <marek.safar@gmail.com>
744
745         * assign.cs, ecore.cs, expression.cs, nullable.cs: More work on nullable
746         types and user defined operators. User operators arguments has to be checked
747         for null value before invocation, which also means no operator is called
748         when any argument is not convertible to unwrapped nullable type.
749         
750 2008-04-09  Marek Safar  <marek.safar@gmail.com>
751
752         * convert.cs, ecore.cs, expression.cs, nullable.cs: Initial refactoring
753         of Unary expressions to follow operator overloading rules precisely.
754         Also fixes #321794, #323794
755         
756 2008-04-08  Marek Safar  <marek.safar@gmail.com>
757
758         * cs-parser.jay, expression.cs: Don't wrap Indirection expression in Unary
759         expression.
760         
761 2008-04-08  Marek Safar  <marek.safar@gmail.com>
762
763         * expression.cs, ecore.cs: Implemented MemberInit expression.
764         
765 2008-04-08  Raja R Harinath  <harinath@hurrynot.org>
766
767         Fix mono/tests/exception4.cs
768         * statement.cs (ExceptionStatement, TryCatch): Revert to using
769         ec.NeedReturnLabel () rather emitting a 'nop'.
770
771         * statement.cs (ExceptionStatement.SomeCodeFollows): A hook for a
772         simple heuristic.
773         (TryCatch.SomeCodeFollows): Likewise.
774         * flowanalysis.cs (FlowBranchingException): Call 'SomeCodeFollows'
775         for 'break', 'continue' and 'return' statements inside a try.
776         We're fairly sure that the generated IL stream will have more
777         instructions textually following the try.
778         (FlowBranchingTryCatch): Likewise.
779
780         * statement.cs (Throw.Resolve): Move CS0156 and CS0724 testing ...
781         * flowanalysis.cs (FlowBranching.CheckRethrow): ... here and to its
782         overrides.
783
784         * statement.cs (CollectionForeach.DisposableWrapper): Make a true
785         wrapper -- forward everything to CollectionForeach.
786         (CollectionForeach.NonDisposableWrapper): New.
787         (CollectionForeach.EmitFinallyBody): Use 'endfinally' instruction
788         instead of a pop + branch to end.
789
790 2008-04-07  Marek Safar  <marek.safar@gmail.com>
791
792         A fix for bug #377485
793         * assign.cs, expression.cs, decl.cs, class.cs, ecore.cs, namespace.cs: 
794         Propagate location for extension method groups. Report conversion failure at
795         right place.
796
797 2008-04-07  Marek Safar  <marek.safar@gmail.com>
798
799         * anonymous.cs, expression.cs, ecore.cs, typemanager.cs: Implemented
800         ListInit and Field expressions.
801
802 2008-04-06  Raja R Harinath  <harinath@hurrynot.org>
803
804         * iterators.cs (Iterator.EmitMoveNext): Remove try/fault wrapper.
805         Since $PC is always -1 inside the body of MoveNext, the fault
806         handler is a no-op.
807         * flowanalysis.cs (FlowBranchingException.EmitFinally): Kill.
808         * statement.cs (ExceptionStatement.emit_finally): Likewise.
809         (ExceptionStatement.ResolveFinally): Drop 'branching' argument.
810
811         The denouement!  Fix #324708
812         * iterators.cs (Iterator.EmitMoveNext): Reset $PC to -1 on entry.
813         (Iterator.EmitYieldBreak): We no longer need to reset $PC.
814         * statement.cs (ExceptionStatement.DoEmit): Actually emit the
815         'finally' inside the finally clause.
816
817         * statement.cs (ExceptionStatement.DoEmit): Emit try/finally block
818         inside an iterator.  Don't emit the body of the 'finally' inside
819         the finally clause yet.
820
821         Use the ResumableStatement infrastructure for MoveNext ()
822         * iterators.cs (Iterator.EmitMoveNext_NoResumePoints): New.
823         (Iterator.EmitMoveNext): Use 'resume_points'.  Get rid of
824         'old_resume_points'.  Move dispatcher upfront.
825         (Iterator.MarkYield): Mark the 'resume_point' of a Yield.
826         * statement.cs (ExceptionStatement.DoEmit): Emit a dispatcher if
827         in an enumerator.  This encodes the main fix in this patch series
828         -- we can only jump into the first instruction of a try from the
829         outside, but we want to emit try/finally regions in iterators and
830         resume in the middle of them.
831
832 2008-04-05  Raja R Harinath  <harinath@hurrynot.org>
833
834         * statement.cs (ExceptionStatement.ResolveFinally): Move setting
835         of NeedReturnLabel here.
836
837         Introduce a common point for emitting try/finally to IL
838         * statement.cs (ExceptionStatement.DoEmit): New.  Combines all the
839         features of the various subclasses, which are now driven by ...
840         (ExceptionStatement.EmitPreTryBody): ... this and ...
841         (ExceptionStatement.EmitTryBody): ... this and the original
842         EmitFinallyBody.
843         (TryFinally, Lock, Using, UsingTemporary, DisposableWrapper):
844         Remove DoEmit and update to follow above protocol.
845
846         * statement.cs (ExceptionStatement.EmitForDispose): If all labels
847         of the dispatcher are the same, skip emitting the 'switch'.
848         * iterator.cs (Iterator.EmitDispose): Update to changes.
849
850         Clean up handling of 'using' statement
851         * statement.cs (UsingTemporary): New.  Carved out of ...
852         (Using): ... this.  Simplify drastically.  Handle exactly
853         one variable.
854         * cs-parser.jay (using_statement): Split.  Create UsingTemporary
855         or Using as appropriate.  If there are multiple variable declared,
856         create nested Using statements.
857         (resource_acquisition): Kill.
858
859         * statement.cs (ExceptionStatement.EmitForDispose): Use
860         EmitFinallyBody, not EmitFinally.
861
862         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Remove.
863         * iterator.cs: Update to changes.
864
865         Start using the ResumableStatement infrastructure
866         * statement.cs (ResumeableStatement.PrepareForDispose): New.
867         (ResumableStatement.EmitForDispose): New.
868         (ExceptionStatement): Override them.
869         * iterators.cs (Iterator.EmitDispose): Use PrepareForDispose and
870         EmitForDispose to create the body of the Dispose method.  Don't
871         use OldResumePoint.
872
873         * iterator.cs (Iterator.AddResumePoint): Move here from ...
874         * statement.cs (Toplevel.AddResumePoint): ... here.
875         (Toplevel.MoveNextStatement.Resolve): Create FlowBranchingIterator.
876         * flowanalysis.cs (FlowBranchingIterator): New.
877         * codegen.cs (EmitContext): Update to changes.
878
879         * iterators.cs (Iterator.OldResumePoint): Rename from ResumePoint.
880         (Iterator.old_resume_points): Rename from 'resume_points'.
881         (Iterator.MoveNextStatement): Remove unused class.
882
883         New infrastructure for try/finally in iterators (still unused)
884         * flowanalysis.cs (FlowBranching.AddResumePoint): New.
885         (FlowBranchingToplevel.AddResumePoint): Hook into
886         ToplevelBlock.AddResumePoint.
887         (FlowBranchingTryCatch): Move CS01626 and CS01631 checks here.
888         (FlowBranchingException): Hook into ExceptionBlock.AddResumePoint.
889         * statement.cs (ToplevelBlock.AddResumePoint): New.  Collect
890         resume points and assign program-counter values.
891         (ExceptionBlock.AddResumePoint): Collect resume points for
892         de-muxer at the top of try block.
893         * iterators.cs (Yield.CheckContext): Simplify.
894         (Yield.Resolve): Use FlowBranching.AddResumePoint.
895
896 2008-04-04  Raja R Harinath  <harinath@hurrynot.org>
897
898         * flowanalysis.cs (FlowBranching.AddReturnOrigin): Change Location
899         argument to an ExitStatement.
900         (FlowBranchingException): Refactor saved origins code.
901         * statement.cs (ExitStatement): Update to cahges.
902         * iterator.cs (YieldBreak): Likewise.
903
904         * statement.cs (ResumableStatement): New.  Common base class for
905         YieldReturn and ExceptionStatement.
906         (ExitStatement): New.  Common base class for Return and YieldBreak.
907         (Return): Update to changes.
908         * iterator.cs (YieldBreak): Likewise.
909         * lambda.cs (ContextualReturn): Likewise.
910
911         Fix #377028
912         * ecore.cs (Expression.ResolveAsTypeStep): If '!silent' attempt to
913         emit a meaningful error message.
914
915         Fix #324765, #319508
916         * flowanalysis.cs (VariableInfo.IsEverAssigned): New.
917         (VariableInfo.SetAssigned): Set it.
918         * statement.cs (Block.UsageWarning): Use 'IsEverAssigned' to
919         determine if CS0219 or CS0168 is appropriate.  Don't use
920         flow-analysis information.
921         (Block.Resolve): Use ec.EndFlowBranching, not ec.DoEndFlowBranching.
922         * codegen.cs (EmitContext.DoEndFlowBranching): Kill.  Inline into ...
923         (EmitContext.EndFlowBranching): ... this.
924
925 2008-04-03  Marek Safar  <marek.safar@gmail.com>
926
927         * class.cs, typemanager.cs: Emit volatile field with IsVolatile modifier.
928
929 2008-04-03  Marek Safar  <marek.safar@gmail.com>
930
931         A fix for bug #376508
932         * convert.cs, expression.cs: Fixed difference between ImplicitConversion and
933         ImplicitConversionExists.
934
935 2008-04-03  Marek Safar  <marek.safar@gmail.com>
936
937         * expression.cs (Binary): Added remaining binary operators to expression
938         tree builder.
939
940         * nullable.cs: Optimize shift with null argument.
941
942 2008-04-03  Raja R Harinath  <harinath@hurrynot.org>
943
944         Fix minor IL regression
945         * statement.cs (TryCatch..ctor): Add 'inside_try_finally' argument.
946         (TryCatch.DoEmit): Use it to avoid creating another ExceptionBlock.
947         * cs-parser.jay (try_statement): Update to changes.
948
949         * statement.cs (TryFinally.need_exc_block): Delete.
950         (TryFinally): Update to changes.
951
952         Now all ExceptionStatements are unconditional
953         * statement.cs (CollectionForeach.DisposableWrapper): New.
954         Extract out the try/finally code into a new wrapper.
955         (CollectionForeach.Resolve): Use it to simplify the code.
956
957 2008-04-02  Raja R Harinath  <harinath@hurrynot.org>
958
959         Start at simplifying ExceptionStatement semantics a bit
960         * statement.cs (TryCatch, TryFinally): Split 'Try' into two pieces.
961         * cs-parser.jay (try_statement): Update to changes.
962         (opt_catch_clauses): Remove.
963         * flowanalysis.cs: Update to changes.
964         (FlowBranching.BranchingType.TryCatch): New.
965         (FlowBranchingTryCatch): New.
966
967         * flowanalysis.cs (FlowBranching.BranchingType.SwitchSection): Kill.
968         (FlowBranching.CreateBranching): Update to changes.
969         (FlowBranchingBlock.AddSibling): Add sanity check.
970         * codegen.cs (EmitContext.StartFlowBranching) <Block variant>:
971         Update to changes.
972
973         * iterators.cs (Iterator.MarkFinally): Remove.
974         * statement.cs (ExceptionStatement): Update to changes.
975
976         Add support for skipping over finally blocks at runtime.  First
977         in a series to fix #324708
978         * iterators.cs (Iterator.SkipFinally): New LocalBuilder.
979         (Iterator.EmitMoveNext): Initialize it.
980         * statement.cs (ExceptionStatement.EmitFinally): Use it to emit a
981         branch over the body of the 'finally' clause.
982
983 2008-03-31  Raja R Harinath  <harinath@hurrynot.org>
984
985         Avoid lopsided use of Foo/DoFoo names
986         * statement.cs (ExpressionStatement.EmitFinallyBody):
987         Rename from EmitFinally.
988         (ExpressionStatement.EmitFinally): Rename from DoEmitFinally.
989         * iterator.cs: Update to changes.
990
991 2008-04-02  Marek Safar  <marek.safar@gmail.com>
992
993         * ecore.cs, expression.cs, nullable.cs: ConditionalLogicalOperator is now
994         based on UserOperatorCall. More binary nullable operators clean up.
995
996 2008-04-02  Martin Baulig  <martin@ximian.com>
997
998         * symbolwriter.cs: Remove the `#if !DISABLE_TERRANIA_CHANGES' conditionals.
999
1000 2008-04-02  Marek Safar  <marek.safar@gmail.com>
1001
1002         * nullable.cs: Merge user and empty conversions when lifting expression
1003         trees.
1004         
1005         * expression.cs (StringConcat): Implemented expression tree representation.
1006
1007 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1008
1009         * nullable.cs: When lifting null literal and a user operator exists, no call 
1010         is made.
1011         
1012 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1013
1014         * nullable.cs, ecore.cs, expression.cs: Convert null arithmetic to lifted
1015         null.
1016
1017 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1018
1019         * nullable.cs, expression.cs: Use namespace instead heavily nested
1020         monster abstract class.
1021
1022 2008-04-01  Marek Safar  <marek.safar@gmail.com>
1023
1024         * ecore.cs, convert.cs, constant.cs, nullable.cs, expression.cs: Implemented
1025         lifting of null literal and user operators. Clean up of some temporary
1026         nullable hacks.
1027
1028 2008-03-30  Raja R Harinath  <harinath@hurrynot.org>
1029
1030         Fix #368224, test-629.cs
1031         * flowanalysis.cs (FlowBranching.StealFinallyClauses): Return true
1032         if it crossed an unwind-protect boundary.
1033         * iterators.cs (Yield.CheckContext): Relax check for 'yield break'.
1034         (Yield.Resolve, Yield.DoEmit): Track whether the yield occurs
1035         inside an unwind-protected region.
1036         (YieldBreak.Resolve, YieldBreak.DoEmit): Likewise.
1037         (Iterator.MarkYield): Add 'unwind_protect' parameter.  Emit a
1038         'leave' instead of a 'br' if unwind-protected.
1039         (Iterator.EmitYieldBreak): Likewise.
1040
1041 2008-03-29  Gert Driesen  <drieseng@users.sourceforge.net>
1042
1043         * driver.cs: Only define versioninfo resources if no win32 resource
1044         file was specified.
1045
1046 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1047
1048         A fix for bug #372375
1049         * convert.cs: Fixed boxing of nullable types.
1050
1051 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1052
1053         * typemanager.cs: Initialize InternalsVisibleTo as the very first optional
1054         type.
1055
1056 2008-03-28  Marek Safar  <marek.safar@gmail.com>
1057
1058         A fix for bug #374619
1059         * nullable.cs: Fixed guarding of EmitBitwiseBoolean.
1060         
1061 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1062
1063         * lambda.cs: Check return type only for invocation.
1064         
1065 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1066
1067         A fix for bug #374214
1068         * ecore.cs: Correctly report argument type mismatch.
1069
1070 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1071
1072         * convert.cs (ImplicitReferenceConversionCore): Correctly compare enum type
1073         and not rely on broken IsEnum.
1074
1075 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1076
1077         * nullable.cs: New file, extracted from generic.cs.
1078         
1079         * generic.cs, generic-mcs.cs, *.csproj, *.sources: Updated.
1080
1081 2008-03-27  Marek Safar  <marek.safar@gmail.com>
1082
1083         * generic.cs, convert.cs, generic-mcs.cs, expression.cs: Added lifting of
1084         predefined comparison operators and null literals.
1085         
1086         * report.cs: New warning ID.
1087         
1088 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1089
1090         A fix for bug #370577
1091         * lambda.cs: Check return type too.
1092
1093 2008-03-25  Marek Safar  <marek.safar@gmail.com>
1094
1095         A fix for bug #372846
1096         * class.cs: Automatic properties can be declared as unsafe.
1097
1098 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1099
1100         * location.cs: Use string based concatenation.
1101         
1102         * expression.cs: LiftedBinaryOperator is gmcs only.
1103         
1104 2008-03-20  Marek Safar  <marek.safar@gmail.com>
1105
1106         * generic.cs, literal.cs, ecore.cs, expression.cs: Ongoing work on nullable
1107         conversions rules and expression trees.
1108
1109 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1110
1111         * delegate.cs: Use extension method source as delegate target.
1112
1113 2008-03-19  Marek Safar  <marek.safar@gmail.com>
1114
1115         * generic.cs, generic-mcs.cs, expression.cs, ecore.cs: Rewrote nullable
1116         binary operations to be purely based on binary operations and optimized
1117         emitted code (30% less in some cases). Introduced ReducedExpression for ETs
1118         and other ET refactoring.
1119         
1120         * typemanager.cs: Fixed warning.
1121         
1122 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1123
1124         * class.cs, decl.cs, delegate.cs: Do protected modifier check on each member
1125         
1126         * symbolwriter.cs: Fixed.
1127
1128 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1129
1130         * anonymous.cs, driver.cs: Reset anonymous types counters.
1131
1132 2008-03-17  Marek Safar  <marek.safar@gmail.com>
1133
1134         * ecore.cs (MethodGroupExpr): Skip first candidate, it's already the best.
1135         
1136         * class.cs: Use fullname for all type member definitions.
1137         
1138 2008-02-19  Martin Baulig  <martin@ximian.com>
1139
1140         * class.cs
1141         (IMethodData.EmitExtraSymbolInfo): New interface method.
1142         (MethodData.Emit): Call method.EmitExtraSymbolInfo().
1143         (MethodOrOperator.EmitExtraSymbolInfo): Implement this new
1144         interface method here as an empty public virtual method.
1145
1146         * anonymous.cs
1147         (AnonymousMethodMethod.ctor): Added `string real_name' argument.
1148         (AnonymousMethodMethod.EmitExtraSymbolInfo): Override and call
1149         CodeGen.SymbolWriter.SetRealMethodName().       
1150
1151 2008-02-18  Martin Baulig  <martin@ximian.com>
1152
1153         * anonymous.cs
1154         (ScopeInfo.EmitType): Override this and emit debugging
1155         information for captured variables.
1156         (RootScopeInfo.EmitType): Override this and emit symbol
1157         information for a captured `this'.
1158
1159 2008-02-15  Martin Baulig  <martin@ximian.com>
1160
1161         * iterators.cs: Emit debugging info.
1162
1163         * codegen.cs
1164         (EmitContext.Flags): Add `OmitDebuggingInfo'.
1165         (EmitContext.OmitDebuggingInfo): New public property.
1166
1167         * statement.cs
1168         (While): Override Emit() and don't emit symbol info there; do it
1169         inside DoEmit() instead.
1170         (Block.Emit): Omit symbol information while emitting the scope
1171         initializers; don't ec.Mark() the `EndLocation'.  Fix the lexical
1172         block logic.
1173         (ExplicitBlock.IsIterator): Moved here from `ToplevelBlock'.
1174         (ToplevelBlock.MakeIterator): Pass the `flags' to `ExplicitBlock's
1175         .ctor to make `IsIterator' work.
1176
1177 2008-03-14  Martin Baulig  <martin@ximian.com>
1178
1179         * symbolwriter.cs: Added the new symbol writer function from the
1180         debugger's `terrania' branch; temporarily enclose them inside
1181         `#if !DISABLE_TERRANIA_CHANGES' conditionals until I'm back from
1182         my vacations.
1183
1184 2008-03-14  Martin Baulig  <martin@ximian.com>
1185
1186         * symbolwriter.cs
1187         (SymbolWriter): Make this a public static class.
1188
1189         * codegen.cs
1190         (CodeGen.SymbolWriter): Removed; use the new static `SymbolWriter'
1191         class instead of using `if (CodeGen.SymbolWriter != null)' everywhere.
1192
1193 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1194
1195         A fix for bug #370577
1196         * statement.cs, lambda.cs: Added extra limitations when dealing with void
1197         return type.
1198         
1199 2008-03-14  Marek Safar  <marek.safar@gmail.com>
1200
1201         * typemanager.cs (CSharpName): Made 250 times faster.
1202
1203 2008-03-13  Marek Safar  <marek.safar@gmail.com>
1204
1205         * ecore.cs, expression.cs: Emit conversion for ET shift argument.
1206         
1207 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1208
1209         * generic.cs, typemanager.cs, enum.cs, codegen.cs, statement.cs: Try not to
1210         crash when predefined field does not exist.
1211         
1212 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1213
1214         * ecore.cs (PropertyExpr): Fixed IsSingleDimensionalArrayLength regression.
1215         
1216 2008-03-12  Marek Safar  <marek.safar@gmail.com>
1217
1218         * class.cs (FixedField): Don't crash when contructors are missing.
1219
1220 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1221
1222         * typemanager.cs, namespace.cs, literal.cs, ecore.cs, class.cs, decl.cs,
1223         convert.cs, constant.cs, expression.cs, statement.cs: Use same method to
1224         check internal types accessibility for internal and external types.
1225         Replaced EnumToUnderlying by GetEnumUnderlyingType.
1226
1227 2008-03-11  Marek Safar  <marek.safar@gmail.com>
1228
1229         * support.cs, typemanager.cs, pending.cs, ecore.cs, class.cs, delegate.cs
1230         convert.cs, const.cs, anonymous.cs, constant.cs, expression.cs,
1231         attribute.cs, statement: Use corect instance of predefined types (work
1232         related to #364674).
1233
1234 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1235
1236         * expression.cs (TypeOfVoid): Fixed predefined method initialization.
1237         
1238 2008-03-07  Marek Safar  <marek.safar@gmail.com>
1239
1240         * generic.cs, typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, 
1241         class.cs, delegate.cs, iterators.cs, const.cs, constant.cs, driver.cs,
1242         expression.cs, attribute.cs, codegen.cs, statement.cs: TypeManager optional
1243         predefined types clean up, delayed predefined types members initialization
1244         (work related to #364674).
1245
1246 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1247
1248         * typemanager.cs (IsFriendAssembly): InternalsVisibleTo is not mandatory.
1249         
1250 2008-03-05  Marek Safar  <marek.safar@gmail.com>
1251
1252         * typemanager.cs, parameter.cs, rootcontext.cs, ecore.cs, class.cs, decl.cs,
1253         delegate.cs, convert.cs, driver.cs, attribute.cs, codegen.cs: TypeManager
1254         predefined types clean up (work related to #364674).
1255
1256 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1257
1258         * ecore.cs: Print an error message instead of throwing exception.
1259         
1260 2008-03-04  Marek Safar  <marek.safar@gmail.com>
1261
1262         * generic.cs, typemanager.cs, literal.cs, convert.cs, cfold.cs, constant.cs,
1263         expression.cs, statement.cs: Unififed null literal representation.
1264
1265 2008-03-03  Marek Safar  <marek.safar@gmail.com>
1266
1267         * anonymous.cs, cfold.cs, convert.cs, delegate.cs, doc.cs, ecore.cs,
1268         expression.cs: Refactored binary operators resolve phase and improved speed.
1269         The nullable code is still missing and won't work correctly, more fixes
1270         required.
1271
1272         It also fixes #323726, #324312, #324248, and many other unreported issues.
1273
1274 2008-02-29  Zoltan Varga  <vargaz@gmail.com>
1275
1276         * report.cs (FeatureIsNotAvailable): Use 'mcs1' instead of 'mcs', and 'mcs' 
1277         instead of 'gmcs'.
1278
1279 2008-02-27  Marek Safar  <marek.safar@gmail.com>
1280
1281         * ecore.cs: Clean-up and split BetterConversion.
1282         
1283 2008-02-25  Raja R Harinath  <harinath@hurrynot.org>
1284
1285         Fix #363791
1286         * enum.cs (EnumMember.Value): Only access 'value' if
1287         ResolveValue says it's ok.
1288         (EnumMember.DoResolveValue): Don't set prev_member.value.
1289         (Enum.GetDefinition): Reverse arguments of Equals --
1290         EnumMember.Value can return 'null'.
1291
1292         * statement.cs (Switch.Error_AlreadyOccurs): Fix typo in name.
1293
1294 2008-02-22  Marek Safar  <marek.safar@gmail.com>
1295
1296         * generic.cs, expression.cs: More ongoing work on expression trees.
1297         
1298 2008-02-21  Marek Safar  <marek.safar@gmail.com>
1299
1300         * class.cs, typemanager.cs: Rewrote operator matching logic to correctly
1301         handle missing matches when mutiple operators exist.
1302         
1303 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1304
1305         A fix for bug #363218
1306         * expression.cs (ArrayCreation.Clone): Deal with multi-dimensional
1307         initializers.
1308         
1309 2008-02-20  Marek Safar  <marek.safar@gmail.com>
1310
1311         * expression.cs, constant.cs, cfold.cs: Yet another side-effect constant
1312         update. This time to deal correctly with SideEffectConstant expression used
1313         as an argument for another constant folding.
1314
1315 2008-02-20  Raja R Harinath  <harinath@hurrynot.org>
1316
1317         * typemanager.cs (DropGenericMethodArguments): Ensure we get an underlying
1318         MethodBuilder.
1319
1320 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1321
1322         * constant.cs, cfold.cs: SideEffectConstant results can apply for folding.
1323
1324 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1325
1326         A fix for bug #328136
1327         * expression.cs: Do not fold immediately LogicalAnd operators when the left
1328         side is a false constant, because we still need to evaluate the right-hand
1329         side.
1330
1331         * statement.cs (If): Emit two types of boolean constants (simple constant,
1332         side-effect constant).
1333
1334 2008-02-19  Marek Safar  <marek.safar@gmail.com>
1335
1336         * constant.cs (SideEffectConstant): Don't emit boolean constant.
1337
1338         * expression.cs: Fold immediately LogicalAnd operators when both sides are
1339         constants.
1340
1341 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1342
1343         A fix for bug #361457
1344         * ecore.cs (IsApplicable): Params methods have lower priority.
1345
1346         * support.cs: Return correct parameter modifier for params types.
1347
1348 2008-02-18  Marek Safar  <marek.safar@gmail.com>
1349
1350         * generic.cs (TypeParameter): Cache attribute target name.
1351
1352         * support.cs: Removed unused variable.
1353
1354         * typemanager.cs: Removed debugging leftover.
1355
1356         * ecore.cs: Use local type instead of a property;
1357
1358         * class.cs (VerifyMembers): Consider also parent to test whether type member
1359         is local or public.
1360
1361         * expression.cs (FullMethodDesc): Removed.
1362
1363         * attribute.cs (IsValidArgumentType): Made static.
1364
1365 2008-02-17  Raja R Harinath  <harinath@hurrynot.org>
1366
1367         Cleanup to be more readable.
1368         * Makefile (GMCS_PROFILE): Remove.
1369         (COMPILER_NAME): New helper.
1370
1371 2008-02-15  Miguel de Icaza  <miguel@novell.com>
1372
1373         * cs-tokenizer.cs: if a conditional expression happens inside a
1374         (...) this also means that we do not need to de-ambiguate between
1375         an parenthesized expression and a cast.
1376
1377         Fixes 346484.
1378
1379         * constant.cs (SideEffectConstant): a constant value that happens
1380         to have a side effect.
1381
1382         Fixes the build regressions introduced by the fix for #359789
1383
1384 2008-02-14  Rodrigo Kumpera  <rkumpera@novell.com>
1385
1386         * expression.cs (Conditional.Emit): when emitting the ternary
1387         operator, use local variables to generate code verifiable code.
1388
1389         The verifier cannot infer that the type on stack before the
1390         stloc.0 is executed is of type ParentB. This happens because the
1391         stack merge algorithm uses only parent types when deciding which
1392         is the common type.  This is described in Part III 1.8.1.3 of ECMA
1393         335.
1394
1395         This code compiled with mcs is not verifiable under MS. The MS
1396         verifier picks the first common interface of Foo and Bar, which is
1397         wrong, but doesn't use a full join type of the 2 interfaces.
1398
1399         CSC uses a clever hack to compile such code in a verifiable
1400         way. It stores the intermediate values in a local variable with
1401         the expected type.
1402
1403         Fixes: #358102
1404
1405 2008-02-14  Miguel de Icaza  <miguel@novell.com>
1406
1407         * expression.cs: Do not fold BitwiseAnd operators when the left
1408         side is a false constant, because we still need to evaluate the
1409         right-hand side.
1410
1411         Fixes #359789
1412
1413         * support.cs: Instead of throwing an InternalErrorException when
1414         the position of the stream is outside the boundary of our buffer,
1415         reset the state of the reader, and restart the reading from the
1416         beginning of the file.
1417
1418 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1419
1420         * generic.cs (TypeParameter.GetMembers): Is not supported operation.
1421
1422 2008-02-14  Marek Safar  <marek.safar@gmail.com>
1423
1424         A fix for bug #361686
1425         * decl.cs: A protected types used inside a private class which parents
1426         derives from the protected class are accessible.
1427
1428 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1429
1430         * generic.cs (ConstraintChecker): Use cached member lookup when looking for
1431         the parameterless constructor.
1432
1433 2008-02-13  Marek Safar  <marek.safar@gmail.com>
1434
1435         * generic.cs, typemanager.cs, iterators.cs, codegen.cs: Refactored core
1436         lookup methods to use standard member cache when doing member lookup.
1437
1438 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1439
1440         * driver.cs: Don't report full path for referenced module as assembly error.
1441
1442 2008-02-12  Marek Safar  <marek.safar@gmail.com>
1443
1444         * Makefile: Fixed `qh' target to work on all machines.
1445
1446         * report.cs, typemanager.cs, parameter.cs, ecore.cs, class.cs, anonymous.cs,
1447         expression.cs, codegen.cs, statement.cs, doc.cs: Replaced type IsSubclassOf
1448         and HasElementType with TypeManager implementation.
1449
1450 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1451
1452         A fix for bugs #325134, #359749
1453         * expression.cs, ecore.cs: Try to resolve an extension method even if the
1454         first binds point to non-method member expression.
1455
1456 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1457
1458         * cs-parser.jay: Null coalescing operator is not part of ISO-1.
1459
1460 2008-02-08  Marek Safar  <marek.safar@gmail.com>
1461
1462         A fix for bugs #321394, #323028
1463         * generic.cs, parameter.cs, ecore.cs, class.cs, decl.cs, delegate.cs:
1464         Reworked naive IsAccessibleAs implementation to handle nested types.
1465
1466 2008-02-05  Jb Evain  <jbevain@novell.com>
1467
1468         * class.cs: use generic type comparison for parameters
1469         as well.
1470
1471 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1472
1473         A fix for bug #325372
1474         * class.cs: Use generic type comparison when testing method signatures.
1475
1476 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1477
1478         A fix for bug #357047
1479         * ecore.cs: Applied C# 3.0 changes to better conversion.
1480
1481 2008-02-05  Marek Safar  <marek.safar@gmail.com>
1482
1483         A fix for bug #358374
1484         * cs-parser.jay: Correctly set modifiers for all constructor types.
1485
1486 2008-02-04  Marek Safar  <marek.safar@gmail.com>
1487
1488         A fix for bug #355251
1489         * generic.cs: Added base class constraint based type inference.
1490
1491 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1492
1493         A fix for bug #357255
1494         * decl.cs: One more missing visibility check.
1495
1496 2008-02-01  Marek Safar  <marek.safar@gmail.com>
1497
1498         * support.cs: Fixed broken return.
1499
1500 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1501
1502         * report.cs: Correctly reset warnings count after probing.
1503
1504 2008-01-25  Martin Baulig  <martin@ximian.com>
1505
1506         * namespace.cs
1507         (NamespaceEntry.SymbolFileID): Make this work again after
1508         MemberName.ToString() is gone.
1509
1510 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1511
1512         * expression.cs: Implemented Divide, Equal, ExclusiveOr, GreaterThanOrEqual
1513         expressions.
1514
1515 2008-01-25  Marek Safar  <marek.safar@gmail.com>
1516
1517         * generic.cs: Use full implicit conversion for type inference fixing.
1518
1519 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1520
1521         * ecore.cs, expression.cs, generic.cs: Implemented Convert, ConvertChecked.
1522         Fixed user operator conversions.
1523
1524 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1525
1526         * generic.cs: Do nullable type to null comparison optimization during
1527         resolve phase.
1528
1529 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1530
1531         A fix for bug #355163
1532         * generic.cs: Enabled l-value resolve on nullable expressions.
1533
1534 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1535
1536         A fix for bug #353986
1537         * class.cs: Ingore static ctors with parameters for any further checks.
1538
1539 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1540
1541         A fix for bug #354310
1542         * namespace.cs: Removed redundant check.
1543
1544 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1545
1546         A fix for bug #354928
1547         * expression.cs: ElementInitializers can be resolved only once.
1548
1549 2008-01-24  Marek Safar  <marek.safar@gmail.com>
1550
1551         * convert.cs, ecore.cs, expression.cs, generic.cs: Implemented Coalesce and
1552         Condition expressions.
1553
1554 2008-01-23  Marek Safar  <marek.safar@gmail.com>
1555
1556         * codegen.cs: Fixed AssemblyBuilder initialization on other platforms.
1557
1558 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1559
1560         * ecore.cs, expression.cs, generic.cs: Implicit bool? to bool conversion is
1561         not allowed.
1562
1563         * generic.cs: Implemented coalesce expression.
1564
1565 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1566
1567         A fix for bug #355145
1568         * anonymous.cs, convert.cs, ecore.cs, generic.cs, lambda.cs: Implemented
1569         expression tree type inference.
1570
1571 2008-01-22  Raja R Harinath  <harinath@hurrynot.org>
1572
1573         Fix #354663
1574         * expression.cs (Binary.IsUnsignedType): Fix typo.
1575
1576 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1577
1578         * ecore.cs, expression.cs, generic.cs: Implemented NewArrayInit expression.
1579
1580 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1581
1582         A fix for bug #355161
1583         * ecore.cs, expression.cs: Wider range of extension method supported
1584         expressions.
1585
1586 2008-01-22  Gert Driesen  <drieseng@users.sourceforge.net>
1587
1588         * codegen.cs: Use magic value for AssemblyBuilderAccess to instruct
1589         AssemblyBuilder to operate in compiler context. Fixes mcs part of
1590         bug #354970.
1591
1592 2008-01-22  Marek Safar  <marek.safar@gmail.com>
1593
1594         A fix for bug #355148
1595         * ecore.cs, expression.cs: Correctly report misused ref and out modifiers.
1596
1597 2008-01-22  Miguel de Icaza  <miguel@novell.com>
1598
1599         * expression.cs (CreateExpressionTree): Add support for or and
1600         logical or, and indent following the coding conventions.
1601
1602         * typemanager.cs (LinqExpression): renamed from
1603         ExpressionTreeManager, for a shorter name.
1604
1605         Use TypeManager.CoreLookupType to lookup types from our core
1606         assemblies and turn those into "Type" variables.
1607
1608         Consumers that previously used "Namespace" and "Type" from this
1609         class should instead use the TypeExpression which is a type that
1610         is fully resolved (without involving the regular C# resolution
1611         rules). 
1612
1613         This typically looks like this:
1614
1615         TypeExpression texpr = new TypeExpression (LinqExpression.expression_type, loc);
1616         new MemberAccess (texpr, name, type_arguments, loc)
1617
1618         This avoids the problem in: #355178
1619
1620 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1621
1622         * cs-parser.jay, expression.cs: Check `namespace alias qualifier' language
1623         feature in parser only as we do in other cases.
1624         
1625 2008-01-21  Marek Safar  <marek.safar@gmail.com>
1626
1627         * attribute.cs, ecore.cs, class.cs, delegate.cs, expression.cs, linq.cs,
1628         typemanager.cs: A refactoring of params arguments to reuse existing
1629         expressions (params -> array initializer) to emit params argument instead
1630         of specialized handling.
1631         It was required by expression tree implementation and it has other benefits
1632         as well, we now apply same optimization for params arguments as we do for
1633         array initializers.
1634         
1635 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1636
1637         A fix for bug #353526
1638         * generic.cs: A type inference of params arguments may not required any
1639         temporary array creation.
1640         
1641 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1642
1643         A fix for bug #353534
1644         * generic.cs, ecore.cs, expression.cs: A method group type inference is
1645         supported for delegates only.
1646         
1647 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1648
1649         * generic.cs: Fixed 3.0 type inference fixing phase to determine a unique
1650         type for more than 1 candidates.
1651         
1652 2008-01-18  Marek Safar  <marek.safar@gmail.com>
1653
1654         * typemanager.cs, ecore.cs, expression.cs: Implemented ArrayLength and Call
1655         expressions.
1656         
1657 2008-01-16  Marek Safar  <marek.safar@gmail.com>
1658
1659         * generic.cs, typemanager.cs, lambda.cs, parameter.cs, ecore.cs, constant.cs,
1660         expression.cs: Implemented Add, And, AndAlso, and ArrayIndex (without unary
1661         operator) expressions. 
1662                 
1663 2008-01-16  Zoltan Varga  <vargaz@gmail.com>
1664
1665         * statement.cs: Avoid declaring an IL variable for this_variable since it is
1666         not accessed from the generated IL.
1667
1668 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1669
1670         * typemanager.cs, lambda.cs, parameter.cs, ecore.cs, class.cs, delegate.cs,
1671         iterators.cs, convert.cs, assign.cs, anonymous.cs, expression.cs,
1672         statement.cs: The first expression tree implementation drop, mostly
1673         infrastructure work.
1674
1675 2008-01-14  Marek Safar  <marek.safar@gmail.com>
1676
1677         * ecore.cs (IsNestedChild): Refactored.
1678
1679 2008-01-11  Marek Safar  <marek.safar@gmail.com>
1680
1681         * lambda.cs: Don't use a cast on unknown expression statement.
1682
1683 2008-01-10  Geoff Norton  <gnorton@novell.com>
1684
1685         * cs-tokenizer.cs: One more token to distinguish between method and lambda
1686         arguments
1687
1688 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1689
1690         * doc.cs: Report better /doc crash details.
1691         
1692 2008-01-09  Marek Safar  <marek.safar@gmail.com>
1693
1694         A fix for bug #352536
1695         * ecore.cs, assign.cs, codegen.cs: Check event assignments.
1696
1697 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1698
1699         A fix for bug #352287
1700         * ecore.cs, expression.cs: Do `this' access checking in all member access
1701         expressions.
1702         
1703 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1704
1705         * rootcontext.cs, driver.cs: Switch to linq mode by default.
1706         
1707         * report.cs: Reset message stacks.
1708         
1709 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1710
1711         * generic.cs (InferInPhases): Correctly calculate params position.
1712         
1713 2008-01-08  Marek Safar  <marek.safar@gmail.com>
1714
1715         * cs-tokenizer.cs: No need to parse full string when parsing lambda
1716         arguments.
1717
1718 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1719
1720         * cs-tokenizer.cs: Enabled lambda arguments micro-parser for all profiles.
1721         
1722         * decl.cs (LookupNamespaceOrType): Don't cache names which caused an error.
1723         
1724         * driver.cs: Updated --help option.
1725         
1726 2008-01-07  Marek Safar  <marek.safar@gmail.com>
1727
1728         * generic.cs (InferParamsTypeArguments): Removed.
1729         (InferInPhases): Add params type inference.
1730         (LowerBoundInference): Fixed scoring mechanism.
1731         
1732         * cs-tokenizer.cs (PreProcessPragma): Use Location instead of line.
1733         
1734 2008-01-06  Gert Driesen  <drieseng@users.sourceforge.net>
1735
1736         * typemanager.cs: On 2.0 profile, GetPublicKeyToken returns an empty
1737         byte array for unsigned "baked" assemblies.
1738
1739 2008-01-05  Gert Driesen  <drieseng@users.sourceforge.net>
1740
1741         * codegen.cs: AssemblyName.GetPublicKey returns a zero-length byte
1742         array for assemblies that are not strongnamed.
1743
1744 2008-01-04  Marek Safar  <marek.safar@gmail.com>
1745
1746         A fix for bug #351481
1747         * expression.cs (MemberAccess.ResolveNamespaceOrType): Use correct
1748         declaring type for nested generic types.
1749         
1750 2008-01-04  Marek Safar  <marek.safar@gmail.com>
1751
1752         * namespace.cs, class.cs, decl.cs, cs-parser.jay: Use GetSignatureForError
1753         instead of ToString.
1754         
1755 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1756
1757         A fix for bug #351047
1758         * expression.cs (Binary.ResolveOperator): Allow equality operators between
1759         null and structs only when equality and inequality operators are defined
1760         either as an user-operators or predefined operators.
1761         
1762 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1763
1764         A fix for bug #351047
1765         * generic.cs, typemanager.cs, class.cs: New IsReferenceType helper method.
1766         
1767 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1768
1769         A fix for bug #351257
1770         * cs-tokenizer.cs: Advance line number for '\r' correctly.
1771         
1772 2008-01-03  Marek Safar  <marek.safar@gmail.com>
1773
1774         A fix for bug #351157
1775         * class.cs (Using): Fixed yet another broken cloning.
1776         
1777         (Block): Put back more sensible default value for statements.
1778         
1779 2008-01-01  Gert Driesen  <drieseng@users.sourceforge.net>
1780
1781         * codegen.cs: Allow AssemblyVersion with only major version component.
1782         Fixes bug #351055.
1783
1784 2007-12-29  Marek Safar  <marek.safar@gmail.com>
1785
1786         A fix for bug #324654
1787         * class.cs: Use FullName property as member name.
1788
1789 2007-12-28  Marek Safar  <marek.safar@gmail.com>
1790
1791         A fix for bug #342117
1792         * generic.cs (ConstraintChecker): Struct constraint also satisfies default
1793         constructor constraint.
1794
1795 2007-12-28  Marek Safar  <marek.safar@gmail.com>
1796
1797         A fix for bug #338273
1798         * class.cs (ProbertyBase): Access modifier checks are required for overrides
1799         only.
1800
1801 2007-12-28  Marek Safar  <marek.safar@gmail.com>
1802
1803         A fix for bug #350839
1804         * ecore.cs (MethodroupExpr): Probing hacks are no longer required.
1805
1806 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
1807
1808         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1809         GHOP:
1810         
1811         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
1812
1813         * statement.cs: Changed some Hashtables to use HybridDictionaries
1814         instead. It was observed that some HashTables only contained a few
1815         items in the vast majority of cases. Since HybridDictionary is
1816         more efficient on small sets (<10 elements), "known_variables"
1817         from class ExplicitBlock as well as "labels" and "constants " from
1818         class Block were changed to HybridDictionaries. 
1819
1820         Atsai results: (56216kb->54987kb)
1821
1822         Miguel results (bootstrap of mcs): 59819kb -> 59290kb
1823
1824
1825 2007-12-27  AdTsai (http://code.google.com/u/AdTsai/)
1826
1827         Reviewed by Ben Maurer, Miguel de Icaza, patches from Google's
1828         GHOP:
1829         
1830         http://code.google.com/p/google-highly-open-participation-mono/issues/detail?id=4 
1831         
1832         * expression.cs: foreach loop to for loop, saved on allocation of
1833         enumerator (59333kb->59141kb)
1834
1835         * statement.cs. Changed foreach loops to for loops, saved on
1836         allocation of enumerator (59141kb->59006kb)
1837
1838         * decl.cs: ArrayLists in .NET 1.1 allocate 16 elements by default
1839         when constructed with no specified capacity. This was causing a
1840         few ArrayLists to allocate more memory than they would potentially
1841         need in the Block class and MemberCache class. Setting the
1842         ArrayLists to construct with a capacity of 1 saves some
1843         memory. (56216kb->55585kb)
1844
1845 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1846
1847         A fix for bug #347189 (2nd issue)
1848         * expression.cs (MemberAccess): Nested type can be found in base non-generic
1849         type.
1850
1851 2007-12-27  Miguel de Icaza  <miguel@novell.com>
1852         
1853         * report.cs: Do not use colors if stdout and stderr are not a
1854         terminal.
1855
1856 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1857
1858         A fix for bug #346998
1859         * ecore.cs (MethodGroupExpr): Implemented override filter for generic
1860         overloads.
1861
1862 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1863
1864         A fix for bug #343465
1865         * class.cs: Explicit method name for nested types uses dots only.
1866
1867 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1868
1869         A fix for bug #343707
1870         * cs-tokenizer.cs: Advance line number for mixed CR/LF files correctly.
1871
1872 2007-12-27  Marek Safar  <marek.safar@gmail.com>
1873
1874         * ecore.cs: Report type inference errors only when arguments count matches
1875         parameter count.
1876         
1877         * generic.cs (NullCoalescingOperator): Cannot be applied to null.
1878         
1879         * expression.cs, report.cs: New warning.
1880         
1881         * typemanager.cs: Catch anonymous method type too.
1882
1883 2007-12-23  Marek Safar  <marek.safar@gmail.com>
1884
1885         A fix for bug #346379
1886         * expression.cs (UnaryMutator): Emit size of type for pointer mutator.
1887
1888 2007-12-23  Marek Safar  <marek.safar@gmail.com>
1889
1890         A fix for bug #347359
1891         * expression.cs (Invocation): Don't resolve already resolved expression.
1892
1893 2007-12-23  Marek Safar  <marek.safar@gmail.com>
1894
1895         A fix for bug #347189
1896         * class.cs (FixedField): Use non-dependent code only in the define phase.
1897
1898 2007-12-23  Marek Safar  <marek.safar@gmail.com>
1899
1900         A fix for bug #348076
1901         * ecore.cs (FieldExpr.DoResolve): Allow any variable based expression.
1902
1903 2007-12-22  Marek Safar  <marek.safar@gmail.com>
1904
1905         * ecore.cs (MethodGroupExpr.OverloadResolve): Set type arguments for
1906         discovered extension methods.
1907
1908 2007-12-22  Marek Safar  <marek.safar@gmail.com>
1909
1910         * ecore.cs, namespace.cs, expression.cs: Removed broken ResolveGeneric
1911         method.
1912
1913 2007-12-21  Miguel de Icaza  <miguel@novell.com>
1914
1915         * report.cs (ErrorMessage): Add support for using colors on
1916         terminals that support it. 
1917
1918 2007-12-21  Marek Safar  <marek.safar@gmail.com>
1919
1920         * ecore.cs: Use information about expanded params for error reporting.
1921
1922 2007-12-21  Marek Safar  <marek.safar@gmail.com>
1923
1924         * ecore.cs, generic.cs, delegate.cs: Refactoring of method overloading code
1925         and logic for params overloads.
1926         
1927 2007-12-15  Miguel de Icaza  <miguel@novell.com>
1928
1929         * generic.cs (NullCoalescingOperator.CloneTo): implement this one,
1930         as this is also created from the parser.  Fixes #349034
1931
1932 2007-12-12  Miguel de Icaza  <miguel@novell.com>
1933
1934         * statement.cs (Throw.CloneTo): it is valid to have empty
1935         expressions for throw. 
1936
1937 2007-12-03  Marek Safar  <marek.safar@gmail.com>
1938
1939         * cs-parser.jay: Set delegate constraint parsing region correctly.
1940
1941 2007-12-03  Marek Safar  <marek.safar@gmail.com>
1942
1943         A fix for bug #345467
1944         * typemanager.cs (IsEqual): Compare generic parameters position only.
1945         
1946 2007-11-28  Marek Safar  <marek.safar@gmail.com>
1947
1948         * expression.cs (BaseAccess): Type arguments can be null.
1949
1950 2007-11-27  Raja R Harinath  <harinath@gmail.com>
1951
1952         * statement.cs (Block.Resolve): Ensure flow-branching tree is
1953         consistent even when an error has occured.
1954         (Switch.Resolve): Likewise.
1955
1956 2007-11-22  Marek Safar  <marek.safar@gmail.com>
1957
1958         A fix for bug #334505
1959         * class.cs: Don't ignore InternalsVisibleTo attribute for internal
1960         overrides.
1961         
1962 2007-11-22  Marek Safar  <marek.safar@gmail.com>
1963
1964         * ecore.cs, typemanager.cs, delegate.cs, expression.cs: The first of 
1965         refactorings required to resolve extension methods correctly when mixing
1966         generics and non-generics members.
1967         
1968 2007-11-20  Marek Safar  <marek.safar@gmail.com>
1969
1970         A fix for bug #342584
1971         * convert.cs: Added not documented explicit IntPtr/UIntPtr to enum
1972         conversion.
1973         
1974 2007-11-19  Marek Safar  <marek.safar@gmail.com>
1975
1976         A fix for bug #342512
1977         * delegate.cs: Use delegate argument expression when is available. Don't
1978         emit virtual call when class is sealed.
1979         
1980 2007-11-16  Marek Safar  <marek.safar@gmail.com>
1981
1982         A fix for bug #325423
1983         * assign.cs (FieldInitializer): Use resolved expression for emit.
1984         
1985         * class.cs: Print less confusing error message.
1986         
1987 2007-11-16  Marek Safar  <marek.safar@gmail.com>
1988
1989         * cs-tokenizer.cs: Removed GMCS ifdefs.
1990         
1991         * rootcontext.cs, report.cs: Report unavailable gmcs features used by
1992         mcs.
1993         
1994         * cs-parser.jay: Disabled nullable check.
1995         
1996         * generic-mcs: Copied more generic stuff.
1997                 
1998 2007-11-16  Marek Safar  <marek.safar@gmail.com>
1999
2000         * gcs-parser.jay: Merged to cs-parser.jay.
2001         
2002         * generic.cs, typemanager.cs, cs-tokenizer.cs, linq.cs, Makefile
2003         * *.csproj, *.sources: Updated to use only jay parser file.
2004
2005 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2006
2007         * gcs-parser.jay: Added nullable and default expression feature checks.
2008         
2009 2007-11-16  Marek Safar  <marek.safar@gmail.com>
2010
2011         * gcs-parser.jay, cs-parser.jay, class.cs: Unified parameters parsing, 
2012         it fixes many TODOs and hidden bugs.
2013         
2014         * expression: Removed duplicate error check.
2015
2016 2007-11-15  Marek Safar  <marek.safar@gmail.com>
2017
2018         * gcs-parser.jay, statement.cs, decl.cs, ecore.cs: Try to resolve an
2019         implicitly type local variable only when it is used in a declaration.
2020
2021 2007-11-15  Marek Safar  <marek.safar@gmail.com>
2022
2023         * attribute.cs: Use CS0612 for empty strings.
2024
2025 2007-11-14  Marek Safar  <marek.safar@gmail.com>
2026
2027         * lambda.cs, statement.cs: Contextual return may act as a statement.
2028
2029 2007-11-14  Marek Safar  <marek.safar@gmail.com>
2030
2031         A fix for a regression cause by #324222
2032         * class.cs: Don't report unused even when it implements an interface.
2033         
2034 2007-11-13  Marek Safar  <marek.safar@gmail.com>
2035
2036         A fix for bug #341205
2037         * ecore.cs, expression.cs: Method group expression cannot do static
2038         method access with an instance reference check before overloading takes
2039         a place.
2040         
2041 2007-11-13  Marek Safar  <marek.safar@gmail.com>
2042
2043         A fix for bug #325359
2044         * class.cs: Use predictable name for automatically generated property.
2045         
2046 2007-11-12  Marek Safar  <marek.safar@gmail.com>
2047
2048         A fix for bug #324996
2049         * expression.cs (Is): Handle case where D is nullable and T is not
2050         correctly.
2051         
2052         * generics.cs (Nullable.HasValue): Nullable HasValue expression.
2053         
2054 2007-11-12  Marek Safar  <marek.safar@gmail.com>
2055
2056         * generic.cs, literal.cs, ecore.cs, class.cs, delegate.cs, const.cs,
2057         anonymous.cs, expression.cs, attribute.cs, codegen.cs, statement.cs:
2058         Flush small error reporting changes.
2059         
2060 2007-11-09  Marek Safar  <marek.safar@gmail.com>
2061
2062         A fix for bug #324996
2063         * expression.cs: Rewrote Is expression implementation to work with
2064         generics, nullable types, anonymous method. A const result expression 
2065         uses existing infrastructure instead of custom not fully-featured one.
2066         
2067 2007-11-08  Marek Safar  <marek.safar@gmail.com>
2068
2069         A fix for bug #340202
2070         * class.cs: Consider generics for volatile field.
2071
2072 2007-11-08  Marek Safar  <marek.safar@gmail.com>
2073
2074         A fix for bug #335594
2075         * expression.cs: Use conversion rules when handling string addition.
2076         
2077 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2078
2079         A fix for bug #336651
2080         * expression.cs: Fixed a crash when probing is on.
2081         
2082 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2083
2084         A fix for bug #324242
2085         * covert.cs: Added a conversion from any nullable-type with an 
2086         underlying enum-type to the type System.Enum.
2087         
2088 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2089
2090         A fix for bug #324222
2091         * class.cs: Report all non-used event fields.
2092         
2093 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2094
2095         A fix for bug #325161
2096         * cs-parser.jay, gcs-parser.jay, decl.cs: Implemented namespace alias
2097         qualifier for generic types.
2098         
2099 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2100
2101         A fix for bug #322971
2102         * expression.cs, ecore.cs: Added intermediate result value check for
2103         indexers. 
2104         
2105 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2106
2107         A fix for bug #324754
2108         * cs-parser.jay, gcs-parser.jay, class.cs: Try to create an interator
2109         when it was requested.
2110
2111 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2112
2113         A fix for bug #325101
2114         * expression.cs: Do type not value comparison for `is' expression.
2115
2116 2007-11-07  Marek Safar  <marek.safar@gmail.com>
2117
2118         A fix for bug #320236
2119         * convert.cs: Don't apply user conversion on underlying target type.
2120
2121 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2122
2123         * expression.cs: Don't use unresolved expression for error reporting.
2124  
2125 2007-11-06  Marek Safar  <marek.safar@gmail.com>
2126
2127         A fix for bugs #337712, #324490
2128         * ecore.cs (MethodGroupExpr): Refactored to handle delegate method
2129         overloading resolution too.
2130         
2131         * delegate.cs: Uses MethodGroupExpr for overloading resolution. It makes
2132         the process consistent and more robust.
2133         
2134         * expression.cs, linq.cs, report.cs: Update.
2135
2136 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2137
2138         A fix for bug #332909
2139         * attribute.cs: Resolve attributes in correct context using error
2140         handling procedure.
2141         
2142         * rootcontext.cs: Define Obsolete attribute members as core members.
2143         
2144 2007-11-02  Marek Safar  <marek.safar@gmail.com>
2145
2146         * statement.cs: Removed unused methods.
2147         
2148 2007-10-31  Wade Berrier  <wberrier@novell.com>
2149
2150         * Makefile:  reenable copy of gmcs.exe.config, but include it in EXTRA
2151         DIST (it doesn't get included because PROGRAM isn't defined to be gmcs
2152         during 'make dist')
2153
2154 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2155
2156         A fix for bug #338102
2157         * decl.cs (CheckExistingMembersOverloads): Workaround issue with generic
2158         methods registered as non-generics.
2159         
2160 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2161
2162         A fix for bugs #337712, #324490
2163         * delegate.cs: Delegate covariance and contravariance is not allowed for
2164         value types.
2165         
2166 2007-10-31  Marek Safar  <marek.safar@gmail.com>
2167
2168         A fix for bug #337719 
2169         * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
2170         `from' keyword.
2171         
2172 2007-10-30  Marek Safar  <marek.safar@gmail.com>
2173  
2174         * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy gmcs.exe.config.
2175
2176 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2177  
2178         * cs-tokenizer.cs, gcs-parser.jay, driver.cs: Fixed parsing of nested
2179         query expressions.
2180
2181 2007-10-29  Raja R Harinath  <rharinath@novell.com>
2182
2183         * Makefile (net_2_0_bootstrap/mcs.exe.config): Copy gmcs.exe.config.
2184
2185 2007-10-29  Marek Safar  <marek.safar@gmail.com>
2186  
2187         A fix for bug #334652
2188         * ecore.cs (MethodGroupExpr.OverloadResolve): Do also lookup for
2189         extension methods when we have not found the best candidate in normal
2190         container.
2191
2192 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2193
2194         * AssemblyInfo.cs: Keep up-to-date.
2195
2196 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2197
2198         * Makefile: Fixed generics compiler name.
2199         
2200 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2201
2202         * lambda.test: removed, lambda parsing is done differently.
2203         
2204         * gen-il.cs, gen-treedump.cs, old-code.cs : Obsolete.
2205
2206 2007-10-27  Gert Driesen  <drieseng@users.sourceforge.net>
2207
2208         * Makefile: Removed dependency on gmcs.exe.config. Fixes build.
2209
2210 2007-10-27  Marek Safar  <marek.safar@gmail.com>
2211
2212         * Makefile, *.sources : All C# compilers are in mcs folder.
2213         
2214         * *.cs: Use existing 2_1 define for smcs.
2215
2216 2007-10-26  Marek Safar  <marek.safar@gmail.com>
2217
2218         A fix for bug #335847
2219         * assign.cs, expression.cs: Couple of changes to avoid creating a
2220         temporary variable for each object initializer assignment statement. It
2221         simplifies struct initialization too, otherwise two temporary variables
2222         would be required.
2223         Implemented optimization of redundant default element initializers.
2224         
2225 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2226
2227         A fix for bug #336766
2228         * expression.cs (Class.CheckBase): Use generic name when method is
2229         generic.
2230         
2231 2007-10-25  Marek Safar  <marek.safar@gmail.com>
2232
2233         A fix for bug #334737
2234         * expression.cs (IndexerAccess.EmitAssign): Emit local temporary
2235         variable and not variable argument for prepared copies.
2236
2237 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2238
2239         A fix for bug #325110
2240         * class.cs, expression.cs, attribute.cs: Use open generic method when
2241         checking conditional attribute.
2242         
2243 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2244
2245         * report.cs, cs-tokenizer.cs, class.cs, cs-parser.jay, anonymous.cs, 
2246         expression.cs, statement.cs: Renamed method FeatureIsNotISO to
2247         FeatureIsNotAvailable.
2248
2249 2007-10-24  Marek Safar  <marek.safar@gmail.com>
2250
2251         ** C# 3.0 Partial methods
2252         
2253         * cs-tokenizer.cs, support.cs, class.cs, decl.cs: Implemented partial
2254         methods support. Because of member cache issue with generics only
2255         non-generics partial methods are fully supported.
2256         
2257 2007-10-23  Marek Safar  <marek.safar@gmail.com>
2258         
2259         * class.cs, decl.cs: Rewrote member overloads check to cope with 
2260         generics and to use member cache for member checking. It also improves
2261         performance and fixes remaining overloads issues.
2262         
2263 2007-10-20  Marek Safar  <marek.safar@gmail.com>
2264         
2265         * class.cs, const.cs, decl.cs, delegate.cs, enum.cs, generic.cs,
2266         roottypes.cs, typemanager.cs:
2267                 
2268         A member cache creation logic changed to add members immediately and
2269         not rely on fallback. The member cache is now only prefered way
2270         how to access and find type declaration members. It saves 5 MB of memory
2271         during MWF compilation and makes code ready for more optimizations and
2272         clean-ups, it's also a pre-requirement for partial methods.
2273         
2274 2007-10-18  Raja R Harinath  <harinath@gmail.com>
2275
2276         * ecore.cs (Expression.Error_ValueCannotBeConverted): Add special
2277         handling for generic parameters.
2278
2279 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2280         
2281         * class.cs (FixedField): Removed redundant volatile check.
2282         
2283 2007-10-15  Marek Safar  <marek.safar@gmail.com>
2284         
2285         * class.cs, decl.cs: Fixed overload members verification to do only one
2286         check per possible collision.
2287         
2288 2007-10-13  Marek Safar  <marek.safar@gmail.com>
2289         
2290         A fix for bug #325478
2291         * anonymous.cs (AnonymousContainer.Compatible): Merge are flags together
2292         and create only one disposable flags container.
2293         
2294 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2295         
2296         A fix for bug #332442 by Alexandre Gomes <alexmipego@gmail.com>
2297         * statement.cs (Fixed): Fixed variables cloning.
2298         
2299 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2300         
2301         A fix for bug #333342
2302         * class.cs (EventField): Don't mark value type event as synchronized. 
2303         
2304 2007-10-12  Marek Safar  <marek.safar@gmail.com>
2305         
2306         * ecore.cs, anonymous.cs (MethodGroupExpr): Use score from type
2307         inference to identify best candidate method correctly.
2308         (ProperyExpr): A range variable is read only and cannot be modified.
2309         
2310 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2311         
2312         * ecore.cs, delegate.cs (MethodGroupExpr): Refactored best candidate
2313         logic to identify best candidate method correctly.
2314         
2315 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2316         
2317         * location.cs (Equals, GetHashCode): Removed.
2318         
2319 2007-10-11  Marek Safar  <marek.safar@gmail.com>
2320         
2321         * report.cs: Implemented message recorder. It is used mainly for lambda
2322         expressions to capture otherwise swallowed error messages.
2323         
2324         * anonymous.cs, lambda.cs.cs: Do full parameters check.
2325
2326         * ecore.cs (ExtensionMethodGroup): Report binding failure at the botton
2327         and not at the top.
2328         (MethodGroupExpr.DoResolve): Use message recorder for error handling.
2329                 
2330         * expression.cs (MemberAccess): Always report lookup failure.
2331         
2332         * location.cs: Implemented Equals, GetHashCode.
2333         
2334         * statement.cs (Return.DoResolve): Fixed hardcoded error argument.
2335         
2336 2007-10-10  Jb Evain  <jbevain@novell.com>
2337
2338         * codegen.cs: re-enable assembly version check.
2339
2340 2007-10-09  Marek Safar  <marek.safar@gmail.com>
2341         
2342         * report.cs, anonymous.cs, driver.cs, expression.cs: Added few ISO-2
2343         checks.
2344         
2345         * namespace.cs (UsingAlias): Do correct version check.
2346         
2347 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2348         
2349         * expresison.cs, ecore.cs: Issue extension method error message when
2350         appropriate.
2351         
2352         * rootcontext.cs: Added ISO_2 compiler mode option.
2353
2354 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2355         
2356         * expresison.cs (UnaryMutator.ResolveOperator): Print more useful error
2357          message.
2358         
2359 2007-10-08  Marek Safar  <marek.safar@gmail.com>
2360         
2361         * attribute.cs (GetString, GetBoolean): Work with both literal and
2362         constant.
2363         
2364         * ecore.cs, expresison.cs, delegate.cs (Invocation, MethodGroupExpr):
2365         Moved method overload specific methods to MethodGroupExpr.
2366         
2367         (IndexerAccess): Re-wrote resolving mechanism, fixed many issues and
2368         it should be less memory consuming.
2369         
2370 Mon Oct 8 09:29:15 CEST 2007 Paolo Molaro <lupus@ximian.com>
2371
2372         * codegen.cs: remove the assembly version check until the buildbot is
2373         fixed.
2374
2375 2007-10-07  Jb Evain  <jbevain@novell.com>
2376
2377         * attribute.cs (Attribute.GetString): if the value
2378         expression is a StringConstant, return its string value.
2379
2380 2007-10-07  Jb Evain  <jbevain@novell.com>
2381
2382         * typemanager.cs: add `assembly_version_attribute_type`.
2383         * codegen.cs: on attribute emission, check that the
2384         AssemblyVersionAttribute doesn't overflow.
2385
2386 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2387         
2388         A fix for bug #324677
2389         * anonymous.cs, decl.cs: Yes another anonymous container hack. Overwrite
2390         parent container of a scope container with currently resolved one. 
2391         
2392 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2393         
2394         A fix for bug #325534
2395         * class.cs (Invocation.DoResolve): Check invocation of object finalizer
2396         only.
2397         
2398 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2399         
2400         A fix for bug #327504
2401         * class.cs (Operator.Define): Refactored implicit and explicit user
2402         operator conversion rules.
2403         
2404 2007-10-05  Marek Safar  <marek.safar@gmail.com>
2405         
2406         A fix for bug #327520
2407         * ecore.cs (ExtensionMethodGroupExpr): Emit resolved extension argument.
2408         
2409 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2410         
2411         A fix for bug #328022
2412         * class.cs (MethodData.Define): Use correct method to check whether
2413         a method implementents an accessor.
2414         
2415 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2416         
2417         A fix for bug #330069
2418         * statement.cs (Fixed.Resolve): Read the first array element only when
2419         an array is instantiated. 
2420         
2421 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2422         
2423         * expression.cs, assign.cs, generics.cs: Print correct operator when
2424         compound assignment is used.
2425         
2426 2007-10-04  Marek Safar  <marek.safar@gmail.com>
2427         
2428         A fix for bug #325841
2429         * expression.cs (ArrayAccess): Use full argument cloning only for
2430         string compound concatenation.
2431         
2432 2007-10-03  Marek Safar  <marek.safar@gmail.com>
2433         
2434         A fix for bug #328774
2435         * ecore.cs (FieldExpr.EmitAssign): Fixed string concatenation compound
2436         assignment.
2437         (PropertyExpr.EmitAssign): Fixed string concatenation compound
2438         assignment.
2439
2440 2007-10-03  Raja R Harinath  <rharinath@novell.com>
2441
2442         Fix #328490
2443         * ecore.cs (SimpleName.DoSimpleNameResolve): Handle Property and
2444         Event accessibility checks here.  Remove some bogus code that
2445         accidently made GenericMethods work.
2446         (PropertyExpr.IsAccessibleFrom, EventExpr.IsAccessibleFrom): New.
2447
2448 2007-09-25  Marek Safar  <marek.safar@gmail.com>
2449         
2450         * expression.cs (ArrayCreation): Fixed cloning of an implicit types.
2451         
2452         * statement.cs (Block): Refactored AddVariable to allow error handling
2453         customization.
2454         
2455         * generic.cs: New stub.
2456         
2457 2007-09-23  Marek Safar  <marek.safar@gmail.com>
2458         
2459         * anonymous.cs, codegen.cs: Changed InferReturnType to be EmitContext
2460         flag.
2461         
2462 2007-09-17  Marek Safar  <marek.safar@gmail.com>
2463
2464         * class.cs: Use partial container to record whether any partial part
2465         contains static field initializer and therefore default contructor has
2466         to be defined.
2467         
2468 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2469
2470         * class.cs (TypeContainer.AddPartial): Fixed an issue reported on
2471         mono-list when only one of two partial parts has defined accessibility
2472         modifier.
2473         
2474 2007-09-14  Marek Safar  <marek.safar@gmail.com>
2475
2476         A fix for bug #82845
2477         
2478         * class.cs (TypeContainer): Set correct resolve context for all field
2479         initializers.
2480         
2481 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2482
2483         * assign.cs: Fixed a crash when field is resolved twice with an error.
2484         
2485         * codegen.cs: Changed InFieldInitializer to be flag.
2486         
2487         * anonymous.cs, ecore.cs, expression.cs: Update after
2488         IsInFieldInitializer rename.
2489         
2490         * const.cs: Removed unused parameter.
2491         
2492         * class.cs: Changed the way how we resolve and emit field initializers.
2493         The field initilizers have to have access to contructor block to emit
2494         compiler generated code.
2495
2496 2007-09-13  Marek Safar  <marek.safar@gmail.com>
2497
2498         * expression.cs (MemberAccess.DoResolve): DeclSpace is broken by
2499         generics use TypeContainer instead.
2500         
2501 2007-09-12  Marek Safar  <marek.safar@gmail.com>
2502         
2503         * generic.cs (TypeInferenceContext.InflateGenericArgument): Stub.
2504
2505         * lambda.cs (ResolveParameters): Use more powerful
2506         InflateGenericArgument.
2507         
2508         * parameters.cs: Better exception message.
2509                 
2510 2007-09-10  Marek Safar  <marek.safar@gmail.com>
2511
2512         * anonymous.cs (AnonymousMethodExpression.CompatibleChecks): Report
2513         correct expression block type. 
2514         
2515         * ecore.cs (Expression.Error_MemberLookupFailed): Made virtual.
2516         
2517         * expression.cs (Invocation): Extracted method group resolve to
2518         DoResolveOverload.
2519         
2520 2007-09-07  Marek Safar  <marek.safar@gmail.com>
2521
2522         * ecore.cs (Expression.MemberLookupFinal): Removed unused loc parameter.
2523         (MethodGroupExpr.ResolveGeneric): Use existing method group instance.
2524         
2525         * expression.cs (MemberAccess.DoResolve): Uses generic resolver for
2526         generic extension methods.
2527
2528 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2529
2530         A fix for bug #82676 (Do I get it right now?)
2531         * convert.cs (Binary.ResolveOperator): An interface is converted to the
2532         object before a standard conversion is applied.
2533         
2534 2007-09-06  Marek Safar  <marek.safar@gmail.com>
2535
2536         * convert.cs (ImplicitReferenceConversionCore): Reverted wrong fix of
2537         #82676.
2538         
2539 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2540
2541         A fix for bug #82676
2542         * convert.cs (ImplicitReferenceConversionCore): Check both sides for
2543         non-generic interface types.
2544         
2545 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2546
2547         A fix for bug #82690
2548         * ecore.cs (PropertyExpr.EmitAssign): Leave a copy does just that.
2549         
2550 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2551
2552         A fix for bug #82571
2553         * anonymous.cs (AnonymousMethod.DoCreateMethodHost): Use internal 
2554         modifier for container based methods.
2555         
2556 2007-09-05  Marek Safar  <marek.safar@gmail.com>
2557
2558         A fix for bug #82676
2559         * convert.cs (ImplicitReferenceConversionCore): From any class-type S to
2560         any interface-type T means to any of interface type T.
2561
2562 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2563
2564         * namespace.cs: We have 2 versions of System.Core assembly.
2565
2566 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2567
2568         A fix for bug #82652
2569         * class.cs (Class.GetClassBases): Compare types and not expressions.
2570
2571 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2572
2573         A fix for bug #82620
2574         * expression.cs (Invocation.EmitArguments): Duplicate params arguments
2575         actually never worked before.
2576         (IndexerAccess): Emit prepared arguments before they are modified.
2577         
2578 2007-09-04  Marek Safar  <marek.safar@gmail.com>
2579
2580         A fix for bug #82563
2581         * assign.cs: Revert wrong fix.
2582         
2583         * expression.cs (VariableReference.EmitAssign): Handle ref reference
2584         correctly.
2585         (ArrayAccess): Changed the way we emit compound (prepared) assignments.
2586         Instead of ldelema/stdind we have to use temporary variables to handle
2587         cases like String.Concat (params string[]).
2588         
2589 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2590
2591         * class.cs: EmitAttributes to Emit rename.
2592         
2593         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Parent can be
2594         null.
2595         (MemberCore.HasClsCompliantAttribute): Don't depend on 
2596         GetClsCompliantAttributeValue execution.
2597         
2598 2007-08-31  Marek Safar  <marek.safar@gmail.com>
2599
2600         * anonymous.cs: Use shorter type prefix.
2601         
2602         * ecore.cs (SimpleName.DoSimpleNameResolve): Use transparent identifiers
2603         when exist.
2604         
2605         * expression.cs (LocalVariableReference.DoResolveBase): Don't capture
2606         variables when probing is on.
2607         
2608         * statement.cs (LocaLInfo.Clone): Clone correctly resolved and 
2609         unresolved variables.
2610         (TopLevelBlock.GetTransparentIdentifier): Default implementation doesn't
2611         handle transparent identifiers.
2612         
2613 2007-08-26  Marek Safar  <marek.safar@gmail.com>
2614
2615         * attribute.cs (IsClsCompliant): Add nullable types test.
2616         
2617 2007-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2618
2619         * doc.cs : catch other types of exception than XmlException to
2620           report CS1570. Fixed bug #82565.
2621
2622 2007-08-23  Marek Safar  <marek.safar@gmail.com>
2623
2624         * anonymous.cs (AnonymousMethodExpressin.ExplicitTypeInference): 
2625         The number of delegate parameters has to match.
2626         (AnonymousMethodExpressin.VerifyParameterCompatibility): Handles generic
2627         arrays.
2628
2629 2007-08-21  Marek Safar  <marek.safar@gmail.com>
2630
2631         * anonymous.cs (AnonymousMethod): Generate private anonymous method
2632         to fix problem with private arguments.
2633
2634 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2635
2636         * anonymous.cs (AnonymousTypeClass): An anonymous type can be empty.
2637         
2638         * decl.cs (MemberName): Ignore generic type with no generic arguments. 
2639         
2640         * expression.cs (AnonymousTypeDeclaration): An anonymous type can be
2641         empty. Add cloning suport.
2642         
2643         * roottypes.cs (GetAnonymousType): Fixed argument comparison logic.
2644
2645 2007-08-20  Marek Safar  <marek.safar@gmail.com>
2646
2647         * convert.cs, ecore.cs, expression.cs, literal.cs: Use factory method 
2648         to create EmptyCast. It handles EmptyConstantCast specialization for
2649         constants.
2650         
2651 2007-08-18  Marek Safar  <marek.safar@gmail.com>
2652
2653         * expression.cs (Binary.is_unsigned): Handle unsafe types too.
2654         (EmitArrayArgument): One routine for array arguments.
2655         (ArrayCreation.MakeByteBlob): Fixed an array alignment. 
2656         
2657 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2658
2659         * cs-tokenizer.cs (GetKeyword): Handle from keyword in a different way.
2660
2661 2007-08-17  Marek Safar  <marek.safar@gmail.com>
2662
2663         * anonymous.cs: MemberLookupFinal update.
2664
2665         * class.cs (ConstructorInitializer): Is expression based.
2666         
2667         * delegate.cs: MethodGroupExpr update.
2668         
2669         * ecore.cs  (Error_MemberLookupFailed): Improved to report better error
2670         messages.
2671         (Error_MemberLookupFailed): Customizable error override.
2672         (MethodGroupExpr): Keep queried type for later usage.
2673         (MethodGroupExpr.OverloadResolve): Catch errors related to overload
2674         resolve.
2675         
2676         * expression.cs: Error_MemberLookupFailed refactoring.
2677         (New.DoResolve): Resolve as much as possible.
2678         (ElementInitializer.Error_MemberLookupFailed): Object initializer
2679         customization for invalid member types.
2680
2681         * statement.cs: MethodGroupExpr update.
2682         
2683 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2684
2685         * modifier.cs (Check): Check all modifiers and not only accessibility
2686         ones.
2687
2688 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2689
2690         * ecore.cs (Expression.Error_ValueCannotBeConverted): Report always a
2691         type and not an expression.
2692
2693 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2694
2695         * statement.cs (Catch.Clone): Type and variable can be null.
2696
2697 2007-08-16  Marek Safar  <marek.safar@gmail.com>
2698
2699         A fix for bug #81979
2700         * assign.cs (Assign.Emit): Prepare arguments for string concatenation.
2701         I am really not sure whether this is the best fix.
2702         
2703         * expression.cs (VariableReference.EmitAssign): Do prepare_load test
2704         only once.
2705         
2706 2007-08-14  Marek Safar  <marek.safar@gmail.com>
2707
2708         ** C# 3.0 Object and collection initializers (major re-write)
2709         
2710         * assign.cs (DoResolve): Initializers are not assign related.
2711         
2712         * codegen.cs (EmitContext.CurrentInitializerVariable): Holds a varible
2713         used during collection or object initialization.
2714         
2715         * expression.cs (Error_InvalidArguments): Add initializers specific
2716         messages. More will come later because it requires some general
2717         refactoring.
2718         (New.DoResolve): Better error handling for unsafe types.
2719         (EmptyExpressionStatement): New class.
2720         (ElementInitializer): An object initializer expression.
2721         (CollectionElementInitializer): A collection initializer expression.
2722         (CollectionOrObjectInitializers): A block of object or collection
2723         initializers.
2724         (NewInitialize): New expression with element/object initializers.
2725         
2726         * statement.cs: Reverted object/collection initializer hacks.
2727         
2728         * typemanager.cs (CSharpName): Filter __arglist type.
2729         
2730 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2731
2732         ** C# 3.0 Anonymous Types (update to the latest standard)
2733         
2734         * expression.cs (Binary.ResolveOperator): Threat all null based types
2735         same.
2736         (AnonymousTypeDeclaration): Renamed from AnonymousType and simplified.
2737         (AnonymousTypeParameter): Updated.
2738         
2739         * anonymous.cs (CompilerGeneratedClass): Add custom name overload.
2740         (AnonymousTypeClass): New anonymous type container.
2741         
2742         * class.cs (AddField): Return operation result.
2743         
2744         * generic.cs: Another empty TypeArguments overload.
2745         
2746         * roottypes.cs (AddAnonymousType, GetAnonymousType): Anonymous types
2747         are stored at top of normal hierarchy.
2748         
2749         * typemanager.cs (CSharpName): Filter anonymous types.
2750         
2751 2007-08-09  Marek Safar  <marek.safar@gmail.com>
2752
2753         * expression.cs (StringConcat.Append): Handle 3 and more concatenation
2754         as single Concat call. How could we miss that :-(
2755         
2756 2007-08-08  Marek Safar  <marek.safar@gmail.com>
2757
2758         * expression.cs (ArrayCreation.CloneTo): Allocate exact size.
2759         
2760 2007-08-07  Miguel de Icaza  <miguel@novell.com>
2761
2762         * expression.cs: Fix the previous commit, the creation of the
2763         arguments array list needs also to be conditional on the arguments
2764         not being null.
2765
2766         * class.cs: Add a little bit of help to help narrow down problems.
2767
2768         * expression.cs (ArrayCreation.CloneTo): Argument can be null, do
2769         not try to copy in that case. 
2770
2771         * driver.cs: When building SMCS, include a new different set of
2772         default assemblies here.   Do this here so we can control whether
2773         to include the default assemblies with /noconfig.
2774
2775 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2776
2777         A fix for bug #81979
2778         * expression.cs (TypeOf.GetAttributableValue): Check for type arguments
2779         only.
2780
2781 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2782
2783         A fix for bug #82300
2784
2785         * anonymous.cs (AnonymousContainer.Define): Don't define anything when
2786         we are in probing scope.
2787
2788 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2789
2790         A fix for bug #82301
2791
2792         * statement.cs (Catch.CloneTo): Clone blocks in the right order.
2793         (Statement.CloneTo): Clone and not map children blocks.
2794
2795 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2796
2797         A fix for bug #82299
2798
2799         * expression.cs (LocalVariableReference.CloneTo): Remap local info
2800         variable too.
2801         
2802         * statement.cs (Statement.CloneTo): Clone variables before statements
2803         to allow remaping of local variables.
2804
2805 2007-08-03  Marek Safar  <marek.safar@gmail.com>
2806
2807         A fix for bug #82296
2808
2809         * anonymous.cs,
2810         * report.cs: Log crash details for future clone problems.
2811         
2812         * statement.cs (Return.Clone): Don't clone non-existent expression.
2813
2814 2007-08-03  Raja R Harinath  <harinath@gmail.com>
2815
2816         * class.cs (TypeContainer.AddBasesForPart): Make virtual.
2817         (Class.AddBasesForPart): Move CS0537 check here from ...
2818         * cs-parser.jay (class_declaration): ... here.  Move calling of
2819         'AddBasesForPart' to ...
2820         (class_bases): ... here.
2821         (struct_declaration, interface_declaration): Update to changes.
2822
2823 2007-08-02  Marek Safar  <marek.safar@gmail.com>
2824
2825         A fix for bug #81923
2826
2827         * statement.cs (Using.ResolveLocalVariableDecls): Only non-user implicit
2828         conversion is allowed.
2829
2830 2007-08-02  Marek Safar  <marek.safar@gmail.com>
2831
2832         A fix for bug #81564
2833
2834         * ecore.cs (EventExpr): Add IsBase handling.
2835
2836         * expression.cs (BaseAccess.CommonResolve): Events can use base accessor
2837         too.    
2838         
2839 2007-08-02  Raja R Harinath  <harinath@gmail.com>
2840
2841         Reduce some differences between cs-parser.jay in mcs/ and gmcs/.
2842         * cs-parser.jay: Some whitespace cleanups.
2843         (current_delegate): New.
2844         (type_name): New.
2845         (struct_declaration): Make similar to gmcs/cs-parser.jay -- add
2846         a dummy code block, and use 'type_name' instead of 'member_name'.
2847         (interface_declaration, class_declaration): Likewise.
2848         (delegate_declaration): Likewise.  Rearrange slightly and use
2849         'current_delegate'.
2850         * cs-tokenizer.cs (handle_where): Rename from handle_constraints.
2851         (GetKeyword): Update to change.  Use '!foo' instead of 'foo == false'.
2852
2853 2007-08-02  Marek Safar  <marek.safar@gmail.com>
2854
2855         A fix for bug #82039
2856
2857         * ecore.cs (TypeLookup.GetSignatureForError): Use name when type is not
2858         available.
2859
2860         * typemanager.cs (CSharpName): Split to string overload.
2861
2862 2007-08-02  Marek Safar  <marek.safar@gmail.com>
2863
2864         * expression.cs,
2865         * report.cs: Updated warning CS0472.
2866
2867 2007-08-01  Marek Safar  <marek.safar@gmail.com>
2868
2869         A fix for bug #82181
2870         * cs-parser.jay,
2871         * cs-tokenizer.cs: Ignore partial keyword inside block expression.
2872
2873 2007-08-01  Marek Safar  <marek.safar@gmail.com>
2874
2875         A fix for bug #82277
2876         * statememnt.cs (Block.Clone): Don't clone explicit blocks twice.
2877
2878 2007-08-01  Marek Safar  <marek.safar@gmail.com>
2879
2880         ** C# 3.0 Type Inference (major bits are working)
2881         
2882         * anonymous.cs (AnonymousMethodExpression): Removed refactored fields.
2883         (.ImplicitStandardConversionExists): Uses compatible.
2884         (.ExplicitTypeInference): Infers type arguments based on explicit arguments
2885         (.InferReturnType): New method.
2886         (.Compatible): Refactored.
2887         (.ResolveParameters): Uses factory to create resolved parameters.
2888         (.CompatibleMethod): Add probing mode support.
2889         (AnonymousContainer): Removed unused fields. Split Define and Resolve to
2890         clearly distinguish between 2 different operations.
2891         (LambdaMethod): Moved to lambda.cs.
2892         (AnonymousMethod): Removed unused fields and methods.
2893         (AnonymousDelegate): Simplified.
2894         
2895         * codegen.cs (ResolveTopBlock): Updated renamed Resolve to Define.
2896         
2897         * convert. cs (ImplicitConversionStandard): Compatible works differently.
2898         
2899         * delegate.cs (Delegate): New mehods to reduce code duplication.
2900         (.GetConstructor): New method.
2901         (.GetInvokeMethod): New method.
2902         (DelegateCreation): Updated.
2903         
2904         * ecore.cs (ResolveOverloadExtensions): Don't crash when extension method
2905         does not exist.
2906         (OverloadResolve): Made probing little bit faster.
2907         
2908         * expression.cs (ParameterReference.DoResolveLValue): Reference can be null
2909         when probing is on.
2910         
2911         * generic.cs (TypeInferenceContext): Dummy implementation.
2912         
2913         * iterators.cs: Updated after Resolve/Define rename.
2914         
2915         * lambda.cs (LambdaExpression)
2916         (.ResolveParameters): Handles both type of arguments and type inference too.
2917         
2918         * parameter.cs (ImplicitLambdaParameter.Resolve): Sanity check.
2919         (InflateTypes): Updated.
2920         
2921         * support.cs (InflateTypes): Changed signature and updated.
2922         
2923         * typemanager.cs (LookupMemberCache): Better dynamic type check.
2924         (MemberLookup_FindMembers): More MS tricks.
2925         (GetParameterData): Ditto.
2926         (GetDelegateParameters): Uses quick path for dynamic types.
2927         
2928 2007-08-01  Marek Safar  <marek.safar@gmail.com>
2929
2930         * class.cs (MethodData.Define): EmitContext is required for generic stuff
2931         only.
2932
2933 2007-07-31  Marek Safar  <marek.safar@gmail.com>
2934
2935         * statement.cs (ProcessParameters): Don't crash when parameters have wrong
2936         syntax.
2937         
2938 2007-07-26  Jb Evain  <jbevain@novell.com>
2939
2940         * typemanager.cs (TypeManager.GetConstructor): Add a method overload
2941         which takes a boolean 'report_errors', similar to the GetMethod.
2942         (InitCodeHelpers): StructLayoutAttribute.ctor(int16) is not visible
2943         in .net 2.1, do not report errors here.
2944
2945         * typemanager.cs (TypeManager.InitCoreTypes): System.ArgIterator,
2946         System.Runtime.CompilerServices.RequiredAttributeAttribute and
2947         System.Runtime.CompilerServices.TypeForwardedToAttribute are internal
2948         in .net 2.1.
2949
2950         * typemanager.cs (TypeManager.InitCoreTypes): Move the resolution
2951         of the type InternalsVisibleToAttribute before the first call
2952         to CoreLookupType which is allowed to fail (third boolean parameter
2953         to true). Because, during the resolution for a type that is not
2954         immediately found, we try to check if the type is not defined in
2955         a friend assembly, and to do so, we need the
2956         InternalVisibleToAttribute.
2957
2958 2007-07-23  Miguel de Icaza  <miguel@novell.com>
2959
2960         * expression.cs (Binary): Add support for the brain-dead CSC 2.x
2961         feature that allows structs to be compared against null and inline
2962         the result as true or false.
2963
2964         Notice that the same code is not permitted inside a generic block
2965         of code that would do:
2966
2967         class Foo<T> where T : struct {
2968             bool Eval (T x)
2969             {
2970                  return x == null;
2971             }
2972         }
2973
2974         It is only allowed if the type of T is not bound (no where
2975         clause).   In my opinion, this CSC 2 behavior is broken but people
2976         seem to be using it (IronRuby does, a few bug reports on bugzilla
2977         have it and some people have complained about it).
2978
2979         All of the users that depend on this behavior have code that is
2980         very likely broken. 
2981         
2982         * report.cs (Warning, Error): make these take object arguments,
2983         not strings, as that allows us to take advantage of Format.
2984
2985 2007-07-20  William Holmes  <billholmes54@gmail.com>
2986
2987         * decl.cs: Changed MemberName.CountTypeArguments to also check the 
2988           Left member variable for the Count.
2989         * doc.cs: Changed DocUtil.GetMethodDocCommentName to call 
2990           MemberName.CountTypeArguments to avoid a NRE. 
2991
2992         This code is contributed under the MIT X11 license
2993
2994 2007-07-18  Marek Safar  <marek.safar@gmail.com>
2995
2996         * cs-tokenizer.cs: Improved lambda parsing and removed old code.
2997
2998 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
2999
3000         * doc.cs : generic method arguments are written as ``x while generic
3001           type arguments are `x. Combined with the previous change, fixed bug
3002           #79706.
3003
3004 2007-07-18  Raja R Harinath  <rharinath@novell.com>
3005
3006         Fix #82120
3007         * expression.cs (Binary.ResolveOperator): When converting
3008         'a + (- b)' to 'a - b', ensure that the unary '-' is discarded.
3009
3010 2007-07-18  Atsushi Enomoto  <atsushi@ximian.com>
3011
3012         * doc.cs : when T: or whatever x: is specified, it does not really
3013           check the doc comment's syntax correctness. Fixed bug #82006.
3014
3015 2007-07-18  Marek Safar  <marek.safar@gmail.com>
3016
3017         * anonymous.cs (AnonymouseMethodExpression): Refactored to work with
3018         LambdaExpression better.
3019         
3020         * cs-tokenizer.cs: Changed a way how we detect lambda parameters.
3021         
3022         * driver.cs (LambdaTypeParseTest): Removed, tested method is gone.
3023         
3024         * ecore.cs (Expression.MemberLookupFailed): Don't show currect context
3025         as it can be generated.
3026         
3027         * expression.cs (Invocation.Error_InvalidArguments): Show correct
3028         modifiers.
3029         
3030         * lambda.cs (LambdaExpression): Refactored to share same code with
3031         AnonymousMethodExpression.
3032         
3033 2007-07-17  Marek Safar  <marek.safar@gmail.com>
3034
3035         * anonymous.cs (MakeName): Include host name for easier debugging.
3036         (LambdaMethod): New class for lambda spcecific stuff.
3037         
3038         * attribute.cs: Set EmitContext return type.
3039
3040         * class.cs: Set EmitContext return type.
3041         
3042         * codegen.cs (EmitContext): Return type cannot be null to stop messing
3043         with null/void meaning.
3044         
3045         * iterators.cs (ContainerType): Implemented.
3046         
3047         * rootcontext.cs: Set value of TypeManager.bool_type at early stage.
3048         
3049         * statement.cs (Return): Updated to lambda expressions.
3050         (Block.CloneTo): Parent can be null.
3051                 
3052 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3053
3054         A fix for bug #81917
3055         * attribute.cs (AttributeTester.GetFixedBuffer): More robust testing.
3056         
3057         * class.cs (FixedField): Check whether field is in unsafe scope.
3058
3059         * ecore.cs (FieldExpr.DoResolve): Create fixed buffer expression here.
3060         (FieldExpr.Emit): Fixed buffers cannot be volatile.
3061
3062         * expression.cs (ElementAccess.Resolve): Move fixed buffers resolve to
3063         FieldExpr.
3064         
3065         * statement.cs (Fixed.Resolve): Simplified fixed buffers.
3066                 
3067 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3068
3069         * cs-tokenizer.cs, class.cs, decl.cs, driver.cs, namespace.cs,
3070         rootcontext.cs, expression.cs, statement.cs: Updated to use WarningLevel
3071         from Report class.
3072
3073 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3074
3075         * ecore.cs (FieldExpr.AddressOf): Less confusing warning message.
3076         
3077 2007-07-13  Marek Safar  <marek.safar@gmail.com>
3078
3079         * anonymous.cs (AnonymousMethodExpression): Parameters are r/o.
3080         (AnonymousContainer.ResolveNoDefine): Another ec to aec flag conversion.
3081         
3082         * codegen.cs(EmitContext): Add ProbingMode flag.
3083         
3084         * delegate.cs (DelegateInvocation): Set few instance variables as r/o.
3085         
3086         * driver.cs: For now set both warning values.
3087         
3088         * ecore.cs (SimpleName): Name is readonly.
3089         (MethodGroup.OverloadResolve): One quick path for probing.
3090         
3091         * expression.cs (Unary): Set Oper r/o.
3092         (Binary): Set Oper r/o.
3093         (ParameterReference): Set few instance variables as r/o.
3094         (ParameterReference.DoResolveBase): Don't capture aruments when 
3095         the probing is on.
3096         (Invocation.CloneTo): Fixed typo, looks easy, yeah.
3097         (Arglist): arguments are private.
3098         (SizeOf): type is private and r/o.
3099         (MemberAccess): arguments are private.
3100
3101         * report.cs: Enhanced reporting on/off capabilities.
3102         
3103         * lambda.cs: Uses ec.IsInProbingMode.
3104         (ContextualReturn): Derives from return.
3105         
3106         * rootcontext.cs: For now set both warning values.
3107         
3108         * statement.cs (CloneContext.RemapBlockCopy): Remaps block to cloned
3109         copy if one exists.
3110         (Return.Resolve): Don't die immediately.
3111         (Block.Resolve): Speed-up probing.
3112         (Block.CloneTo): Clone only child blocks.
3113
3114 Fri Jul 13 11:19:28 CEST 2007 Paolo Molaro <lupus@ximian.com>
3115
3116         * iterators.cs: reverted Miguel's latest change (r81925) as it
3117         breaks the build in System.
3118
3119 2007-07-13  Miguel de Icaza  <miguel@novell.com>
3120
3121         * iterators.cs (Yield.CheckContext): Check for the iterator type
3122         also here as we can call into Yield even in codepaths that are not
3123         directly checked by
3124         (MethodOrOperator is the only path that was checked).
3125
3126         In addition to the standard check, use a more specific check for
3127         constructors to report a more verbose error. 
3128
3129 2007-07-12  Miguel de Icaza  <miguel@novell.com>
3130
3131         * ecore.cs (FieldExpr.AddressOf): Do not stop processing here,
3132         report the warning and continue 
3133
3134         * statement.cs (Using.EmitLocalVariableDecls): We were leaving
3135         values on the stack on the call to Emit.   Use EmitStatement if
3136         possible, or using Emit + Pop if not possible.   Fixes #82064
3137
3138 2007-07-12  Raja R Harinath  <rharinath@novell.com>
3139
3140         * expression.cs (Invocation.IsApplicable): Reorganize slightly to
3141         avoid try...finally in some cases.
3142
3143 2007-07-10  Marek Safar  <marek.safar@gmail.com>
3144
3145         * attribute.cs (Attribute.ResolveConstructor): Uses method group.
3146         
3147         * class.cs (ConstructorInitializer.Resolve): Use and keep method group
3148         instead of method. Re-use standard error handling.
3149         (ConstructorInitializer.Emit): Simplified.
3150         
3151         * delegate.cs: Updated after Invocation.EmitCall change.
3152         
3153         * ecore.cs (GetOperatorTrueOrFalse): Uses MethodGroupExpr only.
3154         (SimpleName.SimpleNameResolve): Set and reset in_transit flag correctly.
3155         (ExtensionMethodGroupExpr): Refactored to use same OverloadResolve
3156         method and don't permanently changing input arguments.
3157         (MethodGroupExpr): Introduced resolved best_candidate, when method group
3158         is resolved it has one of the candidates is the best one which is later
3159         used to emit. Removed a few unused method.
3160         (MethodGroupExpr.MakeUnionSet): Moved from Invocation, it belongs here.
3161
3162         * expression.cs (StaticCallExpr.MakeSimpleCall): Uses method group.
3163         (Binary.ResolveOperator): Ditto.
3164         (ConditionalLogicalOperator.DoResolve): Ditto.
3165         (Invocation): Uses method group.
3166         (Invocation.DoResolve): Simplified.
3167         (Invocation.EmitCall): Removed useless is_static.
3168         (Invocation.Emit): Delegate to method group.
3169         (Invocation.EmitStatement): Simplified.
3170         (New): Uses method group.
3171         (MemberAccess.DoResolve): Don't destroy original expression.
3172         
3173         * statement.cs (ForEach.Resolve): Use null for no method arguments.
3174         
3175 2007-07-04  Marek Safar  <marek.safar@gmail.com>
3176
3177         * ecore.cs (VarExpr.DoResolveLValue): More restriction checks.
3178         
3179         * anonymous.cs,
3180         * lambda.cs: Add custom error message type.
3181
3182 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3183
3184         * lambda.cs: Simplified little bit.
3185         
3186         * parameter.cs: Introduced ImplicitLambdaParameter.
3187         (Parameters.CreateFullyResolved): New factory instead of ctor.
3188         
3189         * anonymous.cs,
3190         * class.cs,
3191         * delegate.cs: Updated parameter creation.
3192         
3193 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3194
3195         *  ecore.cs (SimpleName.GetSignatureForError): Display correctly generic
3196         arguments.
3197         
3198         * generic.cs: Synchronized with gmcs.
3199         
3200 2007-07-03  Marek Safar  <marek.safar@gmail.com>
3201
3202         * class.cs (Indexer): Check return type as soon as possible.
3203         
3204         * cs-parser.jay: Initialize implicit_value_parameter_type for interface
3205         members too.
3206         
3207         * ecore.cs (VarExpr.DoResolveLValue): Set eclass value.
3208         
3209         * expression.cs (Invocation.Error_InvalidArguments): Show type only.
3210         
3211         * parameter.cs (Parameter): Use expression type when it is available.
3212         
3213         * support.cs (ReflectionParameters.ParameterDesc): Show an extension
3214         method modifier for the first parameter only.
3215
3216 2007-06-24  Marek Safar  <marek.safar@gmail.com>
3217
3218         A fix for bug #81938
3219         * typemanager.cs (ChangeType): Fixed couple of char conversions.
3220         
3221         * constant.cs: Tide up an exception message.
3222
3223 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3224
3225         * ecore.cs (SimpleName.DoSimpleNameResolve): Better error reporting when
3226         an uninitialized variable is used.
3227         
3228         * expression.cs (LocalVariableReference.DoResolve): Ditto.
3229
3230 2007-06-22  Marek Safar  <marek.safar@gmail.com>
3231
3232         * ecore.cs (SimpleName.TypeOrNamespaceNotFound): Allow to override type
3233         not found error handling.
3234
3235         * expression.cs (ArrayCreation): Removed redundant fields and little bit
3236         simplified.
3237         (ArrayCreation.ResolveArrayElement): To be ready to customization.
3238         (ArrayCreation.DoResolve): Simplified.
3239         (ImplicitlyTypedArrayCreation.DoResolve): Implicitly typed arrays have
3240         its own resolve process.
3241         (ImplicitlyTypedArrayCreation.ResolveArrayElement): Conversion magic.
3242
3243 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3244
3245         * namespace.cs (NamespaceEntry.Error_AmbiguousTypeReference): Print
3246         more error details.
3247         
3248 2007-06-20  Marek Safar  <marek.safar@gmail.com>
3249
3250         * cs-tokenizer.cs: Removed var related stuff.
3251         
3252         * ecore.cs (Expression.ResolveAsContextualType): Introduced new method.
3253         (VarExpr): Changed to derive from SimpleName. VarExpr now behaves as
3254         a type and a keyword at same time.
3255         
3256         * decl.cs (MembeName.GetTypeExpression): Create VarExpr when type name
3257         matches to "var".
3258         
3259         * expression.cs (ImplicitlyTypedArrayCreation): New empty class for
3260         implicitly typed arrays, more changes will follow.
3261         
3262         * statement.cs (LocalInfo.Resolve): Resolve type as contextual type.
3263         
3264 2007-06-19  Marek Safar  <marek.safar@gmail.com>
3265
3266         * ecore.cs (VarExpr): Removed Handled field.
3267         
3268         * statement.cs (Using.ResolveLocalVariableDecls): Refactored to use
3269         build-in assign functionality.
3270         (ForEach.Resolve): Removed all implicitly typed local variable code and
3271         simplified.
3272         (ArrayForeach.Resolve): Infer implicitly typed local variable here.
3273         (CollectionForeach.Resolve): Infer implicitly typed local variable here.
3274
3275 2007-06-18  Marek Safar  <marek.safar@gmail.com>
3276
3277         * assign.cs: Removed implicitly typed local variable check.
3278         
3279         * expression.cs (LocalVariableReference.DoResolve): Add check for self
3280         referencing implicitly typed local variable.
3281         (LocalVariableReference.DoResolveLValue): Infer implicitly typed local
3282         variable here.
3283         
3284         * statement.cs (Fixed): Removed unsupported implicitly typed local
3285         variable code.
3286
3287 2007-06-15  Marek Safar  <marek.safar@gmail.com>
3288
3289         * decl.cs (MemberName): Moved all Unbound stuff to parser.
3290
3291 2007-06-14  Marek Safar  <marek.safar@gmail.com>
3292
3293         A fix for bugs #81855 and #76274
3294         * attribute.cs (AttachTo): Always set owner for global attributes to
3295         prefined owner.
3296         
3297         * ecore.cs (Error_TypeDoesNotContainDefinition): A type location can be
3298         usefull too.
3299         
3300         * cs-parser.jay: Assembly and module attributes must precede all other
3301         elements except using clauses and extern alias declarations.
3302
3303 2007-06-13  Marek Safar  <marek.safar@gmail.com>
3304
3305         A fix for bug #81748
3306         * cs-tokenizer.cs,
3307         * expression.cs: More checks for non ISO-1 features.
3308
3309 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3310
3311         A fix for bug #81807
3312         * statement.cs(Switch.TableSwitchEmit): Define null label when it's not
3313         present inside switch statement and it is required by nullable check.
3314
3315 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3316
3317         A fix for bug #81840
3318         * ecore.cs (SimpleName.ResolveAsTypeStep): Look for non-generic type
3319         when type matching fails.
3320         
3321         * namespace.cs: Tiny error message change.
3322
3323 2007-06-12  Marek Safar  <marek.safar@gmail.com>
3324
3325         * decl.cs (CheckAbstractAndExtern): Moved to MemberCore for easier error
3326         reporting. Added automatic property check.
3327         
3328         * class.cs: Updated after CheckAbstractAndExtern relocation.
3329         (AEventPropertyAccessor.GetSignatureForError): Customized.
3330         
3331 2007-06-11  Marek Safar  <marek.safar@gmail.com>
3332
3333         * class.cs (DefineBaseTypes): Base type can be undefined.
3334         
3335         * ecore.cs (TypeLookup): Minor refactoring.
3336         (DoResolveAsTypeStep): Removed redundant check.
3337
3338         * namespace.cs (Lookup): Removed redundant check.
3339                 
3340         * rootcontext.cs (BootstrapCorlib_ResolveType): Uses normal 
3341         ResolveAsTypeTerminal step.
3342         (BootstrapCorlib_*): Simplified.
3343         (PopulateCoreType): Core types can be now external.
3344
3345 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3346
3347         * anonymous.cs (VerifyExplicitParameterCompatibility): Add flag to do
3348          verification only.
3349          (InferTypeArguments): Infers anonymous expression type arguments.
3350          (Compatible): Split to Compatible and InferTypeArguments. 
3351         
3352         * lambda.cs: Updated.
3353
3354 2007-06-08  Marek Safar  <marek.safar@gmail.com>
3355
3356         * anonymous.cs (AnonymousContainer): Marked as compiler generated.
3357
3358 2007-06-07  Raja R Harinath  <harinath@gmail.com>
3359
3360         Fix #80477, cs0135-2.cs, cs0135-3.cs
3361         * statement.cs (ToplevelBlock.ProcessParameters): Add parameter
3362         names to the "known" variables list.
3363         (Block.CheckInvariantMeaningInBlock): Handle the fact the
3364         parameter names are also "known".
3365         (Block.CheckError136): Remove.
3366         (ExplicitBlock.CloneTo): New.  Set 'known_variables' in target to
3367         null.
3368
3369 2007-06-07  Marek Safar  <marek.safar@gmail.com>
3370
3371         * ecore.cs (MethodGroupExpr.OverloadResolve): Print full method definition.
3372
3373 2007-06-06  Marek Safar  <marek.safar@gmail.com>
3374
3375         * ecore.cs (SimpleName.Emit): Emitting unresolved simple name is
3376         internal error not an user error.
3377          
3378         * expression.cs (IsApplicable): Refactored to make debugging easier.
3379
3380         * support.cs: More tricks for non-mono runtimes.
3381         
3382         * typemanager.cs (CoreLookupType): Made public.
3383         (InitSystemCore): All linq specific stuff moved to linq.cs
3384
3385 2007-06-05  Marek Safar  <marek.safar@gmail.com>
3386
3387         * typemanager.cs (CSharpSignature): One more missing build-in types
3388         replacement.
3389         More tricks for non-mono runtime.
3390
3391 2007-06-05  Raja R Harinath  <harinath@gmail.com>
3392
3393         * statement.cs (Block.CheckError136_InParents): Remove.
3394         (Block.AddVariable): Use GetParameterInfo instead.
3395         (ToplevelBlock.ProcessArguments): Likewise.
3396
3397 2007-06-04  Raja R Harinath  <rharinath@novell.com>
3398
3399         * statement.cs (ToplevelBlock.CloneTo): New.  Copy over parameter
3400         information too.
3401         (ToplevelBlock.GetParameterInfo): Split out of ...
3402         (ToplevelBlock.GetParameterRefernce): ... this.
3403         (ToplevelBlock.ParameterMap): Remove.
3404         * expression.cs (ParameterReference): Update to use
3405         ToplevelParameterInfo.
3406
3407         * statement.cs (ToplevelBlock.ProcessParameters): Workaround some
3408         regression.
3409
3410         * flowanalysis.cs (FlowBranching.CheckOutParameters): Move ...
3411         * statement.cs (ToplevelBlock.CheckOutParameters): ... here.
3412
3413         * statement.cs (ToplevelBlock.ResolveMeta): Move CS0136 checks ...
3414         (ToplevelBlock.ProcessParameters) ... here.
3415         (ToplevelBlock..ctor): Invoke it.
3416
3417         * statement.cs (ToplevelBlock.ResolveMeta): Add sanity checks for
3418         new parameters.
3419
3420         * statement.cs (IKnownVariable): New interface.
3421         (LocalInfo): Implement it.
3422         (ToplevelParameterInfo): New class.
3423         (ExplicitBlock.AddKnownVariable): Use IKnownVariable.
3424         (ExplicitBlock.GetKnownVariable): Likewise.  Rename from
3425         GetKnownVariableInfo.
3426
3427 2007-06-03  Raja R Harinath  <harinath@gmail.com>
3428
3429         Partly speed up CS0136 error checks.
3430         * statement.cs (ExplicitBlock.GetKnownVariableInfo): Remove
3431         'recurse' parameter.
3432         (Block.DoCheckError136): Only check errors in parameters.  Move
3433         local variable checks ...
3434         (Block.AddVariable): ... here, and ...
3435         (ToplevelBlock.ResolveMeta): ... here.
3436
3437 2007-06-02  Raja R Harinath  <harinath@gmail.com>
3438
3439         * statement.cs (Block.IsChildOf): Remove.
3440
3441         * statement.cs (Statement.Clone): Move special case code ...
3442         (Block.CloneTo): ... here.
3443
3444 2007-05-29  Raja R Harinath  <rharinath@novell.com>
3445
3446         * statement.cs (ToplevelBlock.container): Remove field.  It's
3447         redundant with 'Parent'.
3448         (ToplevelBlock.ContainerBlock): Remove accessor.
3449         (ToplevelBlock..ctor): Update to changes.  Register anonymous
3450         child with parent here, ...
3451         * cs-parser.jay (end_anonymous): ... not here.  Don't modify
3452         current_block.
3453         (start_anonymous): Don't save current_block.
3454         (top_current_block): Remove.
3455
3456         * statement.cs (Block.Flags): Remove IsExplicit and IsToplevel flags.
3457         (Block.Resolve): Update to changes.
3458         (Block..ctor): Move setting of "correct" 'Toplevel'
3459         and 'Explicit' fields to ...
3460         (ExplicitBlock..ctor, ToplevelBlock..ctor): ... here.
3461
3462 2007-05-27  Raja R Harinath  <harinath@gmail.com>
3463
3464         Kill Block.Implicit
3465         * statement.cs (Block.Implicit): Remove.
3466         (Block): Update to changes.
3467         * flowanalysis.cs: Likewise.
3468
3469         Mildly speed up CheckInvariantMeaningInBlock
3470         * statement.cs (ExplicitBlock.AddKnownVariable): Move here from Block.
3471         Recursively call AddKnownVariable to all enclosing blocks.
3472         (ExplicitBlock.GetKnownVariableInfo): Move here from Block.
3473         Remove recursive calls.
3474         (Block): Update to changes.
3475
3476         New ExplicitBlock invariants
3477         * statement.cs (Block.Explicit): New field.  It points to the
3478         immediately enclosing non-implicit block.
3479         (Block..ctor): Maintain the invariant.
3480         * cs-parser.jay: Take advantage of invariant.
3481
3482         Introduce ExplicitBlock
3483         * statement.cs (ExplicitBlock): New.
3484         (ToplevelBlock): Derive from it.
3485         (Block.Flags.IsExplicit): Rename from '...Implicit' and invert
3486         sense of flag.
3487         (Block.Implicit): Update to changes.
3488         * cs-parser.jay: Update to changes.
3489
3490         Remove unused field
3491         * codegen.cs (EmitContext.IsLastStatement): Remove.
3492         * statement.cs (Block.DoEmit): Update to changes.
3493
3494 2007-05-25  Raja R Harinath  <rharinath@novell.com>
3495
3496         * cs-parser.jay: Use 'start_block' and 'end_block' rather than
3497         modifying current_block directly.
3498
3499 2007-05-23  Scott Peterson  <lunchtimemama@gmail.com>
3500         
3501         * class.cs: Implemented automatic properties (C# 3.0)
3502           Thanks to Marek for the help.
3503
3504 2007-05-23  Raja R Harinath  <rharinath@novell.com>
3505
3506         * flowanalysis.cs (VariableInfo.SetAssigned): When noting a
3507         variable as assigned, note also that all its components are
3508         assigned too.
3509         (MyBitVector.SetRange): New.  Function to set multiple bits to true.
3510
3511 2007-05-19  Marek Safar  <marek.safar@gmail.com>
3512
3513         * anonymous.cs, class.cs: Emit Compiler generated attribute when
3514         member is marked as compiler generated.
3515         
3516         * decl.cs (MemberCore): Refactored ModFlags into property.
3517
3518         * modifiers.cs: Add new modifier (COMPILER_GENERATED).
3519         (Check): Check only accessibility modifiers.
3520
3521 2007-05-18  Raja R Harinath  <rharinath@novell.com>
3522
3523         Track all assignable slots in one bit array
3524         * statement.cs (ToplevelBlock.ParameterMap): Convert into array.
3525         (ToplevelBlock.ResolveMeta): Don't create a VariableMap.  Move
3526         logic from VariableMap constructor here.  Use the same 'offset'
3527         variable that's later used for computing offsets of local
3528         variables.
3529         * flowanalysis.cs (UsageVector.parameters): Remove.
3530         (UsageVector): Update to changes.
3531         (VariableMap): Remove.
3532
3533         Avoid creating ParameterMap in every block
3534         * statement.cs (Block.ParameterMap): Move ...
3535         (ToplevelBlock.ParameterMap): ... here.
3536         (ToplevelBlock.ResolveMeta): Create VariableMap for parameters
3537         only once.
3538         * flowanalysis.cs (FlowBranching.param_map): Remove.
3539         (FlowBranching.UsageVector): Update to changes.
3540         (FlowBranchingToplevel.CheckOutParameters): Likewise.
3541
3542         * statement.cs (Block.CloneTo): Clone Toplevel field too.
3543
3544         * expression.cs (ParameterReference): Distinguish between block
3545         where parameter was referenced and declared.
3546
3547 2007-05-18  Marek Safar  <marek.safar@gmail.com>
3548
3549         * flowanalysis.cs, statement.cs: Put back improved error handling.
3550
3551 2007-05-15  Scott Peterson  <lunchtimemama@gmail.com>
3552         
3553         * assign.cs:
3554         * expression.cs:
3555           Imporved object and collection initialization (C# 3.0).
3556
3557 2007-05-15  Marek Safar  <marek.safar@gmail.com>
3558
3559         A fix for bug #81380
3560         * expression.cs (Is.DoResolve): Only value types have constant `is'
3561         behaviour.
3562
3563 2007-05-15  Raja R Harinath  <rharinath@novell.com>
3564
3565         * statement.cs (ToplevelBlock.child): Remove.
3566
3567 2007-05-15  Raja R Harinath  <harinath@gmail.com>
3568
3569         Rationalize ResolveMeta: refactoring
3570         (Block.ResolveMeta): Remove wrong or superfluous comments.  Carve
3571         out constant handling code into ...
3572         (Block.DoResolveConstants): ... this.
3573
3574         Rationalize ResolveMeta: kill local_map
3575         * statement.cs (Block.local_map, Block.LocalMap): Remove.
3576         (Block.AssignableSlots): New.
3577         (Block.ResolveMeta): Make protected.  Don't create a VariableMap
3578         for locals -- move code from VariableMap here.  Avoid unnecessary
3579         allocations.
3580         * flowanalysis.cs (FlowBranching.local_map): Remove.
3581         (FlowBranching..ctor): Use Block.AssignableSlots.
3582         (VariableMap): Remove unused constructors.
3583
3584 2007-05-11  Raja R Harinath  <rharinath@novell.com>
3585
3586         * Makefile [PROFILE=net_2_0_bootstrap]: Add special-case rules.
3587
3588 2007-05-11  Marek Safar  <marek.safar@gmail.com>
3589
3590         * typemanager.cs (IsFriendAssembly): Should not be called for building
3591         assembly.
3592
3593 2007-05-09  Marek Safar  <marek.safar@gmail.com>
3594
3595         * literal.cs (NullConstant): Print null in all cases.
3596         
3597         * expression.cs (Binary.ResolveOperator): Implemented delegate
3598          comparison based on C# 2.0 changes.
3599
3600 2007-04-28  Scott Peterson  <lunchtimemama@gmail.com>
3601
3602         This code is contributed under the MIT X11 license
3603         
3604         The following enables support for several C# 3.0 language features:
3605         
3606         * cs-tokenizer.cs: Added support for the "var" keyword.
3607         
3608         * ecore.cs: Refactored TypeLookupExpression.DoResolveAsTypeStep().
3609           Added VarExpr class to facilitate type inferencing.
3610         
3611         * class.cs: Added IDictionary field AnonymousTypes to TypeContainer
3612           to support anonymous types.
3613         
3614         * assign.cs: Added support for type inferencing and initialization.
3615         
3616         * anonymous.cs: Added AnonymousClass class to enable anonymous types.
3617         
3618         * expression.cs: Added implicit array support to ArrayCreation.
3619           Added 5 types and 1 interface:
3620           
3621           IInitializable                Implementing classes can inject initializing
3622                                         statements after object instantiation.
3623           
3624           Initializer                   Stores data for object initialization.
3625           
3626           AnonymousType                 An expression for anonymous types.
3627           
3628           AnonymousTypeParameter        Stores data about an anonymous type's field.
3629           
3630           NewInitialize                 An expression for object initialization.
3631           
3632           CollectionInitialize          An expression for collection initialization.
3633         
3634         * statement.cs: Added "var" keyword support to the foreach, using, and fixed
3635           statements.
3636
3637 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3638
3639         A fix for bug #81500
3640         * cs-tokenizer.cs: Add special handling for coalescing operator.
3641
3642 2007-05-06  Marek Safar  <marek.safar@gmail.com>
3643
3644         A fix for bug #81529
3645         * attribute.cs (GetAttributeUsage): AttributeUsage attribute inherits
3646         its value from base class until it is redefined.
3647
3648 2007-05-02  Raja R Harinath  <rharinath@novell.com>
3649
3650         Fix regression in cs0631-3.cs
3651         * cs-parser.jay (operator_declarator): Add opt_attributes to error
3652         fallback.  Make error fallback catch more cases.
3653
3654 2007-05-01  Miguel de Icaza  <miguel@novell.com>
3655
3656         * cs-parser.jay: Allow parameters in operator declarations to have
3657         attributes. 
3658
3659 2007-04-27  Miguel de Icaza  <miguel@novell.com>
3660
3661         * statement.cs (If.CloneTo): Only clone the FalseStatement if it
3662         exists. 
3663
3664         * lambda.cs (ContextualReturn.Resolve): An expression is valid
3665         inside the ContextualReturn, it does not have to be an
3666         ExpressionStatement. 
3667
3668 2007-04-24  Miguel de Icaza  <miguel@novell.com>
3669
3670         * lambda.cs (ContextualReturn.Resolve): if the return type is not
3671         set, set it.
3672
3673 2007-04-23  Miguel de Icaza  <miguel@novell.com>
3674
3675         * anonymous.cs (AnonymousContainer): split the virtual Resolve
3676         method in two methods: ResolveNoDefine and Resolve.
3677
3678         ResolveNoDefine will stop just after ResolveTopBlock has been
3679         called.   
3680
3681         Resolve will then continue by creating a method and issuing the
3682         call to method.Define ().
3683
3684         (AnonymousMethod): Split and implement the new Resolve and
3685         ResolveNoDefine as well.
3686
3687         * lambda.cs (LambdaExpression): Split the anonymous method
3688         resolution code into a separate routine (CoreCompatibilityTest)
3689         from DoCompatibleTest.
3690
3691         (LambdaExpression.TryBuild): New method, this method tries to
3692         build the LambdaExpression with the given set of types to be used
3693         as the types for the various parameters of the lambda expression. 
3694
3695         If the compilation succeed with the given types, the infered type
3696         of the Anonymous method is returned, otherwise null is returned.
3697
3698 2007-04-23  Marek Safar  <marek.safar@gmail.com>
3699
3700         A fix for bug #81414
3701         * delegate.cs: Better fix, moved ApplyAttributes from Define to Emit.
3702
3703 2007-04-22  Miguel de Icaza  <miguel@novell.com>
3704
3705         * cs-tokenizer.cs: Change various identifiers here from the
3706         camelCasing to the recommended Linux-like style for instance
3707         variables from the Coding Guidelines. 
3708
3709 2007-04-19  Martin Baulig  <martin@ximian.com>
3710
3711         * convert.cs
3712         (Convert.ImplicitReferenceConversionCore): Allow conversions from
3713         System.Enum to System.ValueType.
3714
3715 2007-04-13  Martin Baulig  <martin@ximian.com>
3716
3717         Rewrote implicit reference conversions.  We need to distinguish
3718         between implicit reference conversions (13.1.4) and implicit
3719         boxing conversions (13.1.5).
3720
3721         According to the spec, there's an an implicit conversion
3722         "From a one-dimensional array-type S[] to IList<T> and base
3723         interfaces of this interface, provided there is an implicit
3724         reference conversion from S to T."  Note that this does not
3725         include boxing conversions.
3726
3727         * convert.cs
3728         (Convert.ImplicitTypeParameterBoxingConversion): New method.
3729         (Convert.ImplicitReferenceConversion): Split into
3730         ImplicitReferenceConversionCore() and
3731         ImplicitBoxingConversionExist().
3732         (Convert.ImplicitReferenceConversionExists): Use the new
3733         ImplicitReferenceConversionCore() and ImplicitBoxingConversionExists().
3734
3735 2007-04-12  Martin Baulig  <martin@ximian.com>
3736
3737         * convert.cs (Convert.ImplicitReferenceConversion): Move the
3738         `TypeManager.null_type' checks up to the top of the method.
3739
3740 2007-04-11  Marek Safar  <marek.safar@gmail.com>
3741
3742         A fix for bug #81350
3743         * class.cs, decl.cs, ecore.cs, namespace.cs: The optimization for private
3744         extension methods.
3745
3746 2007-04-11  Martin Baulig  <martin@ximian.com>
3747
3748         * statement.cs (Foreach.CollectionForeach.ProbeCollectionType):
3749         Use `TypeManager.GetInterfaces(t)' rather than `t.GetInterfaces()'
3750         to make this work for generic classes; fixes #79561.
3751
3752 2007-04-11  Martin Baulig  <martin@ximian.com>
3753
3754         * expression.cs (As): Add support for nullable types; fixes #79371.
3755
3756 2007-04-11  Martin Baulig  <martin@ximian.com>
3757
3758         * doc.cs (DocUtil.GetSignatureForDoc): Don't crash if
3759         `type.FullName' is null; fixes #80243.
3760
3761 2007-04-11  Martin Baulig  <martin@ximian.com>
3762
3763         * expression.cs (Invocation.IsApplicable): Don't modify the method
3764         if type inference succeeded, but the method was not applicable.
3765         Fixes #81250.
3766
3767 2007-04-10  Marek Safar  <marek.safar@gmail.com>
3768
3769         A fix for bug #81324
3770         * namespace.cs (Namespace.LookupExtensionMethod): Always inspect both
3771         internal and external namespaces containers.
3772
3773 2007-04-10  Martin Baulig  <martin@ximian.com>
3774
3775         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Use
3776         TypeManager.DropGenericMethodArguments() so we also call
3777         IMethodData.SetMemberIsUsed() for generic methods.  Fixes #80357.
3778
3779 2007-04-10  Martin Baulig  <martin@ximian.com>
3780
3781         * iterators.cs (Iterator.CreateIterator): Don't crash if
3782         `method.ReturnType' is null.  This happens if something went wrong
3783         while resolving that typ (we already reported an error in this case).
3784
3785 2007-04-10  Martin Baulig  <martin@ximian.com>
3786
3787         * expression.cs (New.DoResolve): Don't call CheckComImport() on
3788         generic interfaces; report the CS0144 directly.
3789
3790 2007-04-10  Martin Baulig  <martin@ximian.com>
3791
3792         * ecore.cs (MemberExpr.ResolveMemberExpr): If `left' is a
3793         `TypeExpr', call ResolveAsTypeTerminal() on it; fixes #81180.
3794
3795 2007-04-10  Martin Baulig  <martin@ximian.com>
3796
3797         * expression.cs (New.DoEmitTypeParameter): Fix #81109.
3798
3799 2007-04-09  Raja R Harinath  <rharinath@novell.com>
3800
3801         A better fix
3802         * flowanalysis.cs (UsageVector.MergeChild): Handle child.Block == null.
3803         * statement.cs: Use KillFlowBranching only in ResolveUnreachable.
3804
3805         Fix #81338
3806         * statement.cs (For.Resolve): If resolution fails, use
3807         KillFlowBranching.
3808
3809 2007-04-08  Marek Safar  <marek.safar@gmail.com>
3810
3811         * anonymous.cs (MakeName): Make faster and zero-based.
3812         (VerifyExplicitParameterCompatibility): Back to mode where generic
3813         parameter is ignored.
3814         (AnonymousMethodMethod.Emit): Decorate method as compiler generated.
3815
3816         * class.cs (EmitType): Method can emit another new method.
3817
3818         * cs-tokenizer.cs (IsLinqEnabled): Fixes static cctor race.
3819
3820         * driver.cs: Updated.
3821
3822         * lambda.cs: Reuse predefined empty parameters.
3823
3824         * parameter.cs: Updated
3825
3826         * support.cs: Implemented InflateTypes.
3827
3828         * typemanager.cs (GetFullName): Don't use FullName as it can be null.
3829         (InitSystemCore): Introduced to isolate 3.0 dependencies.
3830
3831 2007-04-03  Martin Baulig  <martin@ximian.com>
3832
3833         Fix #80632.
3834
3835         * statement.cs (Foreach.CollectionForeach.TryType): Use a custom
3836         version of TypeManager.IsOverride() which also works with generic
3837         types.  
3838
3839 2007-04-03  Martin Baulig  <martin@ximian.com>
3840
3841         Fix #81044.
3842
3843         * convert.cs
3844         (Convert.ExplicitReferenceConversion): We need to cast when
3845         converting from IList<T> to S[].
3846
3847 2007-04-01  Marek Safar  <marek.safar@gmail.com>
3848
3849         * decl.cs (FindExtensionMethods): Consider all candidates with same name
3850         at this level.
3851         
3852         * expression.cs (MemberAccess.DoResolve): Cache resolved expression.
3853
3854 2007-03-31  Marek Safar  <marek.safar@gmail.com>
3855
3856         * anonymous.cs (AnonymousMethodExpression.Compatible): Handles both
3857         argument and return type inferring.
3858
3859         * codegen.cs (InferReturnType): Flag whether return can be inferred.
3860         (ReturnType): Turned to property.
3861
3862         * statement.cs (Return): Implemented return type inferring.
3863
3864         * support.cs (ReflectionParameters): Use local types if possible.
3865
3866 2007-03-30  Raja R Harinath  <rharinath@novell.com>
3867
3868         * flowanalysis.cs (FlowBranching.Reachability): Remove.
3869         (FlowBranching.UsageVector): Update to changes.
3870
3871         Prepare to kill 'Reachability'
3872         * flowanalysis.cs (UsageVector): Remove 'Reachability' from
3873         argument of constructor.
3874
3875 2007-03-29  Raja R Harinath  <rharinath@novell.com>
3876
3877         Prepare to kill 'Reachability'
3878         * flowanalysis.cs (UsageVector.is_unreachable): New.
3879         (UsageVector): Update to maintain 'is_unreachable' in parallel to
3880         'reachability', and verify they're consistent.
3881
3882         Fix #81121
3883         * expression.cs (New.EmitStatement): Handle type parameters here too.
3884
3885 2007-03-29  Martin Baulig  <martin@ximian.com>
3886
3887         Fix #79148.
3888
3889         * anonymous.cs
3890         (ScopeInfo.ctor): Use `Modifiers.PUBLIC' if we're a nested
3891         CompilerGeneratedClass.
3892         (ScopeInfo.EmitScopeInstance): Make this protected.
3893         (CapturedVariable.EmitInstance): Use `Ldarg_0' if
3894         `ec.CurrentAnonymousMethod.Scope == Scope'.
3895
3896         * statement.cs (Block.ScopeInfo): Make this a property.
3897
3898 2007-03-27  Raja R Harinath  <harinath@gmail.com>
3899
3900         Prepare to kill 'Reachability'
3901         * flowanalysis.cs (FlowBranching.Reachability): Make class private.
3902         (FlowBranching.UsageVector.Reachability): Remove property.
3903         (FlowBranching.UsageVector.IsUnreachable): New property.
3904         (FlowBranching.UsageVector.ResetBarrier): New.
3905         (FlowBranching.UsageVector, FlowBranchingLabeled): Update to changes.
3906         * codegen.cs, statement.cs: Update to changes.
3907
3908 2007-03-27  Martin Baulig  <martin@ximian.com>
3909
3910         Fix #81209.
3911
3912         * decl.cs
3913         (DeclSpace.LookupNestedTypeInHierarchy): Correctly handle nested
3914         generic types.
3915
3916 2007-03-26  Raja R Harinath  <rharinath@novell.com>
3917
3918         * flowanalysis.cs (FlowBranching.Reachability): Use a boolean
3919         instead of TriState.  Remove all mention of TriState.
3920
3921         * flowanalysis.cs (FlowBranching.Reachability): Prepare to be
3922         replaced by a boolean.  Add boolean 'is_unreachable' field, check
3923         and maintain invariants.
3924
3925 2007-03-25  Marek Safar  <marek.safar@gmail.com>
3926
3927         * anonymous.cs: Restored checks disabled for uninflated anonymous methods.
3928
3929 2007-03-25  Marek Safar  <marek.safar@gmail.com>
3930
3931         * expression.cs: Stop using obsolete 2.0 opcodes.
3932
3933 2007-03-25  Marek Safar  <marek.safar@gmail.com>
3934
3935         * enum.cs (EnumMember.Define): Fixed regression and slowdown caused by
3936         one of the latests Martin's fixes.
3937
3938 2007-03-23  Miguel de Icaza  <miguel@novell.com>
3939
3940         * expression.cs: On BigEndian systems, swap the bytes, temporary
3941         solution until we get a new bitconverter class.
3942
3943 2007-03-23  Martin Baulig  <martin@ximian.com>
3944
3945         Fix #81158.
3946
3947         * decl.cs (MemberCache.AddMembers): Add generic methods both as
3948         "Method" and "Method`1".  Normally, a cache lookup is done on the
3949         "Method" form (ie. without the generic arity), but this one makes
3950         lookups on the full form work as well.
3951
3952 2007-03-22  Raja R Harinath  <rharinath@novell.com>
3953
3954         * flowanalysis.cs (Reachability): Reorganize slightly, and remove
3955         unused properties.
3956
3957 2007-03-20  Bill Holmes  <billholmes54@gmail.com>
3958         * class.cs: 
3959         Added 2 MemberCoreArrayList objects, ordered_explicit_member_list and
3960         ordered_member_list, to TypeBuilder to store members to be defined
3961         in the order they were parsed in.
3962         - ordered_explicit_member_list contains all properties indexers
3963           and methods that are defined as explicit implementation of an
3964           interface or base class.
3965         - ordered_member_list contains all properties indexers and methods
3966           that are not defined as explicit implementation of an interface
3967           or base class.
3968
3969         Removed MethodArrayList and IndexerArrayList from TypeBuilder.  The 
3970         functionality in these removed classes has been replaced with 
3971         ComputeIndexerName, EmitIndexerName, HasEqualss, HasGetHashCode, and 
3972         CheckEqualsAndGetHashCode members defined and called in the TypeBuilderClass.
3973
3974         Adding CheckForDuplications to PropertyBase.PropertyMethod and calls
3975         to CheckForDuplications inside GetMethod and SetMethod Define Method
3976         to handle method property and indexer name conflicts.
3977
3978         Fixes #79434
3979
3980         All code is contributed under the MIT/X11 license.
3981
3982 2007-03-20  Martin Baulig  <martin@ximian.com>
3983
3984         * class.cs (TypeContainer.Interfaces): Removed; they're now
3985         included in `TypeContainer.Types'.
3986
3987 2007-03-20  Martin Baulig  <martin@ximian.com>
3988
3989         Fix #77963, #80314 and #81019.  Added gtest-317, ..., gtest-320.
3990
3991         * class.cs (TypeContainer.CreateType): New public method.  This is
3992         now called before DefineType() to create the TypeBuilders.
3993         (TypeContainer.DefineType): Don't create the TypeBuilder here; it
3994         has already been created by CreateType().
3995         (TypeContainer.DefineTypeBuilder): Renamed into CreateTypeBuilder();
3996         don't resolve our base classes here; this has been moved into
3997         DefineBaseTypes().  We're now called from CreateType().
3998         (TypeContainer.DefineBaseTypes): New private method; resolve our
3999         base classes here.  We're now called from DefineType().
4000
4001         * rootcontext.cs
4002         (RootContext.ResolveTree): Call TypeContainer.CreateType() on all
4003         our types first to create all the TypeBuilders.  After that, call
4004         TypeContainer.DefineType() on all the types which'll resolve their
4005         base classes and setup the resolve order.
4006
4007 2007-03-20  Martin Baulig  <martin@ximian.com>
4008
4009         * class.cs (TypeContainer.Enums): Removed; they're now included in
4010         `TypeContainer.Types'.  
4011
4012 2007-03-20  Martin Baulig  <martin@ximian.com>
4013
4014         * class.cs
4015         (TypeContainer.DefineType): Don't call ResolveMembers() here.
4016         (TypeContainer.DoResolveMembers): Call DefineType() on our
4017         `compiler_generated' classes; moved here from DefineNestedTypes().
4018
4019         * rootcontext.cs
4020         (RootContext.ResolveTree): Call ResolveMembers() on all
4021         TypeContainer's in the `type_container_resolve_order'.
4022
4023 2007-03-19  Marek Safar  <marek.safar@gmail.com>
4024
4025         * class.cs: Use corlib to handle InternalMethodImplAttribute.
4026
4027 2007-03-17  Marek Safar  <marek.safar@gmail.com>
4028
4029         * class.cs (EventFieldAccessor.EmitMethod): Don't override existing
4030         implementation flags.
4031
4032 2007-03-17  Marek Safar  <marek.safar@gmail.com>
4033
4034         * class.cs: More optimizations for type parameters.
4035
4036 2007-03-15  Marek Safar  <marek.safar@gmail.com>
4037
4038         * anonymous.cs (AnomymousMethod): Can be now hosted in generic container.
4039
4040         * ecore.cs, parameter.cs: More common code for both corlibs.
4041
4042         * typemanager.cs (IsGenericMethod): Simplified.
4043
4044 2007-03-15  Raja R Harinath  <rharinath@novell.com>
4045
4046         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4047         'returns'.
4048         * statement.cs, iterators.cs, lambda.cs: Update to changes.
4049
4050         * statement.cs (Lock.Resolve): Invoke 'ec.NeedReturnLabel'
4051         unconditionally.  Simplify explanation.
4052         (Try.Resolve, Using.Resolve): Likewise.
4053
4054 2007-03-15  Martin Baulig  <martin@ximian.com>
4055
4056         Fix #80731.
4057
4058         * decl.cs (DeclSpace): If we're a partial class, use our
4059         `PartialContainer's `TypeParameters' and `CurrentTypeParameters'.
4060
4061 2007-03-15  Raja R Harinath  <rharinath@novell.com>
4062
4063         * flowanalysis.cs (FlowBranching.Reachability): Remove handling of
4064         'throws'.
4065         (FlowBranching.UsageVector): Update to changes.
4066         (FlowBranching.MergeSiblings): Likewise.
4067         * statement.cs: Likewise.
4068
4069 2007-03-15  Martin Baulig  <martin@ximian.com>
4070
4071         Fix #79302.
4072
4073         * decl.cs
4074         (MemberCache): Added a special .ctor for type parameters.
4075
4076         * typemanager.cs
4077         (TypeManager.MemberLookup_FindMembers): `TypeParameter' now has a
4078         `MemberCache'.  
4079
4080 2007-03-09  Martin Baulig  <martin@ximian.com>
4081
4082         * enum.cs (Enum): Make this a TypeContainer.
4083         (EnumMember): Derive from `Const'.
4084
4085         * const.cs
4086         (Const.DoResolveValue): New protected virtual method; move most of
4087         the functionality of ResolveValue() here so we can override it in
4088         `EnumMember'.
4089         (Const.CreateConstantReference): Make this virtual.
4090
4091         * class.cs (Kind): Add `Kind.Enum'.
4092         (TypeContainer.Emit): Don't emit the enums here; they're already
4093         in the `RootContext.typecontainer_resolve_order'.
4094
4095         * rootcontext.cs (RootContext.EmitCode): Don't emit the enums
4096         here; they're already in the `typecontainer_resolve_order'.
4097
4098         * ecore.cs (EnumConstant.ConvertImplicitly): Add
4099         TypeManager.DropGenericTypeArguments().
4100
4101         * typemanager.cs
4102         (TypeManager.CSharpEnumValue): Add DropGenericTypeArguments().
4103         (TypeManager.IsEnumType): Likewise.
4104         (TypeManager.EnumToUnderlying): Likewise.
4105         (TypeManager.IsEqual): Add support for enums.
4106
4107 2007-03-12  Raja R Harinath  <rharinath@novell.com>
4108
4109         * typemanager.cs (InitCoreTypes) [NET_2_0]: Allow
4110         DefaultParameterValueAttribute to be undefined, say if System.dll
4111         is not referenced.
4112
4113 2007-03-11  Marek Safar  <marek.safar@gmail.com>
4114
4115         * ecore.cs, parameter.cs, typemanager.cs: Another gmcs fix to work with
4116         any mscorlib.
4117
4118 2007-03-10  Marek Safar  <marek.safar@gmail.com>
4119
4120         * class.cs, parameter.cs: Unified parameters verification.
4121
4122 2007-03-08  Martin Baulig  <martin@ximian.com>
4123
4124         * cs-parser.jay (constructor_header): Pass the location to the
4125         newly created TopLevelBlock.
4126
4127 2007-03-07  Martin Baulig  <martin@ximian.com>
4128
4129         * statement.cs (Block.Resolve): Don't crash on error; bug #80715.
4130
4131 2007-03-06  Miguel de Icaza  <miguel@novell.com>
4132
4133         * convert.cs (ExplicitReferenceConversionExists): Sync this method
4134         with the changes from David, fixes the build.
4135
4136 2007-03-05  David Mitchell  <dmitchell@logos.com>
4137
4138         * convert.cs: Implement From System.Collecitons.Generic.IList<T>
4139         and its base interfaces to a one-dimensional array type S[],
4140         provided there is an implicit or explicit reference conversion
4141         from S to T.
4142
4143 2007-03-03  Marek Safar  <marek.safar@gmail.com>
4144
4145         * cs-tokenizer.cs: Implemented basic linq grammar.
4146
4147         * driver.cs: Set linq lang version on demand.
4148
4149 2007-02-26  Marek Safar  <marek.safar@gmail.com>
4150
4151         * cs-parser.jay, expression.cs: Compile empty __arglist correctly.
4152
4153 2007-02-25  Marek Safar  <marek.safar@gmail.com>
4154
4155         * attribute.cs: Replaced DefinePInvoke in favor of S.R.E implementation
4156         (Fixes #80455)
4157
4158         * class.cs (InterfaceMemberBase): Share common `extern' modifier checks
4159         here.
4160         Check property and event extern attributes.
4161
4162         * codegen.cs (ModuleClass): HasDefaultCharSet when module defined global
4163         charset.
4164
4165 2007-02-24  Marek Safar  <marek.safar@gmail.com>
4166
4167         A fix for bug #80407
4168         * ecore.cs: Don't report ambiguity error when methods have same parent.
4169
4170 2007-02-23  Marek Safar  <marek.safar@gmail.com>
4171
4172         A fix for bug #80878
4173         * class.cs, cs-parser.jay: Event property can host anonymous methods.
4174
4175 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4176
4177         * attribute.cs: Enable ExtensionAttribute presence test.
4178
4179 2007-02-22  Marek Safar  <marek.safar@gmail.com>
4180
4181         * class.cs: Warn about missing GetHashCode only when Equals is override.
4182
4183         * decl.cs: Check accessibility of type arguments.
4184
4185         * typemanager.cs: Correctly report nullable array.
4186
4187 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4188
4189         * class.cs, report.cs: Capture more details when things go wrong.
4190
4191 2007-02-20  Marek Safar  <marek.safar@gmail.com>
4192
4193         A fix for bug #80650
4194         * cs-parser.jay: Anonymous container starts at constructor declaration
4195         and not at block beginning because it has to be usable in constructor
4196         initializer.
4197
4198         * statement.cs: Use context location and not block one for error reporting.
4199
4200 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4201
4202         A fix for bug #78712
4203         * class.cs.cs, decl.cs, ecore.cs: LookupAnyGeneric inspects nested types
4204         too.
4205
4206 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4207
4208         A fix for bug #80493 by Atsushi Enomoto
4209         * cs-parser.jay: Ignore invalid attribute target.
4210
4211 2007-02-18  Marek Safar  <marek.safar@gmail.com>
4212  
4213         * cs-tokenizer.cs: Ignore '\0' as white space character.
4214
4215 2007-02-17  Miguel de Icaza  <miguel@novell.com>
4216
4217         * cs-parser.jay: Add support for lambda expressions to the mcs
4218         compiler as well.
4219
4220         * lambda.cs: Only clone when we are probing, not on the final call
4221         (Compatible is the final call). 
4222
4223         * statement.cs (CloneContext): Introduce class to provide block
4224         remapping during clone.
4225
4226         All statements Clone themselves now.
4227
4228         (Clone): special handling for blocks, when we clone a block, we
4229         register the block inside this routine, as children of the block
4230         might trigger a lookup. 
4231         
4232         * expression.cs: Add support for CloneContext in all expressions. 
4233         
4234 2007-02-17  Marek Safar  <marek.safar@gmail.com>
4235  
4236         A fix for bug #80493
4237         * statement.cs: Report ambiguous warning when interfaces are not related.
4238
4239 2007-02-15  Marek Safar  <marek.safar@gmail.com>
4240
4241         C# 3.0 extension methods.
4242
4243         * attribute.cs (Error_MisusedExtensionAttribute): Extension attribute
4244         cannot be used directly.
4245
4246         * class.cs (Class.Emit): Emit extension attribute if any class method
4247         is extension method.
4248         (Method.Define): Add basic extension method validation conditions.
4249         (Method.Emit): Emit extension attribute for method.
4250
4251         * codegen.cs (AssemblyClass): Emit extension attribute if at least one
4252         extension method exists. Currently we follow same approach as Microsoft
4253         does, emit even if a method or a class are private but this can change
4254         later.
4255
4256         * cs-parser.jay: Add handling of `this' keyword in method parameters
4257         context.
4258
4259         * decl.cs (DeclSpace.IsStaticClass): New property.
4260         (MemberCache.FindExtensionMethods): Looks for extension methods with
4261         defined name and extension type.
4262
4263         * doc.cs: Updated after OverloadResolve changes.
4264
4265         * driver.cs: Add new soft reference to System.Core.dll.
4266
4267         * ecore.cs (MethodLookup): Can return only MethodGroupExpr.
4268         (ExtensionMethodGroupExpr): Represents group of extension methods.
4269
4270         * expression.cs (Invocation): Moved methods BetterConversion, MoreSpecific,
4271         BetterFunction, IsOverride, IsAncestralType, OverloadResolve
4272         to MethodGroupExpr and made non-static for easier customization.
4273         (Invocation.DoResolve): Add extension method lookup when no standard
4274         method was found.
4275         (MemberAccess.DoResolve): Try extension methods if no member exists.
4276
4277         * modifiers.cs: Add METHOD_EXTENSION modifier.
4278
4279         * namespace.cs (RegisterExtensionMethodClass): Register class namespace
4280         as well as candidate extension type.
4281         (ComputeNamespaces): When assembly constains extension methods registers
4282         them.
4283         (Namespace.RegisterExternalExtensionMethodClass): Register type for later
4284         extension method lookup.
4285         (Namespace.LookupExtensionMethod): Looks for extension method in this
4286         namespace.
4287         (NamespaceEntry.LookupExtensionMethod): Does extension methods lookup to
4288         find a method which matches name and extensionType.
4289
4290         * parameter.cs (Parameter): Add This modifer.
4291         (HasExtensionMethodModifier): New property.
4292         (Resolve): Add extension parameter check.
4293         (ModFlags): turned to property to exclude this modifier as it is not real
4294         parameter modifier.
4295         (Parameters): Implemented ExtensionMethodType and HasExtensionMethodType.
4296
4297         * support.cs (ParameterData): Add ExtensionMethodType.
4298         (ReflectionParameters): Implemented ExtensionMethodType interface property.
4299
4300         * typemanager.cs: Add type and ctor extension attribute type.
4301
4302 2007-02-15  Miguel de Icaza  <miguel@novell.com>
4303
4304         * report.cs (DisableErrors, EnableErrors): used to prevent error
4305         output when we are "trying" to compile various methods with
4306         different types. 
4307
4308         * ecore.cs (Expression): Add Clone method that calls the virtual
4309         CloneTo method.  The current CloneTo method in Expression throws
4310         an exception so we can track down all the places where this must
4311         be implemented (not using abstract, because that would be a lot of
4312         up-front-work before we can start testing the implementation
4313         idea). 
4314
4315         Important: we only need Clone capabilities for expressions created
4316         by the parser, as the expressions we will be cloning are
4317         expressions in the pre-resolved state.   This vastly simplifies
4318         the work required. 
4319         
4320         (SimpleName): Add CloneTo that does nothing.
4321         (EmptyCast): Add CloneTo.
4322         
4323         * expression.cs (Binary): Implement CloneTo.
4324         (Invocation.IsApplicable): Store the current ec in
4325         EmitContext.TempEc and restore it on return.  This is used so we
4326         do not have to sprinkle hundres of methods with an extra
4327         EmitContext, we know that the only user is the lambda expression
4328         ImplicitConversionExists code. 
4329         
4330         (Argument): Add Cloning capabilities.
4331         (LocalVariableReference, ParenthesizedExpression, Unary, Probe,
4332         Cast, Conditional, ArrayCreation, InvocationOrCast, Invocation,
4333         ArglistAccess, ArgList, TypeOf, SizeOf, CheckedExpr,
4334         UnCheckedExpr, ElementAccess, BaseAccess, BaseIndexerAccess,
4335         IndexerAccess): Add Clone capability.
4336
4337         (LocalVariableReference, This): TODO: needs cloned Block mapping.
4338
4339         (Argument): Add cloning capability.
4340
4341         * assign.cs (Assign): Implement CloneTo.
4342
4343         * anonymous.cs (ImplicitStandardConversionExists): Make virtual.
4344         
4345         * lambda.cs (ImplicitStandardConversionExists): Implement lambda
4346         version by calling Convert with the EmitContext (that we are
4347         currently storing in ec, this is not great, but will do for now,
4348         to avoid passing EmitContext parameters to hundreds of functions
4349         that do not need them now).
4350
4351         (SetExpression): Remove, it is not needed.
4352         
4353         (ContextualReturn): Implement CloneTo.
4354
4355         * statement.cs (Statement): Implement cloning infrastructure,
4356         similar to expressions.
4357
4358         (Block): Partial implementation of Clone for statements.
4359
4360         (Return): Implement clone.
4361         
4362         * constant.cs (Constant.CloneTo): New method, does nothing.
4363
4364         * codegen.cs (TempEc): Add a static EmitContext as a temporary
4365         solution, until we decide how to exactly do this.  
4366         
4367 2007-02-14  Marek Safar  <marek.safar@gmail.com>
4368  
4369         A fix for bug #80493
4370         * class.cs (FindOutBaseMethod): When the base accessor does not exist and
4371         a property is override we need to use second accessor.
4372
4373 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4374  
4375         A fix for bug #80418
4376         * attribute.cs, class.cs: Use correct calling conventions for pinvoke
4377         methods.
4378
4379 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4380
4381         Another fix for bug #80749
4382         * pending.cs: Abstract class has priority over interfaces.
4383
4384 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4385
4386         Another fix for bug #80749
4387         * pending.cs: Abstract class has priority over interfaces.
4388
4389 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4390
4391         Another fix for bug #80749
4392         * pending.cs: Abstract class has priority over interfaces.
4393
4394 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4395
4396         Another fix for bug #80749
4397         * pending.cs: Abstract class has priority over interfaces.
4398
4399 2007-02-13  Marek Safar  <marek.safar@gmail.com>
4400
4401         * class.cs Better error message.
4402
4403         * driver.cs: Add shorter versions of -optimize option.
4404
4405 2007-02-13  Martin Baulig  <martin@ximian.com>
4406
4407         * class.cs (Constructor.Emit): Check the return value of
4408         ec.ResolveTopBlock() and return on error.
4409
4410 2007-02-13  Raja R Harinath  <rharinath@novell.com>
4411
4412         * ecore.cs (Error_InvalidExpressionStatement): Add a comma to error
4413         message to fix error message regression.
4414
4415 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4416
4417         * delegate.cs: Delegate creation expression cannot be of Nullable type.
4418
4419 2007-02-12  Marek Safar  <marek.safar@gmail.com>
4420
4421         A fix for bug #80749
4422         * assign.cs (FieldInitializer): FieldInitializer has to keep track of
4423         its parent container.
4424
4425         * class.cs (DefineFieldInitializers): Each initializer can has different
4426         resolve context.
4427
4428         * const.cs: Updated.
4429
4430 2007-02-11  Miguel de Icaza  <miguel@novell.com>
4431
4432         * lambda.cs (LambdaExpression.Compatible): Remove some early code,
4433         now all the heavy lifting to check that embedded statements or
4434         expressions have the right form is done in the ContextualReturn.
4435
4436         (ContextualReturn): New class.  
4437
4438         * ecore.cs (Error_InvalidExpressionStatement): Make a helper
4439         method that can be invoked to report 201, so we do not replicate
4440         this everywhere.
4441
4442         * cs-parser.jay: Reuse Error_InvalidExpressionStatement.
4443         
4444         * cs-tokenizer.cs (xtoken): Correctly compute the column, it was
4445         treating tabs as spaces. 
4446
4447 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4448
4449         A fix for bug #80315 by martin.voelkle@gmail.com (Martin Voelkle)
4450         * assign.cs: Use full implicit conversion for right side check.
4451
4452 2007-02-09  Marek Safar  <marek.safar@gmail.com>
4453
4454         * statement.cs (Switch): Switch over boolean type is not standardized.
4455
4456 2007-02-08  Marek Safar  <marek.safar@gmail.com>
4457
4458         A fix for bug #80755
4459         * decl.cs (FindBaseEvent): Don't use method cache for events.
4460
4461 2007-02-07  Marek Safar  <marek.safar@gmail.com>
4462
4463         * cs-parser.jay: Better syntax error handling.
4464
4465         * ecore.cs, enum.cs, statement.cs, typemanager.cs: Print enum member name
4466         instead of underlying type value.
4467
4468 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4469
4470         * driver.cs: Check define identifier before is registered.
4471
4472         * namespace.cs: Use existing error message.
4473
4474         * report.cs: New warning.
4475
4476 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4477
4478         A fix for bug #80742
4479         * expression.cs: Delegate Invoke method can be called directly.
4480
4481 2007-02-06  Marek Safar  <marek.safar@gmail.com>
4482
4483         A fix for bug #80676
4484         * class.cs (IsEntryPoint): The Main method can have params modifier.
4485
4486 2007-02-04  Miguel de Icaza  <miguel@novell.com>
4487
4488         * parameter.cs (Parameter, Parameters): Add Clone method.
4489
4490         * anonymous.cs (Compatible): Turn method into virtual method, so
4491         LambdaExpression can implement a different behavior.
4492
4493         (CompatibleChecks, VerifyExplicitParameterCompatibility): Factor
4494         out the basic checking here, so it can be used by
4495         LambdaExpressions.
4496         
4497         * lambda.cs: Introduce "Compatible" function that will do the
4498         heavy lifting.
4499
4500 2007-02-02  Marek Safar  <marek.safar@gmail.com>
4501
4502         * attribute.cs: Unified one error message.
4503
4504         * class.cs (Class): Use type attributes and not properties to test static
4505         class.
4506         (IsEntryPoint): Don's pass local variable.
4507
4508         * convert.cs: Removed duplicate check.
4509
4510         * decl.cs, doc.cs, ecore.cs (LookupType): Renamed to LookupNamespaceOrType.
4511
4512         * driver.cs: Don't crash when soft reference does not exist.
4513
4514         * namespace.cs (EnsureNamespace): Renamed to RegisterNamespace.
4515         (UsingEntry): Removed redundant allocation.
4516
4517         * parameter.cs: Add fast path for type parameters.
4518
4519         * support.cs: Don't allocate attribute when it's not used.
4520
4521 2007-01-30  Miguel de Icaza  <miguel@novell.com>
4522
4523         * anonymous.cs
4524         (AnonymousMethodExpression.ImplicitStandardConversionExists): turn
4525         this into a virtual method, so we can override it in LambdaExpression.
4526
4527         * driver.cs: Improve diagnostics in case of failure. 
4528
4529         * cs-tokenizer.cs: Instead of trying to parse a type and a name,
4530         write a function that is slightly more complex and that parses:
4531
4532         type identifier [, type identifier]* )
4533
4534         The old function would return incorrectly a OPEN_PARENS_LAMBDA for
4535         this expression:
4536
4537                 (canEmpty ? i >= 0 : i > 0)
4538
4539 2007-01-30  Raja R Harinath  <rharinath@novell.com>
4540
4541         * cs-tokenizer.cs (parse_namespace_or_typename): Don't throw an
4542         exception on possibly valid code.
4543
4544 2007-01-29  Raja R Harinath  <rharinath@novell.com>
4545
4546         * cs-tokenizer.cs (is_punct) ['<']: Update to changes in
4547         Push/PopPosition.
4548         (parse_opt_type_arguments): Remove.  It's almost the same as
4549         parse_less_than.
4550         (parse_namespace_or_typename): Use parse_less_than.
4551
4552 2007-01-28  Miguel de Icaza  <miguel@novell.com>
4553
4554         * cs-tokenizer.cs: Typo fix, its not GMCS_SOURCES but GMCS_SOURCE,
4555         this bug took a few hours to find, because the state saved and
4556         restored by PushPosition and PopPosition was ignoring the state of
4557         parse_generic_less_than.
4558
4559         I can also now remove the handling of OP_LT and OP_GT, this solves
4560         the big mistery.
4561         
4562         * cs-tokenizer.cs: store the location for the ARROW token, we use
4563         that in the parser.
4564
4565         (PushPosition, PopPosition): save/restore also `current_token',
4566         restore `parse_generic_less_than' (was missing).
4567
4568         (parse_opt_type_arguments): use parse_type, not
4569         parse_namespace_or_typename to parse types.
4570
4571         * lambda.cs: Empty new file, will eventually have the lambda
4572         expression implementation.
4573
4574         * lambda.test: used to test the internal tokenizer. 
4575
4576         * report.cs (FeatureIsNotISO1): Rename from
4577         FeatureIsNotStandardized, because it was about the language level
4578         (1 vs 2) it was not about standarization.
4579
4580         (FeatureRequiresLINQ): New.
4581
4582         * support.cs (SeekableStreamReader): Only require that the reader
4583         is a TextReader, not a StreamReader, so we can plug StringReader. 
4584
4585         * cs-tokenizer.cs (parse_type_and_parameter): Returns true if at a
4586         given position in the input stream the following tokens can be
4587         parsed as a type followed by an identifier.
4588
4589         (is_punct): after a '(' if parse_type_and_parameter returns true,
4590         then return a special token OPEN_PARENS_LAMBDA which is used to
4591         avoid reduce/reduce errors in the grammar for the
4592         lambda_expression rules.
4593
4594         (parse_type): implement a type parser inside the
4595         tokenizer, the parser only returns true or false depending on
4596         whether the input at a given position can be parsed as a type.
4597
4598         (peek_token): new method used during type parsing.
4599
4600 2007-01-28  Raja R Harinath  <rharinath@novell.com>
4601
4602         Fix #80531
4603         * anonymous.cs (ScopeInfo.InflateParameters): New.
4604         (AnonymousContainer.Resolve): Use it to redirect types of
4605         delegate parameters.
4606
4607 2007-01-27  Raja R Harinath  <rharinath@novell.com>
4608
4609         Fix #80530
4610         * expression.cs (Error_InvalidArguments): Don't use two different
4611         messages for CS1503.  Use ExtraInformation and
4612         SymbolRelatedToPreviousError instead.
4613
4614         Fix #80358
4615         * decl.cs (DeclSpace.initialize_type_params): Don't access
4616         'type_params' of a partial class directly.
4617
4618 2007-01-26  Miguel de Icaza  <miguel@novell.com>
4619
4620         * constant.cs: Removed a handful of out-of-range checks that were
4621         not necessary. 
4622
4623 2007-01-25  Marek Safar  <marek.safar@gmail.com>
4624
4625         * expression.cs (CheckUselessComparison): Add additional check for char
4626         constants.
4627
4628         * namespace.cs: Fixed typo.
4629
4630 2007-01-23  Miguel de Icaza  <miguel@novell.com>
4631
4632         * constant.cs: Bloat removal, CheckRange and CheckUnsigned are
4633         gone, instead we inline the test, preventing the needless casts to
4634         longs, ulongs and doubles for the parameters, avoiding calls to
4635         methods that overchecked stuff, and instead inlined things
4636         nicely. 
4637
4638 2007-01-20  Marek Safar  <marek.safar@gmail.com>
4639
4640         * cs-parser.jay: Better parameter error handling.
4641
4642 2007-01-17  Marek Safar  <marek.safar@gmail.com>
4643
4644         A fix for bug #80368, #80522
4645         * expression.cs (ArrayCreation.only_constant_initializers): Indicates
4646         whether array initializer contains constants only.
4647         (ArrayCreation.Emit): Use better formula to decide when
4648         are array initializers for static initialization.
4649         (ArrayCreation.EmitDynamicInitializers): When the array is small enough we
4650         have to emit even constants otherwise they are pre-initialized.
4651
4652 2007-01-17  Bill Holmes  <bill.holmes@ansys.com>
4653             Raja R Harinath  <rharinath@novell.com>
4654
4655         Fix emit order of 'get' vs. 'set'.
4656         * support.cs (Accessors): New.
4657         * cs-parser.jay (accessor_declarations): Use it instead of 'Pair'.
4658         Note the order in which accessors are declared in the source.
4659         * class.cs (PropertyBase.DefineGet, PropertyBase.DefineSet): New.
4660         Refactored from Property.Define and Indexer.Define.
4661         (PropertyBase.DefineAccessors): New helper that calls the above in
4662         appropriate order as noted by the parser.
4663         (Property.Define, Indexer.Define): Update to changes.
4664         (PropertyBase.SetMethod.PropertyInfo): Don't return a null.
4665
4666 2007-01-17  Raja R Harinath  <rharinath@novell.com>
4667
4668         Fix cs0029-6.cs and gcs0029-2.cs (regression)
4669         * ecore.cs (EmptyConstantCast.ConvertImplicitly): Check that
4670         there's an implicit conversion from the current type to the target
4671         type before converting the underlying constant.
4672
4673 2007-01-16  Marek Safar  <marek.safar@gmail.com>
4674
4675         * const.cs (ResolveValue): Updated after constant conversion was made more
4676         generic.
4677
4678         * constant.cs (GetAttributableValue): constant to object conversion is
4679         used for attributes only.
4680         (IntConstant.ConvertImplicitly): Moved from convert to be used in all
4681         constant conversions.
4682         (LongConstant.ConvertImplicitly): Ditto.
4683
4684         * convert.cs (ImplicitNumericConversion): Extracted constant bussiness.
4685         (ImplicitConversionStandard): Handle constant conversion as extra step.
4686         It solves the issue when constant conversion was called indirectly like
4687         inside array initializer and constant folding was skipped.
4688
4689         * literal.cs (NullLiteral.ConvertImplicitly): Fixed an issue exposed by
4690         this change.
4691
4692         * statement.cs(ImplicitConversionStandard): Updated after constant
4693         conversion was made more generic.
4694
4695 2007-01-16  Sergey P. Kondratyev <se@unicom.tomica.ru>
4696
4697         * expression.cs (As.DoResolve): Use GenericConstraints instead of
4698         Constraints, solves the problem where the compiler incorrectly
4699         reported that a type parameter was not constrained to a class (Bug
4700         80518)
4701
4702 2007-01-14  Marek Habersack  <grendello@gmail.com>
4703
4704         * doc-bootstrap.cs: Fix a compilation problem in the bootstrap phase.
4705
4706 2007-01-14  Marek Safar  <marek.safar@gmail.com>
4707
4708         A fix for bug #80368
4709         * assign.cs (FieldInitializer): New class implements field
4710         initializer statement.
4711
4712         * attribute.cs: Update after FieldMember rename.
4713
4714         * class.cs (PropertyBasedMember): New common class for property based
4715         types.
4716         (InterfaceMemberBase): New base class for all members which can be used as
4717         an interface members.
4718         (MethodCore): Moved really common code to InterfaceMemberBase.
4719         (Method.Define): Equal and GetHasCode detection is relevant for methods
4720         only.
4721         (MethodData.Define): Don't assume that public event implements an
4722         interface automatically.
4723         (MethodData.DefineMethodBuilder): Issue an error even if only extern
4724         modifier is used.
4725         (MemberBase): Moved all interface speficic code to InterfaceMemberBase.
4726         (FieldMember): Merged with FieldBase.
4727         (EventProperty.AEventPropertyAccessor): New specialization to check whether
4728         event extern modifier can be used.
4729         (EventField.EventFieldAccessor): Moved event field specific code here.
4730         (Event.AllowedModifiers): Even event can be extern.
4731         (Event.FindOutBaseMethod): New override specific to events.
4732         (Indexer.parameters): Reintroduce parameters because base class holds
4733         only properties common data.
4734         (Indexer.CheckForDuplications): Indexers are threated as methods so we
4735         need do extra parameters check.
4736
4737         * const.cs: Update after FieldMember rename.
4738
4739         * decl.cs (MemberCache.FindBaseEvent): New method.
4740
4741         * doc.cs (GetMethodDocCommentName): Accept parameters as extra argument
4742         to reflect that indexer is now derived from PropertyBased.
4743
4744         * ecore.cs (GetMemberType): Made public.
4745         (EventExpr.ResolveMemberAccess): Use right event cache and checks for
4746         obsolete event.
4747
4748         * flowanalysis.cs, statement.cs: Update after FieldMember rename.
4749         
4750         * typemanager.cs (CSharpSignature): Correctly print event accessors.
4751         (RegisterEvent): Removed.
4752         (RegisterPrivateFieldOfEvent): Renamed to RegisterEventField.
4753         (GetPrivateFieldOfEvent): Renamed to GetEventField.
4754
4755 2007-01-11  Raja R Harinath  <rharinath@novell.com>
4756
4757         Fix #80249
4758         * statement.cs (CollectionForeach.TryType): Prefer generic
4759         GetEnumerator over non-generic variant.  Fix code to follow comments.
4760
4761 2007-01-09  Raja R Harinath  <rharinath@novell.com>
4762
4763         Fix #80446
4764         * support.cs (ReflectionParameter): Don't use an invalid index on
4765         the generic parameter data.
4766
4767 2007-01-08  Miguel de Icaza  <miguel@novell.com>
4768
4769         * driver.cs: Just add a tiny bit of infrastructure.
4770
4771 2007-01-02  Marek Safar  <marek.safar@gmail.com>
4772
4773         * class.cs (VerifyMembers): Fixed an crash reported on mono mailing list
4774         where field type is struct from current assembly.
4775         
4776         * ecore.cs (EnumConstant.AsString): Report an enum member name whenever
4777         it is possible.
4778
4779 2007-01-02  Marek Safar  <marek.safar@gmail.com>
4780
4781         A fix for bug #80381
4782         * attribute.cs (AttributeTester.RegisterNonObsoleteType): Registers
4783         the core types.
4784
4785         * namespace.cs (GlobalRootNamespace.LookupTypeReflection): Better error
4786         messages.
4787         (Namespace.LookupType): Always use core types from corlib when speficied.
4788
4789         * report.cs: A new warning.
4790
4791         * rootcontext.cs (BootstrapCorlib_ResolveInterface,
4792         BootstrapCorlib_ResolveClass): Register type as non-obsolete type.
4793         (ResolveCore): Add missing System.Runtime.InteropServices._Attribute.
4794
4795         * typemanager.cs (CoreLookupType): Register type as non-obsolete type.
4796         (InitCoreTypes): Set expression type of object_type and value_type
4797         immediately after lookup.
4798
4799 2007-01-01  Miguel de Icaza  <miguel@novell.com>
4800
4801         * cs-tokenizer.cs: Accept Pc class characters (Connector
4802         Punctuation) as valid identifiers.  Fixes #78259
4803
4804         * expression.cs (Invocation.DoResolve): Moved the check for the
4805         use of `this' for doing method calls to the Invocation resolution
4806         step, after overload resolution has taken place instead of doing
4807         the check at the low-level `This.DoResolve' level.
4808
4809         The `This.DoResolve'(appens before overload resolution, so it has
4810         no way of knowing if the method that will be called will be
4811         instace or static, triggering an erroneous report for cs0188 (Bug
4812         78113).
4813
4814         We now do the check for instance method invocations after we know
4815         what method will be called.
4816
4817         (This.CheckThisUsage): Move the actual use of this structure
4818         checking into its own method and expose it. 
4819
4820         * Everywhere that called Error_ValueCannotBeConverted: pass a new
4821         EmitContext.
4822
4823         Exceptions: Null.ConvertImplicitly,
4824         Constant.ImplicitConversionRequired as there are too many call
4825         sites for passing the ec. 
4826
4827         * ecore.cs (Expression.Error_ValueCannotBeConverted): Take an
4828         EmitContext, if the value is null, then we do not try to provide
4829         the extra information from the error (If a userdefined conversion
4830         exists, as UserDefinedConversion requires a non null-EmitContext).
4831
4832         Fixes: #80347
4833
4834 2006-12-30  Raja R Harinath  <rharinath@novell.com>
4835
4836         * flowanalysis.cs (MyBitVector): Document some invariants.
4837         (MyBitVector.Or, MyBitVector.And): Reimplement the optimizations
4838         introduced below, and add a couple of others, 
4839
4840 2006-12-30  Marek Safar  <marek.safar@gmail.com>
4841
4842         * attribute.cs (GetMethodObsoleteAttribute): Uses new
4843         GetPropertyFromAccessor and GetEventFromAccessor.
4844         
4845         * class.cs (MethodCore.CheckBase): A new warning when obsolete member
4846         overrides non-obsolete one.
4847         (Indexer.Define): Error message has been moved to the parser.
4848
4849         * cs-parser.jay: Better syntax errors handling.
4850
4851         * delegate.cs (NewDelegate.DoResolve): Issue less confusing error message
4852         when an invocation has no arguments.
4853
4854         * ecore.cs: Removed not used caching.
4855
4856         * expression.cs (IsSpecialMethodInvocation): Reuses TypeManager
4857         implementation.
4858
4859         * report.cs: Add a new warning.
4860
4861         * support.cs (ReflectionParameters): Implements Equals, GetHashCode.
4862
4863         * typemanager.cs (enumeration_type): Removed.
4864         (CSharpSignature): Reuses IsSpecialMethod.
4865         (IsEqual): Hack for MS BCL.
4866         (GetPropertyFromAccessor): New method.
4867         (GetEventFromAccessor): New method.
4868         (IsSpecialMethod): Fixed to handle more cases.
4869
4870 2006-12-30  Marek Safar  <marek.safar@gmail.com>
4871
4872         * cs-tokenizer.cs (PreProcessDefinition, handle_preprocessing_directive):
4873         Made white spaces array static.
4874
4875         * ecore.cs (RemoveGenericArity): Optimized.
4876
4877         * flowanalysis.cs (MyBitVector.Or, MyBitVector.And): Optimized (up to
4878         10 times faster).
4879         (MyBitVector.initialize_vector): Simplified.
4880
4881 2006-12-22  Miguel de Icaza  <miguel@novell.com>
4882
4883         * ecore.cs: Am not entirely happy with this hack, but it seems to
4884         address the issue in 80257 (a small test case for
4885         CreativeDocs.NET). 
4886
4887         I set the MethodGroupExpr.Type to an internal compiler type
4888         (itself in this case) to force the resolution to take place.   Why
4889         it does not take place with a null is beyond me.
4890
4891 2006-12-20  Marek Safar  <marek.safar@gmail.com>
4892
4893         A fix for bug #80288
4894         * expression.cs (ResolveOperator): Consider user defined conversion for
4895         logical and operator too.
4896         (EmitBranchable): Optimization for logical and when full constant folding
4897         could not be applied but one operand is constant.
4898
4899 2006-12-19  Marek Safar  <marek.safar@gmail.com>
4900
4901         * class.cs (GetClassBases): Write 5 times every day, will never use
4902         FullName for error reporting.
4903
4904         * decl.cs (AsAccessible, CheckAccessLevel): Always unpack arrays first.
4905
4906 2006-12-19  Martin Baulig  <martin@ximian.com>
4907
4908         * statement.cs (LocalInfo.EmitSymbolInfo): New public method; emit
4909         the symbol file info here.
4910
4911 2006-12-18  Marek Safar  <marek.safar@gmail.com>
4912
4913         * cs-tokenizer.cs (handle_preprocessing_directive): When previous section
4914         of `elseif' is taking then following sections are not taking.
4915         Fixes an issue reported on mono mailing list.
4916
4917 2006-12-18  Marek Safar  <marek.safar@gmail.com>
4918
4919         A fix for bug #80300
4920         * cs-tokenizer.cs (PreProcessDefinition): Do no define/undefine when
4921         a caller is not taking.
4922
4923 2006-12-18  Raja R Harinath  <rharinath@novell.com>
4924
4925         * anonymous.cs: Change several TypeContainer declarations to DeclSpace.
4926         (CompilerGeneratedClass): Use parent.PartialContainer unconditionally.
4927         (RootScopeInfo, AnonymousMethodMethod): Update to changes.
4928         * iterator.cs: Change several TypeContainer declarations to DeclSpace.
4929         * class.cs: Update to changes.
4930
4931 2006-12-17  Marek Safar  <marek.safar@gmail.com>
4932
4933         A fix for bug #79934
4934         * anonymous.cs (CompilerGeneratedClass): Register class in a shared
4935         partial container.
4936
4937         * class.cs (ResolveMembers): Register an iterator in current container and
4938         not in shared one.
4939
4940 2006-12-16  Raja R Harinath  <rharinath@novell.com>
4941
4942         Fix test-543.cs
4943         * expression.cs (VerifyArgumentsCompat): Allow zero arguments to
4944         satisfy a params annotated parameter.
4945
4946 2006-12-16  Marek Safar  <marek.safar@gmail.com>
4947
4948         A fix for bug #77014
4949         * expression.cs (Invocation.BetterFunction): Fixed to cope with dynamic
4950         paramters correctly and not rely on hacks in Parameters class.
4951         (Invocation.IsParamsMethodApplicable): Changed to accept params parameter
4952         at any possition.
4953         (Invocation.VerifyArgumentsCompat): Ditto.
4954         (Invocation.EmitArguments): Changed to correctly emit params arguments at
4955         any possition.
4956
4957         * parameter.cs (HasParams): Don't assume that params is the last one.
4958
4959         * support.cs (ReflectionParameters.ctor): Look for params attribute
4960         correctly.
4961         (ReflectionParameters.ParameterType): Removed hack when we returned last
4962         parameter for out of range parameters.
4963         (ParameterName, ParameterModifier): Ditto.
4964
4965 2006-12-14  Marek Safar  <marek.safar@gmail.com>
4966
4967         A fix for bug #79987
4968         * decl.cs (DeclSpace.VerifyClsCompliance): External names cache is null
4969         when assembly is not CLS compliant but type is. I have no idea why is this
4970         allowed.
4971
4972         * typemanager.cs (Reset): Invalidate AllClsTopLevelTypes cache.
4973
4974 2006-12-13  Miguel de Icaza  <miguel@novell.com>
4975
4976         * class.cs (ConstructorInitializer.Resolve): Allow for ":this()"
4977         in struct constructors, they are basically no-ops.
4978
4979 2006-12-12  Marek Safar  <marek.safar@gmail.com>
4980
4981         * cs-tokenizer.cs (Position): Save preprocessor status too.
4982
4983 2006-12-12  Marek Safar  <marek.safar@gmail.com>
4984
4985         A fix for bug #77794
4986         * cs-tokenizer.cs (consume_identifier): Check for correct partial context.
4987
4988 2006-12-12  Marek Safar  <marek.safar@gmail.com>
4989
4990         * cs-tokenizer.cs (get_cmd_arg): Support CR as the line terminator.
4991         Fixes #69299.
4992         (pp_expr): Report error for an invalid expression.
4993         (handle_preprocessing_directive): Simplified; add more error checking.
4994
4995 2006-12-11  Marek Safar  <marek.safar@gmail.com>
4996
4997         A fix for bug #74939
4998         * cs-tokenizer.cs (is_punct): We cannot simply disable preprocessor
4999         directives handling.
5000
5001 2006-12-10  Marek Safar  <marek.safar@gmail.com>
5002
5003         A fix for bugs #80093, and #75984
5004         * cs-tokenizer.cs (handle_preprocessing_directive): Fixed #if/#else/#endif
5005         logic, it seems to me as it worked before "by coincidence".
5006         (xtoken): Simplified to use reworked handle_preprocessing_directive.
5007         (cleanup): Enabled endif check.
5008
5009 2006-12-09  Marek Safar  <marek.safar@gmail.com>
5010
5011         A fix for bug #80162
5012         * statement.cs (CollectionForeach.TryType): Generics and non-generics
5013         enumerators are never ambiguous.
5014
5015 2006-12-08  Raja R Harinath  <rharinath@novell.com>
5016
5017         Fix #80060
5018         * cs-tokenizer.cs (parse_less_than): Recognize double-colons too.
5019
5020 2006-12-06  Marek Safar  <marek.safar@gmail.com>
5021
5022         A fix for bug #80144
5023         * class.cs (EventProperty.Define): Explicit implementation means
5024         that an even is used.
5025
5026 2006-12-06  Marek Safar  <marek.safar@gmail.com>
5027
5028         Fixes the operators implementation (part II)
5029
5030         * cfold.cs (DoConstantNumericPromotions): Renamed to
5031         DoBinaryNumericPromotions and simplified.
5032         (BinaryFold): Couple of conversion fixes; simplified.
5033
5034         * constant.cs, ecore.cs, literal.cs
5035         (ToType): Renamed to ConvertImplicitly.
5036         (Reduce): Renamed to ConvertExplicitly.
5037
5038         * class.cs, convert.cs: Updated.
5039
5040         * expression.cs: TryReduce doesn't throw an exception.
5041
5042 2006-12-01  Marek Safar  <marek.safar@gmail.com>
5043
5044         A fix for bug #80108
5045         * ecore.cs (EventExpr.EmitAddOrRemove): Don't crash when right side is not
5046         compatible.
5047
5048 2006-11-30  Marek Safar  <marek.safar@gmail.com>
5049
5050         Fixes unary operators implementation (part I)
5051         Also fixes #80026
5052
5053         * cfold.cs (Error_CompileTimeOverflow): Made internal
5054
5055         * const.cs (IConstant): Changed to use reference to constant and
5056         not constant itself.
5057         Updated IConstant implementations.
5058
5059         * constant.cs (CreateConstant): New factory method.
5060         Updated IConstant implementation.
5061
5062         * convert.cs (ImplicitStandardConversionExists): Uses compiler Equals.
5063
5064         * ecore.cs: Updated to use CreateConstantReference.
5065
5066         * enum.cs: Reflects IConstant changes.
5067
5068         * expression.cs (Unary): Reimplemented +,-,~ to conform C# standard.
5069
5070         * literal.cs (NullConstant): Change to be independently usable.
5071
5072 2006-11-29  Martin Baulig  <martin@ximian.com>
5073
5074         * class.cs (Constructor.Emit): Correctly handle anonymous methods;
5075         we need to emit the scope initializer before calling the base .ctor.
5076
5077         * anonymous.cs: Merged back from the new anonymous methods branch.
5078         (AnonymousMethodHost): Renamed to `RootScopeInfo'.
5079
5080         * expression.cs (ParameterReference.DoResolveBase): Create a
5081         "normal" ScopeInfo when capturing parameters rather than using the
5082         root scope; this makes things work with anonymous methods having
5083         parameters.
5084
5085         * statement.cs
5086         (ToplevelBlock.AnonymousMethodHost): Renamed into `RootScope'.
5087
5088 2006-11-22  Marek Safar  <marek.safar@gmail.com>
5089
5090         A fix for bug #79987
5091         * class.cs (VerifyClsCompliance): Move redundant CLS compliance attribute
5092         check to a base class.
5093         * decl.cs (VerifyClsCompliance): Warn that CLS compliance cannot be tested
5094         only when assembly has missing attribute.
5095         * report.cs: Update.
5096
5097 2006-11-21  Marek Safar  <marek.safar@gmail.com>
5098
5099         * cs-tokenizer.cs: Merged with gmcs version.
5100
5101 2006-11-20  Marek Safar  <marek.safar@gmail.com>
5102
5103         * cs-tokenizer.cs,
5104         * cs-parser.jay: Better error message when partial keyword is misplaced.
5105
5106 2006-11-19  Gert Driesen  <drieseng@users.sourceforge.net>
5107
5108         A fix for bug #79810
5109         report.cs: CS1058 only applies to 2.0 profile (gmcs).
5110         codegen.cs: on 2.0 profile, non-exception throwables are wrapped in
5111         a RuntimeWrappedException by default.
5112
5113 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5114
5115         A fix for bug #79843
5116         * delegate.cs (Delegate.VerifyMethod): Fixed covariance and contravariance
5117         implementation.
5118         (DelegateCreation.Error_NoMatchingMethodForDelegate): Ditto.
5119
5120 2006-11-18  Marek Safar  <marek.safar@gmail.com>
5121
5122         * driver.cs, namespace.cs: Uses faster IndexOf version.
5123
5124 2006-11-17  Marek Safar  <marek.safar@gmail.com>
5125
5126         A fix for bug #79941
5127         * class.cs (MemberCore.IsDuplicateImplementation): Add more tricks for
5128         operators.
5129         (Operator.Define): Implicit/Explicit operator of same type is duplicate
5130         even if internal name is different.
5131         * convert.cs (GetConversionOperator): Replaced EmitContext with parentType.
5132         (UserDefinedConversion): Simplified as the operators cannot be internal.
5133         * ecore.cs (Error_ValueCannotBeConverted): Take account of user
5134         conversions.
5135         (MethodLookup): Replaced EmitContext with parentType.
5136         * expression.cs: Updated.
5137
5138 2006-11-09  Raja R Harinath  <rharinath@novell.com>
5139
5140         * driver.cs (BadAssembly): Handle all the ugliness of
5141         DefineDynamicAssembly.
5142
5143 2006-11-08  Raja R Harinath  <rharinath@novell.com>
5144
5145         Address parts of #58244 -- most of what's left is in the runtime
5146         * driver.cs (LoadAssembly): Simplify slightly.  Add CS0009 and
5147         CS1509 error checks, and handle them for all assembly loads, not
5148         just the first invocation.
5149         (LoadModule): Likewise.  Move handling of 'adder_method' ...
5150         * codegen.cs (AssemblyClass.AddModule): ... here.
5151
5152 2006-11-02  Marek Safar  <marek.safar@gmail.com>
5153
5154         * statement.cs.cs (CollectionForeach.TryType): Issue a error when
5155         IEnumerable<T> is ambiguous.
5156
5157 2006-10-31  Marek Safar  <marek.safar@gmail.com>
5158
5159         A fix for bug #67689
5160         * statement.cs.cs (CollectionForeach.TryType): Issue a warning when
5161         GetEnumerator is ambiguous.
5162
5163         * report.cs: Add new warning.
5164
5165 2006-10-29  Marek Safar  <marek.safar@gmail.com>
5166
5167         A fix for bug #78602
5168         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5169         to protected member can be nested type.
5170
5171 2006-10-28  Marek Safar  <marek.safar@gmail.com>
5172
5173         A fix for bug #78965
5174         ecore.cs (PropertyExpr.InstanceResolve): The qualifier for access
5175         to protected member must derive from current type.
5176
5177 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5178
5179         assign.cs: Reuses error method.
5180
5181         ecore.cs (Expression.Error_ValueCannotBeConverted): Report a value
5182         instead of type for constants.
5183         (Expression.Error_ValueAssignment): Common error method.
5184
5185         * expression.cs (UnaryMutator.ResolveOperator): Value cannot be used
5186         for any assignment.
5187
5188 2006-10-27  Marek Safar  <marek.safar@gmail.com>
5189
5190         A fix for bug #79081
5191         * expression.cs (MemberAccess.DoResolve): Check nested type
5192         accessibility.
5193
5194 2006-10-27  Atsushi Enomoto  <atsushi@ximian.com>
5195
5196         * doc.cs : nested delegates were not handled. Fixed bug #79754.
5197
5198 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5199
5200         A fix for bug #76591
5201         * cs-tokenizer.cs (IsCastToken): Enable a cast of anonymous method.
5202
5203 2006-10-26  Marek Safar  <marek.safar@gmail.com>
5204
5205         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Don't allow to have
5206         type forwarder of the same type multiple times.
5207
5208 2006-10-26  Raja R Harinath  <rharinath@novell.com>
5209
5210         Fix #78820
5211         * ecore.cs (PropertyExpr.InstanceResolve): Always resolve the
5212         instance as an rvalue, even when we later resolve as an lvalue.
5213
5214 2006-10-25  Martin Baulig  <martin@ximian.com>
5215
5216         * anonymous.cs: Fix #79673.
5217
5218 2006-10-24  Marek Safar  <marek.safar@seznam.cz>
5219
5220         A fix for bug #79666
5221         expression.cs (ArrayCreation.GetAttributableValue): An initializer can be
5222         ignored when is optimized (= default value) as its value is already set.
5223
5224 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5225
5226         A fix for bug #79724
5227         * report.cs (SymbolRelatedToPreviousError): Uses DeclSpace instead of
5228         TypeContainer for type lookup.
5229
5230 2006-10-23  Marek Safar  <marek.safar@seznam.cz>
5231
5232         A fix for bug #79231
5233         * ecore.cs (ResolveAsBaseTerminal): Removed redundant error test.
5234         * expression.cs (OverloadResolve): Always convert type name for
5235         an error message.
5236         (ResolveNamespaceOrType): Don't confuse a nested type with any 
5237         other member.
5238
5239 2006-10-18  Martin Baulig <martin@ximian.com>
5240
5241         * anonymous.cs: Propagate the IsStatic state, fixes the crasher in banshee.
5242
5243 2006-10-17  Miguel de Icaza  <miguel@novell.com>
5244
5245         * convert.cs: Fix typo, fixes the test-535.cs, we were casting to
5246         an int32, but requesting an int64 from the conversion
5247
5248 2006-10-12  Martin Baulig  <martin@ximian.com>
5249
5250         * anonymous.cs
5251         (AnonymousContainer.Resolve): Inflate the `ReturnType'.  Fixes #79592.
5252         
5253 2006-10-12  Martin Baulig  <martin@ximian.com>
5254
5255         * statement.cs
5256         (Using.EmitLocalVariableDeclFinally): Small fix for iterators.
5257
5258 2006-10-11  Miguel de Icaza  <miguel@novell.com>
5259
5260         * convert.cs: Remove broken code: I was doing the "Existance"
5261         tests for Implicit conversions.
5262
5263 2006-10-10  Miguel de Icaza  <miguel@novell.com>
5264
5265         * convert.cs: Added one missing case in
5266         ImplicitStandardConversionExists uint64 to intptr.
5267
5268         Fixes #59800
5269         
5270         * typemanager.cs (uintptr_type): another core known type.   
5271
5272         * ecore.cs (OperatorCast): routine used to do cast operations that
5273         depend on op_Explicit.  We could change some of the Decimal
5274         conversions to use this.
5275
5276         This one has a probe mechanism that checks both types for an op_
5277         which it coudl be used to eliminate two classes: CastToDecimal
5278         and CastFromDecimal.
5279
5280         * convert.cs: Implement the conversions documented in #59800
5281         
5282 2006-10-10  Martin Baulig  <martin@ximian.com>
5283
5284         * iterators.cs (Iterator.Resolve): Call RootScope.ResolveType()
5285         before RootScope.ResolveMembers().
5286
5287         * anonymous.cs (ScopeInfo.CapturedScope.ctor): Use the child's
5288         `CurrentType' if appropriate.
5289
5290 2006-10-09  Marek Safar  <marek.safar@seznam.cz>
5291
5292         A fix for bug #78568
5293         * cs-tokenizer.cs (Deambiguate_CloseParens): Expression cannot be cast
5294         when contains binary operators.
5295         * cs-parser.jay: Updated.
5296
5297 2006-10-09  Martin Baulig  <martin@ximian.com>
5298
5299         * delegate.cs
5300         (Delegate.DefineType): Don't call TypeParameter.Resolve() here;
5301         moved that into Define() and also do the other type parameter
5302         checks there.  Fixes #79094.  Added gtest-292.cs.
5303
5304         * expression.cs
5305         (ArrayCreation.EmitDynamicInitializers): Use `etype.IsValueType'
5306         since that doesn't include type parameters; don't use `Ldelema'
5307         for type parameters.  Fixes #78980.  Added gtest-293.cs.
5308
5309 2006-10-08  Marek Safar  <marek.safar@seznam.cz>
5310
5311         A fix for #77796
5312         * convert.cs (ExplicitReferenceConversion): Only enum to enum value
5313         conversion is allowed.
5314
5315 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5316
5317         * ecore.cs (Expression.MemberLookup): Don't register any symbol for
5318         error reporting when no error occurs.
5319
5320 2006-10-06  Marek Safar  <marek.safar@seznam.cz>
5321
5322         * cfold.cs (ConstantFold.BinaryFold): Report an error when the conversion
5323         does not exist.
5324
5325 2006-10-06  Raja R Harinath  <rharinath@novell.com>
5326
5327         Fix #79584
5328         * class.cs (DefineTypeBuilder): Check circular dependencies before
5329         setting the parent of the TypeBuilder.
5330         (CheckRecursiveDefinition): Don't use 'BaseType', since
5331         it may not be valid until after DefineTypeBuilder.  Use
5332         'base_type' instead.
5333
5334 2006-10-04  Martin Baulig  <martin@ximian.com>
5335
5336         Merged the Anonymous Methods patch.
5337
5338         * anonymous.cs, iterators.cs: The new anonymous methods code.
5339
5340         * statement.cs (Variable): New public abstract class.
5341         (LocalInfo.Variable): New public property.
5342         (LocalInfo.ResolveVariable): New public method.
5343         (Block.Flags): Add `IsIterator'.
5344         (Block.AddVariable): Improved the CS0136 check.
5345         (Block.AnonymousChildren): New public property.
5346         (Block.AddAnonymousChild): New public method.
5347         (ToplevelBlock): Update to use the new anonymous method framework.
5348         (ToplevelBlock.ctor): `container' is now a `Block' and not a
5349         `ToplevelBlock'; this is required to correctly implement the
5350         CS0136 check.
5351         (Fixed, Using): Use `TemporaryVariable' instead of directly
5352         creating the `LocalBuilder'.
5353
5354         * parameter.cs (Parameter.ResolveVariable): New public method.
5355         (Parameters.ResolveVariable): Likewise.
5356
5357         * ecore.cs (TemporaryVariable): Use the new `Variable' framework.
5358
5359         * class.cs (TypeContainer): Replaced the `iterators' list and
5360         corresponding methods with a list of `CompilerGeneratedClass'es.
5361         (TypeContainer.ResolveMembers): New public method.
5362         (Method): `IIteratorContainer' has been replaced by
5363         `IAnonymousHost'.
5364
5365         * expression.cs (VariableReference): New public abstract base
5366         class for `LocalVariableReference', `ParameterReference' and
5367         `This'.
5368
5369         * codegen.cs (EmitContext): Removed `capture_context',
5370         `HaveCaptureInfo', `EmitScopeInitFromBlock()' and `Capture*()'.
5371         (EmitContext.EmitThis): Removed.
5372
5373         * cs-parser.jay: Replace `iterator_container' with
5374         `anonymous_host'.       
5375
5376 2006-10-04  Martin Baulig  <martin@ximian.com>
5377
5378         * generic.cs (GenericMethod): Don't make this abstract.
5379         (Constraints.Clone): Added dummy implementation.
5380
5381 2006-10-04  Raja R Harinath  <harinath@gmail.com>
5382
5383         Fix #79577
5384         * namespace.cs (LookForAnyGenericType): Avoid nullref on
5385         'declspaces'.  Avoid allocating arrays willy-nilly.
5386
5387         Fix #79553
5388         * cfold.cs (BinaryFold): Move boolean Equality and Inequality
5389         cases out of the switch.
5390
5391 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5392
5393         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Better error
5394         message when non-generic type is used with the type arguments.
5395         * expression.cs: Updated.
5396
5397 2006-09-28  Raja R Harinath  <rharinath@novell.com>
5398
5399         Fix #79013
5400         * convert.cs (Convert.ImplicitStandardConversionExists): Avoid infloop.
5401         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
5402         Change semantics slightly.  Don't insist on having only one
5403         temporary EmptyExpression -- just throttle the creation of new ones.
5404
5405         Fix #79451
5406         * ecore.cs (Expression.MemberLookup): Enable CS0229 errors for
5407         non-interfaces too.  If no methods are found, don't try to create
5408         a MethodGroupExpr.
5409
5410 2006-09-28  Marek Safar  <marek.safar@seznam.cz>
5411
5412         * ecore.cs (ResolveAsTypeStep): Print better error when type can be
5413         generic type.
5414
5415         * namespace.cs (Namespace.LookForAnyGenericType): New method to help
5416         us produce better error message.
5417
5418 2006-09-27  Marek Safar  <marek.safar@seznam.cz>
5419
5420         * expression.cs (Binary.ResolveOperator): Warn about a side effect
5421         of the `|' operator.
5422
5423         * report.cs: A new warning added.
5424
5425 2006-09-27  Martin Baulig  <martin@ximian.com>
5426
5427         * generic.cs (GenericMethod): Don't make this abstract.
5428
5429 2006-09-27  Martin Baulig  <martin@ximian.com>
5430
5431         * report.cs
5432         (InternalErrorException): Added overloaded ctor taking a params array.
5433
5434 2006-09-26  Marek Safar  <marek.safar@seznam.cz>
5435
5436         * class.cs, codegen.cs, const.cs, cs-tokenizer.cs, driver.cs, ecore.cs:
5437         Fixed the cases when same error was reported twice.
5438
5439         * report.cs (SymbolRelatedToPreviousError): Simplified as all our messages
5440         now report symbol information.
5441
5442 2006-09-25  Martin Baulig  <martin@ximian.com>
5443
5444         * class.cs: Completely unified with the gmcs version.
5445
5446 2006-09-25  Martin Baulig  <martin@ximian.com>
5447
5448         * typemanager.cs (TypeManager.IsNullableType): New public function.
5449         (TypeManager.IsNullableTypeOf): Likewise.
5450         (TypeManager.IsNullableValueType): Likewise.
5451
5452         * class.cs (MethodCore): Added the `GenericMethod' argument from
5453         gmcs and also unified all classes derived from `MethodCore' with gmcs.
5454
5455 2006-09-24  Raja R Harinath  <harinath@gmail.com>
5456
5457         * convert.cs: Unify with gmcs version.
5458
5459 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5460
5461         * decl.cs (DeclSpace.VerifyClsCompliance): When type has type parameters
5462         verify them as well.
5463
5464         * report.cs: New warning.
5465
5466 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5467
5468         * anonymous.cs (AnonymousMethod.Compatible): Cannot generate arguments
5469         for anonymous block with out argument.
5470
5471 2006-09-24  Marek Safar  <marek.safar@seznam.cz>
5472
5473         * class.cs (ClassOrStruct.VerifyMembers): Fixed to report correctly
5474         not used private events only.
5475
5476 2006-09-23  Marek Safar  <marek.safar@seznam.cz>
5477
5478         * cfold.cs (BinaryFold): On the guest to unify empty constant cast.
5479
5480         * const.cs (Const.Define): Check for constant type.
5481         (Const.IsConstantTypeValid): Looks for valid constant types.
5482
5483         * convert.cs (ImplicitReferenceConversion): NullCast to EmptyConstantCast.
5484
5485         * ecore.cs (EmptyConstantCast): New common class for all constant based
5486         EmptyCast(s).
5487
5488         * expression.cs (Is.DoResolve): Handle null constant especially.
5489         (New.DoResolve): Check for new void().
5490         (MemberAccess.DoResolve): Cope with all kind of nulls.
5491
5492         * literal.cs (NullConstant): Uses EmptyConstantCast.
5493         (NullDefault): Based on EmptyConstantCast.
5494         (NullLiteral): Uses EmptyConstantCast.
5495
5496         * statement.cs (Block.ResolveMeta): Check for constant type.
5497
5498 2006-09-22  Martin Baulig  <martin@ximian.com>
5499
5500         * delegate.cs, attribute.cs: Merged with the gmcs versions.
5501
5502 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5503
5504         * literal.cs (NullDefault): The type of default(IFoo) is 'IFoo',
5505         not the null type.
5506
5507         Fix part of #79451
5508         * typemanager.cs (Closure.Filter): Consider PrivateScope attributes.
5509         * decl.cs (DeclSpace.FindMemberToOverride): Likewise.  Reorganize
5510         code slightly.
5511
5512 2006-09-22  Martin Baulig  <martin@ximian.com>
5513
5514         * ecore.cs: Merged with the gmcs version.
5515
5516         * generic.cs (ConstructedType): New dummy class.
5517         (TypeArguments): Don't make this abstract.
5518
5519         * typemanager.cs
5520         (TypeManager.IsGenericTypeDefinition): New method.
5521         (TypeManager.GetGenericFieldDefinition): Moved here from gmcs.
5522
5523 2006-09-22  Raja R Harinath  <rharinath@novell.com>
5524
5525         * expression.cs (ComposedCast): Check for arrays of TypedReference
5526         before creating the type, not after.
5527
5528 2006-09-21  Marek Safar  <marek.safar@seznam.cz>
5529
5530         * cfold.cs, const.cs, enum.cs, statement.cs: Updated
5531         after ToType change.
5532
5533         * constant.cs (Constant.ImplicitConversionRequired): Designed to used
5534         when constant must be implicitly convertible.
5535
5536         * convert.cs (ImplicitReferenceConversion): Reuse ToType.
5537
5538         * ecore.cs (NullCast): Derives from NullConstant.
5539
5540         * expression.cs (Is.DoResolve): Removed useless variables.
5541         (Conditional.DoResolve): Quick hack for `Foo () ? null : null'.
5542         (New.Constantify): Add enum support.
5543         (MemberAccess.DoResolve): Add warning when accessing null constant or
5544         variable.
5545
5546         * generic.cs (GenericConstraints.IsReferenceType): Another dummy
5547         property.
5548
5549         * literal.cs (NullConstant): New abstract class with common
5550         functionality for all null specializations.
5551         (NullDefault): Represents default(X) when result can be
5552         reduced to null.
5553         (NullLiteral): Updated.
5554
5555         * report.cs: Add new warning.
5556
5557 2006-09-21  Martin Baulig  <martin@ximian.com>
5558
5559         * generic.cs (GenericTypeParameterBuilder): Removed this ugly hack.
5560
5561 2006-09-21  Martin Baulig  <martin@ximian.com>
5562
5563         * generic.cs (GenericConstraints): New dummy class.
5564         (Constraints): Likewise.
5565         (TypeParameter): Likewise.
5566         (TypeParameterName): Likewise.
5567         (GenericMethod): Likewise.
5568
5569         * typemanager.cs (TypeManager.GetGenericArguments): New method.
5570
5571         * decl.cs: Merged with the gmcs version.
5572
5573 2006-09-21  Raja R Harinath  <rharinath@novell.com>
5574
5575         * generic.cs (TypeParameter): Implement IMemberContainer.
5576         (GenericTypeParameterBuilder): New.  An abominable repugnant hack.
5577
5578         * rootcontext.cs: Unify with gmcs version.
5579
5580         * report.cs: Unify with gmcs version.
5581         * typemanager.cs (AddTypeParameter, LookupTypeParameter): Move
5582         from gmcs/generics.cs.
5583         * generics.cs (TypeParameter): New dummy class.
5584
5585         * support.cs: Unify with gmcs version.
5586
5587 2006-09-20  Raja R Harinath  <rharinath@novell.com>
5588
5589         * ecore.cs (MethodGroupExpr.ResolveGeneric): New dummy method.
5590         * expression.cs (MemberAccess, BaseAccess): Remove GMCS_SOURCE #ifdef.
5591
5592         * decl.cs (MemberName): Unify with gmcs, except for GetTypeExpression.
5593         * generic.cs (TypeArguments): New dummy class to help avoid #ifdefs.
5594         * mcs.exe.sources: Add generic.cs.
5595
5596         * codegen.cs: Unify with gmcs version.
5597
5598         * codegen.cs (IResolveContent.GenericDeclContainer): Copy from gmcs.
5599         (EmitContext): Add GenericDeclContainer implementation.
5600         * decl.cs (MemberCore, DeclSpace): Likewise.
5601         * namespace.cs: Remove #ifdef GMCS_SOURCE.
5602
5603         * namespace.cs (GetTypeInAssembly): Remove #ifdef GMCS_SOURCE.
5604         MCS TypeManager has a corresponding dummy method.
5605
5606 2006-09-19  Martin Baulig  <martin@ximian.com>
5607
5608         * expression.cs: Completely merged with the gmcs version.
5609
5610 2006-09-19  Martin Baulig  <martin@ximian.com>
5611
5612         * expression.cs (Invocation): Merged with the gmcs version.
5613         (ArrayAccess.GetStoreOpcode): Likewise.
5614
5615 2006-09-19  Martin Baulig  <martin@ximian.com>
5616
5617         * typemanager.cs
5618         (TypeManager.IsGenericMethod): Moved here from ../gmcs/generic.cs.
5619         (TypeManager.IsGenericMethodDefinition): Likewise.
5620
5621 2006-09-19  Martin Baulig  <martin@ximian.com>
5622
5623         * typemanager.cs
5624         (TypeManager.IsEqual): Moved the gmcs implementation here.
5625         (TypeManager.DropGenericTypeArguments): Likewise.
5626         (TypeManager.DropGenericMethodArguments): Likewise.
5627         (TypeManager.GetTypeArguments): Moved here from gmcs.
5628         (TypeManager.HasGenericArguments): Likewise.
5629
5630 2006-09-19  Martin Baulig  <martin@ximian.com>
5631
5632         * expression.cs (Binary): Merged with the gmcs version.
5633
5634 2006-09-19  Martin Baulig  <martin@ximian.com>
5635
5636         * expression.cs (Probe, As, Is): Merged with the gmcs version.
5637
5638 2006-09-19  Martin Baulig  <martin@ximian.com>
5639
5640         * typemanager.cs: Merged with the gmcs version.
5641
5642 2006-09-16  Raja R Harinath  <rharinath@novell.com>
5643
5644         * AssemblyInfo.cs [GMCS_SOURCE]: Unify with gmcs source.
5645         * driver.cs: Likewise.
5646
5647 2006-09-16  Marek Safar  <marek.safar@seznam.cz>
5648
5649         A fix for #79401
5650         * class.cs (MethodCore.VerifyClsCompliance): Do check for abstract members
5651         only if parent type is class.
5652         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Fixed missing cache
5653         update.
5654
5655 2006-09-15  Marek Safar  <marek.safar@seznam.cz>
5656
5657         * cs-parser.jay,
5658         * expression.cs(MemberAccess.DoResolve): Don't crash when not allowed
5659         keywords are used.
5660         * typemanager.cs(CSharpName): Converts NullType to null.
5661
5662 2006-09-15  Martin Baulig  <martin@ximian.com>
5663
5664         * typemanager.cs
5665         (TypeManager.GetMethodName): Added mcs implementation.
5666         (TypeManager.IsEqual): Likewise.
5667
5668         * ecore.cs
5669         (SimpleName.RemoveGenericArity): Added dummy implementation.
5670
5671         * pending.cs: Merged with the gmcs version.     
5672
5673 2006-09-15  Martin Baulig  <martin@ximian.com>
5674
5675         * statement.cs: Merge with the gmcs version.
5676
5677 2006-09-15  Martin Baulig  <martin@ximian.com>
5678
5679         * statement.cs (Switch): Merge with the gmcs implementation
5680         (without nullables), which is newer.
5681
5682 2006-09-15  Martin Baulig  <martin@ximian.com>
5683
5684         * statement.cs (Block.Variables): Make this public.
5685         (ToplevelBlock.Parameters): Make this a property.
5686         (Throw.Resolve): Use `TypeManager.IsSubclassOf ()'.
5687
5688 2006-09-15  Martin Baulig  <martin@ximian.com>
5689
5690         * namespace.cs: Merge with the gmcs version.
5691
5692 2006-09-15  Martin Baulig  <martin@ximian.com>
5693
5694         * decl.cs (MemberName): Minor code cleanups.
5695
5696 2006-09-15  Martin Baulig  <martin@ximian.com>
5697
5698         * parameter.cs: Merge with the gmcs version.
5699
5700 2006-09-15  Martin Baulig  <martin@ximian.com>
5701
5702         * enum.cs: Merge with the gmcs version: 3005 is a warning in gmcs
5703         and an error in mcs.
5704
5705 2006-09-15  Martin Baulig  <martin@ximian.com>
5706
5707         * flowanalysis.cs: Merged from GMCS; added the generics code into
5708         a `GMCS_SOURCE' conditional so we can share this file.
5709
5710 2006-09-08  Martin Baulig  <martin@ximian.com>
5711
5712         * typemanager.cs (TypeManager.interlocked_type): New public field.
5713         (TypeManager.int_interlocked_compare-exchange): New public field.
5714         (TypeManager.InitEnumUnderlyingTypes): Also initialize the
5715         enumerator types here and call InitGenericCoreTypes().
5716         (TypeManager.InitCoreTypes): Call InitEnumeratorTypes() right
5717         after calling InitEnumUnderlyingTypes().
5718
5719         * rootcontext.cs
5720         (RootContext.ResolveCore): Added `System.Threading.Interlocked' to
5721         `classes_second_stage'. 
5722
5723 2006-09-14  Marek Safar  <marek.safar@seznam.cz>
5724
5725         * assign.cs, ecore.cs, expression.cs: Share error message text.
5726         * class.cs (FieldMember.Define): Check for varible of static type.
5727         * driver.cs (LoadAssembly): Uses error output for errors.
5728         * statement.cs: Updated.
5729
5730 2006-09-08  Marek Safar  <marek.safar@seznam.cz>
5731
5732         * expression.cs (Error_OperatorCannotBeApplied): Report type instead of
5733         type instance.
5734
5735 2006-09-07  Martin Baulig  <martin@ximian.com>
5736
5737         * driver.cs
5738         (MainDriver): Revert r62663 from Marek; see #70506 for details.
5739
5740 2006-08-29  Miguel de Icaza  <miguel@novell.com>
5741
5742         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
5743         
5744 2006-08-17  Miguel de Icaza  <miguel@novell.com>
5745
5746         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
5747         #52019 and #79064, the use of the \uXXXX sequence in source code
5748         to represent unicode characters.
5749
5750 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
5751
5752         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
5753         support.
5754         * class.cs, ecore.cs, statement.cs: Merged to one error message.
5755
5756 2006-08-13  Miguel de Icaza  <miguel@novell.com>
5757
5758         * assign.cs: Catch attempts to assign to a method groups in += and
5759         report as 1656
5760
5761 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
5762
5763         A fix for #79056
5764         * cs-parser.jay: Don't destroy current array type by typeof of array's.
5765
5766 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
5767
5768         * class.cs (Method.Define): Issue a warning when generic method looks like
5769         an entry point.
5770         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
5771         as well.
5772
5773 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
5774  
5775         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
5776         looking for ctor.
5777         * decl.cs (MemberCache.FindMembers): When container is interface we need to
5778         search all base interfaces as a member can be ambiguous.
5779         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
5780         Constructor member type filter. 
5781         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
5782         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
5783         reporting for returned memberinfos.
5784         * report.cs: Updated.
5785         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
5786         version to work on all runtimes.
5787         (TypeManager.RealMemberLookup): Removed members filtering.
5788
5789 2006-08-08  Raja R Harinath  <rharinath@novell.com>
5790
5791         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
5792         (PropertyExpr.EmitAssign): Likewise.
5793         * expression.cs (Indirection.EmitAssign): Likewise.
5794         (LocalVariableReference.EmitAssign): Likewise.
5795         (ParameterReference.EmitAssign): Likewise.
5796         (Invocation.EmitArguments): Likewise.
5797         (ArrayAccess.EmitAssign): Likewise.
5798         (IndexerAccess.EmitAssign): Likewise.
5799         (This.EmitAssign): Likewise.
5800         (ConditionalLogicalOperator.Emit): Likewise.
5801
5802         Fix #79026
5803         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
5804         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
5805         leave it in after returning it.
5806         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
5807
5808 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
5809
5810         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
5811         message.
5812
5813 2006-08-03  Raja R Harinath  <rharinath@novell.com>
5814
5815         Fix cs0146-3.cs and cs0146-4.cs.
5816         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
5817         enclosing types don't depend on the current type.
5818
5819 2006-08-02  Raja R Harinath  <rharinath@novell.com>
5820
5821         Fix #77963
5822         * class.cs (TypeContainer.DoDefineMembers): Use
5823         FindBaseMemberWithSameName on Parent, since we're interested in
5824         whether we hide inherited members or not.
5825         (FindBaseMemberWithSameName): Make slightly more robust.
5826
5827         Fix the non-generic testcase from #77396
5828         * decl.cs (DeclSpace.DeclContainer): Remove override.
5829
5830         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
5831         declspaces for doppelgangers too.
5832         (UsingEntry): Implement IResolveContext.
5833         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
5834         'this' as the resolve context.
5835         (LocalAliasEntry): Likewise.
5836
5837         Implement parts of #77403
5838         * roottypes.cs (RootDeclSpace): New.  Used to represent the
5839         toplevel declaration space.  Each namespace declaration introduces
5840         a "partial" root declaretion space.
5841         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
5842         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
5843         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
5844         from 'current_namespace.SlaveDeclSpace'.
5845         (namespace_declaration): Likewise.
5846         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
5847         check.  It can't happen now.
5848         * decl.cs (DeclSpace.LookupType): Likewise.
5849         * driver.cs (MainDriver): Sanity check.
5850
5851 2006-08-01  Raja R Harinath  <rharinath@novell.com>
5852
5853         * decl.cs (DeclSpace.FindNestedType): Remove.
5854         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
5855         LookupTypeContainer to get the container of the nested type.
5856         * class.cs (TypeContainer.FindNestedType): Make non-override.
5857
5858 2006-07-31  Raja R Harinath  <rharinath@novell.com>
5859
5860         * decl.cs (DeclSpace.PartialContainer): Move field from ...
5861         * class.cs (TypeContainer.PartialContainer): ... here.
5862         (TypeContainer.AddBasesForPart): New helper.
5863         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
5864         instead.
5865         * cs-parser.jay (current_class): Convert to DeclSpace.
5866         (struct_declaration, interface_declaration, class_declaration):
5867         Use AddBasesForPart instead of .Bases directly.
5868         * const.cs, iterators.cs: Update to changes.
5869
5870 2006-07-28  Raja R Harinath  <rharinath@novell.com>
5871
5872         * class.cs (TypeContainer.AddMemberType): Rename from
5873         AddToTypeContainer.
5874         (TypeContainer.AddMember): Rename from AddToMemberContainer.
5875         (AddTypeContainer): New.  Combine AddClassOrStruct and
5876         AddInterface.
5877         (AddPartial): Update.  Add 'is_partial' argument.
5878         * roottypes.cs: Update to changes.
5879         * cs-parser.jay (push_current_class): New helper for handling
5880         current_container and current_class.
5881         (struct_declaration, interface_declaration, class_declaration):
5882         Use it.
5883
5884 2006-07-26  Raja R Harinath  <rharinath@novell.com>
5885
5886         * roottypes.cs: Rename from tree.cs.
5887
5888         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
5889         * tree.cs (Tree, ITreeDump): Remove types.
5890         * rootcontext.cs (tree, Tree): Remove fields.
5891         (root, ToplevelTypes): New.
5892         * *.cs: Update to rename.
5893
5894         * tree.cs (Tree.RecordDecl): Remove.
5895         (RootTypes.AddToTypeContainer): Record the toplevel type in its
5896         namespace here.
5897         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
5898
5899 2006-07-23  Raja R Harinath  <harinath@gmail.com>
5900
5901         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
5902         DoFlowAnalysis and OmitStructFlowAnalysis here.
5903         (ec.With): Rename from WithUnsafe and generalize.
5904         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
5905         (ec.WithFlowAnalyis): New.
5906         * ecore.cs, expression.cs, statement.cs: Update.
5907
5908 2006-07-22  Raja R Harinath  <harinath@gmail.com>
5909
5910         * statement.cs (Block.ResolveMeta): Simplify slightly.
5911
5912         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
5913         multiple boolean fields.  Convert InUnsafe, constant_check_state,
5914         check_state to flags.
5915         (CheckState, ConstantCheckState): Update.
5916         (InUnsafe): New read-only property.
5917         (FlagsHandle): Rename from CheckStateHandle and convert to handle
5918         arbitrary flags.
5919         (WithUnsafe): New helper similar to WithCheckState.
5920         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
5921         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
5922
5923 2006-07-21  Raja R Harinath  <rharinath@novell.com>
5924
5925         Make comparisons use the same IL irrespective of whether they're
5926         in a 'checked' or 'unchecked' context: one of the issues in #78899
5927         * codegen.cs (EmitContext.CheckState): Make read-only property.
5928         (EmitContext.ConstantCheckState): Likewise.
5929         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
5930         helper that implement a save/restore stack for CheckState
5931         values.  This is the only way to change check-state.
5932         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
5933         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
5934         (CheckedExpr.EmitBranchable): New forwarding method.
5935         (UnCheckedExpr): Likewise.
5936         * statement.cs (Block.ResolveMeta): Use WithCheckState.
5937         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
5938         (Checked.Resolve, checked.DoEmit): Likewise.
5939
5940 2006-07-20  Miguel de Icaza  <miguel@novell.com>
5941
5942         * anonymous.cs: Cache the resolved anonymous delegate, and return
5943         this so that the ResolveTopBlock is only triggered once, not
5944         twice.
5945
5946         Currently we trigger ResolvetopBlock twice due to a first pass of
5947         argument check compatibility, and a second pass that does the
5948         actual resolution.   
5949         
5950 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
5951
5952         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
5953         modifiers.
5954         * rootcontext.cs (Reset): Add helper_classes.
5955
5956 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
5957
5958         A fix for #78860
5959         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
5960         correctly.
5961
5962 2006-07-13  Miguel de Icaza  <miguel@novell.com>
5963
5964         * statement.cs (Lock): Handle expressions of type
5965         TypeManager.null_type specially.  Fixes #78770
5966
5967 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
5968
5969         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
5970         to an event.
5971
5972 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
5973
5974         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
5975         for accessors as well.
5976         * ecore.cs (EventExpr): Add AccessorTable.
5977
5978 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
5979
5980         A fix for #78738
5981         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
5982         for CS0122 where appropriate.
5983         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
5984         level attributes.
5985         (Filter): Assembly can be null in the case of top level attributes.
5986
5987 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
5988
5989         A fix for #78690
5990
5991         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
5992         is done at global level.
5993
5994 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
5995
5996         A fix for #77002, Implemented TypeForwarder support.
5997
5998         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
5999         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
6000         * typemanager.cs (): Add type_forwarder_attr_type.
6001
6002 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
6003
6004         * report.cs: Add CS0469 warning.
6005
6006 2006-06-21  Martin Baulig  <martin@ximian.com>
6007
6008         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
6009         the `try'-block, so we also report CS0016 etc. there.
6010
6011 2006-06-21  Martin Baulig  <martin@ximian.com>
6012
6013         * delegate.cs
6014         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
6015
6016 2006-06-21  Martin Baulig  <martin@ximian.com>
6017
6018         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
6019         also report CS1686 for parameters.
6020
6021 2006-06-21  Martin Baulig  <martin@ximian.com>
6022
6023         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
6024         instead of an error if the value is not implicitly convertible to
6025         the switch types; fixes #77964.
6026
6027 2006-06-21  Raja R Harinath  <rharinath@novell.com>
6028
6029         Fix #78673
6030         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
6031         FieldBuilder is null.
6032
6033         Fix #78662
6034         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
6035         'left' and 'right' before error-checking.
6036
6037 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
6038
6039         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
6040         Fixed bug #78601.
6041         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
6042         (FieldExpr.DoResolve): likewise.
6043         (PropertyExpr.InstanceResolve): likewise.
6044         (EventExpr.InstanceResolve): likewise. 
6045
6046 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
6047
6048         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
6049         attribute applicable tests for attribute argument.
6050
6051 2006-06-02  Raja R Harinath  <rharinath@novell.com>
6052
6053         Fix #78079
6054         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
6055         (Binary.OverloadResolve_PredefinedIntegral): New.
6056         (Binary.OverloadResolve_PredefinedFloating): New.
6057         (Binary.OverloadResolve_PredefinedString): New.
6058         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
6059         Follow the standard more closely, and treat numeric promotions in
6060         terms of overload resolution.
6061         (Binary.CheckShiftArguments): Simplify.
6062
6063 2006-06-01  Raja R Harinath  <rharinath@novell.com>
6064
6065         * flowanalysis.cs (MyBitVector): Simplify representation.
6066         (MyBitVector.Clone): Avoid allocating BitArray.
6067         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
6068         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
6069         (*): Update.  Change all references to MyBitVector.And and
6070         MyBitVector.Or to &= and |=.
6071
6072 2006-05-29  Raja R Harinath  <rharinath@novell.com>
6073
6074         Fix cs0231-[34].cs.
6075         * cs-parser.jay (formal_parameter_list): Extend the pattern below
6076         to param arguments too.
6077
6078 2006-05-26  Miguel de Icaza  <miguel@novell.com>
6079
6080         * cs-parser.jay: Catch another parsing form for arglist being
6081         followed by other arguments.  Fixes #78313.
6082
6083 2006-05-24  Raja R Harinath  <rharinath@novell.com>
6084
6085         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
6086         checking of out parameters to ...
6087         (FlowBranchingToplevel.Merge): ... here.
6088         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
6089         set, propagate the origin upward, and only complain if there was
6090         no other error.
6091         (FlowBranchingException.AddContinueOrigin): Likewise.
6092         (FlowBranchingException.AddReturnOrigin): Likewise.
6093         (FlowBranchingException.AddGotoOrigin): Likewise.       
6094
6095 2006-05-23  Raja R Harinath  <rharinath@novell.com>
6096
6097         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
6098         unreachable, skip it.
6099         (FlowBranchingException.Merge): Always propagate jumps, even if
6100         the finally block renders subsequent code unreachable.
6101
6102 2006-05-18  Raja R Harinath  <rharinath@novell.com>
6103
6104         Fix #77601
6105         * statement.cs (Goto.Resolve): Move responsibility for resolving
6106         'goto' to FlowBranching.AddGotoOrigin.
6107         (Goto.SetResolvedTarget): New.  Callback to set the
6108         LabeledStatement that's the target of the goto.
6109         (Goto.DoEmit): Use Leave instead of Br when crossing an
6110         unwind-protect boundary.
6111         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
6112         LookupLabel and adjust to new semantics.
6113         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
6114         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
6115         Goto.SetResolvedTarget to update target.
6116         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
6117         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
6118         AddBreakOrigin & co.  Delay propagation until ...
6119         (FlowBranchingException.Merge): ... this.
6120
6121         * statement.cs (Block.Resolve): Always depend on flow-branching to
6122         determine unreachability.  Kill workaround that originally emitted
6123         only one statement after an "unreachable" label (see infloop in
6124         test-515.cs).
6125
6126         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
6127         This is still "wrong", but anything better would probably need a
6128         multi-pass algorithm.
6129         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
6130         usage vector.  Force current usage vector to be reachable, to
6131         optimistically signify backward jumps.
6132         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
6133         detected.
6134         (FlowBranchingLabeled.Merge): New.  If no backward jump was
6135         detected, return the original salted-away usage vector instead,
6136         updated with appropriate changes.  Print unreachable warning if
6137         necessary.
6138         * statement.cs (Block.Resolve): Don't print unreachable warning on
6139         a labeled statement.
6140
6141 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
6142
6143         * driver.cs: Pass filename without path to AssemblyBuilder's 
6144         AddResourceFile. Fixes bug #78407.
6145
6146 2006-05-17  Raja R Harinath  <rharinath@novell.com>
6147
6148         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
6149         * flowanalysis.cs (FlowBranchingLabeled): ... here.
6150         (FlowBranching.MergeChild): Overwrite
6151         reachability information from Labeled branchings too.
6152
6153 2006-05-16  Raja R Harinath  <rharinath@novell.com>
6154
6155         * statement.cs (Goto.Resolve): Merge jump origins here ...
6156         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
6157
6158         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
6159         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
6160         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
6161         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
6162         here, ...
6163         * statement.cs (Goto.Resolve): ... not here.
6164         (Goto.Emit): Remove CS1632 check.
6165
6166 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
6167
6168         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
6169         error message.
6170
6171 2006-05-11  Raja R Harinath  <rharinath@novell.com>
6172
6173         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
6174         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
6175         (FlowBranchingException.Label): Likewise.
6176
6177         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
6178         given value.
6179         (MyBitVector.Or): Use it to avoid losing information (Count).
6180         (FlowBranching.MergeOrigins): Likewise.
6181
6182         * flowanalysis.cs (UsageVector.IsDirty): Remove.
6183         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
6184         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
6185         (UsageVector.ToString): Simplify.
6186         (UsageVector.MergeSiblings): Move here from ...
6187         (FlowBranching.Merge): ... here.
6188         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
6189         not a MyBitVector.
6190
6191 2006-05-10  Raja R Harinath  <rharinath@novell.com>
6192
6193         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
6194         null bitvector is treated as all-true.
6195
6196         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
6197         (MyBitVector): Rationalize invariants.  'vector != null' implies
6198         that we have our own copy of the bitvector.  Otherwise,
6199         'InheritsFrom == null' implies all inherited bits are true.
6200
6201 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
6202
6203         * statement.cs (LocalInfo): Add IsConstant.
6204         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
6205         local variable for constants.
6206
6207 2006-05-09  Raja R Harinath  <rharinath@novell.com>
6208
6209         * flowanalysis.cs (MyBitVector.Empty): New.
6210         (MyBitVector): Don't allow InheritedFrom to be null.
6211         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
6212         (UsageVector, FlowBranching): Update to changes.
6213
6214         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
6215         recursion.  The 'Parent == null' condition isn't sufficient for
6216         anonymous methods.
6217         (FlowBranching.AddBreakOrigin): Likewise.
6218         (FlowBranching.AddContinueOrigin): Likewise.
6219         (FlowBranching.AddReturnOrigin): Likewise.
6220         (FlowBranching.StealFinallyClauses): Likewise.
6221         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
6222         (FlowBranching.CheckOutParameters): Likewise.
6223         (FlowBranchingToplevel): Terminate all the above recursions here.
6224         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
6225         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
6226
6227         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
6228         toplevel block.
6229         (FlowBranchingToplevel): New.  Empty for now.
6230         (FlowBranching.MergeTopBlock): Update.
6231         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
6232         branching for the anonymous delegate.
6233         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
6234
6235         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
6236         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
6237         information at the start of the merge.  Reorganize.
6238
6239 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6240
6241         * class.cs (MethodData.Define): Method cannot implement interface accessor.
6242
6243 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6244
6245         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
6246         to newly introduced ctor.
6247
6248         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
6249         message to one place.
6250         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
6251         global namespace.
6252
6253 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
6254
6255         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
6256
6257         * ecore.cs (Expression.ResolveAsConstant): Updated.
6258
6259         * statement.cs (ResolveMeta): Updated.
6260
6261 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6262
6263         * cs-parser.jay: __arglist cannot be used in initializer.
6264
6265 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
6266
6267         A fix for #77879
6268         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
6269         private types.
6270
6271 2006-05-05  Raja R Harinath  <rharinath@novell.com>
6272
6273         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
6274         (LabeledStatement): Add 'name' parameter.
6275         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
6276         (Block.AddLabel): Update to changes.
6277         * cs-parser.jay (labeled_statement): Likewise.
6278
6279         * flowanalysis.cs (BranchingType.Labeled): New.
6280         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
6281         (FlowBranchingLabeled): New.  Does nothing for now, but will
6282         eventually handle 'goto' flows.
6283         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
6284         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
6285         that's terminated ...
6286         (Block.Resolve): ... here.
6287
6288         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
6289         (UsageVector.MergeFinallyOrigins): Likewise.
6290         (FlowBranching.InTryOrCatch): Likewise.
6291         (FlowBranching.AddFinallyVector): Likewise.
6292         (FlowBranchingException): Update to changes.
6293
6294         Fix #78290
6295         * statement.cs (Return.Resolve): Move error checking to ...
6296         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
6297         (FlowBranchingException): Handle return origins like break and
6298         continue origins.
6299         (FlowBranching.UsageVector.CheckOutParameters): Remove.
6300
6301 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6302
6303         A fix for #76122
6304         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
6305         filter.
6306
6307 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
6308
6309         A fix for #77543
6310         * class.cs (MethodData.Define): Do public accessor check only when method
6311         implements an interface.
6312
6313 2006-05-04  Raja R Harinath  <rharinath@novell.com>
6314
6315         Remove special handling of 'break'
6316         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
6317         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
6318         (UsageVector.Break): Remove.
6319         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
6320         reachability.
6321         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
6322
6323         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
6324         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
6325
6326 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6327
6328         A fix for #75726
6329         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
6330         be the interface member.
6331
6332 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
6333
6334         A fix for #60069
6335         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
6336         for emitting small (int) values.
6337
6338 2006-05-03  Raja R Harinath  <rharinath@novell.com>
6339
6340         Fix #59427
6341         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
6342         control-flow passes through the 'finally' after merging-in all the
6343         control-flows from 'try' and the 'catch' clauses.
6344
6345         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
6346         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
6347         always true at the only non-recursive entry point.
6348         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
6349         FlowBranchingBreakable.
6350         (FlowBranchingLoop): Remove.
6351         * statement.cs (Return.DoResolve): Update to changes.
6352
6353         Fix #76471, #76665
6354         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
6355         (FlowBranching.CreateBranching): Handle it: create a
6356         FlowBranchingContinuable.
6357         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
6358         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
6359         except that it handles the 'continue' command.
6360         (FlowBranching.UsageVector.MergeOrigins): Rename from
6361         MergeBreakOrigins.
6362         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
6363         except that it overrides AddContinueOrigin.
6364         (FlowBranchingException): Override AddContinueOrigin, similar to
6365         AddBreakOrigin.
6366         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
6367         Create a new branching around the embedded statement.
6368         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
6369         control flow after the embedded statement.
6370         (Continue.Resolve): Move all error checking to AddContinueOrigin.
6371
6372         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
6373         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
6374         FlowBranchingBreakable.
6375         (FlowBranchingSwitch): Remove.
6376
6377         Fix test-503.cs
6378         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
6379         error reporting to ...
6380         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
6381         Rename from 'AddBreakVector'.  Add new location argument.  Return
6382         a bool indicating whether the 'break' crosses an unwind-protect.
6383         (FlowBranchingException.AddBreakOrigin): Add.
6384         (FlowBranchingException.Merge): Propagate 'break's to surrounding
6385         flowbranching after updating with the effects of the 'finally'
6386         clause.
6387         (FlowBranchingBreakable): New common base class for
6388         FlowBranchingLoop and FlowBranchingSwitch.
6389
6390         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
6391         embedded statement.
6392         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
6393
6394 2006-05-02  Raja R Harinath  <rharinath@novell.com>
6395
6396         * statement.cs (Do.Resolve): If the loop is infinite, set the
6397         barrier.
6398         (While.Resolve, For.Resolve): Set a barrier after the embedded
6399         statement.  There's no direct control flow that goes from the end
6400         of the embedded statement to the end of the loop.
6401         * flowanalysis.cs (FlowBranching.Infinite): Remove.
6402         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
6403         above ensure that the reachability is correctly computed.
6404
6405         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
6406         (UsageVector.MergeBreakOrigins): If the current path is
6407         unreachable, treat it as if all parameters/locals are initialized.
6408         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
6409         infinite loops before merging-in break origins.
6410
6411         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
6412         (Reachability.Reachable): Split part into ...
6413         (Reachability.Unreachable): ... this.  Simplify.
6414         (Reachability.IsUnreachable): Use 'Unreachable' instead.
6415
6416         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
6417         (Reachability.SetThrowsSometimes): Likewise.
6418         (FlowBranchingBlock.MergeTopBlock): Don't compare against
6419         TriState.Always, use corresponding property.
6420         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
6421         (Block.Resolve): Likewise.  Remove some redundant checks.
6422
6423 2006-05-02  Raja R Harinath  <harinath@gmail.com>
6424
6425         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
6426         (Reachability.Meet): Don't bother checking AlwaysThrows --
6427         barrier is always set.
6428         (FlowBranchingBlock.Merge): Likewise.
6429
6430 2006-05-01  Raja R Harinath  <harinath@gmail.com>
6431
6432         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
6433         checks for unreachable.
6434
6435 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
6436
6437         A fix for #77980
6438         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
6439
6440         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
6441         whether field is really assigned.
6442
6443 2006-04-30  Raja R Harinath  <harinath@gmail.com>
6444
6445         * flowanalysis.cs (Reachability): Make 4-argument constructor
6446         private.
6447         (Reachability.Meet): Rename from 'And'.  Remove static variant.
6448         (Reachability.Always): Rename from the highly misleading
6449         'Reachability.Never'.
6450         (FlowBranching.Merge): Update to changes.  Mark an impossible
6451         situation with a 'throw'.
6452         (*): Update to changes.
6453
6454 2006-04-29  Raja R Harinath  <harinath@gmail.com>
6455
6456         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
6457         Remove 'Undefined'.
6458         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
6459         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
6460         (*): Update to changes.
6461         * statement.cs: Update to changes.
6462
6463 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
6464
6465         A fix for #78049
6466         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
6467
6468 2006-04-28  Raja R Harinath  <harinath@gmail.com>
6469
6470         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
6471         dummy UsageVector.
6472
6473         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
6474         argument to two arguments: an usage-vector and a bool.  Move call
6475         to FlowBranching.Merge () ...
6476         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
6477
6478         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
6479         handling of loop and switch reachability to ...
6480         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
6481
6482 2006-04-27  Raja R Harinath  <harinath@gmail.com>
6483
6484         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
6485         handling to FlowBranchingLoop.InLoop.
6486         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
6487
6488 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
6489
6490         A fix for #78115
6491         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
6492         anonymous method is allowed from AnonymousContainer here.
6493
6494         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
6495
6496 2006-04-24  Raja R Harinath  <rharinath@novell.com>
6497
6498         Fix #78156
6499         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
6500
6501 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
6502
6503         A fix for #49011.
6504         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
6505         (DoubleConstant.Reduce): Ditto.
6506
6507 2006-04-23  Raja R Harinath  <rharinath@novell.com>
6508
6509         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
6510         Remove 'lvalue_right_side' argument.  Move parts to ...
6511         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
6512         (LocalVariable.DoResolveLValue): ... these.
6513
6514 2006-04-21  Raja R Harinath  <rharinath@novell.com>
6515
6516         Fix cs1655.cs
6517         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
6518         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
6519         (LocalVariableReference.DoResolveBase): Use it to implement new
6520         CS1655 check.
6521         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
6522         (Argument.Resolve): Simplify.  Move CS1510 check ...
6523         * ecore.cs (Expression.ResolveLValue): ... here.
6524         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
6525         (PropertyExpr.DoResolveLValue): Likewise.
6526         (FieldExpr.Report_AssignToReadonly): Likewise.
6527         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
6528         LValueMemberAccess or LValueMemberOutAccess on instance depending
6529         on it.
6530         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
6531         DoResolve as appropriate.
6532
6533 2006-04-20  Raja R Harinath  <rharinath@novell.com>
6534
6535         Fix #75800
6536         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
6537         implicit conversions on 'out' and 'ref' arguments.
6538
6539         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
6540         improve clarity.  Remove dead code.
6541
6542         Fix #66031
6543         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
6544         (Catch.Resolve): Resolve VarBlock if it exists.
6545
6546 2006-04-19  Miguel de Icaza  <miguel@novell.com>
6547
6548         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
6549         twice, this was some residual code, the enumerator was emitted
6550         properly in the two branche of if later.
6551
6552 2006-04-19  Raja R Harinath  <rharinath@novell.com>
6553
6554         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
6555         cast is never an lvalue.
6556         (Cast.DoResolve, Cast.ResolveRest): Combine.
6557         (Argument.Emit): Simplify slightly.  Move 'Expr is
6558         IMemoryLocation' check ...
6559         (Argument.Resolve): ... here.
6560         (Argument.Error_LValueRequired): Remove.  Inline into only user.
6561
6562         Simplifications.  Fix cs0191-2.cs
6563         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
6564         CS1649 and CS1651 to ...
6565         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
6566         the actual selection of the error code and message to a lookup
6567         table.  Add a dummy return value to simplify callsites.
6568         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
6569         readonly fields of other instances of the same type.  Move CS0197
6570         warning from ...
6571         * expression.cs (Argument.Resolve): ... here.  Simplify code.
6572         Ensure that ec.InRefOutArgumentResolving is only set during LValue
6573         resolution of an out or ref argument.  The code simplification
6574         above uses this invariant.
6575
6576 2006-04-18  Raja R Harinath  <rharinath@novell.com>
6577
6578         Possibly fix #77752.  Fix cs1690-[4-7].cs.
6579         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
6580         CheckMarshallByRefAccess.  Drop parameter.
6581         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
6582         warning.
6583         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
6584         InstanceExpression.
6585         * report.cs (AllWarnings): Add CS1690.
6586         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
6587         for ref access too.
6588         (LocalVariableReference.DoResolveBase): Update.
6589
6590 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6591
6592         * class.cs (MethodOrOperator): Moved common parts from method class.
6593         detect obsolete attributes.
6594         (Method.Define): Simplified as it reuses code from base.
6595         (Constructor.ValidAttributeTargets): Fixed issue found during
6596         refactoring.
6597         (Destructor.ValidAttributeTargets): Fixed issue found during
6598         refactoring.
6599         (Operator): Finished refactoring set off by #78020. Operator class is now
6600         ordinary method class.
6601
6602         * anonymous.cs: Updated.
6603
6604         * decl.cs (DeclSpace): Add IsGeneric
6605
6606 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6607
6608         * class.cs (Constructor.Emit): Don't emit the attributes twice.
6609
6610 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6611
6612         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
6613         detect obsolete attributes.
6614         (Method.CreateEmitContext): Moved to MethodOrOperator.
6615
6616 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
6617
6618         A fix for #78048.
6619         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
6620         customized exception to make crash detection easier.
6621         (MethodOrOperator): Started to work on new base class for methods and
6622         operators.
6623         (Method): Derives from MethodOrOperator.
6624         (Constructor.Emit): Emits its own attributes.
6625         (AbstractPropertyEventMethod.Emit): Ditto.
6626         (Operator): Derives from MethodOrOperator, will refactor fully in extra
6627         patch.
6628         (Operator.Emit): It's temporary more tricky than should be.
6629         
6630         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
6631
6632         * report.cs (InternalErrorException): Add ctor with inner exception.
6633
6634 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
6635
6636         A fix for #76744.
6637         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
6638         only not visible.
6639
6640 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
6641
6642         A fix for #77916.
6643         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
6644         array.
6645
6646 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6647
6648         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
6649         attribute is present and Guid not.
6650         (Interface.ApplyAttributeBuilder): Ditto.
6651
6652         * attribute.cs: Add error message.
6653
6654 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
6655
6656         A fix for #78020.
6657
6658         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
6659         sources (it's composite) so hold them in extra array as they are used in
6660         Emit phase only. It worked in the previous versions by mistake.
6661         (Attribute.Emit): Emit attribute for more owners when exist.
6662
6663         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
6664         it has now different behaviour.
6665
6666 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
6667
6668         * constant.cs (Constant.IsDefaultInitializer): New method.
6669
6670         * class.cs: Updated.
6671
6672         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
6673         re-initialize default values. It saves KBs almost for every assembly.
6674         Thanks Zoltan for the idea.
6675         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
6676         (ArrayCreation.DoResolve): Resolve only once.
6677         (ArrayCreation.Emit): Emit static initializer only when it is faster.
6678         (ArrayCreation.GetAttributableValue): Cope with optimized values.
6679
6680 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
6681
6682         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
6683         From #77961.
6684
6685 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6686
6687         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
6688         in an embedded statement too.
6689
6690 2006-04-01  Raja R Harinath  <rharinath@novell.com>
6691
6692         Fix #77958
6693         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
6694
6695 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
6696
6697         A fix for #77966.
6698
6699         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
6700         was not specified.
6701
6702         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
6703
6704 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
6705
6706         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
6707         phase.
6708
6709         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
6710         LocalTemporary change.
6711
6712         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
6713         TypeContainer.
6714         (ClassOrStruct.DefineFieldInitializers): Implemented static field
6715         initializers optimization.
6716         (ClassOrStruct.TypeAttr): Moved from modifiers.
6717         (Constructor.CheckBase): Don't crash when static ctor has parameters.
6718         (FieldBase.ResolveInitializer): Resolves initializer.
6719         (FieldBase.HasDefaultInitializer): New property.
6720
6721         * cs-parser.jay: Removed message.
6722
6723         * expression.cs (CompilerGeneratedThis): New specialization.
6724
6725         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
6726
6727 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
6728
6729         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
6730
6731 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6732
6733         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
6734         be now EnumConstants only.
6735
6736 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
6737
6738         * attribute.cs, driver.cs: Reset more caches.
6739
6740 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6741
6742         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
6743
6744 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6745
6746         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
6747         for easier reuse. Updated all overrides.
6748         (IntegralConstant): New base class for all integral constants.
6749         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
6750         of the constant range, report custom error.
6751         (UIntConstant.Reduce): Fixed uint conversion.
6752
6753         * ecore.cs, literal.cs: Reduce updates.
6754
6755 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6756
6757         A fix for #75813.
6758
6759         * class.cs (Constructor.Define): Removed extra if for default ctors.
6760         A patch from Atsushi Enomoto.
6761
6762 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
6763
6764         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
6765         GetAttributableValue.
6766
6767         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
6768         when required.
6769
6770         * convert.cs (ImplicitConversionRequired): Error message moved to
6771         DoubleLiteral.
6772
6773         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
6774         automatic implicit conversion of an output value.
6775         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
6776
6777         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
6778         conversion.
6779         (TypeOf.GetAttributableValue): Add extra handling for object type.
6780
6781         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
6782         special error message.
6783
6784 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
6785
6786         * class.cs (Constructor.Emit): Don't crash when struct ctor is
6787         InternalCall.
6788         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
6789         compatible with MS runtime.
6790
6791 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
6792
6793         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
6794         attribute arguments here.
6795
6796         * class.cs (Indexer.Define): The check was moved to attribute class.
6797
6798 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
6799
6800         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
6801         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
6802         easier.
6803
6804 2006-03-22  Raja R Harinath  <rharinath@novell.com>
6805
6806         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
6807         mcs to keep code differences small.
6808         * attribute.cs (Attribute.GetParameterDefaultValue): New.
6809         * typemanager.cs (parameter_default_value_attribute_type): New.
6810         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
6811         CS1908 check.
6812
6813 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
6814
6815         * expression.cs (StringConcat.Append): Reverted back to no warning state.
6816
6817 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
6818
6819         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
6820
6821         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
6822         the blocks too.
6823
6824 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
6825
6826         * doc-bootstrap.cs : fix build.
6827
6828 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
6829
6830         * expression.cs (StringConcat.Append): Issue a warning when empty string
6831         is going to append.
6832
6833 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
6834
6835         * assign.cs (CompoundAssign.ResolveSource): Removed.
6836
6837         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
6838         clean up.
6839
6840         * class.cs (TypeContainer.FindMethods): Removed.
6841         (TypeContainer.CheckMemberUsage): Made static.
6842
6843         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
6844
6845         * constant.cs (CheckRange): Removed unused type argument.
6846         (CheckUnsigned): Removed unused type argument.
6847
6848         * cs-parser.jay: Updated after MemberAccess clean up.
6849         Uses Length for empty string test.
6850
6851         * cs-tokenizer.cs: Uses Length for empty string test.
6852         (IsCastToken): Made static.
6853         (is_hex): Made static.
6854         (real_type_suffix): Made static.
6855
6856         * decl.cs (SetupCache): Made static.
6857         (OnGenerateDocComment): Removed unused ds argument.
6858
6859         * delegate.cs (VerifyDelegate): Removed unused argument.
6860
6861         * doc.cs: Uses Length for empty string test.
6862
6863         * driver.cs: Uses Length for empty string test.
6864
6865         * enum.cs (IsValidEnumType): Made static
6866
6867         * expression.cs (EnumLiftUp): Removed unused argument.
6868         (ResolveMethodGroup): Ditto.
6869         (BetterConversion): Ditto.
6870         (GetVarargsTypes): Ditto.
6871         (UpdateIndices): Ditto.
6872         (ValidateInitializers): Ditto.
6873         (MemberAccess.ctor): Ditto.
6874         (GetIndexersForType): Ditto.
6875
6876         * flowanalysis.cs: (MergeFinally): Removed unused argument.
6877
6878         * iterators.cs: Updated after MemberAccess clean up.
6879
6880         * location.cs: Uses Length for empty string test.
6881
6882         * namespace.cs: Uses Length for empty string test.
6883
6884          * report.cs (CheckWarningCode): Made static.
6885
6886         * statement.cs (LabeledStatement): Removed unused argument.
6887
6888         * typemanager.cs (FilterNone): Removed.
6889
6890 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
6891
6892         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
6893         obsolete.
6894
6895         * class.cs: Updated.
6896
6897 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
6898
6899         * cs-parser.jay.cs: __arglist is not allowed for delegates.
6900
6901 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
6902
6903         A fix for #77822.
6904
6905         * expression.cs (VerifyArgumentsCompat): Reverted to double error
6906         reporting, it's more tricky than I thought.
6907
6908 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
6909
6910         A fix for #77816.
6911
6912         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
6913         host container.
6914         (AnonymousMethod.ImplicitStandardConversionExists): New method.
6915         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
6916         Add more error reporting; Fixed issue with params.
6917
6918         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
6919
6920         * cs-parser.jay: AnonymousMethod requires host container.
6921
6922         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
6923
6924 2006-03-18  Raja R Harinath  <harinath@gmail.com>
6925
6926         * class.cs: Change 'TypeContainer ds' constructor argument to
6927         'DeclSpace parent'.  Some classes were missed below due to
6928         different naming convention.
6929
6930         * class.cs (MemberCore.Parent): Delete.  This makes the
6931         ParentContainer changes below enforceable by the compiler.
6932
6933         Treat pointers to enclosing declaration space as 'DeclSpace', not
6934         'TypeContainer'.
6935         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
6936         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
6937
6938         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
6939         of TypeContainer.
6940         (Block.AddThisVariable): Likewise.
6941         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
6942         (AbstractPropertyEventMethod.Emit): Likewise.
6943         (AbstractPropertyEventMethod.EmitMethod): Likewise.
6944         (GetMethod.Define, SetMethod.Define): Likewise.
6945         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
6946         (DelegateMethod.EmitMethod): Likewise.
6947
6948         Fix regression test-partial-13.cs.
6949         Rationalize use of PartialContainer.  Ensure that the partial
6950         class semantics can be tied to type-correctness, i.e., any
6951         violation will cause a compile error.
6952         * class.cs, const.cs: Access all fields that belong to class
6953         TypeContainer via ParentContainer.  Arguments of EmitContexts and
6954         Resolve()-like functions still use 'Parent'.
6955
6956         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
6957         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
6958         (PropertyMethod.CheckModifiers): Remove unused argument.
6959         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
6960         DeclSpace.
6961
6962 2006-03-17  Raja R Harinath  <harinath@gmail.com>
6963
6964         Make semantics of PartialContainer simpler.
6965         * decl.cs (DeclSpace.IsPartial): Remove.
6966         * class.cs (TypeContainer.IsPartial): Likewise.
6967         (TypeContainer..ctor): Set PartialContainer to point to self.
6968         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
6969         (TypeContainer.FindNestedType): Likewise.
6970         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
6971
6972 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
6973
6974         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
6975
6976 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
6977
6978         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
6979         classes.
6980
6981 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
6982
6983         * class.cs (Operator.Define): An error for base conversion was not
6984         reported correctly.
6985
6986 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
6987
6988         * iterator.cs : yield break is allowed in try statement which has
6989           catch clauses. Fixed bug #77767.
6990
6991 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
6992
6993         A fix for #77593, #77574.
6994
6995         * class.cs (MethodCore.CheckBase): Another if for operator.
6996
6997 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
6998
6999         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
7000         were not resolved
7001
7002         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
7003         (DelegateCreation.ImplicitStandardConversionExists): New method for just
7004         conversion test.
7005         
7006         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
7007         not needed.
7008
7009         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
7010         Updated after another emitcontext usage was clean up. It should help us to
7011         synchronize with gmcs easier.
7012
7013 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
7014
7015         A fix for #77353.
7016
7017         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
7018         (Event.Define): ditto
7019         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
7020
7021         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
7022         Removed redundant code and set NewSlot for Invoke method too.
7023
7024         * parameter.cs (Parameters.ctor): Add custom, type ctor.
7025         (Parameters.MergeGenerated): New method. Use this method when you merge
7026         compiler generated argument with user arguments.
7027
7028 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
7029
7030         * attribute.cs (ResolveAsTypeTerminal): Removed.
7031
7032         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
7033         specialization for predefined types; 30% speed up.
7034         Finally placed obsolete check to right place.
7035         (Expression.ResolveType): Removed.
7036
7037         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
7038         Updated after ResolveType was removed.
7039
7040         * expression.cs (Cast.ctor): Check void cast.
7041         (Binary.ResolveAsTypeTerminal): Is never type.
7042         (Conditional.ResolveAsTypeTerminal): Is never type.
7043
7044         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
7045
7046 2006-03-01  Raja R Harinath  <rharinath@novell.com>
7047
7048         Fix #77679.
7049         * expression.cs (ParameterReference.DoResolveBase): Change return
7050         type to bool.
7051         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
7052         Update.
7053
7054         Fix #77628.
7055         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
7056
7057         Fix #77642.
7058         * typemanager.cs (GetFullNameSignature): Don't nullref on
7059         protected accessors.
7060
7061 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
7062
7063         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
7064         these two separated members to simplify the code.
7065         (Attribute.Resolve): Refactored to use new fields and methods.
7066         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
7067         implemented obsolete attribute checking.
7068         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
7069         implemented obsolete checking again. It look line never ending quest ;-)
7070         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
7071
7072         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
7073
7074         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
7075
7076         *class.cs (Property.Define): Add RegisterProperty call.
7077
7078         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
7079         argument groups (only 2).
7080
7081         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
7082         encoding expression to arguments.
7083         (Expression.ExprClassToResolveFlags): Just turned to property.
7084
7085         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
7086         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
7087         optimized as well as implemented support for zero-length attributes.
7088
7089         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
7090         Add caching of PropertyInfo's.
7091
7092 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7093
7094         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
7095         error multiple times.
7096
7097 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
7098
7099         New partial class implementation.
7100         A fix for #77027, #77029, #77403
7101
7102         * attribute.cs (Attributable): Made attributes protected.
7103
7104         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
7105         the replacements of ClassPart and PartialContainer.
7106         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
7107         (TypeContainer.AddInterface): Ditto.
7108         (TypeContainer.AddPartial): The main method for partial classes. It checks
7109         for errors and merges ModFlags and attributes. At the end class is added to
7110         partial_parts list.
7111         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
7112         required here.
7113         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
7114         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
7115         from the rest of partial classes.
7116         (TypeContainer.GetClassBases): Simplified.
7117         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
7118         DefineType.
7119         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
7120         (TypeContainer.HasExplicitLayout): Uses Flags now.
7121         (PartialContainer): Removed.
7122         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
7123         (StaticClass): Was merged with Class.
7124         (Class.GetClassBases): class and static class bases are verified here.
7125         (Class.TypeAttr): Added static attributes when class is static.
7126         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
7127         (MemberBase): In some cases we need to call parent container for partial
7128         class. It should be eliminated but it's not easy now.
7129
7130         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
7131
7132         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
7133         partial classed to accumulate class comments.
7134         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
7135
7136         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
7137
7138         * driver.cs (MainDriver): Tree.GetDecl was removed.
7139
7140         * modifiers.cs (Modifiers): Add partial modifier.
7141
7142         * tree.cs (Tree.decl): Removed.
7143         (RootTypes): Started to use this class more often for root types
7144         specializations.
7145
7146 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7147
7148         A fix for #77615
7149
7150         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
7151         external interface does not have an attribute.
7152
7153 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
7154
7155         Another prerequisites for new partial classs implementation.
7156         
7157         * attribute.cs (Attribute.Equal): Implemented.
7158         (Attribute.Emit): Changed as attributes can be applied more than twice.
7159         (Attributes.Emit): Check for duplicate attributes here.
7160
7161         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
7162         as a parameter, clean-up.
7163
7164 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7165
7166         A fix for #77485
7167
7168         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
7169         contains obsolete attribute check which can in some cases look for base
7170         type of current class which is not initialized yet.
7171         (TypeContainer.BaseType): Replacement of ptype.
7172
7173         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
7174
7175 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
7176
7177         First of prerequisites for new partial classs implemention.
7178         
7179         * attribute.cs (Attributable): Extended by ResolveContext;
7180         Attributes finally have correct context for resolving in all cases.
7181         (AttachTo): Attribute owner is assigned here.
7182
7183         * codegen.cs (IResolveContext): Introduce new interface to hold
7184         all information needed in resolving phase.
7185         (EmitContext): Implements IResolveContext; more clean-up needed here.
7186         
7187         * decl.cs (MemberCore): Implemented IResolveContext.
7188
7189         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
7190         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
7191         parameter.cs, statement.cs, tree.cs, typemanager.cs:
7192         Refactored to use new IResolveContext instead of EmitContext; cleanup
7193
7194 2006-02-06  Miguel de Icaza  <miguel@novell.com>
7195
7196         * codegen.cs (EmitScopeInitFromBlock): check here the
7197         capture_context, there is no need to make two calls to the
7198         EmitContext. 
7199
7200         * anonymous.cs: Add some debugging messages that might help me
7201         track other instances of this problem in the future (the
7202         regression of test 467).
7203
7204         * cs-parser.jay: track the variable block, as we need to initalize
7205         any captured variables declared in this block for the "catch"
7206         portion of the "Try" statement.
7207
7208         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
7209         scope initialization for captured variables. 
7210
7211         Also, move the emit for the variables after the block location has
7212         been marked.
7213
7214 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
7215
7216         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
7217
7218 2006-02-02  Miguel de Icaza  <miguel@novell.com>
7219
7220         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
7221         commit yesterday, the initialization for the roots is necessary.
7222         What is not necessary is the scope activation.
7223
7224 2006-02-02  Raja R Harinath  <rharinath@novell.com>
7225
7226         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
7227         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
7228         CS0206 checks.
7229         (Argument.Resolve): Remove CS0206 checks.
7230
7231 2006-02-01  Miguel de Icaza  <miguel@novell.com>
7232
7233         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
7234         scopes for all the roots, the scopes will now be emitted when the
7235         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
7236
7237         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
7238         code.  This reduces a lot of existing cruft.
7239         
7240         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
7241         that the ScopeInfo is generated as we enter the scope, not at the
7242         time of use, which is what we used to do before.
7243
7244         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
7245         every time a Block is about to be emitted if we have a
7246         CaptureContext. 
7247
7248 2006-02-01  Raja R Harinath  <rharinath@novell.com>
7249
7250         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
7251         (Reset): Update.
7252         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
7253
7254         * typemanager.cs (cons_param_array_attribute): Make private.
7255         (Reset): Set it to null.
7256         (InitCoreHelpers): Don't initialize it.
7257         (ConsParamArrayAttribute): New.  Initialize it as needed.
7258         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
7259
7260 2006-01-31  Miguel de Icaza  <miguel@novell.com>
7261
7262         * expression.cs: There might be errors reported during the
7263         selection of applicable methods.  If there are errors, do not
7264         continue execution as it will lead the compiler to crash.
7265
7266 2006-01-30  Miguel de Icaza  <miguel@novell.com>
7267
7268         * expression.cs: Member access is not allowed on anonymous
7269         methods.  Fixes #77402.
7270
7271 2006-01-30  Raja R Harinath  <rharinath@novell.com>
7272
7273         Fix #77401
7274         * cs-parser.jay (VariableDeclaration): Don't set
7275         current_array_type to null.
7276         (field_declaration, event_declaration, declaration_statement):
7277         Set it to null here.
7278
7279 2006-01-28  Raja R Harinath  <harinath@gmail.com>
7280
7281         * typemanager.cs (GenericParameterPosition): New.
7282         * doc.cs: Use it.
7283
7284 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
7285
7286         * doc.cs : To process "include" elements, first we should create
7287           another list than XmlNodeList, because it could result in node
7288           removal, which could result in that the XmlNodeList gives up
7289           yielding next node.
7290
7291           (Also made code identical to gmcs again.)
7292
7293 2006-01-25  Miguel de Icaza  <miguel@novell.com>
7294
7295         * ecore.cs: Introduce an error report that we were not catching
7296         before, if not silent, we must report the error.  Gonzalo ran into
7297         it.
7298
7299 2006-01-23  Miguel de Icaza  <miguel@novell.com>
7300
7301         A fix for bug: #76957
7302         
7303         * iterators.cs (MoveNextMethod.CreateMethodHost): call
7304         ComputeMethodHost before creating the method, this is a new
7305         requirement. 
7306
7307         * anonymous.cs (AnonymousContainer): Now we track all the scopes
7308         that this method references (RegisterScope).  The actual scope
7309         where the method is hosted is computed with the ComputeMethodHost
7310         before we create the method.
7311
7312         Moved the Deepest routine here.
7313
7314         (AnonymousContainer.ComputeMethodHost): New routine used to
7315         compute the proper ScopeInfo that will host the anonymous method.
7316
7317         (ScopeInfo): Deal with multiple roots.  The problem was that we
7318         did not have a unique root where all ScopeInfos could be hanged
7319         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
7320         of roots.  
7321
7322         Remove AdjustMethodScope which is now computed at the end.  Remove
7323         LinkScope which did a partial link, instead link all ScopeInfos
7324         before code generation from the new "LinkScopes" routine. 
7325
7326         Simplify all the Add* routines as they no longer need to maintain
7327         the tree, they just need to record that they are using variables
7328         from a ScopeInfo.
7329
7330         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
7331         routines to produce the forest of ScopeInfo trees.
7332
7333         * class.cs (TypeContainer.AppendMethod): This is just like
7334         AddMethod, but ensures that an interface implementation method
7335         (IEnumerable.XXX) is not inserted at the beginning of the queue of
7336         methods, but at the end.
7337
7338         We use this functionality to ensure that the generated MoveNext
7339         method in the iterator class is resolved/emitted before the
7340         enumerator methods created.   
7341
7342         This is required because the MoveNext method computes the right
7343         ScopeInfo for the method.  And the other methods will eventually
7344         need to resolve and fetch information computed from the anonymous
7345         method. 
7346
7347 2006-01-21  Raja R Harinath  <harinath@gmail.com>
7348             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
7349
7350         Fix rest of #76995.
7351         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
7352         the 'aliases' hash.
7353         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
7354         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
7355
7356 2006-01-18  Raja R Harinath  <rharinath@novell.com>
7357
7358         Fix #76656, cs0231-2.cs.
7359         * cs-parser.jay (formal_parameter_list): Make error case catch
7360         more issues.
7361         (parenthesized_expression_0): Add CS1026 check.
7362         (invocation_expression): Remove unused { $$ = lexer.Location }.
7363
7364 2006-01-17  Raja R Harinath  <rharinath@novell.com>
7365
7366         Fix #76824.
7367         * cs-parser.jay (statement_expression): Don't list out the
7368         individual statement-expressions.  Convert syntax error into
7369         CS0201 check.
7370
7371 2006-01-16  Raja R Harinath  <rharinath@novell.com>
7372
7373         Fix #76874.
7374         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
7375         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
7376         CheckIntermediateModification.
7377         (FieldExpr.DoResolve): Add new two-argument version that
7378         allows us to resolve the InstanceExpression as an lvalue.
7379         The one-argument variant is now just a wrapper.
7380         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
7381         Resolve the lhs as an lvalue if the it has a value type.
7382         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
7383         from Assign.DoResolve.
7384         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
7385         resolved as an lvalue.
7386         (PropertyExpr.DoResolve): Update.
7387         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
7388         has a value type.  Move CS1612 check here from
7389         CheckIntermediateModification.
7390         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
7391         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
7392         'right_side' of a ResolveLValue on an 'out' argument.
7393         (EmptyExpression.LValueMemberAccess): New.  Used as the
7394         'right_side' of a propagated ResolveLValue on a value type.
7395         (LocalVariableReference.DoResolveBase): Recognize
7396         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
7397         Add CS1654 check.
7398         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
7399         EmptyExpression.Null.
7400
7401 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
7402
7403         * typemanager.cs : added IsGenericParameter(). In mcs it always
7404           return false.
7405         * doc.cs : for generic parameters, use GenericParameterPosition,
7406           not FullName.
7407
7408 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
7409
7410         * expression.cs: Fix Console.WriteLine ((this = x).foo);
7411
7412 2006-01-12  Miguel de Icaza  <miguel@novell.com>
7413
7414         This fixes the problem where we used ldfld instead of ldflda to
7415         load the "THIS" pointer on captured parameters, when THIS is a
7416         value type.  See bug #77205.
7417         
7418         * iterators.cs (CapturedThisReference.Emit): Pass false to
7419         EmitThis (we do not need the address).
7420
7421         * codegen.cs (EmitThis): it needs to know whether we need the
7422         address of `this' or not.  This is used by value types.  
7423
7424         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
7425         every other call passes false.
7426
7427 2006-01-12  Raja R Harinath  <rharinath@novell.com>
7428
7429         Fix #77221.
7430         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
7431         GetOverride.
7432         * expression.cs (Invocation.OverloadResolve): Update.
7433         (Invocation.DoResolve): Avoid double resolution of invocation.
7434
7435 2006-01-11  Raja R Harinath  <rharinath@novell.com>
7436
7437         Fix #77180.
7438         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
7439         unary negation of floating point types as 0-expr; negation cannot
7440         overflow in floating point types.
7441
7442         Fix #77204.
7443         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
7444         on operands of 'void' type.
7445
7446         Fix #77200.
7447         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
7448         and ExclusiveOr for boolean constants too.
7449
7450 2006-01-09  Raja R Harinath  <rharinath@novell.com>
7451
7452         Fix #75636.
7453         * expression.cs (Invocation.OverloadResolve): Replace reflected
7454         override methods with their base virtual methods, rather than
7455         skipping over them.
7456         * typemanager.cs (TypeManager.GetOverride): New.
7457
7458 2006-01-05  Jb Evain  <jbevain@gmail.com>
7459
7460         * class.cs (Property.Define, Indexer.Define): do not tag the
7461         properties as SpecialName | RTSpecialName.
7462
7463 2006-01-04  Miguel de Icaza  <miguel@novell.com>
7464
7465         * class.cs (MethodCore.IsDuplicateImplementation): This method was
7466         doing a low-level comparission of parameter types.  It was lacking
7467         a check for __argslist. 
7468
7469 2005-12-30  Miguel de Icaza  <miguel@novell.com>
7470
7471         * expression.cs (ParameterReference.DoResolveBase): Allow
7472         reference parameters if they are local to this block. 
7473
7474         This allows the ref and out parameters of a delegate to be used in
7475         an anonymous method, for example:
7476
7477         delegate void set (out int x);
7478
7479         set s = delegate (out int x){
7480                 x = 0;
7481         };
7482
7483         This is used by functionality introduced late in the C# language.
7484         
7485         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
7486         method that take ref and out parameters. 
7487
7488         Fixes #77119 which was a late change in the spec.
7489
7490 2005-12-23  Miguel de Icaza  <miguel@novell.com>
7491
7492         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
7493         parent if its the same scope.  Fixes #77060.
7494
7495 2005-12-21  Miguel de Icaza  <miguel@novell.com>
7496
7497         * driver.cs: Report the case of no source files and no -out:
7498         argument provided.
7499
7500 2005-12-20  Raja R Harinath  <rharinath@novell.com>
7501
7502         Fix #77035.
7503         * expression.cs (ComposedCast.GetSignatureForError): Define.
7504
7505 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
7506
7507         Fix #76995
7508
7509         * namespace.cs (NamespaceEntry): Add extern_aliases as a
7510         ListDictionary, to contain the ExternAliasEntry entries (in
7511         addition to the NamespaceEntry.aliases hashtable). This field is
7512         shared between the original entry and its doppelganger (bodyless 
7513         copy of it).
7514         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
7515         extern_aliases field.
7516         (NamespaceEntry.Lookup): Move the IsImplicit check after the
7517         lookup in extern_aliases.
7518
7519 2005-12-16  Raja R Harinath  <rharinath@novell.com>
7520
7521         Fix #77006.
7522         * class.cs (TypeContainer.Mark_HasEquals): New.
7523         (TypeContainer.Mark_HasGetHashCode): New.
7524         (ClassPart): Override them.
7525         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
7526
7527         Fix #77008.
7528         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
7529         'parent' argument to the base constructor.
7530
7531         Remove all mention of TypeContainer from decl.cs.
7532         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
7533         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
7534         (DeclSpace.DeclSpace): Likewise.
7535         (DeclSpace.DefineMembers): Remove unused argument.
7536         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
7537         debugging check -- we don't care if the debug code throws an
7538         InvalidCastException instead of an InternalErrorException.
7539         * class.cs (TypeContainer.DefineMembers): Update to changes.
7540         (TypeContainer.DoDefineMembers): Likewise.
7541         (TypeContainer.GetMethods): Likewise.
7542         (PropertyMember.Define): Likewise.
7543         (MemberBase.Parent): New property that forwards to
7544         MemberCore.Parent, but ensures that we get a TypeContainer.
7545         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
7546         (RootContext.PopulateTypes): Likewise.  Remove special case code
7547         for !RootContext.StdLib: DefineMembers is idempotent.
7548
7549 2005-12-14  Miguel de Icaza  <miguel@novell.com>
7550
7551         * convert.cs (ExplicitConversionCore): Check the return value from
7552         ExplicitConversionCore which can return null on failure.  Fixes #76914
7553
7554 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
7555
7556         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
7557
7558 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
7559
7560         * doc.cs : The search for referenced namespace was insufficient to
7561           get global one as it used to do. Fixed bug #76965.
7562
7563 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
7564
7565         * doc.cs : check name in cref in the last phase that whether it is
7566           namespace or not.
7567
7568 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7569
7570         * cs-tokenizer.cs : reverted the latest change: it somehow broke
7571           Mono.C5.
7572
7573 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7574
7575         * doc.cs : so it turned out that we cannot skip override check for 
7576           interface members. Fixed bug #76954.
7577
7578 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
7579
7580         * cs-tokenizer.cs : fixed bug #75984:
7581           - #warning and #error should not be handled when the source line
7582             is disabled.
7583           - #line is not checked strictly when the source line is disabled.
7584           - #define and #undef is on the other hand checked strictly at any
7585             state.
7586
7587 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
7588
7589         * cs-tokenizer.cs : missing Location (actually, filename) in one of
7590           CS1027 report.
7591
7592 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7593
7594         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
7595
7596         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
7597         event initializers.
7598         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
7599         (FieldBase.Initializer): Initializer is now optional.
7600         (EventField.Define): Only event field can have initializer.
7601
7602         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
7603
7604         * const.cs (Const): Reuse initializer.
7605
7606         * cs-parser.jay: Updated after FieldBase changes.
7607         Added current_array_type to simplify array initializers.
7608
7609         * ecore.cs (NullCast.IsDefaultValue): Implemented.
7610
7611         * expression.cs, iterators.cs: Updated.
7612
7613         * namespace.cs (NamespaceEntry): Made UsingFound private.
7614
7615 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7616
7617         * parameterCollection.cs: Obsolete, removed.
7618         * parser.cs: Obsolete, removed.
7619
7620 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
7621
7622         Fix #76849.
7623         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
7624
7625         * enum.cs (Enum.Define): Set obsolete context here.
7626
7627 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7628
7629         * doc.cs :
7630           - FindDocumentedMember() now expects 1) paramList as null
7631             when "we don't have to check the number of parameters" and
7632             2) Type.EmptyTypes when "there is no arguments".
7633           - Introduced FoundMember struct to hold the exact type which was
7634             used to find the documented member (the above change broke
7635             test-xml-044; it might be better just to use DeclaringType than
7636             what MS does, like this change does, but it depends on usage.)
7637
7638 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
7639
7640         * doc.cs : documented member might be from DeclaringType for nested
7641           types. Fixed bug #76782.
7642
7643 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
7644
7645         * anonymous.cs: Have the param code handle leaving copies on the
7646         stack etc. Allows anonymous params to take part in the assignment
7647         code (++, +=, etc). Fixes bug #76550
7648
7649         * expression.cs: Handle the prepare_for_load/leave_copy by passing
7650         it down to the anon code.
7651
7652         * iterators.cs: Use dummy var here
7653
7654         * codegen.cs: Handle new vars
7655
7656 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7657
7658         Fix #76849.
7659         * class.cs (MethodData.Define): Set proper Obsolete context.
7660
7661         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
7662         obsolete context.
7663         (FieldExpr.DoResolve): Ditto.
7664
7665 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
7666
7667         Fix #76849.
7668         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
7669         parent is not obsolete.
7670
7671 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
7672
7673         * doc.cs : (FindDocumentedMember) find parameterless members first
7674           and get CS0419 in the early stage. Fixed first case of bug #76727.
7675
7676 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
7677
7678         Fix #76859.
7679         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
7680         no error was reported.
7681
7682         *expression.cs (Binary.DoResolve): left can be null.
7683
7684 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
7685
7686         Fix #76783.
7687         * class.cs (MethodData.Emit): Parameters should be labeled first.
7688
7689 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
7690
7691         Fix #76761.
7692         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
7693
7694 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
7695
7696         * attribute.cs (AreParametersCompliant): Moved to Parameter.
7697
7698         * class.cs (MethodCore): Parameter clean up.
7699         (IMethodData): Added ParameterInfo.
7700         (MethodData): Parameter clean up.
7701         (Indexer.Define): Parameter clean up.
7702
7703         * anonymous.cs,
7704         * codegen.cs,
7705         * cs-parser.jay,
7706         * decl.cs,
7707         * doc.cs,
7708         * ecore.cs,
7709         * flowanalysis.cs,
7710         * iterators.cs,
7711         * pending.cs,
7712         * statement.cs,
7713         * typemanager.cs: Parameter clean up.
7714
7715         * delegate.cs (Define): Get rid of duplicated code.
7716
7717         * expression.cs (ParameterReference): Removed useless parameters
7718         and simplified.
7719         (Invocation): Ditto.
7720
7721         * parameter.cs (ParamsParameter): New class, params specialization.
7722         (ArglistParameter): Attemp to separate arglist.
7723         (Parameter): Refactored to be reusable and faster.
7724         (Parameter.Modifier): Made understandable.
7725         (Parameters): Changed to be used as a class for `this' assembly
7726         parameters. Refactored to use new specialized classes.
7727
7728         * support.cs (ParameterData): Added Types property.
7729         (InternalParameters): Deleted.
7730
7731 2005-08-20  Martin Baulig  <martin@ximian.com>
7732
7733         Merging this patch from GMCS to fix #75867.
7734
7735         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
7736         scope if we don't already have it.
7737
7738 2005-11-17  Martin Baulig  <martin@ximian.com>
7739
7740         * anonymous.cs
7741         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
7742         inherit the scope from our parent.  Fixes #76653.
7743
7744 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7745
7746         * doc.cs : the previous patch does not actually fix the bug.
7747           PropertyInfo override check is now implemented and really fixed it.
7748         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
7749
7750 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7751
7752         * doc.cs : apply "override filter" also to properties.
7753           Fixed bug #76730.
7754
7755 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
7756
7757         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
7758           no need to check overrides. For classes, omit those results from 
7759           interfaces since they must exist in the class. Fixed bug #76726.
7760
7761 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7762
7763         * typemanager.cs : (GetFullNameSignature) differentiate indexers
7764           with different parameters. Fixed the second problem in #76685.
7765
7766 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7767
7768         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
7769           get expected 'protected' access in CheckValidFamilyAccess()).
7770           Fixed bug #76692.
7771
7772 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
7773
7774         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
7775           Fixed bug #76705.  CS1569 was incorrectly commented out.
7776
7777 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
7778
7779         * doc.cs : use Invocation.IsOverride() to do real override check.
7780         * expression.cs : made Invocation.IsOverride() internal.
7781
7782 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
7783
7784         * doc.cs : use TypeManager.FindMembers() instead of (possible)
7785           TypeBuilder.FindMembers() and filter overriden base members out.
7786           Fixed bug #76990.
7787
7788 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7789
7790         * doc.cs : ref/out parameters are represented as '@' (instead of
7791           '&' in type FullName). Fixed bug #76630 (additionally crefs).
7792
7793 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7794
7795         * doc.cs : when there was no '.' in cref to methods in doc comment,
7796           then parameters were missing in the output. Fixed bug #76691.
7797
7798 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7799
7800         * driver.cs : don't output docs when there is an error.
7801           Fixed bug #76693.
7802
7803 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7804
7805         * doc.cs :
7806           Now it should detect indexers. Fixed primary concern in bug #76685.
7807           Fixed CS0419 message to not show the identical member signature in
7808           the message.
7809
7810 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
7811
7812         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
7813           instead of Type.FindMembers() since it does not handle events.
7814           Fixed bug #71604.
7815
7816 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
7817
7818         * codegen.cs: Fixed typo (speficied -> specified).
7819
7820 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
7821
7822         Fix #76369.
7823         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
7824
7825 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
7826
7827         * attribute.cs: Changed error message.
7828
7829         * cs-tokenizer.cs: One more check.
7830
7831 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
7832
7833         * statement.cs (Block.Resolve): Ignore empty statement.
7834
7835 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
7836
7837         * report.cs: Made error/warning methods more strict to avoid
7838         their misuse.
7839
7840         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
7841         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
7842         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
7843         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
7844
7845 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
7846
7847         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
7848         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
7849
7850         * class.cs (TypeContainer.IsComImport): New property.
7851         (Constructor.Define): Create proper ctor for ComImport types.
7852
7853         * expression.cs (New.CheckComImport): Fixed.
7854
7855 2005-11-07  Miguel de Icaza  <miguel@novell.com>
7856
7857         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
7858         that a parameter has been captured does not mean that we do not
7859         have to do the rest of the processing.  This fixes the second part
7860         of #76592.  If there was another anonymous method capturing
7861         values in the past, the Scope would never be set for the second
7862         method that captured the same parameter.
7863
7864         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
7865         properly manipulate the stack.   Second part of fix for #76592.
7866
7867         * expression.cs (New): Add support for invoking "new" on
7868         interfaces that have been flagged with the ComImport attribute and
7869         the CoClass.  Fixes #76637 
7870
7871         * statement.cs (Try.DoEmit): When a variable is captured, do not
7872         try to emit the vi.LocalBuilder variable as it has been captured.
7873         Create a temporary variable and store the results on the
7874         FieldBuilder.  Fixes #76642
7875
7876 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
7877
7878         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
7879
7880         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
7881
7882         * expression.cs (Binary.DoResolve): Added && optimalization.
7883     
7884         * typemanager.cs (AddUserType): Removed useless argument.
7885
7886 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
7887
7888         * statement.cs (Block.variables): Uses ListDictionary.
7889
7890 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
7891
7892         Fix #75969.
7893         * class.cs (PartialContainer.EmitType): Customized to emit
7894         security attributes.
7895         (ClassPart.ApplyAttributeBuilder): Transform security attribute
7896         for partial classes.
7897
7898 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
7899
7900         Fix #76599.
7901         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
7902         access has to be fixed.
7903         
7904         * typemanager.cs (IsUnmanagedType): Wrong common field type.
7905
7906 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
7907
7908         Fix #76590.
7909         * ecore.cs (NullCast.Reduce): Implemented.
7910
7911         * expression.cs (ArrayCreation.CheckIndices): Correcly check
7912         constant type.
7913         
7914         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
7915         properly.
7916         (Foreach.Resolve): Catch null properly.
7917
7918 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
7919  
7920         * cs-tokenizer.cs: Warning text fix.
7921
7922         * driver.cs: AllWarningNumbers exposed on public interface.
7923
7924         * report.cs (): Reviewed warning numbers.
7925         (IsValidWarning): Use binary search.
7926
7927 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
7928  
7929         * driver.cs: Implemeted resource visibility.
7930         (Resources): New class for code sharing between /res: and
7931         /linkres:
7932  
7933 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
7934
7935         Fix #76568.
7936         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
7937         folding.
7938         
7939         * convert (Convert.ImplicitReferenceConversion): NullCast holds
7940         contants only.
7941         
7942         * ecore.cs (NullCast): Child is contant only.
7943         
7944         * literal.cs (NullLiteral.Reduce): null can be converted to any
7945         reference type.
7946
7947 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
7948
7949         * driver.cs: Use Encoding.Default as default code page instead
7950           of ISO-28591.
7951
7952 2005-10-27  Raja R Harinath  <rharinath@novell.com>
7953
7954         Fix #76085.
7955         * expression.cs (Invocation.Error_InvalidArguments): Handle
7956         __arglist parameters.
7957         (Invocation.VerifyArgumentsCompat): Likewise.
7958         * support.cs (ReflectionParameters.GetSignatureForError): Print
7959         __arglist parameters.
7960         (InternalParamters.GetSignatureForError): Likewise.
7961         * parameter.cs (Parameters.GetSignatureForError): Likewise.
7962
7963 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
7964
7965         * attribute.cs (GetPropertyValue): Made public.
7966
7967         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
7968         Resolve.
7969         Add new property WrapNonExceptionThrows to handle 2.0 assembly
7970         attribute.
7971         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
7972         is not defined.
7973         
7974         * driver.cs: Reflect method name change.
7975         
7976         * statement.cs (Try.Resolve): Warn when try has both general
7977         exception handlers.
7978         
7979         * typemanager.cs: runtime_compatibility_attr_type new predefined
7980         type.
7981
7982 2005-10-26  Raja R Harinath  <harinath@gmail.com>
7983
7984         Fix #76419.
7985         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
7986         treat it as an empty parameter list.
7987
7988 2005-10-26  Raja R Harinath  <rharinath@novell.com>
7989
7990         Fix #76271.     
7991         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
7992         ResolveAsTypeStep silent.
7993         * statement.cs (Block.AddConstant): Mark block as used.
7994         (Block.ResolveMeta): Avoid piling on error messages
7995         if a constant initializer resolution fails.
7996
7997 2005-10-25  Raja R Harinath  <rharinath@novell.com>
7998
7999         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
8000         Remove.
8001         (NamespaceEntry.VerifyAllUsing): New.
8002         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
8003         behaviour.  Delegates actual resolution of alias to ...
8004         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
8005         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
8006         Update.
8007         * driver.cs (Driver.MainDriver): Update.
8008         
8009         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
8010         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
8011         property.
8012         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
8013         Remove.
8014         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
8015         RootNamespace.DefineNamespacesForAll.
8016
8017 2005-10-24  Raja R Harinath  <harinath@gmail.com>
8018
8019         * typemanager.cs (assemblies, external_aliases, modules)
8020         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
8021         (ComputeNamespaces, GetRootNamespace): Remove extra staging
8022         overhead.  Move resposibility ...
8023         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
8024         * driver.cs, attribute.cs, codegen.cs: Update to changes.
8025
8026 2005-10-23  Raja R Harinath  <harinath@gmail.com>
8027
8028         * namespace.cs (RootNamespace.all_namespaces): Renamed from
8029         cached_namespaces.  Improve usage.
8030         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
8031         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
8032         Move from GlobalRootNamespace and simplify.
8033         (RootNamespace.Global): Make instance variable.
8034         (RootNamespace.RootNamespace): Add "alias name" parameter.
8035         (GlobalRootNamespace): Simplify drastically.
8036         (Namespace.Lookup): Don't use GetNamespace.
8037         * typemanager.cs (GetRootNamespace): Rename from
8038         ComputeNamespaceForAlias.
8039         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
8040
8041 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8042
8043         * anonymous.cs (AnonymousContainer): Don't crash when container
8044         doesn't exist.
8045
8046 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8047
8048         * expression.cs (Binary.DoResolve): Warn when comparing same
8049         values.
8050
8051 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
8052
8053         Fix #76486.
8054         * expression.cs (Binary.DoResolve): It looks like there are no
8055         convetsion rules in enum context.
8056
8057 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
8058
8059         Add support for extern alias qualifiers.
8060         * typemanager.cs: Move some LookupTypeReflection code
8061         to namespace.cs, to have cleaner code. Added some methods
8062         to help us keep track of the extern aliased references.
8063         * driver.cs: Add suport for extern alias assemblies on command
8064         line and check for their warnings/errors. Also keep track of the
8065         extern aliased assemblies.
8066         * namespace.cs: Move the global functionality of Namespace
8067         to GlobalRootNamespace/RootNamespace. Now the global namespace
8068         is GlobalRootNamespace.Globa. Also the code moved from 
8069         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
8070         Finally added LocalAliasEntry (AliasEntry before) and
8071         ExternAliasEntry, to handle alias statements.
8072         * cs-parser.jay: Add support in the grammar for extern alias
8073         statement.
8074         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
8075         Update callings to Namespace (now in GlobalRootNamespace).
8076
8077 2005-10-18  Raja R Harinath  <rharinath@novell.com>
8078
8079         Fix #76371.
8080         * class.cs (TypeContainer.DefineType): Move updating of
8081         topological sort earlier in the code.
8082         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
8083
8084 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
8085
8086         Fix #76273.
8087         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
8088         
8089         * constant.cs (Constant.TryReduce): Moved from Cast class.
8090         (Reduce): Made little bit more OO and fixed missing conversions.
8091         
8092         * ecore.cs (Reduce): Implemented.
8093         (Binary.EnumLiftUp): New method to upgrade values to enum values.
8094         
8095         * literal.cs (Reduce): Implemented.
8096         
8097         * class.cs: Reverted Miguel's wrong commit.
8098
8099 2005-10-14  Miguel de Icaza  <miguel@novell.com>
8100
8101         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
8102
8103 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
8104
8105         * cs-parser.jay, expression.cs : CS0214 was missing error location
8106           for constants. Fixed bug #76404.
8107
8108 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
8109
8110         Fix #76370.
8111         * convert.cs (ExplicitConversionCore): Fixed object->enum
8112         conversion.
8113
8114 2005-10-10  Raja R Harinath  <rharinath@novell.com>
8115
8116         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
8117         InstanceExpression.
8118         (PropertyExpr.EmitCall): Likewise.
8119         * expression.cs (Invocation.EmitArguments): Handle case where
8120         arguments == null.
8121         (Invocation.EmitCall): Avoid allocating temporary variable if
8122         there are no arguments.
8123
8124 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8125
8126         Fix #76323.
8127         * convert.cs (ImplicitConversionStandard): Move conversion of
8128         void* to arbitrary pointer types ...
8129         (ExplicitConversionStandard): .. here.
8130         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
8131         error to always print typenames.
8132
8133 2005-10-07  Raja R Harinath  <rharinath@novell.com>
8134
8135         * convert.cs (GetConversionOperator): Rename from
8136         GetConversionOperators.  Move operator selection code from ...
8137         (UserDefinedConversion): ... here.
8138
8139 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
8140
8141         * convert.cs (ExplicitConversionCore): Removed duplicate enum
8142         conversion.
8143
8144 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
8145
8146         * assign.cs (Assign.DoResolve): Error method changed.
8147
8148         * cfold.cs (DoConstantNumericPromotions): Error method changed.
8149         
8150         * const.cs (ResolveValue): Reset in_transit immediately.
8151         
8152         * constant.cs: Error method changed.
8153         
8154         * convert.cs: Removed useless location parameter.
8155         (ExplicitNumericConversion): Don't do double enum check.
8156         (ExplicitConversionCore): Renamed from ExplicitConversion.
8157         (ExplicitUnsafe): Extracted from ExplicitConversion.
8158         (ExplicitConversion): Uses for error reporting.
8159         
8160         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
8161         error messages.
8162         (ResolveBoolean): Uses common error method.
8163         (CastToDecimal): Get rid of ec.
8164         (CastFromDecimal): Optimized.
8165         (ConvCast): Get rid of ec.
8166         
8167         * enum.cs (ResolveValue): Reset in_transit immediately.
8168         (Emit): Return after first error.
8169         
8170         * expression.cs: Convert changes.
8171         
8172         * literal.cs: Error method changed.
8173         
8174         * statement.cs: Error method changed.
8175
8176 2005-10-03  Raja R Harinath  <rharinath@novell.com>
8177
8178         * support.cs (SeekableStreamReader.Position): Don't error out when
8179         the requested position is just beyond the end of the current
8180         buffered data.
8181
8182 2005-09-28  Raja R Harinath  <rharinath@novell.com>
8183
8184         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
8185         try to keep in sync with the byte count of the underlying Stream.
8186         However, this limits us to a window size of 2048 characters: i.e.,
8187         the maximum lookahead of our lexer/parser can be 2048 characters.
8188
8189 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
8190
8191         Fix #76255.
8192         * driver.cs: Fix compilation files with full root path.
8193
8194 2005-09-25  Miguel de Icaza  <miguel@novell.com>
8195
8196         * report.cs (SymbolRelatedToPreviousError): Format the output so
8197         it does not use an open parenthesis that is never closed. 
8198
8199         * driver.cs: Follow coding guidelines
8200
8201 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8202
8203         Fix #72930.
8204         * const.cs (Const.ResolveValue): Check for assigning non-null
8205         value to reference type.
8206
8207 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
8208
8209         * anonymous.cs: Implemented ExprClassName.
8210         
8211         * assign.cs (Assign.DoResolve): Don't chrash when type is not
8212         delegate.
8213         
8214         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
8215         check.
8216         
8217         * class.cs (StaticClass.DefineContainerMembers): Report protected
8218         members as error.
8219         
8220         * codegen.cs: if(ed) PRODUCTION.
8221         
8222         * convert.cs (Error_CannotImplicitConversion): Better error
8223         distinction.
8224         
8225         * cs-parser.jay: More error checks.
8226         
8227         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
8228         
8229         * driver.cs (CSCParseOption): Enabled wrong option check.
8230         
8231         * ecore.cs (Expression.ExprClassName): Turned to property.
8232         (MemberExpr.CheckIntermediateModification): For checking boxed
8233         value types     modification.
8234         
8235         * statement.cs (Fixed.Resolve): Expression type must be
8236         convertible to fixed type.
8237         (CollectionForeach.GetEnumeratorFilter,TryType):
8238         Small refactoring for easier error checking.
8239
8240 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
8241
8242         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
8243         attributes.
8244         
8245         * class.cs (GeneratedBaseInitializer): New class for customization
8246         compiler generated initializers.
8247         (MemberBase.DoDefine): Check Obsolete attribute here.
8248         (FieldMember.DoDefine): Ditto.
8249         
8250         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
8251         constants.
8252         
8253         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
8254         (MemberCore.GetObsoleteAttribute): Removed argument.
8255         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
8256         (MemberCore.CheckObsoleteType): New helper.
8257         
8258         * delegate.cs,
8259         * enum.cs,
8260         * statement.cs: Updates after MemberCore changes.
8261         
8262         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
8263         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
8264         
8265         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
8266         obsolete attribute for compiler construct.
8267         (As.DoResolve): Cache result.
8268         
8269         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
8270
8271 2005-09-26  Raja R Harinath  <rharinath@novell.com>
8272
8273         Fix #76133.
8274         * expression.cs (This.VerifyFixed): In a value type T, the type of
8275         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
8276         value type R, 'this' is treated as a value parameter.
8277
8278 2005-09-22  Miguel de Icaza  <miguel@novell.com>
8279
8280         * statement.cs (Lock): Use the TemporaryVariable class instead of
8281         manually using local variables as those do not work when variables
8282         are captured.
8283
8284         * ecore.cs: Moved the TemporaryVariable class from being a nested
8285         class inside Foreach to be a public class that can be employed in
8286         other places. 
8287
8288 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
8289
8290         * cs-parser.jay: interface_accessors replaced by
8291         accessor_declarations.
8292
8293         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
8294         location.
8295         
8296         * statement.cs (GotoCase.Resolve): Convert null constant to
8297         null case.
8298         (SwitchLabel.ResolveAndReduce): Ditto.
8299         (SwitchLabel.NullStringCase): Custom null stamp.
8300         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
8301         
8302         typemanager.cs (CSharpSignature): Don't skip first argument
8303         for full names.
8304
8305 2005-09-18  Miguel de Icaza  <miguel@novell.com>
8306
8307         * driver.cs: Set InEmacs based on the environment variable EMACS. 
8308
8309         * location.cs (InEmacs): in this mode, do not report column
8310         location as it confuses Emacs.
8311
8312 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
8313
8314         * cfold.cs, constant.cs, convert.cs, ecore.cs,
8315         expression.cs, iterators.cs, literal.cs: Store constants and
8316         literals location.
8317         
8318         * class.cs (MemberBase.ShortName): Pass location.
8319         
8320         * cs-parser.jay: Some location fixes.
8321         
8322         * ecore.cs (Expression.Location): Made virtual.
8323
8324 2005-09-05  Miguel de Icaza  <miguel@novell.com>
8325
8326         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
8327         if the underlying types are the same, otherwise we need to produce
8328         code that will do the proper cast.
8329
8330         This was exposed by Marek's constant rewrite which produced
8331         invalid code for the call site:
8332
8333         enum X : long { a }
8334         void Method (X v) {}
8335
8336         Method ((X) 5)
8337
8338         This fixes test-49.cs
8339
8340 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8341
8342         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
8343           Type/Object should be allowed as well. Fixed bug #75968.
8344
8345 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
8346
8347         * expression.cs : (Binary.DoResolve): when one is enum constant and
8348           another is constant 0, then return enum one *as enum type*.
8349           Fixed bug 74846.
8350
8351 2005-09-02  Raja R Harinath  <rharinath@novell.com>
8352
8353         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
8354         internal.
8355
8356         Fix #75941.
8357         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
8358         flow-branching for LocalVariableReferences in case we were invoked
8359         from a MemberAccess.
8360         * expression.cs (LocalVariableReference.VerifyAssigned): New.
8361         Carved out of ...
8362         (LocalVariableReference.DoResolveBase): ... this.
8363         (MemberAccess.Resolve): Do the check that was disabled during
8364         SimpleNameResolve.
8365
8366 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8367
8368         * class.cs :
8369           (PartialContainer.Create): check abstract/sealed/static strictly
8370           but abstract/sealed can exist only at one side. Fixed bug #75883.
8371
8372 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
8373
8374         Fix #75945.
8375         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
8376         specified, don't default to UnmanagedType.I4.
8377
8378 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
8379
8380         * expression.cs : conditional operator should check possibly
8381           incorrect assign expression. Fixed bug #75946.
8382
8383 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8384
8385         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
8386           Reverting the change. gmcs is much complex than mcs on this matter.
8387
8388 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
8389
8390         * cs-tokenizer.cs : To read another token ahead of the actual 
8391           consumption, use new SavedToken and cache token instead of moving
8392           back the stream with SeekableStreamReader (it seemed problematic).
8393         * cs-parser.jay,
8394           driver.cs : Thus use StreamReader directly.
8395         * support.cs : Thus removed SeekableStreamReader.
8396
8397 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8398
8399         Fix #75934.
8400         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
8401         (ScopeInfo.EmitScopeType): Use it to construct field names from
8402         names of captured locals.
8403
8404         Fix #75929.
8405         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
8406         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
8407         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
8408         (ExplicitConversion): Remove enum cases already handled by
8409         implicit conversion.  Move implicit conversion check to the beginning.
8410         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
8411         * expression.cs (ArrayCreation.EmitDynamicInitializers):
8412         Don't treat System.Enum as a struct.
8413
8414 2005-08-30  Jb Evain  <jbevain@gmail.com>
8415
8416         * attribute.cs: handles as expression in parameters.
8417
8418 2005-08-30  Raja R Harinath  <rharinath@novell.com>
8419
8420         Fix #75802.
8421         * class.cs (TypeContainer.VerifyClsName): Don't use a
8422         PartialContainer when verifying CLS compliance.
8423         (AbstractPropertyEventMethod): Set Parent here, ...
8424         (PropertyMethod): ... not here.
8425
8426 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
8427
8428         * attribute.cs : escaped attribute name should not be allowed to be
8429           resolved (e.g. @class as classAttribute). Fixed bug #75930.
8430
8431 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8432
8433         Fix #75927.
8434         * convert.cs (ImplicitStandardConversionExists): Allow zero also
8435         when converting a long constant to unsigned long.
8436         * expression.cs (Invocation.OverloadResolve): Add sanity check to
8437         detect where IsApplicable and VerifyArgumentsCompat disagree.
8438
8439 2005-08-29  Raja R Harinath  <rharinath@novell.com>
8440         and Carlos Alberto Cortez  <carlos@unixmexico.org>
8441
8442         Fix #75848.
8443         * class.cs (TypeContainer.CanElideInitializer): New helper.
8444         (TypeContainer.EmitFieldInitializers): Use it to determine if we
8445         can safely emitting the initializer of a field.
8446
8447 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8448
8449         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
8450           allowed inside a switch (without loop). Fixed bug #75433.
8451
8452 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
8453
8454         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
8455         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
8456
8457 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8458
8459         * driver.cs : kinda reverting the default encoding changes (not exact 
8460           revert since I noticed that "codepage:reset" might not work fine).
8461
8462 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8463
8464         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
8465           Location. Now getter and setter store location correctly.
8466           (errors/cs0111-12.cs now reports the expected location.)
8467
8468 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
8469
8470         * driver.cs : Use default encoding on the environment.
8471           Removed (now that) extra parameter for SeekableStreamReader.
8472         * support.cs : (SeekableStreamReader) third .ctor() argument for
8473           StreamReader is not required (always true). preamble size could
8474           be acquired in simpler and safe way.
8475
8476 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
8477
8478         * cs-parser.jay: report CS0642 at warning level 3
8479           and report CS0642 for an if else statement also
8480           fixes bug #74745. Patch by John Luke (and a bit
8481           modified by me).
8482           Removed extra CS0642 warning check for "while",
8483           "for" and "fixed".
8484         * statement.cs: In Block.Resolve(), CS0642 check
8485           is reimplemented to check a sequence of an empty
8486           statement and a block.
8487
8488           Both fix bug #66777.
8489
8490 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
8491
8492         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
8493         detection until I fix it.
8494         
8495         * cs-tokenizer.cs: Changed error message.
8496         
8497         * cs-parser.jay: Fixed 2 error locations.
8498         
8499         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
8500         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
8501         properties.
8502         
8503         * enum.cs (GetSignatureForError): Fixed.
8504         
8505         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
8506         method detection.
8507         
8508         * class.cs,
8509         * typemanager.cs (RegisterProperty): Removed.
8510         
8511         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
8512
8513 2005-08-24  Raja R Harinath  <rharinath@novell.com>
8514
8515         Fix #75874.
8516         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
8517         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
8518
8519 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8520
8521         * expression.cs : tiny fix is required for not warning positive ulong.
8522           See test-441.cs.
8523
8524 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8525
8526         * expression.cs : add CS0652 check for constant and integral
8527           expression. Fixed bug #53974.
8528
8529 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8530
8531         * expression.cs : in DoNumericPromotions(), check if there is implicit
8532           conversion overload for string (to check CS0034). Fixed bug #52492.
8533
8534 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8535
8536         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
8537
8538 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8539
8540         * ecore.cs : report location when it is *not* Null.
8541
8542 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
8543
8544         * codegen.cs,
8545           ecore.cs,
8546           flowanalysis.cs,
8547           expression.cs:
8548           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
8549           correctly. Fixed bug #75721.
8550
8551 2005-08-23  Raja R Harinath  <rharinath@novell.com>
8552
8553         * support.cs (SeekableStreamReader.Position): Avoid an expensive
8554         loop that performs 'min (pos, char_count)'.
8555
8556         Fix #75862.
8557         * expression.cs (Unary.ResolveOperator): Don't discard implicit
8558         converted value in Operator.OnesComplement.
8559
8560 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
8561
8562         * anonymous.cs: If the anon method is pulled into a helper class,
8563         it needs to be `internal' not `private'. Fixes runtime behavior on
8564         msft. bug #75704
8565
8566 2005-08-20  Martin Baulig  <martin@ximian.com>
8567
8568         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
8569         scope if we don't already have it.
8570
8571         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
8572         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
8573         fixes #75867.
8574
8575 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
8576
8577         Fix #75803
8578         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
8579         is a partial class.
8580
8581 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
8582
8583         The big constants rewrite
8584         Fix #75746, #75685 and more
8585         As a side effect saved 1MB for MWF ;-)
8586         
8587         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
8588         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
8589         enum based for corlib compilation.
8590         
8591         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
8592         subtractions.
8593         
8594         * class.cs (FixedField.Define): Use ResolveAsConstant.
8595         
8596         * const.cs (IConstant): Interface constants and enums.
8597         (Const.ResolveValue): New method for constant resolvning.
8598         (ExternalConstant): Constants from imported assemblies.
8599         
8600         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
8601         conversion; like enums.
8602         (Constant.ToType): Converts this constant to different type.
8603         (Constant.Increment): Adds 1.
8604         
8605         * convert.cs (ImplicitConversionRequired): Simplified.
8606         
8607         * cs-parser.jay: Create EnumMember directly.
8608         
8609         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
8610         
8611         * doc.cs (GenerateEnumDocComment): Removed.
8612         
8613         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
8614         (ConvertIntLiteral): Removed.
8615         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
8616         
8617         * enum.cs (EnumMember): Implement IConstant.
8618         (Enum.IsValidEnumConstant): Removed.
8619         (Enum.GetNextDefaultValue): Removed.
8620         (Enum.FindMembers): Updated.
8621         (Enum.GenerateDocComment): Iterate enum members.
8622         
8623         * expression.cs (Cast.TryReduce): Handle enums correctly.
8624         (New.Constantify): Made public.
8625         (MemberAccess.DoResolve): Removed contant specific if(s).
8626         
8627         * literal.cs (NullLiteral): Implement new abstract methods.
8628         
8629         * statement.cs (GotoCase.Resolve): Use new constant methods.
8630         (SwitchLabel.ResolveAndReduce): Use new constant methods.
8631         
8632         * typemanager.cs (LookupEnum): Removed.
8633         (IsEnumType): Fixed to work with corlib.
8634         (RegisterConstant): Removed.
8635         (LookupConstant): Removed.
8636         (GetConstant): Changed to work with IConstant.
8637
8638 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
8639
8640         * location.cs : Fixed overflown (>255) column number.
8641
8642 2005-08-03  Raja R Harinath  <rharinath@novell.com>
8643
8644         First cut of the qualified-alias-member feature.
8645         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
8646         token.
8647         * cs-parser.jay (DOUBLE_COLON): New token.
8648         (namespace_or_type_name): Add rule for recognizing
8649         qualified-alias-members.
8650         (primary_expression): Likewise.
8651         (element_access): Allow QualifiedAliasMember as a possible
8652         type-bearing expression.
8653         (local_variable_type, local_variable_pointer_type): Likewise.
8654         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
8655         aliases in the current and enclosing namespace declarations.
8656         (NamespaceEntry.UsingAlias): Add CS0440 warning.
8657         * decl.cs (MemberName.is_double_colon): New.
8658         (MemberName.MemberName): Add new constructor for alias-member.
8659         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
8660         * expression.cs (QualifiedAliasMember): New expression type.
8661
8662 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8663
8664         * location.cs : it borked when no argument was specified.
8665
8666 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8667
8668         * location.cs : tiny ToString() format fix.
8669
8670 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8671
8672         * statement.cs : oops, it was missing.
8673
8674 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
8675
8676         A set of fixes for precise line/column location.
8677
8678         * location.cs :
8679           "token" field now holds a file/line "delta", a line number offset 
8680           from the segment, and a column number. See also:
8681           http://lists.ximian.com/pipermail/mono-devel-list/2004-
8682           December/009508.html
8683           Removed static IsNull. Use instance IsNull property instead.
8684         * cs-tokenizer.cs :
8685           For some tokens it stores Location. For Identifier it stores
8686           LocatedToken which is a pair of string name and location.
8687           Column numbers are adjusted only at getChar().
8688         * report.cs :
8689           Use Location.ToString() for reporting (it now contains column).
8690         * cs-parser.jay :
8691           Largely modified to use LocatedToken instead of
8692           string (IDENTIFIER), and to acquire Location from some tokens.
8693         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
8694           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
8695           codegen.cs :
8696           Now MemberName holds Location. DeclSpace.ctor() receives Location
8697           as a parameter. Removed extra parameters to all derived classes.
8698           Replaced Location.IsNull() with instance property.
8699         * assign.cs, expression.cs :
8700           Added .ctor() overload that omits Location.
8701         * attribute.cs :
8702           Added "nameEscaped" flag that indicates the identifier was escaped
8703           in the source file. This fixes bug #57047.
8704
8705 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
8706
8707         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
8708         New method, looking for lo-case imported cls type.
8709
8710         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
8711         here.
8712
8713         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
8714
8715         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
8716
8717         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
8718         all_imported_types.
8719         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
8720
8721         Optimized to save 3.5 MB for SWF compilation.
8722
8723 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8724
8725         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
8726         (PartialContainer.Create): Moved logic AddToContainer.
8727         (PartialContainer.MarkForDuplicationCheck): Shares name.
8728         
8729         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
8730         place.
8731         
8732         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
8733         initialization.
8734         (Namespace.GetSignatureForError): New method.
8735         
8736         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
8737         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
8738
8739 2005-08-01  Raja R Harinath  <rharinath@novell.com>
8740
8741         Fix #75669.
8742         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
8743         member lookup rather than qualifier_type, since qualifier_type can
8744         be null.
8745
8746 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
8747
8748         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
8749         enum member.
8750
8751 2005-07-31  Miguel de Icaza  <miguel@novell.com>
8752
8753         * statement.cs: Copy the local exception into the exception
8754         captured local.  Fixes 75674
8755
8756 2005-07-31  Raja R Harinath  <harinath@gmail.com>
8757
8758         Fix #75658.
8759         * expression.cs (Invocation.OverloadResolve): Don't report error
8760         CS1501 if error CS1502 has been reported.
8761         (New.DoResolve): Delegate CS1501 reporting to
8762         Invocation.OverloadResolve.
8763
8764         Fix #75656.
8765         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
8766         invariant-meaning-in-block property in an enclosing block if
8767         necessary.
8768
8769 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
8770
8771         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
8772         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
8773         (Switch.CheckSwitch): Just save 50kb for SWF.
8774
8775 2005-07-27  Martin Baulig  <martin@ximian.com>
8776
8777         * anonymous.cs (CaptureContext.AddField): Added
8778         `AnonymousContainer am' argument; compute its toplevel scope if
8779         it's not already computed.  Fixes #75649.
8780
8781 2005-07-26  Raja R Harinath  <rharinath@novell.com>
8782
8783         Fix #75628.
8784         * class.cs (Constructor.Emit): Reset block to null if the block
8785         resolve fails.
8786
8787 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
8788
8789         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
8790
8791 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
8792
8793         * class.cs (MethodData.Define): Check whether accessor implementing
8794         interface is public.
8795
8796         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
8797
8798 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
8799
8800         Fix #57245
8801         * namespace.cs (LookupType): Moved same type check to...
8802         
8803         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
8804         with the same name.
8805
8806 2005-07-21  Raja R Harinath  <rharinath@novell.com>
8807
8808         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
8809         already found a typebuilder.
8810         * class.cs (MethodCore.IsDuplicateImplementation): Compare
8811         MemberNames, not strings.
8812
8813         * const.cs (Error_ExpressionMustBeConst): 
8814         Rename from Error_EpressionMustBeConst.
8815         * const.cs, class.cs, statement.cd: Update.
8816
8817 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
8818
8819         Fix #65573
8820
8821         * const.cs (Const.LookupConstantValue): Report missing contant expression
8822         everytime.
8823         (Error_EpressionMustBeConstant): Only one error method.
8824
8825         * class.cs, statement.c: Updated.
8826
8827 2005-07-20  Raja R Harinath  <rharinath@novell.com>
8828
8829         * statement.cs (Block.Flags): Add back HasVarargs.
8830         (Block.flags): Make protected.
8831         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
8832
8833         * typemanager.cs (types, typecontainers, user_types): Remove.
8834         (UserTypes, TypeContainers): Likewise.
8835         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
8836         (CleanUp, Reset): Update.
8837         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
8838         (GetNestedType): Use Type.GetNestedType.
8839         (CoreLookupType): Take two arguments, the namespace and the
8840         basename of the type.  Update to use the Namespace.Lookup
8841         mechanism.
8842         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
8843         (RealMemberLookup): Use IsNestedChildOf instead of playing with
8844         string concatenation and substring matches.
8845         * class.cs, enum.cs, delegate.cs: Update to changes.
8846
8847 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
8848
8849         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
8850         Expression and made virtual.
8851
8852         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
8853         (ImplicitStandardConversionExists): Fixed `byte' typo ?
8854
8855         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
8856
8857         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
8858         error message.
8859
8860         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
8861         change.
8862
8863 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
8864
8865         Fix #57707
8866         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
8867         AssemblyCultureAttribute is not used on executable.
8868
8869         * rootcontext.cs,
8870         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
8871
8872 2005-07-16  Raja R Harinath  <rharinath@novell.com>
8873
8874         Fix #60638.
8875         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
8876         New.  Reports CS0252/CS0253.
8877         Mostly taken from preliminary patch by Duncak Mak.
8878         (Binary.DoResolveOperator): Store results of operator lookup.
8879         Use them to detect if we need to warn about unintended reference
8880         comparisons.
8881
8882 2005-07-15  Raja R Harinath  <rharinath@novell.com>
8883
8884         Fix #72969.
8885         * namespace.cs (Namespace.Lookup): Add back location parameter.
8886         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
8887         * delegate.cs, ecore.cs, expression.cs: Update to changes.
8888
8889         * codegen.cs (EmitContext.DeclSpace): Make readonly.
8890         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
8891         (Namespace.LookupType): ... this.
8892         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
8893         of namespaces.
8894         * typemanager.cs (LookupTypeReflection): Remove buggy code that
8895         purported to handle pointers.
8896         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
8897         CoreLookupType.
8898
8899 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
8900
8901         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
8902         type as namespace.
8903
8904 2005-07-15  Raja R Harinath  <rharinath@novell.com>
8905
8906         * namespace.cs (Namespace.Lookup): Drop location parameter.
8907         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
8908         (NamespaceEntry.Lookup): ... this.
8909         (NamespaceEntry.Error_AmbiguousTypeReference):
8910         Move here from DeclSpace.
8911         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
8912         names ...
8913         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
8914         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
8915         Move to NamespaceEntry.
8916         * delegate.cs, expression.cs: Update to changes.
8917
8918 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
8919
8920         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
8921         CheckAttributeType and refactored.
8922         (Attribute.ResolvePossibleAttributeType): Changed to reuse
8923         ResolveAsTypeTerminal error handling.
8924         (ResolveAsTypeTerminal): Introduced because of global attributes extra
8925         handling.
8926         (GetSignatureForError): Print errors in same way.
8927
8928         * class.cs,
8929         * codegen.cs: Reflect attribute GetSignatureForError change.
8930
8931         * ecore.cs,
8932         * expression.cs: Add silent parameter to ResolveAsTypeStep.
8933
8934         * namespace.cs (UsingEntry): Refactored to make fields private.
8935
8936         * assign.cs,
8937         statement.cs: Error_UnexpectedKind has extra parameter.
8938
8939 2005-07-14  Raja R Harinath  <rharinath@novell.com>
8940
8941         * ecore.cs (IAlias): Remove.
8942         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
8943         that implement the interface.
8944         * namespace.cs (Namespace): Likewise.
8945         (Namespace.declspaces): Renamed from 'defined_names'.
8946         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
8947         DeclSpace instead of an IAlias.
8948         * tree.cs (Tree.AddDecl): Update.
8949
8950 2005-07-12  Raja R Harinath  <rharinath@novell.com>
8951
8952         * statement.cs (Block.Flags); Remove HasVarargs.
8953         (Block.HasVarargs): Move to ToplevelBlock.
8954         (Block.ThisVariable, Block.AddThisVariable): Likewise.
8955         (Block.Variables): Make protected.  Initialize variable hashtable
8956         if necessary.
8957         (Block.AddVariable): Update.
8958         (Block.Resolve): Update to changes.
8959         (ToplevelBlock.HasVarargs): New boolean.
8960         (ToplevelBlock.ThisVariable): Move here from Block.
8961         (ToplevelBlock.AddThisVariable): Likewise.
8962         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
8963         * expression.cs (This.ResolveBase): Update to changes.
8964         (ArglistAccess.DoResolve): Likewise.
8965
8966 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
8967
8968         Fix #75321
8969         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
8970
8971         * class.cs (TypeContainer.VerifyMembers): Distinguish between
8972         not used and not used & assigned.
8973         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
8974
8975 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
8976
8977         Fix #75053
8978         * expression.cs (Is.DoResolve): null is never provided type.
8979
8980 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
8981
8982         Fix #52496
8983         * cs-parser.jay: Less strict event error rule to catch more errors.
8984
8985 2005-07-08  Martin Baulig  <martin@ximian.com>
8986
8987         Fix test-iter-10.cs - distinguish whether we `yield' in a property
8988         gettter (allowed) or setter (not allowed).
8989
8990         * class.cs (Accessor): Implement IIteratorContainer.
8991         (Accessor.Yields): New public field.
8992         (PropertyBase.PropertyMethod.Define): Handle iterators on a
8993         per-accessor basis.
8994
8995         * cs-parser.jay
8996         (get_accessor_declaration, set_accessor_declaration): Set the
8997         `yields' flag on the accessor, not the property.
8998         (property_declaration): Do the iterators check on a per-accessor
8999         basis and not for the whole property.
9000
9001 2005-07-08  Martin Baulig  <martin@ximian.com>
9002
9003         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
9004         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
9005
9006 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
9007
9008         Fix #74975
9009         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
9010         (ExtractSecurityPermissionSet): Cope with self referencing security
9011         attributes properly.
9012
9013         * driver.cs (SetOutputFile): Made public property OutputFile.
9014
9015 2005-07-07  Raja R Harinath  <rharinath@novell.com>
9016
9017         Fix #75486.
9018         * class.cs (TypeContainer.first_nonstatic_field): Rename from
9019         has_nonstatic_fields.  Make into a FieldBase pointer.
9020         (TypeContainer.AddField): Add CS0282 check.
9021         (TypeContainer.EmitType): Update.
9022
9023 2005-07-06  Miguel de Icaza  <miguel@novell.com>
9024
9025         * cs-tokenizer.cs (consume_identifier): Do not create strings to
9026         compare if they start with __.
9027
9028 2005-07-06  Raja R Harinath  <rharinath@novell.com>
9029
9030         * statement.cs (Switch.SwitchGoverningType): Only look at
9031         UserCasts that don't need implicit standard conversions to one of
9032         the allowed switch types (Fixes test-322.cs).
9033         (LocalInfo.Resolve): Re-enable sanity-test.
9034
9035 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
9036
9037         * cs-tokenizer.cs (consume_identifier): Detect double undescores
9038         
9039         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
9040         
9041         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
9042
9043 2005-07-06  Raja R Harinath  <rharinath@novell.com>
9044
9045         Fix #75472.
9046         * ecore.cs (SimpleName.GetSignatureForError): Add.
9047         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
9048         (MemberAccess.GetSignatureForError): Add.
9049
9050 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
9051  
9052         The big error and warning messages review.
9053         
9054         * anonymous.cs,
9055         * assign.cs,
9056         * attribute.cs,
9057         * class.cs,
9058         * codegen.cs,
9059         * convert.cs,
9060         * cs-parser.jay,
9061         * cs-tokenizer.cs,
9062         * decl.cs,
9063         * delegate.cs,
9064         * doc.cs,
9065         * driver.cs,
9066         * ecore.cs,
9067         * enum.cs,
9068         * expression.cs,
9069         * flowanalysis.cs,
9070         * iterators.cs,
9071         * literal.cs,
9072         * location.cs,
9073         * modifiers.cs,
9074         * namespace.cs,
9075         * parameter.cs,
9076         * pending.cs,
9077         * report.cs,
9078         * rootcontext.cs,
9079         * statement.cs,
9080         * support.cs,
9081         * tree.cs,
9082         * typemanager.cs: Updated.
9083         
9084         * class.cs: (MethodCore.SetYields): Moved here to share.
9085         (PropertyMethod.Define): Moved iterator setup here.
9086         
9087         * iterators.cs: Add orig_method to have full access to parent
9088         container.
9089
9090 2005-07-05  Raja R Harinath  <rharinath@novell.com>
9091
9092         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
9093         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
9094         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
9095         variable of struct type.
9096         * expression.cs (Unary.ResolveOperator): Update to change.
9097         (Indirection.VerifyFixed): Likewise.
9098         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
9099         (ParameterReference.VerifyFixed): Value parameters are fixed.
9100         (This.VerifyFixed): Treat 'this' as a value parameter.
9101         * statement.cs (LocalInfo.IsFixed): Remove.
9102
9103 2005-07-01  Martin Baulig  <martin@ximian.com>
9104
9105         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
9106         `ec.EmitThis ()' to get the correct scope.
9107
9108 2005-07-01  Martin Baulig  <martin@ximian.com>
9109
9110         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
9111         instance is a ParameterReference; fixes #75299.
9112
9113 2005-07-01  Martin Baulig  <martin@ximian.com>
9114
9115         Reverted Marek's latest patch (r46725):
9116         - it contains structural changes which are neither mentioned in
9117           the ChangeLog nor explained anywhere; for example the additional
9118           argument of EmitContext's and Iterator's .ctor's and the
9119           TypeContainer.DefineMembers() change.
9120         - structural changes like this should go in in seperate patches
9121           and not be hidden in a huge patch which just seems to affect
9122           warnings and errors.
9123           a big and hard to understand patch.
9124         - it breaks iterators and causes regressions, for instance in
9125           test-iter-03.cs.      
9126
9127 2005-06-30  Raja R Harinath  <rharinath@novell.com>
9128
9129         Fix #75412.
9130         * expression.cs (Indexers.map): Remove.
9131         (Indexers.Append): Filter out inaccessible setters and getters.
9132         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
9133
9134         Fix #75283.
9135         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
9136         Refactored from ...
9137         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
9138         (FieldExpr.Emit, PropertyExpr.Emit): Update.
9139         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
9140         * expression.cs (Invocation.EmitCall): Add CS0120 check.
9141
9142 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
9143
9144         Fix #75322
9145         * class.cs (FieldBase.GetInitializerExpression): One more field
9146         for backup.
9147
9148 2005-06-28  Miguel de Icaza  <miguel@novell.com>
9149
9150         * pending.cs: Do not define a proxy if the base method is virtual,
9151         it will be picked up by the runtime (bug 75270).
9152
9153 2005-06-08  Martin Baulig  <martin@ximian.com>
9154
9155         The big Iterators rewrite :-)
9156
9157         * iterators.cs: Rewrite this to use the anonymous methods framework.
9158
9159         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
9160         before the TypeContainers; see 2test-21.cs.
9161
9162         * class.cs
9163         (TypeContainer.DefineType): Don't create a new EmitContext if we
9164         already have one (this only happens if we're an Iterator).
9165         (TypeContainer.Define): Also call Define() on all our iterators.
9166         (Method.CreateEmitContext): Added support for iterators.
9167
9168         * anonymous.cs
9169         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
9170         (AnonymousContainer.CreateMethodHost): Moved here from
9171         AnonymousMethod and made abstract.
9172         (AnonymousContainer.CreateScopeType): New abstract method.
9173         (AnonymousContainer.IsIterator): New public property.
9174         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
9175         get the ScopeTypeBuilder rather than manually defining it here. 
9176         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
9177         iterators here.
9178
9179         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
9180         before RootContext.DefineTypes().
9181
9182         * codegen.cs (EmitContext.RemapToProxy): Removed.
9183         (EmitContext.CurrentAnonymousMethod): Changed type from
9184         AnonymousMethod -> AnonymousContainer.
9185         (EmitContext.ResolveTopBlock): Protect from being called twice.
9186         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
9187         (EmitContext.EmitThis): Removed the iterators hacks; use the
9188         anonymous methods framework for that.
9189
9190         * statement.cs
9191         (ToplevelBlock.Container): Make this a property, not a field.
9192         (ToplevelBlock.ReParent): New public method; move the
9193         ToplevelBlock into a new container.
9194         (Foreach.TemporaryVariable): Simplify.
9195
9196 2005-06-05  Martin Baulig  <martin@ximian.com>
9197
9198         * statement.cs (LocalInfo.CompilerGenerated): New flag.
9199         (Block.AddTemporaryVariable): New public method; creates a new
9200         `LocalInfo' for a temporary variable.
9201         (Block.EmitMeta): Create the LocalBuilders for all the temporary
9202         variables here.
9203         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
9204         non-iterator variables.
9205
9206 2005-06-05  Martin Baulig  <martin@ximian.com>
9207
9208         * statement.cs (Foreach.TemporaryVariable): Create the
9209         LocalBuilder in the Emit phase and not in Resolve since in some
9210         situations, we don't have an ILGenerator during Resolve; see
9211         2test-19.cs for an example.
9212
9213 2005-06-04  Martin Baulig  <martin@ximian.com>
9214
9215         **** Merged r45395 from GCS ****
9216
9217         The big Foreach rewrite - Part II.
9218
9219         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
9220         with `PropertyInfo ienumerator_getcurrent'.
9221
9222         * codegen.cs (VariableStorage): Removed.
9223
9224         * statement.cs
9225         (Foreach): Derive from Statement, not ExceptionStatement.
9226         (Foreach.CollectionForeach): New nested class.  Moved all the code
9227         dealing with collection foreach here.
9228         (Foreach.ForeachHelperMethods): Removed.
9229         (Foreach.TemporaryVariable): Implement IMemoryLocation.
9230
9231 2005-05-23  Martin Baulig  <martin@ximian.com>
9232
9233         * statement.cs (Try.DoResolve): Don't create a `finally' if we
9234         don't need to.  Fix #75014.
9235
9236 2005-05-20  Martin Baulig  <martin@ximian.com>
9237
9238         Merged r44808 from GMCS.
9239
9240         * class.cs (TypeContainer.CircularDepException): Removed.
9241         (TypeContainer.DefineType): Removed the `InTransit' stuff.
9242         (TypeContainer.CheckRecursiveDefinition): Check for circular class
9243         (CS0146) and interface (CS0529) dependencies here.
9244
9245 2005-06-21  Raja R Harinath  <rharinath@novell.com>
9246
9247         * expression.cs (Invocation.EmitCall): Fix initialization
9248         'this_call' to reflect current behaviour.  Fix indentation.
9249
9250         * convert.cs (FindMostEncompassedType): Add two trivial special
9251         cases (number_of_types == 0 || number_of_types == 1).
9252         (FindMostEncompasingType): Likewise.
9253
9254 2005-06-17  Raja R Harinath  <rharinath@novell.com>
9255
9256         Some cleanups preparing for the fix of #75283.
9257         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
9258         error testing.
9259         (EventExpr.InstanceResolve): Likewise.
9260         (EventExpr.DoResolve): Remove redundant checks.
9261
9262 2005-06-10  Duncan Mak  <duncan@novell.com>
9263
9264         * cs-tokenizer.cs (process_directives): New flag for controlling
9265         the processing of preprocessor directives.
9266         (x_token): After seeing a '#', return Token.NONE instead of going
9267         to handle_preprocessing_directive() when not processing
9268         directives. This avoids unnecessary processing during the token peek in
9269         is_punct().
9270
9271         This fixes #74939.
9272
9273         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
9274         the existing error reporting methods instead of Report.Error.
9275
9276         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
9277         after Raja's rewrite.
9278
9279 2005-06-08  Miguel de Icaza  <miguel@novell.com>
9280
9281         * class.cs: Small fix.
9282
9283 2005-06-08  Raja R Harinath  <rharinath@novell.com>
9284
9285         Fix #75160.
9286         * class.cs (GetPartialBases): Fix return value check of
9287         part.GetClassBases.
9288
9289 2005-06-07  Raja R Harinath  <rharinath@novell.com>
9290
9291         Ensure that partial classes are registered in their enclosing
9292         namespace.  Initial part of fix of #75160.
9293         * tree.cs (Tree.RecordDecl): Add new namespace argument.
9294         Register declspace with namespace here, not in
9295         DeclSpace.RecordDecl.
9296         * cs-parser.jay: Pass namespace to RecordDecl.
9297         * class.cs (PartialContainer.Create): Likewise.
9298         (ClassPart.DefineType): New sanity-check.  Throws an exception if
9299         called.
9300         * decl.cs (Declspace.RecordDecl): Remove.
9301         * namespace.cs (NamespaceEntry.DefineName): Remove.
9302
9303 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
9304
9305         * rootcontext.cs: Reset TargetExt as well.
9306
9307 2005-06-03  Raja R Harinath  <rharinath@novell.com>
9308
9309         * ecore.cs (Expression.Resolve): Emit CS0654 error when
9310         -langversion:ISO-1.
9311
9312 2005-06-02  Raja R Harinath  <rharinath@novell.com>
9313
9314         Fix #75080, cs0119.cs.
9315         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
9316         of ...
9317         (Expression.Resolve): ... this.  Use it.  Remove bogus code
9318         allowing ExprClass.Type and ExprClass.Namespace for
9319         ResolveFlags.VariableOrValue.
9320         (Expression.Resolve) [1-argument variant]: Change default resolve
9321         flags based on language version.
9322         (Expression.Error_UnexpectedKind): Use a simple string array
9323         rather than an ArrayList.
9324         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
9325         not ExprClass.Type.
9326         (TypeOfVoid.DoResolve): Likewise.
9327         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
9328         flags argument -- it always has the same value.
9329
9330 2005-05-31  Raja R Harinath  <rharinath@novell.com>
9331
9332         Fix #75081.
9333         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
9334         Use it in the error message.
9335         * assign.cs, expression.cs, statement.cs: Update.
9336
9337 2005-05-30  Raja R Harinath  <rharinath@novell.com>
9338
9339         Fix #75088.
9340         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
9341         the "almostMatchedMember" case too.
9342         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
9343         that failed the accessibility checks to 'almost_match'.
9344
9345 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
9346
9347         * attribute.cs: Use internal MethodBuilder methods to set
9348         ExactSpelling and SetLastError on PInvoke methods, instead
9349         of passing them via charset.  Fixes #75060.
9350
9351 2005-05-27  Raja R Harinath  <rharinath@novell.com>
9352
9353         * parameter.cs (Parameter): Remove TODO comment.
9354         (Parameter.DefineParameter): Remove Location parameter.
9355         (Parameters.LabelParameters): Likewise.
9356         * class.cs (Constructor.Emit): Update to change.
9357         (MethodData.Emit): Likewise.
9358         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
9359         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
9360
9361 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
9362
9363         * parameter.cs,
9364           Removed Parameters.Location and added Parameter.Location instead.
9365           Removed Location parameter from Emit() and GetSignature().
9366         * anonymous.cs,
9367           class.cs,
9368           cs-parser.jay,
9369           delegate.cs,
9370           iterators.cs,
9371           statement.cs :
9372           Modified all related calls.
9373
9374 2005-05-26  Raja R Harinath  <rharinath@novell.com>
9375
9376         Improve user-defined conversion handling.
9377         * convert.cs (GetConversionOperators): Rewrite.  Return only the
9378         applicable operators.
9379         (AddConversionOperators): New.  Helper for GetConversionOperators.
9380         (FindMostEncompassedType, FindMostEncompassingType): Verify that
9381         there is only one most encompassed/encompassing type.
9382         (FindMostSpecificSource, FindMostSpecificTarget): Remove
9383         "applicable operator" handling.
9384         (UserConversion): Move cache here from GetConversionOperators.
9385         Directly cache the chosen operator, rather than the whole
9386         MethodGroup.
9387         (ExplicitNumericConversion): Fix buggy implementation of Decimal
9388         case.  Allow conversion of decimal to sbyte and byte too.
9389         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
9390         New static methods.  Used to avoid allocating EmptyExpressions in
9391         convert.cs.
9392
9393 2005-05-24  Duncan Mak  <duncan@novell.com>
9394
9395         * ecore.cs (CastFromDecimal): New class for casting a decimal to
9396         another class, used in Convert.ExplicitNumericConversion.
9397         (CastToDecimal): New class, similar to above, but casts to
9398         System.Decimal, used in Convert.ImplicitNumericConversion and also
9399         in explicit convesion from double/float to decimal.
9400
9401         * convert.cs (ImplicitNumericConversion): Handle implicit
9402         conversions to System.Decimal.
9403         (ExplicitNumericConversion): handle explicit conversions to
9404         System.Decimal.
9405
9406         This fixes #68711.
9407         
9408 2005-05-20  Miguel de Icaza  <miguel@novell.com>
9409
9410         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
9411         know the type at this stage, just break through.   Fixes #75008 
9412
9413 2005-05-19  Martin Baulig  <martin@ximian.com>
9414
9415         * delegate.cs
9416         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
9417         to disable error reporting.
9418
9419         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
9420         here since we don't want to report an error; see the new test-336.cs.
9421
9422 2005-05-19  Raja R Harinath  <rharinath@novell.com>
9423
9424         * statement.cs (ToplevelBlock.GetParameterReference)
9425         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
9426         Move here from class Block.
9427         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
9428         * expression.cs (ParameterReference.DoResolveBase): Likewise.
9429
9430 2005-05-18  Martin Baulig  <martin@ximian.com>
9431
9432         Fix #74978.
9433
9434         * flowanalysis.cs
9435         (FlowBranching.Reachability): Add non-static public And() and Or()
9436         methods.
9437         (FlowBranchingSwitch): New class; do the `break_origins' thing
9438         like in FlowBranchingLoop.
9439         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
9440         reachability, not just locals and parameters.
9441         (FlowBranching.MergeChild): Remove some of the hacks for loop and
9442         switch; MergeBreakOrigins() now takes care of that.
9443
9444 2005-05-18  Martin Baulig  <martin@ximian.com>
9445
9446         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9447         a loop and may leave it, reset the barrier; fixes #74974.
9448
9449 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
9450         
9451         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
9452         is back.
9453         
9454         * cs-parser.jay: Catch more lexical errors.
9455         
9456         * report.cs: Add one more Error method.
9457         
9458         * rootcontext.cs,
9459         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
9460
9461 2005-05-17  Martin Baulig  <martin@ximian.com>
9462
9463         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
9464         #70970. 
9465
9466 2005-05-16  Raja R Harinath  <rharinath@novell.com>
9467
9468         Fix test-382.cs.  Emit values of decimal constants.
9469         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
9470         Carved out of ...
9471         (TypeContainer.AddField): ... this.
9472         (TypeContainer.EmitFieldInitializers): Allow the list of fields
9473         with initializers to include 'Const's.
9474         (ClassPart.RegisterFieldForInitialization): Forward to
9475         PartialContainer.
9476         * const.cs (Const.Const): Pass initializer to base class.
9477         (Const.Define): In case of decimal constants, register them for
9478         initialization in a static constructor.
9479
9480 2005-05-14  Martin Baulig  <martin@ximian.com>
9481
9482         * statement.cs (Block.Resolve): Correctly handle unreachable code;
9483         do not call ResolveUnreachable() on unreachable statements in
9484         here, see the comment in the source code.
9485
9486 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9487
9488         Fix #74934.
9489         * expression.cs (BinaryResolveOperator): If one of the operands of
9490         an equality comparison is 'null' and the other is a pointer type,
9491         convert the null to a NullPointer.
9492         * convert.cs (ImplicitReferenceConversion): If the expression is a
9493         NullLiteral and the target type is a pointer type, return a
9494         NullPointer instead.
9495         (ImplicitConversionStandard): Likewise.
9496
9497 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
9498         
9499         * cs-parser.jay: Set readonly context based on special constructs.
9500         
9501         * expression.cs (LocalVariableReference.DoResolveBase): Improved
9502         readonly variable error handling.
9503         
9504         * rootcontext.cs (EmitCode): Don't verify members when error
9505         occurred.
9506         
9507         * statement.cs (LocalInfo): Add reaodnly context information.
9508         (SetReadOnlyContext, GetReadOnlyContext): New methods.
9509
9510 2005-05-13  Raja R Harinath  <rharinath@novell.com>
9511
9512         * statement.cs (Block.Resolve): Revert change below.  Modify fix
9513         for #74041 to initialize 'resolved' to false only for explicit
9514         blocks.  Fixes #74873.
9515
9516 2005-05-12  Raja R Harinath  <harinath@gmail.com>
9517
9518         Fix #74920.
9519         * typemanager.cs (unmanaged_enclosing_types): New.
9520         (IsUnmanagedType): Avoid infloops by using
9521         'unmanaged_enclosing_types' to talk with recursive invocations.
9522
9523 2005-05-13  Martin Baulig  <martin@ximian.com>
9524
9525         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
9526         instance variable, not a local.  Fix #74873.
9527         (Block.ResolveUnreachable): Set it to true here.
9528
9529 2005-05-11  Duncan Mak  <duncan@novell.com>
9530
9531         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
9532         continuing to process for 'arg'.
9533         (handle_preprocessing_directive): Check the argument of the #endif
9534         directive and report error CS1025 if there are any trailing
9535         characters.
9536
9537         According to the C# spec, having even whitespace after the #endif
9538         directive is illegal; however, because we call arg.TrimEnd ()
9539         beforehand, we have the same behavior as csc, allowing whitespace
9540         after the directive.
9541
9542         Fixes #74892.
9543
9544 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
9545
9546         Fix #74863.
9547         
9548         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
9549         (Constructor.GetObsoleteAttribute): Implemented correctly.
9550
9551 2005-05-10  Martin Baulig  <martin@ximian.com>
9552
9553         * support.cs (ReflectionParameters.ParameterModifier): Use
9554         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
9555         and `ParameterAttributes.In'.  Fixes #74884.
9556
9557 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
9558
9559         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
9560         
9561         * expression.cs (Argument.GetParameterModifier): Turned to property.
9562         (Invocation.Error_InvalidArguments): Add more descriptive errors.
9563         
9564         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
9565         its C# equivalent.
9566         
9567 2005-05-09  Raja R Harinath  <rharinath@novell.com>
9568
9569         Fix #74852.
9570         * decl.cs (MemberCache.AddMethods): Register override methods,
9571         rather than non-override methods.
9572         * typemanager.cs (RegisterOverride): New.
9573         (IsOverride): Update.
9574
9575 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
9576
9577         Fix #73105.
9578         
9579         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
9580         recursive declaration.
9581         
9582         * statement.cs (Block.ResolveMeta): Report any error in resolving.
9583         
9584 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
9585
9586         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
9587         
9588         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
9589
9590 2005-05-05  Raja R Harinath  <rharinath@novell.com>
9591
9592         Fix #74797.
9593         * decl.cs (DeclSpace.FamilyAccessible): 
9594         Use TypeManager.IsNestedFamilyAccessible.
9595
9596         Fix reopened #64812.
9597         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
9598         internal'.
9599
9600 2005-05-04  Raja R Harinath  <rharinath@novell.com>
9601             Abin Thomas  <projectmonokochi@rediffmail.com>
9602             Anoob V E  <projectmonokochi@rediffmail.com>
9603             Harilal P R  <projectmonokochi@rediffmail.com>
9604
9605         Fix #64812.
9606         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
9607         allow access to all static members.
9608
9609 2005-05-04  Martin Baulig  <martin@ximian.com>
9610
9611         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
9612
9613 2005-05-04  Martin Baulig  <martin@ximian.com>
9614
9615         Fix #74655.
9616
9617         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
9618         section at the end; make things work if `default' is not the last
9619         section.        
9620
9621 2005-05-04  Martin Baulig  <martin@ximian.com>
9622
9623         Fix #70400.
9624
9625         * statement.cs (Switch): Replaced the `got_default' field with a
9626         `default_section' one.
9627         (Switch.CheckSwitch): Set `default_section' here.
9628         (Switch.Resolve): If we're a constant switch and the constant is
9629         not found, use the default section.
9630
9631 2005-05-03  Martin Baulig  <martin@ximian.com>
9632
9633         * expression.cs (ArrayAccess.EmitGetLength): New public method.
9634
9635         * statement.cs (Foreach.ArrayForeach): New nested class.
9636         (Foreach.TemporaryVariable): New nested class.
9637         (Foreach.EmitArrayForeach): Removed; this is now in the new
9638         ArrayForeach class.
9639
9640 2005-05-03  Raja R Harinath  <rharinath@novell.com>
9641
9642         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
9643         more conservative.
9644         (VerifyPendingMethods): Revert change below.
9645
9646         * typemanager.cs (IsOverride, RegisterNonOverride): New.
9647         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
9648         that used to trigger warning -28.  Remove warning -28.
9649         * expression.cs (Invocation.OverloadResolve): Use
9650         TypeManager.IsOverride to distinguish override methods.
9651
9652         Fix #74773.
9653         * pending.cs (VerifyPendingMethods): If a base type implements the
9654         requested interface, don't bother checking individual methods of
9655         the base type.  As a side-effect, this prevents the creation of
9656         unnecessary proxies.
9657
9658 2005-05-02  Martin Baulig  <martin@ximian.com>
9659
9660         Fix #70182.
9661
9662         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9663         Also `And' the locals if the old vector is null.
9664         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
9665         null; in this case we basically reset all the variables.        
9666
9667 2005-05-02  Martin Baulig  <martin@ximian.com>
9668
9669         Fix #74529.
9670
9671         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
9672         Added `FlowBranching branching' argument; always `and' the
9673         variables instead of `or'ing them unless we're an infinite loop.
9674
9675         * statement.cs (While.Resolve): Create a new sibling unless we're
9676         infinite.       
9677
9678 2005-05-02  Martin Baulig  <martin@ximian.com>
9679
9680         Fix #70140.
9681
9682         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
9683         arguments; use it instead of creating a new TopLevelBlock.
9684         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
9685         our ConstructorInitializer.
9686
9687         * statement.cs
9688         (TopLevelBlock.TopLevelBranching): New public property.
9689         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
9690         and create our `TopLevelBranching'.
9691
9692         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
9693         anonymous method host, use `block.TopLevelBranching' rather than
9694         creating a new branching.
9695
9696 2005-04-20  Miguel de Icaza  <miguel@novell.com>
9697
9698         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
9699         a ScopeInfo, if any of the current children is a child of the new
9700         entry, move those children there.
9701
9702 2005-04-30  Martin Baulig  <martin@ximian.com>
9703
9704         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
9705         at the beginning of a SwitchSection.  Fix #73335.
9706
9707 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
9708
9709         Fix #74378
9710         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
9711         
9712         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
9713         (FieldExpr.DoResolve): Obsolete members are ignored for field
9714         initializers.
9715         
9716 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
9717
9718         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
9719         of arrays detection.
9720
9721         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
9722         verification.
9723         (Field.VerifyClsCompliance): Volatile fields are not compliant.
9724
9725         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
9726         arrays report.
9727
9728 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
9729
9730         * cs-parser.jay: Use the prefered version of -unsafe in error
9731         message.
9732
9733 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
9734
9735         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
9736         circumstances.
9737
9738 2005-04-20  John Luke  <john.luke@gmail.com>
9739
9740         * driver.cs: fix typo in error message, --outout to --output
9741
9742 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
9743
9744         * codegen.cs (InRefOutArgumentResolving): New field.
9745         
9746         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
9747         fields outside contructor.
9748         
9749         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
9750         
9751 2005-04-19  Miguel de Icaza  <miguel@novell.com>
9752
9753         * anonymous.cs (CaptureContext.EmitParameterInstance): The
9754         parameter code was not completed ever, so it was not as up-to-date
9755         as local variables.  Must finish it.
9756
9757         The bug fix was to compare the Toplevel of the block, not the
9758         current block.  Thanks for Ben for pointing this out. 
9759
9760 2005-04-19  Raja R Harinath  <rharinath@novell.com>
9761
9762         * decl.cs (AddMethods): Use the declaring type of the problem
9763         method to determine if we want to squash a warning.
9764
9765 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
9766
9767         * attribute.cs: Removed debug output.
9768
9769         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
9770         
9771         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
9772         Report.Stderr.
9773         
9774 2005-04-18  Raja R Harinath  <rharinath@novell.com>
9775
9776         Fix #74481.
9777         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
9778         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
9779         all null comparisons against reference types.
9780
9781 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
9782
9783         Fix# 74565
9784         * class.cs (TypeContainer.CircularDepException) New nested
9785         exception class.
9786         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
9787         (TypeContainer.DefineType): Removed error, reset InTransit before
9788         exit.
9789         (Class.DefineType): Throw exception when is in Transit.
9790         Catch exception and report error.
9791         (Struct.DefineType): Throw exception when is in Transit.
9792         Catch exception and report error.
9793         (Interface.DefineType): Throw exception when is in Transit.
9794         Catch exception and report error.
9795
9796         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
9797         handle nested exception handlers.
9798
9799         * flowanalysis.cs (InTryWithCatch): New method, search for try with
9800         a catch.
9801
9802         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
9803         InFinally and InCatch storage.
9804
9805         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
9806         (Catch.Resolve): Set and Restore ec.InCatch.
9807         (Try.Resolve): Set and Restore ec.InFinally.
9808         (Try.HasCatch): True when try has catch.
9809
9810 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
9811
9812         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
9813           for the same event member, so exclude such cases from warning 419.
9814           Fixed bug #74633.
9815
9816 2005-04-16  Miguel de Icaza  <miguel@novell.com>
9817
9818         * expression.cs (Binary.ResolveOperator): Apply patch from John
9819         Luke to fix bug 59864: operators &, | and ^ on enumerations
9820         require that the same enum type on both sides.
9821
9822         * driver.cs: Add warnings to old flag usage, this is to assist
9823         people who produce Makefiles and hope that the Makefiles will be
9824         used on Windows.
9825
9826         * class.cs (TypeContainer.EmitType): Moved the definition of the
9827         special $PRIVATE$ field from the resolve phase to the Emit phase.
9828         During resolve we do not know if we are a struct with
9829         HasExplicitLayout, we know this only after the attributes for the
9830         type are emitted.
9831
9832         Set the FieldOffset to zero on the dummy field that we create for
9833         the class.   Fixes 74590.
9834
9835 2005-04-16  Raja R Harinath  <rharinath@novell.com>
9836
9837         Fix #73834.
9838         * ecore.cs (PropertyExpr.resolved): New.
9839         (DoResolve): Use it to handle a case of double resolution here.
9840         Handle a case of identical-name-and-type-name.
9841         * expression.cs (ArrayCreation.CheckIndices): Avoid double
9842         resolution by storing the results of expression resolution back
9843         into the "probes" array.
9844
9845 2005-04-15  Raja R Harinath  <rharinath@novell.com>
9846
9847         Fix cs0208-7.cs and cs0208-8.cs.
9848         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
9849         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
9850         error reporting to point out the reason a struct is not unmanaged.
9851
9852 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
9853
9854         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
9855           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
9856
9857 2005-04-13  Raja R Harinath  <rharinath@novell.com>
9858
9859         Fix #74528.
9860         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
9861         IdenticalNameAndTypeName here.
9862         (EventExpr.InstanceResolve): Likewise.
9863
9864 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
9865
9866         C# 2.0 DefaultCharSetAttribute implementation
9867         
9868         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
9869         which allows us to set GlobalNamespace for every resolve.
9870         (Attribute.ResolveArguments): Cut from Resolve.
9871         (Attribute.GetCharSetValue): Returns CharSet named argument.
9872         (Attribute.DefinePInvokeMethod): Gets default charset from
9873         module settings.
9874         (GlobalAttribute.ResolveAsTypeStep): Override.
9875         (GlobalAttribute.ResolveArguments): Override.
9876         
9877         * class.cs (TypeAttr): Is protected.
9878         
9879         * codegen.cs (ModuleClass.DefaultCharSet): New member.
9880         (ModuleClass.DefaultCharSetType): New memeber.
9881         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
9882         
9883         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
9884         charset from module.
9885         
9886         * delegate.cs (TypeAttr): Override.
9887         (Delegate.DefineType): Use this TypeAttr.
9888         
9889         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
9890         at very early stage (before types are defined) to resolve model
9891         module attributes. It will probably not work with corlib but it
9892         should be ok.
9893         
9894         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
9895         charset from module.
9896         
9897         * typemanager.cs (default_charset_type): New type.
9898
9899 2005-04-13  Raja R Harinath  <rharinath@novell.com>
9900
9901         * decl.cs (MemberCache.AddMethods): Don't warn if
9902         System.Object.Finalize has buggy MethodAttributes.
9903
9904         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
9905         removed below.
9906
9907 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
9908
9909         * doc.cs : detect ambiguous reference to overloaded members.
9910           Fixed bug #71603. MS 1.1 csc does not detect it.
9911
9912 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
9913
9914         * doc.cs : delegates must not be referenced with parameters.
9915           Fixed bug #71605.
9916
9917 2005-04-12  Miguel de Icaza  <miguel@novell.com>
9918
9919         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
9920
9921 2005-04-10  Miguel de Icaza  <miguel@novell.com>
9922
9923         * driver.cs (MainDriver): Stop processing if the CLS stage found
9924         errors. 
9925
9926         (CompilerCallableEntryPoint.InvokeCompiler): Always
9927         reset after execution;   Take a TextWriter argument for the
9928         output.
9929
9930         * report.cs: Use the error stream instead of hardcoding stderr. 
9931
9932 2005-04-09  Miguel de Icaza  <miguel@novell.com>
9933
9934         * class.cs: Reduce code paths to test, too small of an
9935         optimization to make it worth the extra testing.  Always perform
9936         it. 
9937
9938 2005-04-08  Raja R Harinath  <rharinath@novell.com>
9939
9940         Fix #74510.
9941         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
9942         operators that had errors reported on them.
9943
9944 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
9945
9946         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
9947         argument types.
9948         (Attribute.Resolve): Add named argument type checking.
9949         
9950         * class.cs (FixedField.Define): Use IsPrimitiveType
9951         
9952         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
9953         
9954         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
9955         unsafe parameter types.
9956         
9957         * statement.cs (Using.ResolveExpression): Add better error description.
9958         
9959         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
9960         
9961 2005-04-08  Raja R Harinath  <rharinath@novell.com>
9962
9963         Fix #74484.
9964         * attribute.cs (Attribute.GetAttributeUsage): Resolve
9965         AttributeUsageAttribute in the emitcontext of the attribute class,
9966         not in the emitcontext of the attributable entity it was attached to.
9967         * cs-parser.jay: Use 'current_class', not 'current_container',
9968         when creating a GlobalAttribute.
9969
9970 2005-04-08  Alp Toker  <alp@atoker.com>
9971
9972         * pending.cs: The fix to #58413 failed to compile methods implementing
9973         interfaces with/without params modifiers and vice versa, even though
9974         params modifiers aren't part of the signature. Make the modifier check
9975         less strict as in csc.
9976
9977 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
9978             Anoob V E  <projectmonokochi@rediffmail.com>
9979             Harilal P R  <projectmonokochi@rediffmail.com>
9980
9981         Fix #58413.
9982         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
9983         modifiers of pending methods.
9984         (PendingImplementation.PendingImplementation): Initialize it.
9985         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
9986         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
9987         with ParameterData.  Add check for modifiers.
9988         * class.cs (MethodData.Define): Update to changes.
9989
9990 2005-04-07  Raja R Harinath  <rharinath@novell.com>
9991
9992         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
9993
9994 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
9995
9996         * class.cs (PropertyMethod.Define): Check private accessor in abstract
9997         property.
9998         
9999         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
10000         
10001         * rootcontext.cs,
10002         * typemanager.cs: Registered RequiredAttributeAttribute.
10003         
10004 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
10005
10006         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
10007         Warning CS0169 is back at level 3.
10008         (IMethodData.SetMemberIsUsed): New method.
10009         
10010         * decl.cs (IsUsed): New value; moved from FieldBase.Status
10011         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
10012         
10013         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
10014
10015         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
10016         contants.
10017         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
10018         is used.
10019         
10020         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
10021         is used.
10022         
10023         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
10024         to avoid the problems with nested types.
10025
10026 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
10027             Anoob V.E  <projectmonokochi@rediffmail.com>
10028             Harilal P.R  <projectmonokochi@rediffmail.com>
10029             Raja R Harinath  <rharinath@novell.com>
10030
10031         Fix #73820.
10032         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
10033         attribute.
10034         * typemanager (GetConstructor): Make public.
10035
10036 2005-04-05  John Luke  <john.luke@gmail.com>
10037             Raja R Harinath  <rharinath@novell.com>
10038
10039         Fix #62232.
10040         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
10041         struct too.  Return false quicker in a few cases.
10042         (VerifyUnManaged): Use it.
10043
10044 2005-04-05  Raja R Harinath  <rharinath@novell.com>
10045
10046         Fix #74041.
10047         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
10048         not 'unreachable_seen'.
10049
10050 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
10051
10052         * attribute.cs (Attribute.GetValue): Removed unused.
10053         
10054         * codegen.cs (CodeGen.TrimExt): Removed unused.
10055         
10056         * cs-parser.jay (output): Removed unused.
10057         
10058         * cs-tokenizer.cs (hex_digits): Removed unused.
10059         
10060         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
10061         
10062         * expression.cs (Indirection.LoadExprValue): Removed unused.
10063         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
10064         
10065         * iterators.cs (Iterator.param_types): Removed unused.
10066         
10067         * statement.cs (Goto.block): Removed unused.
10068         (ToplevelBlock.did): Removed unused.
10069         (Switch.ResolveConstantSwitch): Removed unused.
10070
10071 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
10072
10073         * rootcontext.cs: Allow mcs to bootstrap with the compilation
10074         resetting thingy.
10075
10076 2005-04-01  Raja R Harinath  <rharinath@novell.com>
10077
10078         Fix #74232 and cs0208-3.cs.
10079         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
10080         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
10081         unmanaged type.  Don't use FieldBuilders when 't' is a
10082         TypeBuilder.  Use ModFlags and MemberType fields.
10083         * class.cs (MemberBase.member_type): Rename from MemberType.
10084         (MemberBase.MemberType): New property.  Determines member_type on
10085         demand.
10086         (MemberBase.DoDefine): Don't initialize MemberType here.
10087         (FieldMember.Define): Likewise.
10088
10089 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
10090
10091         Fix #74241
10092         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
10093         Attributes are emitted there.
10094         
10095 2005-04-01  Raja R Harinath  <rharinath@novell.com>
10096
10097         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
10098         keyword in 'partial enum' too.
10099         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
10100         is not allowed).
10101         Report from Kamil Skalski <nazgul@omega.pl>.
10102
10103         Fix #74309.
10104         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
10105         have partial containers too.
10106
10107         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
10108         in block' checks to Block.CheckInvariantMeaningInBlock.
10109         * statement.cs (Block.GetKnownVariableInfo): Make private.
10110         (Block.IsVariableUsedInChildBlock): Remove.
10111         (Block.IsVariableUsedInBlock): Likewise.
10112         (Block.CheckInvariantMeaningInBlock): New.  Show location of
10113         conflicting declaration.
10114         (Block.AddVariable): Make error messages less long-winded and more
10115         specific.  Show location of conflicting declaration.
10116         * parameter.cs (Parameters.Location): New readonly property.
10117
10118 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10119
10120         Clean up semantics of invoking ResolveMemberAccess.
10121         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
10122         can have an instance, ensure that we pass in a non-TypeExpression
10123         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
10124         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
10125         argument.  Update to changes and simplify.
10126         (FieldExpr.Emitinstance): Remove CS0120 check.
10127         (PropertyExpr.EmitInstance): Likewise.
10128         * expression.cs (Argument.Resolve): Likewise.
10129         (Invocation.DoResolve): Update to changes in semantics of
10130         InstanceExpression.
10131
10132 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
10133
10134         Fix #74241
10135         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
10136         customization.
10137         
10138         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
10139
10140 2005-03-31  Raja R Harinath  <rharinath@novell.com>
10141
10142         Fix difference in behaviour with commandline invocation.
10143         * driver.cs (Driver.Reset): New.
10144         (CompilerCallableEntryPoint): Call it.
10145
10146         * statement.cs (If.Resolve): Avoid spurious "uninitialized
10147         variable" warnings if the boolean expression failed to resolve.
10148
10149 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
10150
10151         * attribute.cs: Fix the union of several permissions when some of them
10152         are unrestricted (so the result isn't an unrestricted permission set).
10153         Fix #74036.
10154
10155 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10156
10157         * ecore.cs (MemberExpr): New class.  Convert from interface
10158         IMemberExpr.
10159         (MemberExpr.ResolveMemberAccess): Refactor and move here from
10160         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
10161         error checks.
10162         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
10163         (MethodGroupExpr.IsExplicitImpl): Remove.
10164         (Expression.GetFieldFromEvent): Remove.
10165         (SimpleName.MemberStaticCheck): Remove.
10166         (SimpleName.DoSimpleNameResolve): Update to changes.
10167         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
10168         (MemberAccess.IdenticalNameAndTypeName): Remove.
10169         (MemberAccess.error176): Move to MemberExpr.
10170         (MemberAccess.DoResolve): Update to changes.
10171         (BaseAccess.DoResolve): Likewise.
10172
10173 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
10174
10175         C# 2.0 Conditional attribute class implementation
10176         
10177         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
10178         Analyzes class whether it has attribute which has ConditionalAttribute
10179         and its condition is not defined.
10180         
10181         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
10182         (Class.IsExcluded): New method. Search for at least one defined
10183         condition in ConditionalAttribute of attribute class.
10184
10185 2005-03-30  Raja R Harinath  <rharinath@novell.com>
10186
10187         * ecore.cs (PropertyExpr): Derive from Expression, not
10188         ExpressionStatement.
10189         (PropertyExpr.EmitStatement): Remove.
10190
10191 2005-03-29  Raja R Harinath  <rharinath@novell.com>
10192
10193         Fix #74060.
10194         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
10195         internal field "value__" of an enum be private.  The examples for
10196         "value__" that I found on MSDN all used FieldAttributes.Private.
10197
10198         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
10199         Don't mention IL method attribute names.
10200
10201         Fix #47991.  Remove a TODO.
10202         * statement.cs (Block.Toplevel): Make into a field.
10203         (Block.Parameters): Move into ToplevelBlock.
10204         (Block.known_variables): Rename from child_variable_names.
10205         (Block.Block): Remove variants that take Parameters.  Initialize
10206         'Toplevel' with the immediately surrounding toplevel block.
10207         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
10208         LocalInfo parameter.
10209         (Block.GetKnownVariableInfo): New.
10210         (Block.IsVariableNameUsedInChildBlock): Update.
10211         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
10212         the block, even though it may not be in scope.
10213         (Block.AddVariable): Remove Parameters parameter.  Use
10214         Toplevel.Parameters instead.
10215         (Block.AddConstant): Remove Parameters parameter.
10216         (Block.GetParameterReference): Update to use Toplevel.Parameters.
10217         (Block.IsParamaterReference): Likewise.
10218         (Block.IsLocalParameter): Likewise.  Simplify a lot.
10219         (ToplevelBlock.Parameters): New.  Moved from Block.
10220         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
10221         initialize Parameters to a non-null value.
10222         * cs-parser.jay: Update to changes.
10223         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
10224         simple names that mean different things in the same block.  Use
10225         Block.IsVariableNameUsedInBlock.
10226
10227 2005-03-28  Raja R Harinath  <rharinath@novell.com>
10228
10229         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
10230         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
10231         GetTypeHandle.  It is possible for a reflected type to derive from
10232         a TypeBuilder (e.g., int[] derives from the TypeBuilder
10233         System.Array during mscorlib compilation).
10234         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
10235         contain a method_hash, don't create one either.  Don't create a
10236         deep copy of the base cache's method_hash.
10237         (MemberCache.SetupCache): Rename back from DeepCopy.
10238         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
10239         already initialized.  If we see an override function, add its
10240         underlying base virtual function to the member_hash too.
10241
10242         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
10243
10244 2005-03-26  Raja R Harinath  <harinath@acm.org>
10245
10246         Fix #73038.
10247         * assign.cs (Assign.DoResolve): When the RHS of an assignment
10248         fails to resolve, ensure that the LHS is still resolved as an
10249         lvalue.
10250
10251 2005-03-25  Raja R Harinath  <harinath@acm.org>
10252
10253         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
10254         ec.ContainerType.
10255         (Enum.current_ec): Remove.
10256         (Enum.LookupEnumValue): Remove EmitContext argument.
10257         Just uses the one created during DefineType.
10258         (Enum.FindMembers): Update.
10259         * expression.cs (MemberAccess.DoResolve): Update.
10260
10261 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
10262
10263         * assign.cs (Assign.DoResolve): Check for CS1717 when
10264         source and target are same (uses Equals).
10265
10266         * expression.cs (LocalVariableReference, ParameterReference,
10267         This): Implemented Equals, GetHashCode.
10268
10269         * statement.cs (Block.GetParameterReference): Removed useless
10270         local variable.
10271
10272 2005-03-22  Raja R Harinath  <rharinath@novell.com>
10273
10274         Fix cs0128.cs
10275         * statement.cs (Block.AddVariable): Ensure that we skip implicit
10276         blocks before deciding whether the error is cs0136 or cs0128.
10277
10278         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
10279         (using_alias_directive, using_namespace_directive): Pass
10280         MemberName, not an expression to Namespace.UsingAlias and
10281         Namespace.Using.
10282         (MakeName): Use the MemberName of the namespace.
10283         * namespace.cs (Namespace.MemberName): New.
10284         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
10285         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
10286         Likewise.
10287         * decl.cs (MemberName.Name): Make readonly.
10288         (MemberName.FromDotted): New "constructor".
10289         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
10290         (MemberCore.Name): Compute from MemberName on demand.
10291         (MemberCore.SetMemberName): Provide a way to change the
10292         MemberName.
10293         (MemberCore.AddToContainer): Don't take a fullname parameter.
10294         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
10295         fully qualified name of the container to the member name.
10296         (TypeContainer.AddToTypeContainer): Use a fully qualified name
10297         only if the type is a member of the root container.
10298         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
10299         MemberName.Left rather than searching for an embedded ".".
10300         (PartialContainer.CreatePart): Update to changes in RootContext.
10301         (MemberBase.ShortName): Turn into a property.  Use
10302         MemberCore.SetMemberName.
10303         (MemberBase.ExplicitInterfaceName): Remove.
10304         (MemberBase.UpdateMemberName): Remove.
10305         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
10306         (PropertyBase.SetMemberName): New override.
10307         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
10308         (Tree.GetDecl): New.
10309         (Tree.AllDecls): Rename from Decls.
10310         * attribute.cs, enum.cs, report.cs: Update to changes.
10311         * driver.cs (MainDriver): Use MemberName.FromDotted on
10312         RootContext.MainClass.
10313
10314 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
10315
10316         * class.cs (FixedField.Define): Check for CS1664 and more sanity
10317         checks.
10318
10319         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
10320
10321 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
10322
10323         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
10324         property accessor modifiers.
10325
10326         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
10327         fixed buffer attribute (CS1716).
10328         (PropertyMethod.HasCustomAccessModifier): When property accessor
10329         has custom modifier.
10330
10331         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
10332         modifiers.
10333         (PropertyExpr.DoResolveLValue): Add CS0272.
10334
10335 2005-03-17  Miguel de Icaza  <miguel@novell.com>
10336
10337         * convert.cs: When converting to a pointer, use the proper Conv.U
10338         or Conv.I depending on the source data type.
10339
10340         * cs-tokenizer.cs: Make the size for large decimal constants,
10341         fixes #72957.
10342
10343 2005-03-17  Martin Baulig  <martin@ximian.com>
10344
10345         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
10346         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
10347
10348 2005-03-17  Martin Baulig  <martin@ximian.com>
10349
10350         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
10351         to bool so we can return an error condition.
10352         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
10353         returned an error.
10354
10355 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
10356
10357         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
10358         attributes.
10359
10360 2005-03-16  Raja R Harinath  <rharinath@novell.com>
10361
10362         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
10363         Refactor to avoid traversing the list of assemblies, and to avoid
10364         string concatenation.
10365         * typemanager.cs (guid_attr_type): Remove.
10366         (negative_hits, pointers, references): Remove hashes.
10367         (type_hash): New.
10368         (GetConstructedType): New.  Uses type_hash to handle constructed
10369         types (arrays, references, pointers).
10370         (GetReferenceType, GetPointerType): Use it.
10371         (GetNestedType): New.  Uses type_hash to handle nested types of
10372         reflected types.
10373         (LookupType, LookupTypeDirect): Remove.
10374         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
10375         'types' hash and LookupTypeReflection directly.
10376         (params_string, params_object): Use GetConstructedType.
10377         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
10378         top-level types.
10379         (Namespace.Lookup): Use cached_types.
10380         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
10381         provided by old TypeManager.LookupType.
10382         * rootcontext.cs (MakeFQN): Remove.
10383         * decl.cs (DeclSpace.MakeFQN): Likewise.
10384         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
10385         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
10386         TypeManager.GetConstructedType.
10387         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
10388
10389 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
10390
10391         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
10392         indexers.
10393
10394         * cs-parser.jay: Reports CS1527 for any namespace element.
10395
10396         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
10397         Added CS0407.
10398
10399         * expression.cs (ParameterReference.IsAssigned): Changed error to
10400         CS0269.
10401         (Error_WrongNumArguments): Moved CS0245 detection here.
10402
10403         * statement.cs (Return.Resolve): Add CS1622 report.
10404
10405 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
10406
10407         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
10408
10409 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
10410
10411         * attribute.cs expression.cs: Get rid of some allocations.
10412
10413 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
10414
10415         * doc.cs : just eliminate the latest change.
10416
10417 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10418
10419         * doc.cs : commented out the latest change. It breaks xml-030.cs
10420
10421 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10422
10423         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
10424           fail. So invoke CreateType() in FindDocumentedType().
10425
10426 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
10427
10428         * cs-tokenizer.cs : added IsKeyword().
10429         * doc.cs : Detect keyword incorrectly used as identifier.
10430           Allow identifiers prefixed by @.
10431
10432 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
10433
10434         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
10435         It caused exception in namespace resolving (again!).
10436         
10437         * class.cs (Class.ctor): Removed exit.
10438         (PropertyMethod.ctor): ditto.
10439         
10440         * codegen.cs (Codegen.Reset): Reset static data.
10441         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
10442         
10443         * cs-tokenizer.cs (Cleanup): Removed.
10444         
10445         * driver.cs (GetSystemDir): Rewrote to one line command.
10446         It caused problem with unloaded dynamic modules.
10447         (UnixParseOption): Removed Exit.
10448         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
10449         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
10450         Now can be mcs used as library.
10451         
10452         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
10453         empty location.
10454         
10455         * location.cs (Reset): Reset static data.
10456         
10457         * namespace.cs (Reset): Reset static data.
10458         
10459         * report.cs (Report.Reset): Reset static data.
10460         
10461         * rootcontext.cs (RootContext.Reset): Reset static data.
10462         
10463         * tree.cs (RootTypes.ctor): Use Location.Null
10464         
10465         * typemanager.cs (TypeManager.Reset): Reset static data.
10466         (CoreLookupType): Removed Exit.
10467         (TypeHandle.Reset): Reset static data.
10468         
10469 2005-03-10  Raja R Harinath  <rharinath@novell.com>
10470
10471         Fix #73516.
10472         * typemanager.cs (ComputeNamespaces): Import namespaces from
10473         referenced modules too.
10474
10475 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10476
10477         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
10478         than '.'.
10479
10480 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10481
10482         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
10483         enclosing DeclSpace.  This ensures that a name-lookup populates
10484         more caches and there are fewer 'TypeExpression's.  Carve out
10485         nested type lookup into ...
10486         (LookupNestedTypeInHierarchy): ... this.
10487
10488 2005-03-09  Raja R Harinath  <rharinath@novell.com>
10489
10490         Clean up a few partial-class semantics.  
10491         Fixes test-357.cs and cs1618-2.cs.
10492         * cs-parser.jay (struct_declaration): Use 'current_class' as
10493         parent of newly-created struct.  Remove call to Register ().
10494         Use 'pop_current_class' to complete handing the current struct.
10495         (interface_declaration): Likewise.
10496         (class_declaration): Likewise.
10497         (enum_declaration): Use 'current_class' as parent of newly created
10498         enum.
10499         (delegate_declaration): Likewise.
10500         (pop_current_class): New function.  This is used to handle closing
10501         up the 'current_class' and 'current_container', and pointing them
10502         to the enclosing class/container.
10503         (CSharpParser): Initialize 'current_class' too.
10504         * decl.cs (MemberCore): Add check for invariant: a partial
10505         container is not a parsed entity, and thus does not enclose any
10506         parsed members.
10507         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
10508         (DeclSpace.BaseTypeExpr): Use it.
10509         (DeclSpace.LookupType): Add check for invariant.
10510         * class.cs (TypeContainer): Add check for invariant: a nested
10511         class should have the same NamespaceEntry as its enclosing class.
10512         (TypeContainer.EmitFieldInitializers): Make virtual.
10513         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
10514         MemberCore.
10515         (TypeContainer.Register): Remove.
10516         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
10517         null.  Use TypeResolveEmitContext for resolving base types and
10518         interfaces.  Move initialization of Parts.TypeBuilder here from
10519         ...
10520         (TypeContainer.DefineNestedTypes): ... here.
10521         (PartialContainer): Take a Namespace not a NamespaceEntry.
10522         (PartialContainer.Create): Don't use Register.  Call the
10523         appropriate Add... function directly.
10524         (ClassPart): Take both the PartialContainer and the enclosing
10525         class as constructor arguments.
10526         (ClassPart.EmitFieldInitializers): Override.
10527         (ClassPart.PartFindNestedTypes): Remove.
10528         (FieldBase.GetInitializerExpression): Resolve the initializer
10529         expression in the emit context of the enclosing class.
10530         * tree.cs (RootTypes): Remove Register ().
10531         
10532 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
10533
10534         * cs-parser.jay: Removed CS0134.
10535         
10536         * driver.cs: Removed CS1901.
10537         
10538         * expression.cs (SizeOf.DoResolve): Don't report CS0233
10539         for predefined types.
10540
10541 2005-03-07  Duncan Mak  <duncan@novell.com>
10542
10543         * codegen.cs (Save):  Catch UnauthorizedAccessException as
10544         well. Fixes bug #73454.
10545
10546 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
10547
10548         * cs-tokenizer.cs (xtoken): Add CS1035.
10549         
10550         * class.cs (MethodData.Define): Add CS0683.
10551         (FieldMember.ctor): Add CS0681.
10552
10553 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10554
10555         * ecore.cs (SimpleName.DoResolve): Rename from
10556         SimpleName.DoResolveAllowStatic.
10557         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
10558         Pass 'intermediate' flag to MemberStaticCheck.
10559         (SimpleName.MemberStaticCheck): Skip "static check" only in case
10560         of "intermediate" lookups via MemberAccess.
10561         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
10562         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
10563
10564 2005-03-07  Raja R Harinath  <rharinath@novell.com>
10565
10566         Fix #73394.
10567         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
10568         slipped in because of variable names that are identical to a
10569         builtin type's BCL equivalent ('string String;', 'int Int32;').
10570         (PropertyExpr.EmitInstance): Likewise.
10571
10572 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
10573
10574         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
10575         
10576         * report.cs (warning_ignore_table): Made public.
10577
10578 2005-03-04  Raja R Harinath  <rharinath@novell.com>
10579
10580         Fix #73282.
10581         * class.cs (MethodData.Emit): Pass 'container' to
10582         container.GetObsoleteAttribute instead of 'container.Parent'.
10583
10584 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
10585
10586         * cs-parser.jay: Add 1534 error test.
10587
10588         * iterators.cs (Yield.CheckContext): Add error 1629.
10589         (Iterator.ctor): Save unsafe modifier.
10590         (MoveNextMethod.DoEmit): Restore unsafe context.
10591
10592         * namespace.cs (UsingAlias): Better error message.
10593
10594 2005-03-03  Dan Winship  <danw@novell.com>
10595
10596         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
10597         the warning message [#73219]
10598
10599 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10600
10601         Fix compile with MCS 1.0.0.0.
10602         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
10603         w_restore to not depend on string constant folding.
10604
10605 2005-03-03  Raja R Harinath  <rharinath@novell.com>
10606
10607         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
10608         CS0246 check to users who passed 'silent = false'.
10609         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
10610         check.
10611         (SimpleName.SimpleNameResolve): Update.
10612         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
10613         (MemberAccess.IdenticalNameAndTypeName): Update.
10614         * doc.cs (FindDocumentedTypeNonArray): Update.
10615
10616 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
10617
10618         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
10619         * parameters.cs (ComputeAndDefineParameters): Remove.
10620         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
10621         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
10622         Use GetParameterInfo.
10623
10624 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
10625
10626         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
10627
10628 2005-03-02  Raja R Harinath  <rharinath@novell.com>
10629
10630         Unify DeclSpace.LookupType and DeclSpace.FindType.
10631         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
10632         is in charge of defining nested types on demand.
10633         (DeclSpace.LookupType): Use it when the current_type is a
10634         TypeBuilder.  Use LookupTypeDirect for reflected types.
10635         (DeclSpace.FindType): Remove.
10636         (DeclSpace.LookupInterfaceOrClass): Likewise.
10637         (DeclSpace.DefineTypeAndParents): Likewise.
10638         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
10639         DeclSpace.LookupType.
10640         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
10641         * typemanager.cs (LookupType): Simplify.
10642         (AddUserType): Remove type from negative_hits.
10643         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
10644         * class.cs (TypeContainer.FindMembers): Move handling of nested
10645         types ...
10646         (TypeContainer.FindMembers_NestedTypes): ... here.
10647         (TypeContainer.FindNestedType): Implement override.
10648         (ClassPart.FindNestedType): Delegate to PartialContainer.
10649         (ClassPart.PartFindNestedType): Looks up the nested types of the
10650         part alone.
10651
10652 2005-03-02  Martin Baulig  <martin@ximian.com>
10653
10654         * class.cs (TypeContainer.DoDefineMembers): We also need a default
10655         static constructor in static classes.
10656
10657 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
10658
10659         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
10660         sizeParamIndex is not specified.
10661
10662 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
10663
10664         Fix #73117
10665         * report.cs (WarningMessage.IsEnabled): Missing null check.
10666
10667 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10668
10669         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
10670         in the fields and not in the properties.
10671
10672 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
10673
10674         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
10675         fields as well.
10676
10677 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10678
10679         * attribute.cs: Small refactoring (improved robustness).
10680         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
10681         (ValidateGuid): Removed.
10682         (Resolve): Removed referenced to above mentioned.
10683         (GetAttributeUsage): Made private and changed to work without
10684         class assistance.
10685         (GetIndexerAttributeValue): Don't crash.
10686         (GetConditionalAttributeValue): Ditto.
10687         (GetClsCompliantAttributeValue): Ditto.
10688         (ExtractSecurityPermissionSet): All attributes exceptions are
10689         error 648.
10690         (GetPropertyValue): New helper.
10691         (GetMethodImplOptions): New method.
10692         (DefinePInvokeMethod): Reuse common code. Implemented handling of
10693         some missing properties.
10694         
10695         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
10696         (Method.ApplyAttributeBuilder): Updated.
10697         
10698         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
10699         exception.
10700
10701 2005-02-28  Raja R Harinath  <rharinath@novell.com>
10702
10703         Fix #73052.
10704         * report.cs (Report.SymbolRelatedToPreviousError): Handle
10705         non-simple types (array, pointer, reference).
10706
10707 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
10708
10709         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
10710
10711         * class.cs (MethodCore.IsDuplicateImplementation): Special error
10712         for operators.
10713         (Method.CheckBase): Catch wrong destructor here.
10714         (MethodData.Define): Add errors 550, 668.
10715
10716         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
10717
10718         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
10719
10720         * pending.cs (VerifyPendingMethods): Add error 551.
10721
10722         * typemanager.cs (CSharpName): Next error report helper.
10723
10724 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
10725
10726         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
10727         attributes. Removed useless attribute double check.
10728         It saves almost 2MBs for corlib.
10729
10730 2005-02-25  Raja R Harinath  <rharinath@novell.com>
10731
10732         Fix #72924.
10733         * statement.cs (ExpressionStatement.Resolve): Make robust to being
10734         called twice in case of error.
10735
10736 2005-02-23  Chris Toshok  <toshok@ximian.com>
10737
10738         Fix compiler portions of #72827.
10739         * statement.cs (Block.Emit): call Begin/EndScope on the
10740         EmitContext instead of the ILGenerator.
10741
10742         * codegen.cs (EmitContext.BeginScope): new method, call
10743         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
10744         we have one.)
10745         (EmitContext.BeginScope): same, but EndScope and CloseScope
10746
10747         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
10748         offset and call the superclass's OpenScope(int) with it.
10749         (SymbolWriter.CloseScope): get the current il
10750         offset and call superclass's CloseScope(int) with it.
10751
10752 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
10753
10754         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
10755         CS1677 for out and ref as well.
10756
10757         * class.cs (Method.Define): Add error CS1599 detection.
10758         
10759         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
10760         
10761         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
10762         
10763         * delegate.cs (Delegate.Define): Add error CS1599 detection.
10764         
10765         * support.cs.cs (ModifierDesc): New helper method.
10766
10767 2005-02-23  Raja R Harinath  <rharinath@novell.com>
10768             Abin Thomas  <projectmonokochi@rediffmail.com>
10769             Anoob V E  <projectmonokochi@rediffmail.com>
10770             Harilal P R  <projectmonokochi@rediffmail.com>
10771
10772         Fix #57851, #72718.
10773         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
10774         MemberLookup (used for error reporting) actually returns a result.
10775         Fix error report number (122, not 112).
10776
10777 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
10778             Anoob V E  <projectmonokochi@rediffmail.com>
10779             Harilal P R  <projectmonokochi@rediffmail.com>
10780
10781         Fix #71134.
10782         * pending.cs (PendingImplementation.GetAbstractMethods):
10783         Find NonPublic members too.
10784
10785 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
10786
10787         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
10788         Fixed error 217.
10789         
10790         * class.cs (MethodCore.CheckMethodAgainstBase):
10791         Add error 239 report.
10792
10793 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10794
10795         Fix #68955.
10796         * expression.cs (Invocation.IsApplicable): Make public.
10797         (Invocation.IsParamsMethodApplicable): Likewise.
10798         * delegate.cs (Delegate.VerifyApplicability): Don't use
10799         Invocation.VerifyArgumentCompat for parameter applicability
10800         testing.  Use Invocation.IsApplicable and
10801         Invocation.IsParamsMethodApplicable.
10802
10803 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
10804
10805         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
10806         
10807         * class.cs (Operator.Define): Add error 217 report.
10808         
10809 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10810
10811         * namespace.cs (UsingEntry.Resolve): Undo change below.
10812
10813 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10814
10815         Fix #72756.
10816         * ecore.cs (Expression.MemberLookupFailed): Add argument to
10817         disable the error message when the extended MemberLookup also
10818         fails.
10819         (Expression.MemberLookupFinal): Update.
10820         (SimpleName.DoSimpleNameResolve): Update.
10821         * expression.cs (MemberAccess.ResolveNamespaceOrType):
10822         Don't use MemberLookupFinal.
10823         (New.DoResolve): Update.
10824         (BaseAccess.CommonResolve): Update.
10825
10826 2005-02-21  Raja R Harinath  <rharinath@novell.com>
10827
10828         Fix #72732.
10829         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
10830         occured previously, don't resolve again.
10831
10832 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
10833
10834         Fix #69949
10835         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
10836         argument. Call ResolveAttributeUsage for unresolved.
10837         when types doesn't match ctor arguments.
10838         
10839         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
10840         for nested attribute classes.
10841         (Class.attribute_usage): Removed.
10842         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
10843         for attribute class.
10844         
10845         * ecore.cs (IsAttribute): Removed.
10846         
10847         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
10848         
10849         * rootcontext.cs (RegisterAttribute): Removed, attributes are
10850         now normal types.
10851         (attribute_types): Removed.
10852         (EmitCode): Global attributes are emited as the latest.
10853
10854 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
10855
10856         * class.cs (EmitFieldInitializers): Don't emit field initializer
10857         for default values when optimilization is on.
10858         
10859         * constant.cs (Constant.IsDefaultValue): New property.
10860         
10861         * driver.cs: Add /optimize handling.
10862         
10863         * constant.cs,
10864         * ecore.cs,
10865         * literal.cs: Implement new IsDefaultValue property.
10866         
10867         * rootcontext.cs (Optimize): New field, holds /optimize option.
10868
10869 2005-02-18  Raja R Harinath  <rharinath@novell.com>
10870
10871         Fix crasher in re-opened #72347.
10872         * namespace.cs (Namespace.Lookup): Return null if
10873         DeclSpace.DefineType returns null.
10874
10875         Fix #72678.
10876         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
10877
10878 2005-02-18  Raja R Harinath  <rharinath@novell.com>
10879
10880         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
10881         now returns null if it cannot resolve to an lvalue.
10882         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
10883         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
10884         returned null.  Remove check for SimpleName.
10885         (EventExpr.DoResolveLValue): New.
10886         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
10887         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
10888         error from ...
10889         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
10890         avoid CS0131 error.
10891         (Unary.ResolveOperator): Move CS0211 check ...
10892         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
10893         CS0131 error.
10894         (Unary.DoResolveLValue): Simplify.
10895         (AddressOf.DoResolveLValue): New.
10896         (ArrayAccess.DoResolveLValue): New.
10897
10898 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
10899
10900         * attribute.cs (Attribute.Resolve): Add arguments casting for
10901         when types doesn't match ctor arguments.
10902
10903 2005-02-16  Raja R Harinath  <rharinath@novell.com>
10904
10905         Fix parts of #63202.
10906         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
10907         lookup of operator in base type.  Ensure that all checks happen
10908         when the operator resolves to an "op_..." method.
10909
10910 2005-02-15  Raja R Harinath  <rharinath@novell.com>
10911
10912         Fix #71992.
10913         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
10914         'ignore_cs0104' parameter.  Pass it to ...
10915         (NamespaceEntry.Lookup): ... this.
10916         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
10917         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
10918         (TypeLookupExpression.DoResolveAsTypeStep): Update.
10919         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
10920         Update.  Request that cs0104 errors be ignored.
10921         (ComposedCast.ResolveAsTypeStep): Update.
10922
10923 2005-02-14  Raja R Harinath  <rharinath@novell.com>
10924
10925         Fix #59209.
10926         * expression.cs (Invocation.BetterFunction): Remove support for
10927         comparing virtual functions and their overrides.
10928         (Invocation.IsOverride): New.
10929         (Invocation.OverloadResolve): Don't consider 'override' functions
10930         during candidate selection.  Store them in a lookaside list.
10931         If the selected method is a 'virtual' function, use the list to
10932         find any overrides that are closer to the LHS type.
10933
10934 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
10935
10936         * expression.cs (New.DoResolve): Add complex core type reduction.
10937         (New.Constantify): Converts complex core type syntax like 'new int ()'
10938         to simple constant.
10939         
10940 2005-02-14  Raja R Harinath  <rharinath@novell.com>
10941
10942         * decl.cs (EntryType.EntryType): New constructor to create an
10943         updated copy of a cache entry.
10944         (MemberCache.AddMethods): Use it.
10945         (MemberCache.ClearDeclaredOnly): Remove.
10946         (MemberCache.MemberCache): Update.
10947
10948 2005-02-11  Miguel de Icaza  <miguel@novell.com>
10949
10950         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
10951         variable.  This one is represents the actual low-level declaration
10952         of the method, as opposed to the semantic level `IsStatic'.   
10953
10954         An anonymous method which is hosted into a static method might be
10955         actually an instance method.  IsStatic would reflect the
10956         container, while MethodIsStatic represents the actual code
10957         generated.
10958
10959         * expression.cs (ParameterReference): Use the new MethodIsStatic
10960         instead of IsStatic.
10961
10962         * anonymous.cs (AnonymousMethod.Compatible): Pass the
10963         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
10964         set on the current EmitContext. 
10965
10966         * expression.cs (Cast): Overload DoResolveLValue so we can pass
10967         resolve our casted expression as an LValue.  This triggers the
10968         proper LValue processing that is later required by Assign.
10969
10970         This fixes 72347.
10971
10972         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
10973
10974 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
10975
10976         C# 2.0 Fixed buffer implementation
10977
10978         * anonymous.cs: Update after RegisterHelperClass renaming.
10979
10980         * attribute.cs (AttributeTester.fixed_buffer_cache):
10981         Cache of external fixed buffers.
10982         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
10983         implementation if field is fixed buffer else null.
10984
10985         * class.cs
10986         (TypeContainer.AddField): Accept FieldMember instead of Field.
10987         (FieldBase.IsFieldClsCompliant): Extracted code from
10988         VerifyClsCompliance descendant customization.
10989         (FixedField): New class handles fixed buffer fields.
10990         (FixedFieldExternal): Keeps information about imported fixed
10991         buffer.
10992         (IFixedField): Make access to internal or external fixed buffer
10993         same.
10994
10995         * cs-parser.jay: Add fixed buffer parsing.
10996
10997         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
10998         buffer.
10999
11000         * expression.cs (Indirection): Extended implementation to accept
11001         fixed buffer field.
11002         (PointerArithmetic.Emit): Get element from fixed buffer as well.
11003         (ElementAccess.MakePointerAccess): Get type as parameter.
11004         (DoResolve): Add fixed buffer field expression conversion.
11005         (DoResolveLValue): Ditto.
11006         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
11007         (ArrayPtr): Derives from FixedBufferPtr.
11008         (ArrayPtr.Emit): Add extra emit for array elements.
11009
11010         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
11011
11012         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
11013         for compiler generated types.
11014         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
11015
11016         * statement.cs (Fixed): Refactored to be easier add fixed buffer
11017         and consume less memory.
11018         (Fixed.Resolve): Add fixed buffer case.
11019
11020         * typemanager.cs (compiler_generated_attr_ctor,
11021         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
11022         (HasElementType): Add our own implementation to work on every
11023         runtime.
11024
11025 2005-02-11  Miguel de Icaza  <miguel@novell.com>
11026
11027         * anonymous.cs (CaptureContext): Track whether `this' has been
11028         referenced.   
11029
11030         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
11031         only captured `this' if it was implicitly done (instance
11032         methods/variables were used). 
11033
11034         * codegen.cs (EmitContext.CaptureThis): New method to flag that
11035         `this' must be captured.
11036
11037 2005-01-30  Miguel de Icaza  <miguel@novell.com>
11038  
11039         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
11040         is null it means that there has been no need to capture anything,
11041         so we just create a sibling.
11042
11043         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
11044
11045         Just a partial fix.  The other half is fairly elusive.
11046         
11047 2005-02-10  Raja R Harinath  <rharinath@novell.com>
11048
11049         Fix #52586, cs0121-4.cs.
11050         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
11051         and return a hashtable.
11052         (MemberCache.ClearDeclaredOnly): New.
11053         (MemberCache.MemberCache): Update to change.  Make a deep copy of
11054         the method_hash of a base type too.
11055         (MemberCache.AddMethods): Adapt to having a deep copy of the base
11056         type methods.  Overwrite entries with the same MethodHandle so
11057         that the ReflectedType is correct.  The process leaves in base
11058         virtual functions and their overrides as distinct entries.
11059         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
11060         matters since it was boxed in a ArrayList before.
11061         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
11062         modifier.
11063         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
11064         case of a virtual function and its override (choose the overload
11065         as better).
11066         (Invocation.OverloadResolve): Avoid 'override' members during
11067         'applicable_type' calculation.
11068
11069 2005-02-09  Raja R Harinath  <rharinath@novell.com>
11070
11071         Combine two near-redundant caches.
11072         * typemanager.cs (method_params): Rename from method_internal_params.
11073         (TypeManager.GetParameterData): New.  Replace
11074         Invocation.GetParameterData.
11075         (TypeManager.LookupParametersByBuilder): Remove.
11076         * expression.cs (Invocation.method_parameter_cache): Remove.
11077         (Invocation.GetParameterData): Remove.
11078         Update to changes.
11079         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
11080         Update to changes.
11081
11082 2005-02-08  Raja R Harinath  <rharinath@novell.com>
11083
11084         Fix #72015.
11085         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
11086         TypeManager.multicast_delegate_type is null, resolve it by looking
11087         up "System.MulticastDelegate".
11088         * rootcontext.cs (RootContext.ResolveCore): Simplify.
11089
11090 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
11091             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
11092             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
11093
11094         Fix cs0164.cs.
11095         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
11096         (LabeledStatement.AddReference): New.  Set 'referenced'.
11097         (Goto.Resolve): Use it.
11098
11099 2005-02-05  John Luke  <john.luke@gmail.com>
11100
11101         * driver.cs: remove duplicate -doc line in Usage ()
11102
11103 2005-02-04  Raja R Harinath  <rharinath@novell.com>
11104
11105         * location.cs (Location.AddFile): Fix CS2002 error report.
11106
11107 2005-02-02  Martin Baulig  <martin@ximian.com>
11108
11109         * delegate.cs (Delegate.DefineType): Report an internal error if
11110         TypeManager.multicast_delegate_type is null.  See bug #72015 for
11111         details.        
11112
11113 2005-02-02  Raja R Harinath  <rharinath@novell.com>
11114
11115         Fix a crasher in a variant of #31984.
11116         * const.cs (Constant.CheckBase): New override that defers the
11117         new-or-override check in case the base type hasn't been populated
11118         yet.
11119         (Constant.Define): Ensure the new-or-override check is performed.
11120
11121 2005-02-01  Duncan Mak  <duncan@ximian.com>
11122
11123         * const.cs (LookupConstantValue): Check that `ce' is not null
11124         before calling GetValue ().
11125
11126 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11127
11128         Fix test-334.cs (#69519).
11129         * cs-parser.jay (using_alias_directive): Pass in an expression to
11130         NamespaceEntry.UsingAlias.
11131         (using_namespace_directive): Pass in an expression to
11132         NamespaceEntry.Using.
11133         (namespace_name): Don't flatten to a string.
11134         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
11135         (NamespaceEntry.AliasEntry.Resolve): Lookup using
11136         ResolveAsTypeStep.
11137         (NamespaceEntry.UsingEntry): Likewise.
11138         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
11139         changes.
11140         (NamespaceEntry.LookupForUsing): Remove.
11141         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
11142         names.
11143         (NamespaceEntry.Lookup): Remove support for dotted names.
11144
11145 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11146
11147         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
11148         split into two.
11149         (NamespaceEntry.ImplicitParent): Compute on demand.
11150         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
11151         parallels the current.
11152         (NamespaceEntry.LookupForUsing): Use it.
11153         (NamespaceEntry.Lookup): If the current namespace-entry is
11154         implicit, don't search aliases and using tables.
11155
11156 2005-02-01  Raja R Harinath  <rharinath@novell.com>
11157
11158         Fix #31984.
11159         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
11160         BaseCache here.
11161         (TypeContainer.BaseCache): Compute on demand.
11162         (TypeContainer.FindMembers): Define constants and types if they're
11163         not already created.
11164         (FieldMember.Define): Move resetting of ec.InUnsafe before error
11165         check.
11166         * const.cs (Constant.Define): Make idempotent.
11167
11168 2005-01-29  Miguel de Icaza  <miguel@novell.com>
11169
11170         * pending.cs: Produce better code (no nops produced by using Ldarg
11171         + value).
11172         
11173         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
11174         i - 1' it should be arg + 1.
11175
11176         Fixes bug #71819.
11177
11178 2005-01-28  Raja R Harinath  <rharinath@novell.com>
11179
11180         * attribute.cs (Attribute.CheckAttributeType): Make private
11181         non-virtual.
11182         (Attribute.ResolveType): Make virtual.
11183         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
11184         handling of RootContext.Tree.Types.
11185
11186 2005-01-27  Raja R Harinath  <rharinath@novell.com>
11187
11188         Update attribute-handling to use the SimpleName/MemberAccess
11189         mechanisms.
11190         * cs-parser.jay (attribute): Pass in an expression to the
11191         constructors of Attribute and GlobalAttribute.
11192         * attribute.cs (Attribute): Take an expression for the name.
11193         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
11194         passed in attribute name expression.
11195         (Attribute.CheckAttributeType): Use it.
11196         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
11197         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
11198         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
11199         argument to prevent error messages if the lookup fails.
11200
11201 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
11202
11203         * expression.cs (Indirection): Implemented IVariable interface
11204         to support indirection in AddressOf operator.
11205         (PointerArithmetic.Emit): Add optimalization for case where
11206         result can be precomputed.
11207
11208 2005-01-26  Martin Baulig  <martin@ximian.com>
11209
11210         * class.cs (TypeContainer.AttributeTargets): Return the correct
11211         AttributeTargets depending on our `Kind' instead of throwing an
11212         exception; fixes #71632.
11213
11214 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
11215
11216         Fix #71257
11217         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
11218         constant members.
11219
11220 2005-01-25  Raja R Harinath  <rharinath@novell.com>
11221
11222         Fix #71602.
11223         * expression.cs (MemberAccess.DoResolve): Don't complain with
11224         cs0572 when the LHS of a member access has identical name and type
11225         name.
11226
11227 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
11228
11229         Fix #71651, #71675
11230         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
11231         CreatePermission.
11232         Create custom PermissionSet only for PermissionSetAttribute.
11233
11234 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
11235
11236         Fix #71649
11237         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
11238         delegates in static class.
11239
11240 2005-01-24  Martin Baulig  <martin@ximian.com>
11241
11242         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
11243         merging an implicit block, just use its reachability.
11244
11245         * statement.cs (Block.Resolve): Make the unreachable code check
11246         work wrt. implicit blocks; see test-337 from #63842.
11247
11248 2005-01-21  Alp Toker  <alp@atoker.com>
11249  
11250         * cs-parser.jay: destructor_declaration's container is PartialContainer
11251         not Class when partial types are used, so use Kind prop instead of
11252         'is'.
11253         
11254 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
11255
11256         * cs-parser.jay: Improve error reporting when an interface
11257         declares new types.
11258
11259 2005-01-20  Dick Porter  <dick@ximian.com>
11260
11261         * support.cs: SeekableStreamReader fix from Sandor Dobos
11262         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
11263         chars are read.  Fixes bug 70369.
11264
11265 2005-01-20  Raja R Harinath  <rharinath@novell.com>
11266
11267         * cs-parser.jay (catch_clause): Simplify current_block handling
11268         somewhat.
11269
11270 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
11271
11272         * convert.cs (ImplicitStandardConversionExists): Synchronize the
11273         code with ImplicitStandardConversion to handle the implicit
11274         conversion of method groups into valid delegate invocations. 
11275
11276         The problem is that in parameter handling we were using this code
11277         path.  Fixes bug #64698
11278
11279 2005-01-19  Raja R Harinath  <rharinath@novell.com>
11280
11281         * cs-parser.jay: Fix several infelicities.
11282         - Avoid assigning to the parser value stack.  Code like 
11283           '$3 = null' is unclean.  Synthesize a value for the code block
11284           instead. 
11285         - Avoid using oob_stack for storing location information.  Use ...
11286         (_mark_): ... this.  New (empty) rule.  Saves the current location
11287         in $$.
11288         (foreach_statement): Avoid using oob_stack for current_block
11289         handling.  Use technique used in for_statement and
11290         using_statement.  Synthesize a value for the code block to store
11291         additional intermediate information.
11292
11293 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
11294
11295         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
11296         of a different type is only allowed to private fields of a
11297         containing type, not on fields of a base class.
11298
11299         See test-174.cs and error cs0122-9.cs
11300
11301 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11302
11303         Fix test-335.cs (bug #58126).
11304         * cs-parser.jay (argument): Split out non-expression parts of the
11305         rule into 'non_simple_argument'.
11306         (invocation_expression): Support parenthesized invocations with
11307         multiple arguments, and with single non-simple arguments.
11308
11309 2005-01-13  Raja R Harinath  <rharinath@novell.com>
11310
11311         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
11312         places.
11313
11314 2005-01-12  Raja R Harinath  <rharinath@novell.com>
11315
11316         Fix cs0038-1.cs, cs1640-6.cs.
11317         * ecore.cs (Expression.Resolve): Remove special-case for
11318         SimpleName in error-handling.
11319         (Expression.almostMatchedMembers): Relax access permission to
11320         protected.
11321         (Expression.MemberLookupFailed): Handle duplicates in
11322         almostMatchedMembers list.
11323         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
11324         * expression.cs (New.DoResolve): Report CS1540 for more cases.
11325         * typemanager.cs (GetFullNameSignature): Use the MethodBase
11326         overload if the passed in MemberInfo is a MethodBase.
11327
11328 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
11329
11330         Fix #70749
11331         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
11332         for non-CAS & merge permission sets properly.
11333
11334 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11335
11336         Improve standard-compliance of simple name and member access 
11337         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
11338         * ecore.cs (FullNamedExpression): New abstract base class 
11339         for Namespaces and TypeExpressions.
11340         (ResolveFlags.SimpleName): Remove.
11341         (SimpleName): Remove support for dotted names.
11342         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
11343         DeclSpace.FindType and DeclSpace.LookupType.
11344         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
11345         (Expression.ExprClassName): Make member function.
11346         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
11347         a namespace.  Remove creation of dotted "SimpleName"s.
11348         (MemberAccess.DoResolve): Likewise.
11349         * decl.cs (DeclSpace.Cache): Make private.
11350         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
11351         (DeclSpace.FindType): Update.
11352         (DeclSpace.LookupType): Move here from RootContext.  Return a 
11353         FullNamedExpression.
11354         * namespace.cs (Namespace): Derive from FullNamedExpression
11355         so that it can be part of expression resolution.
11356         (Namespace.Lookup): Return an FullNamedExpression.
11357         (NamespaceEntry.LookupAlias): Lookup aliases only in current
11358         namespace.
11359         * rootcontext.cs (NamespaceLookup): Remove.
11360         (LookupType): Move to DeclSpace.
11361         * attribute.cs (CheckAttributeType): Update.
11362         * doc.cs (FindDocumentedType): Remove allowAlias argument.
11363         (FindDocumentedTypeNonArray): Likewise.
11364
11365 2005-01-11  Raja R Harinath  <rharinath@novell.com>
11366
11367         Fix cs0509.cs, cs1632.cs.
11368         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
11369         is the same as IsInterface.
11370         (TypeContainer.GetClassBases): Likewise.
11371         * statement.cs (LabeledStatement.ig): New field.
11372         (LabeledStatement.LabelTarget): Save ILGenerator which created the
11373         label.
11374         (LabeledStatement.DoEmit): Check that the label was created with
11375         the same ILGenerator.
11376
11377 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11378
11379         Fix #71058
11380         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
11381         accessors to its properties.
11382
11383         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
11384         from accessors to property.
11385         
11386 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
11387
11388         Fix #70722
11389         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
11390         only for overrides.
11391         
11392 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
11393
11394         * attribute.cs: Check for null and empty strings.  
11395
11396         I have lost another battle to Paolo.
11397
11398 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
11399
11400         Fix #70942
11401         * class.cs (PropertyMethod): Set Parent field in ctors.
11402         (SetMethod.InternalParameters): Add unsafe switch hack.
11403         Override MarkForDuplicationCheck where it is appropriate.
11404
11405         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
11406         It says whether container allows members with the same name.
11407         Base default is no.
11408         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
11409         Removed is_method parameter.
11410
11411 2005-01-06  Duncan Mak  <duncan@ximian.com>
11412
11413         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
11414         because the previous change led to incorrect reporting of CS1032
11415         ("Cannot define/undefine preprocessor symbols after first token in
11416         file"). Instead of using `tokens_seen' as the only flag that
11417         triggers CS1040, introduce `comments_seen'. This new flag is used
11418         to signify having seen comments on the current line, so it is
11419         unset after a newline.
11420
11421 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11422
11423         * doc.cs : When searching for a type, find nested type too.
11424           This fixes bug #71040.
11425
11426 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
11427
11428         * doc.cs :
11429           - Warn missing member comment on those classes which also does not
11430             have doc comments. Fixed bug #71041.
11431           - Don't warn missing doc comment on default constructor.
11432             Fixed bug #71042.
11433
11434 2005-01-06  Duncan Mak  <duncan@ximian.com>
11435
11436         * cs-tokenizer.cs (xtoken): After handling traditional C-style
11437         comments, set `tokens_seen' to true. This allows us to detect
11438         misplaced preprocessor directives (i.e. not at the beginning of
11439         the a line, nor after whitespaces). In that case, report error
11440         CS1040. This fixes bug #56460.
11441
11442         * cs-parser.jay (interface_member_declaration): Add checks for
11443         IsExplicitImpl, and report CS0541 error if an interface member is
11444         defined as an explicit interface declaration.
11445
11446 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
11447
11448         Fix #70817
11449         * class.cs (PropertyMethod): Set Parent field in ctors.
11450         (SetMethod.InternalParameters): Add unsafe switch hack.
11451         
11452         * decl.cs (MemberCore.Parent): Cannot be readonly.
11453
11454 2005-01-06  Raja R Harinath  <rharinath@novell.com>
11455
11456         * decl.cs (DeclSpace.ResolveType): Remove.
11457         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
11458         Merge in code from ...
11459         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
11460         * class.cs, enum.cs: Update to changes.
11461
11462 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
11463
11464         * anonymous.cs: Ensure that we init the scope of our parent if it
11465         has not been initialized yet.
11466
11467 2004-12-30  Duncan Mak  <duncan@ximian.com>
11468
11469         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
11470         if field.FieldBuilder is null. Fixes #70758.
11471
11472         * convert.cs: Fixed some typos and updated some of the comments.
11473         (ImplicitStandardConversionExists):
11474         (TryImplicitIntConversion): If `target_type' is an interface and
11475         the type of `ic' implements this interface, return true or a new
11476         BoxedCast instead of null. This fixes #70468.
11477
11478 2004-12-29  Duncan Mak  <duncan@ximian.com>
11479
11480         * expression.cs (Argument.Emit): Check that Expr is
11481         IMemoryLocation before casting to it, and report CS1510 otherwise.
11482
11483         This fixes #70402.
11484
11485 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
11486
11487         * statement.cs (Block.ThisVariable): remove the recursion here, to
11488         make the --profile more sane.
11489
11490 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
11491
11492         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
11493         assembly, by JB Evain.
11494
11495 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11496
11497         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
11498           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
11499         "parent" refers to enclosing type/class.  "base" refers to superclass.
11500
11501 2004-12-17  Raja R Harinath  <rharinath@novell.com>
11502
11503         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11504         Ensure that we only have GlobalAttributes.
11505         * attribute.cs (Attribute.Emit): Make non-virtual.
11506         (GlobalAttribute.Emit): Remove.
11507         (Attribute.Resolve): Make virtual.
11508         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
11509         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
11510         the argument. Don't create one.
11511         (Attribute.GetObsoleteAttribute): Likewise.
11512         (Attribute.GetClsCompliantAttributeValue): Likewise.
11513         * class.cs, decl.cs: Update to changes.
11514
11515 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
11516
11517         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
11518         
11519         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
11520         
11521         * statement.cs (Foreach.Resolve): Add error 186 report.
11522
11523 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
11524
11525         * expression.cs (Conditional.DoResolve): Add warning 429.
11526         
11527         * statement.cs (If.Resolve): Add warning 665.
11528
11529 2004-12-16  Raja R Harinath  <rharinath@novell.com>
11530
11531         New invariant: RootContext.Tree.Types.NamespaceEntry == null
11532         except when in the parser, and in GlobalAttribute.
11533         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
11534         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
11535         RootContext.Tree.Types.NamespaceEntry once work is done.
11536         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
11537         and resets RootContext.Tree.Types.NamespaceEntry.
11538
11539 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
11540
11541         * cs-parser.jay: Don't create a block for every variable.
11542
11543 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
11544
11545         * location.cs: Provide extra information.
11546
11547         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
11548         variables from the captured environment, it is the ldarg_0.
11549
11550 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11551
11552         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
11553         find a conclusion.
11554         
11555         * class.cs: Changed warning level for 169 to avoid developer
11556         displeasure from warning flooding. It will be changed back when they
11557         fix most of current BCL warnings.
11558         
11559         * RootContext.cs: Pushed default WarningLevel to 3.
11560         
11561         * statement.cs: Removed unused variable.
11562
11563 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
11564
11565         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
11566         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
11567         Add error 502 report.
11568         (StaticClass.DefineType): Add error 441 report.
11569         (Class.AllowedModifiersProp): New virtual property as temporary
11570         extension to AllowedModifiers.
11571         (Class.DefineType): Add error 418 report. Moved ModFlags check here
11572         to share implementation with StaticClass and don't call virtual
11573         methods from ctor.
11574         
11575         * driver.cs (MainDriver): Add error 1558 test.
11576
11577         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
11578         report. Moved error 36 test here.
11579
11580         * statement.cs (Throw.Resolve): Add error 724 report.
11581
11582         * typemanager.cs: Add out_attribute_type core type.
11583         
11584 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
11585
11586         * class.cs (TypeContainer.VerifyClsCompliance): Add error
11587         3018 report.
11588         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
11589
11590         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
11591         3017 report.
11592         
11593         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
11594
11595         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
11596         Add error 3023 report.
11597         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
11598
11599         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
11600         implementation.
11601
11602 2004-12-12  John Luke  <john.luke@gmail.com>
11603
11604         * driver.cs (AddArgs): take -- into account when
11605         adding arguments, fixes bug 65710 
11606
11607 2004-12-12  Martin Baulig  <martin@ximian.com>
11608
11609         * expression.cs (Unary.TryReduceNegative): Added support for
11610         SByteConstant and ByteConstant.
11611         (Unary.Reduce): Check error values from TryReduceNegative().
11612
11613 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
11614
11615         * attributes.cs (Attribute.Resolve): Avoid multiple error report
11616         and report exception as error 182.
11617
11618 2004-12-10  Raja R Harinath  <rharinath@novell.com>
11619
11620         * driver.cs (Main): Fix message when there are warnings.
11621
11622 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
11623
11624         * delegate.cs: Fixed my fix from yesterday, sorry about that.
11625
11626 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
11627
11628         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
11629         Reduced number of warnings.
11630         
11631         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
11632
11633 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
11634
11635         * driver.cs: Removed message.
11636
11637         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
11638
11639 2004-12-08    <vargaz@freemail.hu>
11640
11641         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
11642
11643 2004-12-08  Martin Baulig  <martin@ximian.com>
11644
11645         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
11646         instead of a CS3002 for properties and indexer.
11647
11648 2004-12-08  Martin Baulig  <martin@ximian.com>
11649
11650         * decl.cs (MemberName.ToString): Make this work again.
11651
11652 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
11653
11654         * attribute.cs (Resolve): Add error 591 detection.
11655
11656         * class.cs (FieldMember.Define): Add error 1547 detection.
11657         (Indexer.Define): Add error 620 detection.
11658         (Operator.Define): Add error 590 detection.
11659
11660         * ecore.cs: Missing argument for error 79.
11661
11662         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
11663         detection.
11664
11665 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
11666
11667         Fix #70106
11668         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
11669         only.
11670
11671 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
11672
11673         * cs-parser.jay : handle doc comments on implicit/explicit operators.
11674           Some operator comments were suppressed.
11675         * doc.cs : Implicit/explicit operator name in doc comments are like
11676           "op_Explicit(type)~returnType", so added suffix handling.
11677
11678 2004-12-07  Martin Baulig  <martin@ximian.com>
11679
11680         * decl.cs
11681         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
11682         (MemberCore.GetClsCompliantAttributeValue): Likewise.
11683         (DeclSpace.ec): New protected field; store the EmitContext here.
11684         (DeclSpace.EmitContext): New public property; moved here from
11685         `TypeContainer'.
11686         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
11687         EmitContext.
11688
11689         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
11690         (Enum.Emit): Don't create a new EmitContext.
11691
11692         * delegate.cs (Delegate.DefineType): Always create the
11693         EmitContext.
11694
11695         * iterators.cs (Iterators.DefineIterator): Create a new
11696         EmitContext and store it in `ec'.
11697
11698 2004-08-24  Martin Baulig  <martin@ximian.com>
11699
11700         * typemanager.cs
11701         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
11702         this for accessibility checks.
11703         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
11704         IsNestedFamilyAccessible.
11705         (TypeManager.IsSubclassOf): New method, do what the name actually
11706         says.   
11707
11708 2004-12-06  Raja R Harinath  <rharinath@novell.com>
11709
11710         Fix crash on cs0657-17.cs.
11711         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
11712         Use RootContext.Tree.Types, not 'new RootTypes ()'.
11713         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
11714         the case where the NamespaceEntry gets overwritten.
11715
11716 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
11717
11718         Fixed #69195, #56821
11719         * ecore.cs (ResolveBoolean): Tiny refactoring.
11720
11721         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
11722         of right expression resolving when left is false constant and
11723         operator is LogicalAnd OR true constant and operator is LogicalOr.
11724
11725         * statement.cs (ResolveUnreachable): Always reports warning.
11726
11727 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
11728
11729         * class.cs: Distinguish between 1721 and 1722 (just a little help
11730         for the programmer).
11731
11732 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
11733
11734         * delegate.cs: Only allow this on new versions of the language. 
11735
11736 2004-12-02  Duncan Mak  <duncan@ximian.com>
11737
11738         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
11739         Expression class.
11740         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
11741         here as a static method. Take an additional bool out parameter
11742         `must_do_cs1540_check' for signaling to InstanceResolve.
11743         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
11744         member field from PropertyExpr class and made it an argument of
11745         the method instead.
11746         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
11747         check for MarshalByRefObject, and report CS0122 instead of CS1540.
11748         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
11749         and `remove_accessor' as well as InstanceResolve: report CS0122
11750         where applicable.
11751
11752         Fixes #70129.
11753
11754 2004-12-03  Raja R Harinath  <rharinath@novell.com>
11755
11756         Fix test-327.cs, test-328.cs, and put in early infrastructure
11757         for eventually fixing #52697.
11758         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
11759         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
11760         from other methods.
11761         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
11762         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
11763         (VerifyUsing, error246): Update.
11764         * rootcontext.cs (RootContext.NamespaceLookup): Just use
11765         'NamespaceEntry.LookupNamespaceOrType'.
11766
11767 2004-12-03  Martin Baulig  <martin@ximian.com>
11768
11769         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11770         method as our child, call AnonymousMethod.Compatible() on it.
11771
11772 2004-12-03  Raja R Harinath  <rharinath@novell.com>
11773
11774         Disable XML documentation support in 'basic' profile.
11775         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
11776         Redirect XmlElement to System.Object.
11777         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
11778         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
11779         * mcs.exe.sources: Add doc-bootstrap.cs.
11780         * doc-bootstrap.cs: New file.  Contains empty stub implementation
11781         of doc.cs.
11782
11783 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
11784
11785         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
11786           comments are allowed.
11787
11788 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
11789
11790         * delegate.cs: Add checks for subtypes in paramaters and return values
11791         in VerifyMethod () to add support for Covariance/Contravariance
11792         in delegates.
11793         
11794 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
11795
11796         * report.cs: Remove extra closing parenthesis.
11797
11798         * convert.cs (Error_CannotImplicitConversion): If the name of the
11799         types are the same, provide some extra information.
11800
11801         * class.cs (FieldBase): Use an unused bit field from the field to
11802         encode the `has_offset' property from the FieldMember.  This saves
11803         a couple of Ks on bootstrap compilation.
11804
11805         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
11806         method as our child, return the AnonymousMethod resolved
11807         expression.
11808
11809         * expression.cs (New.DoResolve): Allow return values from
11810         NewDelegate to also include AnonymousMethods.
11811
11812         Fixes #70150.
11813
11814 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
11815
11816         Fix bug #70102
11817         * attribute.cs (Resolve): Improved implementation of params
11818         attribute arguments.
11819
11820         * support.cs (ParameterData): Add HasParams to be faster.
11821
11822 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
11823
11824         all things are for /doc support:
11825
11826         * doc.cs: new file that supports XML documentation generation.
11827         * mcs.exe.sources: added doc.cs.
11828         * driver.cs:
11829           Handle /doc command line option.
11830           Report error 2006 instead of 5 for missing file name for /doc.
11831           Generate XML documentation when required, after type resolution.
11832         * cs-tokenizer.cs:
11833           Added support for picking up documentation (/// and /** ... */),
11834           including a new XmlCommentState enumeration.
11835         * cs-parser.jay:
11836           Added lines to fill Documentation element for field, constant,
11837           property, indexer, method, constructor, destructor, operator, event
11838           and class, struct, interface, delegate, enum.
11839           Added lines to warn incorrect comment.
11840         * rootcontext.cs :
11841           Added Documentation field (passed only when /doc was specified).
11842         * decl.cs:
11843           Added DocComment, DocCommentHeader, GenerateDocComment() and
11844           OnGenerateDocComment() and some supporting private members for
11845           /doc feature to MemberCore.
11846         * class.cs:
11847           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
11848         * delegate.cs:
11849           Added overriden DocCommentHeader.
11850         * enum.cs:
11851           Added overriden DocCommentHeader and GenerateDocComment().
11852
11853 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
11854
11855         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
11856         unwrapping the enumeration values, chain to
11857         DoConstantNumericPromotions again, so we can promote things to the
11858         fundamental types (takes care of enums that are bytes, sbytes).
11859
11860         Fixes bug #62054.
11861
11862 2004-12-01  Raja R Harinath  <rharinath@novell.com>
11863
11864         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
11865         Fix long-standing bug in type-lookup.  Use FindType instead of
11866         LookupType when ec.ResolvingTypeTree.
11867         (Attribute.ResolveType, Attribute.Resolve)
11868         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
11869         Update to changes.
11870         (Attributes.Search): Remove internal version.  Update.
11871         (Attributes.SearchMulti): Update.
11872         (Attributes.GetClsCompliantAttribute): Remove.
11873         (Attributes.GetIndexerNameAttribute): Remove.
11874         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
11875         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
11876         * class.cs (Indexer.Define): Likewise.
11877
11878 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
11879
11880         Fix bug #68790
11881         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
11882         MarshallByReference members access.
11883
11884         * expression.cs: Use CheckMarshallByRefAccess;
11885         Better error CS0197 message.
11886
11887         * report.cs: Print whole related error message.
11888
11889 2004-11-30  Raja R Harinath  <rharinath@novell.com>
11890
11891         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
11892         the current directory to help debugging.
11893
11894 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
11895
11896         * class (GetClassBases): Better error 60 report.
11897         (EventProperty): Disabled warning 67 detection.
11898
11899 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
11900
11901         Fix bug #60324
11902         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
11903
11904         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
11905         precise values.
11906
11907 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
11908
11909         Fix bug #49488
11910         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
11911
11912         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
11913
11914 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
11915
11916         * attribute.cs (Attribute.Resolve): Refine error reporting and
11917         report a cs0117 if the identifier does not exist, to distinguish
11918         from 0617 which is a miss-use of the actual identifier.
11919
11920         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
11921         between cs0070 and cs0079.
11922
11923         * class.cs (MemberBase.DoDefine): When reporting a wrong
11924         accessibility level, we use MethodCore to compare instead of
11925         Method (this was a regression in some refactoring effort).
11926
11927         So now we correctly report cs0056 again.
11928
11929         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
11930         testing the target_type (which was known to be object_type) and
11931         not the source type (which is anonymous_method).
11932
11933         Fixed reporting of error cs1660.
11934
11935         * expression.cs (UserCast.Source): Expose the underlying cast.
11936
11937         * statement.cs (Switch.SwitchGoverningType): Sort the list of
11938         allowed types to find a match to int32 first (most common).
11939
11940         In addition, it ignores any ImplicitUserConversions that did an
11941         internal implicit conversion (as the switch statement allows only
11942         one integral conversion to exist).
11943
11944         * class.cs (PartialContainer.Create): rename `name' to
11945         `member_name' for clarity.  Then replace the string calls with a
11946         call to MemberName.GetPartialName, as now using
11947         MemberName.ToString is an error (this is due to the side effects
11948         it had, that were fixed in the past).
11949
11950         This will restore the error reporting on a number of partial class
11951         errors that were missusing this (and getting an exception as a
11952         results, which is now just a plain textual warning, because
11953         yyparse debug output would crash otherwise).
11954
11955 2004-11-26  Raja R Harinath  <rharinath@novell.com>
11956
11957         * Makefile (PROGRAM_INSTALL_DIR): Remove.
11958
11959 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
11960
11961         * rootcontext.cs (LookupType): Make sure to cache lookups that
11962         don't give us a negative result. This saves about 5% of corlib
11963         compilation time.
11964
11965 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
11966
11967         * report.cs (AbstractMessage.Print): messages are sent to stderr
11968
11969         * class.cs (TypeContainer.GetClassBases): It is an error to have a
11970         non-interface in the list of interfaces (at this point, either
11971         parent was properly set, or a base class is being listed in the
11972         interfaces section).
11973
11974         This flags error 1722, and resolves the crash from bug 69259.
11975
11976 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
11977
11978         * statement.cs (Using.EmitExpressionFinally): make this work right
11979         for valuetypes. Fixes 69926.
11980
11981 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
11982
11983         * const.cs (Const.ChangeType): Cope with the "0 literal can be
11984         converted to an enum" here, before we try to change the underlying
11985         type.  This code exists, but it is a different code path than the
11986         one used while encoding constants.
11987
11988         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
11989         old bug: when converting from the null literal to a pointer,
11990         return an EmptyCast, not the NullLiteral.
11991
11992         This fixes #69921, the recent null_type changes probably made this
11993         bug more prominent.
11994
11995         (ImplicitReferenceConversionExists): In addition, resynchronized
11996         the code here, so it matches the same code in
11997         ImplicitReferenceConversionExists for the `from any class-type S
11998         to any interface-type T'.
11999         
12000
12001 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
12002
12003         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
12004
12005 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
12006
12007         * cs-parser.jay: Use verbosity accordingly. 
12008
12009 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
12010
12011         * expression.cs (Unary.ResolveOperator): Do not report warning;
12012         AddressOf reads from variable.
12013         
12014         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
12015
12016 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
12017
12018         Fix bug #69462
12019
12020         * attribute.cs (Attributable): Removed CheckTargets.
12021         (Attributes.Emit): Explicit attribute targets are tested here.
12022
12023         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
12024         not enabled for interfaces.
12025
12026         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
12027         (GetAssemblyName): Ouch next bug there.
12028
12029 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
12030
12031         * expression.cs: Error 275 added.
12032         
12033 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
12034
12035         Fix bug #69177 (Implemented decimal constant support)
12036
12037         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
12038         (BinaryFold): Add DecimalConstant.
12039
12040         * const.cs (Define): Decimal constant 
12041         (is not constant.
12042         (ChangeType): Add decimal type handling.
12043         (LookupConstantValue): Don't set value for decimal type but
12044         emit DecimalConstantAttribute. Needed for constant optimization.
12045
12046         * constant.cs (ToDecimal): New method.
12047         (ConvertToDecimal): New method.
12048         (IntConstant): Implemented ConvertToDecimal.
12049         (DecimalConstant.Emit): Emit optimized version for decimals in
12050         int range.
12051
12052         * expression.cs (ResolveOperator): Changed order of constant
12053         reduction to work correctly with native types which have
12054         overloaded operators.
12055         (ResolveMemberAccess): Extract constant value from attribute
12056         for decimal type.
12057
12058         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
12059
12060         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
12061         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
12062         (ChangeType): Decimal is special.
12063         (TypeToCoreType): Add decimal type.
12064
12065 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
12066
12067         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
12068         decimal types.
12069
12070 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
12071
12072         * class.cs (EventField.ApplyAttributeBuilder): Fix error
12073         test cs1667-5.cs.
12074
12075 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
12076
12077         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
12078
12079         * pending.cs (PendingImplementation): Grab only interfaces.
12080
12081 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
12082
12083         * statement.cs (ForeachHelperMethods): Add location member and
12084         error 202 detection.
12085
12086 2004-11-19  Raja R Harinath  <rharinath@novell.com>
12087
12088         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
12089         automatically handled by executable.make.
12090         (PROGRAM): Make profile-specific.
12091
12092 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
12093
12094         * expression.cs (DoResolveBase): Fixed wrong warning for out
12095         variables.
12096
12097 2004-11-18  Martin Baulig  <martin@ximian.com>
12098
12099         Merged latest changes into gmcs.  Please keep this comment in
12100         here, it makes it easier for me to see what changed in MCS since
12101         the last time I merged.
12102
12103 2004-11-17  Raja R Harinath  <rharinath@novell.com>
12104
12105         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
12106         (TypeHandle.GetMemberCache): New.
12107         (TypeHandle.TypeHandle): Update.
12108         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
12109         (TypeManager.LookupParentInterfacesCache):
12110         Rename from LookupInterfaceCache.  Optimize slightly.
12111         (TypeManager.MemberLookup_FindMembers): Update.
12112         * decl.cs (MemberCache.MemberCache): Set Container to null in the
12113         multi-type variant.
12114         (AddCacheContents): Rename from AddHashtable.
12115         * class.cs (TypeContainer.parent_container): Remove.
12116         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
12117         (TypeContainer.DoDefineMembers): Don't initialize it.
12118         Update to name changes.
12119         
12120 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
12121
12122         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
12123         that factors the code to check access modifiers on override.  
12124
12125         (PropertyBase): Use the code here.
12126
12127         Patch from Lluis S'anchez, fixes bug #69361.
12128
12129 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
12130
12131         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
12132         routine that is used to report the use of a captured variable
12133         whose address has been taken.
12134
12135         There are two checks: one when variables are being captured and
12136         the other check is when the address of a variable is taken. 
12137         
12138         (because an anonymous methods might be resolved before *or* after
12139         the address has been taken) and 
12140
12141         * expression.cs (Conditional.DoResolve): Remove the special
12142         casing that Martin added to trueExpr and falseExpr being both
12143         NullLiteral.  We get the right behavior now just by introducing
12144         the null_type into the compiler. 
12145
12146         * convert.cs (ExplicitConversion): Change the code to use
12147         null_type instead of testing `expr is NullLiteral'.
12148         (ImplicitConversionStandard): use null_type too.
12149         (ImplicitReferenceConversionExists): use null_type too.
12150         (ImplicitReferenceConversion): use null_type too.
12151
12152         * literal.cs: The type of `NullLiteral' is now null_type instead
12153         of object_type. 
12154         (Resolve): Set the type here.
12155
12156         * typemanager.cs: Introduce null_type.
12157
12158 2004-11-17  Martin Baulig  <martin@ximian.com>
12159
12160         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
12161         direction, like FindMembers() does.  Fixes #69546, testcase is in
12162         test-315.cs.    
12163
12164 2004-11-16  Martin Baulig  <martin@ximian.com>
12165
12166         This is based on a patch from Marek Safar, see bug #69082.
12167         Fixes bugs #63705 and #67130.
12168
12169         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
12170         method; create a MemberCache for an interface type and cache the
12171         result.
12172
12173         * decl.cs (IMemberContainer.ParentContainer): Removed.
12174         (IMemberContainer.ParentCache): New property.
12175         (MemberCache.SetupCacheForInterface): Removed.
12176         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
12177         to create a cache for an interface's "parent".
12178
12179         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
12180         interfaces too.
12181
12182 2004-11-16  Martin Baulig  <martin@ximian.com>
12183
12184         Merged back from gmcs; these changes already went into gmcs a
12185         couple of weeks ago.
12186
12187         * typemanager.cs
12188         (TypeManager.AddUserType): Removed the `ifaces' argument.
12189         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
12190         `TypeExpr []'.
12191         (TypeManager.AddUserInterface): Removed.
12192         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
12193         `TypeExpr []'.
12194         (TypeManager.GetInterfaces): Likewise.
12195         (TypeManager.GetExplicitInterfaces): Likewise.
12196
12197         * ecore.cs (TypeExpr.GetInterfaces): Removed.
12198
12199         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
12200         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
12201
12202 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
12203
12204         * statement.cs: Avoid adding bools to a hashtable.
12205
12206 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
12207
12208         * expression.cs (Invocation.OverloadResolve): Flag error if we are
12209         calling an unsafe method from a safe location.
12210
12211 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
12212
12213         Fix #69167
12214         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
12215
12216 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
12217
12218         * namespace.cs (VerifyUsing): use GetPartialName instead of
12219         ToString. 
12220
12221 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
12222
12223         * statement.cs (Return.Resolve): Fix regression in typo: if
12224         `in_exc', we have to request a NeedReturnLabel, this was a typo
12225         introduced in the anonymous method check-in.  Fixes #69131.
12226
12227         * Indexers were using the ShortName when defining themselves,
12228         causing a regression in the compiler bootstrap when applying the
12229         patch from 2004-11-02 (first part), now they use their full name
12230         and the bug is gone.
12231
12232 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
12233
12234         * driver.cs: Strip the path from the names of embedded resources. Fixes
12235         #68519.
12236
12237 2004-11-04  Raja R Harinath  <rharinath@novell.com>
12238
12239         Fix error message regression: cs0104-2.cs.
12240         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
12241         (AliasEntry.Resolve): Update.
12242         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
12243         'silent' flag.
12244         (RootContext.LookupType): Update.
12245
12246 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
12247
12248         * cs-parser.jay: Add support for handling accessor modifiers
12249         * class: Add support port accessor modifiers and error checking,
12250         define PropertyMethod.Define as virtual (not abstract anymore)
12251         * ecore.cs: Add checking for proeprties access with access modifiers
12252         * iterators.cs: Modify Accessor constructor call based in the modified
12253         constructor
12254 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
12255
12256         * expression.cs (StringConcat): Handle being called twice,
12257         as when we have a concat in a field init with more than two
12258         ctors in the class
12259
12260 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
12261
12262         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
12263         special case explicit implementations, we should always produce
12264         the .property or .event declaration.
12265         
12266         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
12267         since it will not return correct data if people use this
12268         unresolved in the presence of using statements (see test-313).
12269
12270         * class.cs (MethodData.Define): If we are an explicit interface
12271         implementation, set the method name to the full name of the
12272         interface plus the name of the method.  
12273
12274         Notice that using the method.MethodName.GetFullName() does not
12275         work, as it will only contain the name as declared on the source
12276         file (it can be a shorthand in the presence of using statements)
12277         and not the fully qualifed type name, for example:
12278
12279         using System;
12280
12281         class D : ICloneable {
12282                 object ICloneable.Clone ()  {
12283                 }
12284         }
12285
12286         Would produce a method called `ICloneable.Clone' instead of
12287         `System.ICloneable.Clone'.
12288
12289         * namespace.cs (Alias.Resolve): Use GetPartialName.
12290         
12291 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12292
12293         * cs-parser.jay: Add error 1055 report.
12294
12295 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
12296
12297         * assign.cs (Assign.DoResolve): Only do the transform of
12298         assignment into a New if the types are compatible, if not, fall
12299         through and let the implicit code deal with the errors and with
12300         the necessary conversions. 
12301
12302 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
12303
12304         * cs-parser.jay: Add error 1031 report.
12305
12306         * cs-tokenizer.cs: Add location for error 1038.
12307
12308 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12309
12310         * cs-parser.jay: Add error 1016 report.
12311
12312 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12313
12314         * cs-parser.jay: Add errors 1575,1611 report.
12315
12316 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12317
12318         * cs-parser.jay: Add error 1001 report.
12319
12320 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12321
12322         Fix #68850
12323         * attribute.cs (GetMarshal): Add method argument for
12324         caller identification.
12325
12326         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
12327         agument for GetMarshal and RuntimeMissingSupport.
12328
12329 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
12330
12331         * attribute.cs (ExtractSecurityPermissionSet): Removed
12332         TypeManager.code_access_permission_type.
12333
12334         * typemanager.cs: Removed TypeManager.code_access_permission_type.
12335
12336 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
12337
12338         * expression.cs (LocalVariableReference.DoResolveLValue): Check
12339         for obsolete use of a variable here.   Fixes regression on errors
12340         cs0619-25 and cs0619-26.
12341
12342 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
12343
12344         Fix #62358, implemented security attribute encoding.
12345
12346         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
12347         Tests permitted SecurityAction for assembly or other types.
12348         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
12349         data from SecurityPermissionAttribute to PermisionSet class.
12350
12351         * class.cs (ApplyAttributeBuilder): Added special handling
12352         for System.Security.Permissions.SecurityAttribute based types.
12353
12354         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
12355         special handling for System.Security.Permissions.SecurityAttribute
12356         based types.
12357
12358         * enum.cs (ApplyAttributeBuilder): Added special handling
12359         for System.Security.Permissions.SecurityAttribute based types.
12360
12361         * parameter.cs (ApplyAttributeBuilder): Added special handling
12362         for System.Security.Permissions.SecurityAttribute based types.
12363
12364         * rootcontext.cs: Next 2 core types.
12365
12366         * typemanager.cs (TypeManager.security_permission_attr_type):
12367         Built in type for the SecurityPermission Attribute.
12368         (code_access_permission_type): Build in type.
12369
12370 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
12371
12372         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
12373         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
12374         all of this information into
12375         EmitContext.EmitCapturedVariableInstance.
12376         
12377         * codegen.cs (EmitCapturedVariableInstance): move here the
12378         funcionality of emitting an ldarg.0 in the presence of a
12379         remapping.   This centralizes the instance emit code.
12380
12381         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
12382         then emit a load of this: it means that we have reached the
12383         topmost ScopeInfo: the one that contains the pointer to the
12384         instance of the class hosting the anonymous method.
12385
12386         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
12387         captures to the topmost CaptureContext.
12388
12389 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
12390
12391         * expression.cs (LocalVariableReference): Move the knowledge about
12392         the iterators into codegen's EmitCapturedVariableInstance.
12393
12394 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
12395
12396         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
12397         all code paths return a value from an anonymous method (it is the
12398         same as the 161 error, but for anonymous methods).
12399
12400 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
12401
12402         The introduction of anonymous methods in the compiler changed
12403         various ways of doing things in the compiler.  The most
12404         significant one is the hard split between the resolution phase
12405         and the emission phases of the compiler.
12406
12407         For instance, routines that referenced local variables no
12408         longer can safely create temporary variables during the
12409         resolution phase: they must do so from the emission phase,
12410         since the variable might have been "captured", hence access to
12411         it can not be done with the local-variable operations from the runtime.
12412         
12413         * statement.cs 
12414
12415         (Block.Flags): New flag `IsTopLevel' to indicate that this block
12416         is a toplevel block.
12417
12418         (ToplevelBlock): A new kind of Block, these are the blocks that
12419         are created by the parser for all toplevel method bodies.  These
12420         include methods, accessors and anonymous methods.
12421
12422         These contain some extra information not found in regular blocks:
12423         A pointer to an optional CaptureContext (for tracking captured
12424         local variables and parameters).  A pointer to the parent
12425         ToplevelBlock.
12426         
12427         (Return.Resolve): Catch missmatches when returning a value from an
12428         anonymous method (error 1662).
12429         Invoke NeedReturnLabel from the Resolve phase instead of the emit
12430         phase.
12431
12432         (Break.Resolve): ditto.
12433
12434         (SwitchLabel): instead of defining the labels during the
12435         resolution phase, we now turned the public ILLabel and ILLabelCode
12436         labels into methods called GetILLabelCode() and GetILLabel() that
12437         only define the label during the Emit phase.
12438
12439         (GotoCase): Track the SwitchLabel instead of the computed label
12440         (its contained therein).  Emit the code by using
12441         SwitchLabel.GetILLabelCode ().
12442
12443         (LocalInfo.Flags.Captured): A new flag has been introduce to track
12444         whether the Local has been captured or not.
12445
12446         (LocalInfo.IsCaptured): New property, used to tell whether the
12447         local has been captured.
12448         
12449         * anonymous.cs: Vastly updated to contain the anonymous method
12450         support.
12451
12452         The main classes here are: CaptureContext which tracks any
12453         captured information for a toplevel block and ScopeInfo used to
12454         track the activation frames for various local variables.   
12455
12456         Each toplevel block has an optional capture context associated
12457         with it.  When a method contains an anonymous method both the
12458         toplevel method and the anonymous method will create a capture
12459         context.   When variables or parameters are captured, they are
12460         recorded on the CaptureContext that owns them, for example:
12461
12462         void Demo () {
12463              int a;
12464              MyDelegate d = delegate {
12465                  a = 1;
12466              }
12467         }
12468
12469         Here `a' will be recorded as captured on the toplevel
12470         CapturedContext, the inner captured context will not have anything
12471         (it will only have data if local variables or parameters from it
12472         are captured in a nested anonymous method.
12473
12474         The ScopeInfo is used to track the activation frames for local
12475         variables, for example:
12476
12477         for (int i = 0; i < 10; i++)
12478                 for (int j = 0; j < 10; j++){
12479                    MyDelegate d = delegate {
12480                         call (i, j);
12481                    }
12482                 }
12483
12484         At runtime this captures a single captured variable `i', but it
12485         captures 10 different versions of the variable `j'.  The variable
12486         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
12487         recorded on a child.  
12488
12489         The toplevel ScopeInfo will also track information like the `this'
12490         pointer if instance variables were referenced (this is necessary
12491         as the anonymous method lives inside a nested class in the host
12492         type of the method). 
12493
12494         (AnonymousMethod): Expanded to track the Toplevel, implement
12495         `AnonymousMethod.Compatible' to tell whether an anonymous method
12496         can be converted to a target delegate type. 
12497
12498         The routine now also produces the anonymous method content
12499
12500         (AnonymousDelegate): A helper class that derives from
12501         DelegateCreation, this is used to generate the code necessary to
12502         produce the delegate for the anonymous method that was created. 
12503
12504         * assign.cs: API adjustments for new changes in
12505         Convert.ImplicitStandardConversionExists.
12506
12507         * class.cs: Adjustments to cope with the fact that now toplevel
12508         blocks are of type `ToplevelBlock'. 
12509
12510         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
12511         insteda of standard blocks.
12512
12513         Flag errors if params arguments are passed to anonymous methods.
12514
12515         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
12516         `CurrentAnonymousMethod' which points to the current Anonymous
12517         Method.  The variable points to the AnonymousMethod class that
12518         holds the code being compiled.  It is set in the new EmitContext
12519         created for the anonymous method.
12520
12521         (EmitContext.Phase): Introduce a variable and an enumeration to
12522         assist in enforcing some rules about when and where we are allowed
12523         to invoke certain methods (EmitContext.NeedsReturnLabel is the
12524         only one that enfonces this right now).
12525
12526         (EmitContext.HaveCaptureInfo): new helper method that returns
12527         whether we have a CapturedContext initialized.
12528
12529         (EmitContext.CaptureVariable): New method used to register that a
12530         LocalInfo must be flagged for capturing. 
12531
12532         (EmitContext.CapturedParameter): New method used to register that a
12533         parameters must be flagged for capturing. 
12534         
12535         (EmitContext.CapturedField): New method used to register that a
12536         field must be flagged for capturing. 
12537
12538         (EmitContext.HaveCapturedVariables,
12539         EmitContext.HaveCapturedFields): Return whether there are captured
12540         variables or fields. 
12541
12542         (EmitContext.EmitMethodHostInstance): This is used to emit the
12543         instance for the anonymous method.  The instance might be null
12544         (static methods), this (for anonymous methods that capture nothing
12545         and happen to live side-by-side with the current method body) or a
12546         more complicated expression if the method has a CaptureContext.
12547
12548         (EmitContext.EmitTopBlock): Routine that drives the emission of
12549         code: it will first resolve the top block, then emit any metadata
12550         and then emit the code.  The split is done so that we can extract
12551         any anonymous methods and flag any captured variables/parameters.
12552         
12553         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
12554         during this phase, the ILGenerator should not be used as labels
12555         and local variables declared here might not be accessible to any
12556         code that is part of an anonymous method.  
12557
12558         Exceptions to this include the temporary variables that are
12559         created by some statements internally for holding temporary
12560         variables. 
12561         
12562         (EmitContext.EmitMeta): New routine, in charge of emitting all the
12563         metadata for a cb
12564
12565         (EmitContext.TemporaryReturn): This method is typically called
12566         from the Emit phase, and its the only place where we allow the
12567         ReturnLabel to be defined other than the EmitMeta.  The reason is
12568         that otherwise we would have to duplicate a lot of logic in the
12569         Resolve phases of various methods that today is on the Emit
12570         phase. 
12571
12572         (EmitContext.NeedReturnLabel): This no longer creates the label,
12573         as the ILGenerator is not valid during the resolve phase.
12574
12575         (EmitContext.EmitThis): Extended the knowledge in this class to
12576         work in anonymous methods in addition to iterators. 
12577
12578         (EmitContext.EmitCapturedVariableInstance): This emits whatever
12579         code is necessary on the stack to access the instance to a local
12580         variable (the variable will be accessed as a field).
12581
12582         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
12583         EmitContext.EmitAddressOfParameter): Routines to support
12584         parameters (not completed at this point). 
12585         
12586         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
12587         will also remove the parameters.
12588
12589         * convert.cs (Convert): Define a `ConstantEC' which points to a
12590         null.  This is just to prefity some code that uses
12591         ImplicitStandardConversion code and do not have an EmitContext
12592         handy.
12593
12594         The idea is to flag explicitly that at that point in time, it is
12595         known that the conversion will not trigger the delegate checking
12596         code in implicit conversions (which requires a valid
12597         EmitContext). 
12598
12599         Everywhere: pass new EmitContext parameter since
12600         ImplicitStandardConversionExists now requires it to check for
12601         anonymous method conversions. 
12602
12603         (Convert.ImplicitStandardConversionExists): If the type of an
12604         expression is the anonymous_method_type, and the type is a
12605         delegate, we invoke the AnonymousMethod.Compatible method to check
12606         whether an implicit conversion is possible. 
12607
12608         (Convert.ImplicitConversionStandard): Only do implicit method
12609         group conversions if the language level is not ISO_1.
12610
12611         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
12612         MethodInfo for the Invoke method.  used by Delegate and
12613         AnonymousDelegate.
12614
12615         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
12616         method conversions if the target type is a delegate.
12617
12618         Removed extra debugging nops.
12619
12620         (LocalVariableReference): Turn the `local_info' into a public
12621         field. 
12622
12623         Add `prepared' field, the same hack used for FieldExprs to cope
12624         with composed assignments, as Local variables do not necessarily
12625         operate purely on the stack as they used to: they can be captured
12626         fields. 
12627
12628         Add `temp' for a temporary result, like fields.
12629
12630         Refactor DoResolve and DoResolveLValue into DoResolveBase.
12631
12632         It now copes with Local variables that are captured and emits the
12633         proper instance variable to load it from a field in the captured
12634         case. 
12635
12636         (ParameterReference.DoResolveBase): During the resolve phase,
12637         capture parameters if we are in an anonymous method.
12638
12639         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
12640         anonymous method, use the EmitContext helper routines to emit the
12641         parameter reference.
12642
12643         * iterators.cs: Set RemapToProxy to true/false during the
12644         EmitDispose class.
12645
12646         * parameters.cs (GetParameterByName): New helper method. 
12647
12648         * typemanager.cs (anonymous_method_type) a new type that
12649         represents an anonyous method.  This is always an internal type,
12650         used as a fencepost to test against the anonymous-methodness of an
12651         expression. 
12652         
12653 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
12654
12655         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
12656         561 report.
12657         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
12658
12659 2004-10-18  Martin Baulig  <martin@ximian.com>
12660
12661         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
12662         `Type' directly, but call ResolveType() on it.
12663         (Catch.Resolve): Likewise.
12664         (Foreach.Resolve): Likewise.
12665
12666 2004-10-18  Martin Baulig  <martin@ximian.com>
12667
12668         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
12669         `Type' directly, but call ResolveType() on it.
12670         (Probe.DoResolve): Likewise.
12671         (ArrayCreation.LookupType): Likewise.
12672         (TypeOf.DoResolve): Likewise.
12673         (SizeOf.DoResolve): Likewise.
12674
12675 2004-10-18  Martin Baulig  <martin@ximian.com>
12676
12677         * expression.cs (Invocation.BetterFunction): Put back
12678         TypeManager.TypeToCoreType().
12679
12680 2004-10-18  Raja R Harinath  <rharinath@novell.com>
12681
12682         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
12683         the ResolveType.
12684
12685 2004-10-18  Martin Baulig  <martin@ximian.com>
12686
12687         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
12688         `Type' directly, but call ResolveType() on it.
12689
12690 2004-10-18  Martin Baulig  <martin@ximian.com>
12691
12692         * class.cs (FieldMember.Define): Don't access the TypeExpr's
12693         `Type' directly, but call ResolveType() on it.
12694         (MemberBase.DoDefine): Likewise.
12695
12696         * expression.cs (New.DoResolve): Don't access the TypeExpr's
12697         `Type' directly, but call ResolveType() on it.
12698         (ComposedCast.DoResolveAsTypeStep): Likewise.
12699
12700         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
12701         `Type' directly, but call ResolveType() on it.
12702
12703 2004-10-17  John Luke  <john.luke@gmail.com>
12704
12705         * class.cs (Operator.GetSignatureForError): use CSharpName
12706
12707         * parameter.cs (Parameter.GetSignatureForError): Returns
12708         correct name even if was not defined.
12709
12710 2004-10-13  Raja R Harinath  <rharinath@novell.com>
12711
12712         Fix #65816.
12713         * class.cs (TypeContainer.EmitContext): New property.
12714         (DefineNestedTypes): Create an emitcontext for each part.
12715         (MethodCore.DoDefineParameters): Use container's emitcontext.
12716         Pass type array to InternalParameters.
12717         (MemberBase.DoDefine): Use container's emitcontext.
12718         (FieldMember.Define): Likewise.
12719         (Event.Define): Likewise.
12720         (SetMethod.GetParameterInfo): Change argument to EmitContext.
12721         Pass type array to InternalParameters.
12722         (SetIndexerMethod.GetParameterInfo): Likewise.
12723         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
12724         * delegate.cs (Define): Pass emitcontext to
12725         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
12726         array to InternalParameters.
12727         * expression.cs (ParameterReference.DoResolveBase): Pass
12728         emitcontext to GetParameterInfo.
12729         (ComposedCast.DoResolveAsTypeStep): Remove check on
12730         ec.ResolvingTypeTree.
12731         * parameter.cs (Parameter.Resolve): Change argument to
12732         EmitContext.  Use ResolveAsTypeTerminal.
12733         (Parameter.GetSignature): Change argument to EmitContext.
12734         (Parameters.ComputeSignature): Likewise.
12735         (Parameters.ComputeParameterTypes): Likewise.
12736         (Parameters.GetParameterInfo): Likewise.
12737         (Parameters.ComputeAndDefineParameterTypes): Likewise.
12738         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
12739         * support.cs (InternalParameters..ctor): Remove variant that takes
12740         a DeclSpace.
12741         * typemanager.cs (system_intptr_expr): New.
12742         (InitExpressionTypes): Initialize it.
12743
12744 2004-10-12  Chris Toshok  <toshok@ximian.com>
12745
12746         * cs-parser.jay: fix location for try_statement and catch_clause.
12747
12748 2004-10-11  Martin Baulig  <martin@ximian.com>
12749
12750         * report.cs: Don't make --fatal abort on warnings, we have
12751         -warnaserror for that.
12752
12753 2004-10-07  Raja R Harinath  <rharinath@novell.com>
12754
12755         More DeclSpace.ResolveType avoidance.
12756         * decl.cs (MemberCore.InUnsafe): New property.
12757         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
12758         with newly created EmitContext.
12759         (FieldMember.Define): Likewise.
12760         * delegate.cs (Delegate.Define): Likewise.
12761         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
12762         only if normal name-lookup fails.
12763         (TypeExpr.DoResolve): Enable error-checking.
12764         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
12765         (SizeOf.DoResolve): Likewise.
12766         (ComposedCast.DoResolveAsTypeStep): Likewise.
12767         (StackAlloc.DoResolve): Likewise.
12768         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
12769         (Block.Unsafe): New property.
12770         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
12771         (Unsafe): Set 'unsafe' flag of contained block.
12772         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
12773         (Fixed.Resolve): Likewise.
12774         (Catch.Resolve): Likewise.
12775         (Using.ResolveLocalVariableDecls): Likewise.
12776         (Foreach.Resolve): Likewise.
12777
12778 2004-10-05  John Luke <john.luke@gmail.com>
12779
12780         * cs-parser.jay: add location to error CS0175
12781
12782 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
12783
12784         * ecore.cs (Expression.Constantity): Add support for turning null
12785         into a constant.
12786
12787         * const.cs (Const.Define): Allow constants to be reference types
12788         as long as the value is Null.
12789
12790 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
12791
12792         * namespace.cs (NamespaceEntry.Using): No matter which warning
12793         level is set, check if this namespace name has already been added.
12794
12795 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
12796
12797         * expression.cs: reftype [!=]= null should always use br[true,false].
12798         # 67410
12799
12800 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
12801
12802         Fix #67108
12803         * attribute.cs: Enum conversion moved to 
12804         GetAttributeArgumentExpression to be applied to the all
12805         expressions.
12806
12807 2004-10-01  Raja R Harinath  <rharinath@novell.com>
12808
12809         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
12810         * class.c (TypeContainer.DefineType): Flag error if
12811         base types aren't accessible due to access permissions.
12812         * decl.cs (DeclSpace.ResolveType): Move logic to
12813         Expression.ResolveAsTypeTerminal.
12814         (DeclSpace.ResolveTypeExpr): Thin layer over
12815         Expression.ResolveAsTypeTerminal.
12816         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
12817         Refactor code into NestedAccess.  Use it.
12818         (DeclSpace.NestedAccess): New.
12819         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
12820         argument to silence errors.  Check access permissions.
12821         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
12822         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
12823         (Cast.DoResolve): Likewise.
12824         (New.DoResolve): Likewise.
12825         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
12826         (TypeOf.DoResolve): Likewise.
12827
12828         * expression.cs (Invocation.BetterConversion): Return the Type of
12829         the better conversion.  Implement section 14.4.2.3 more faithfully.
12830         (Invocation.BetterFunction): Make boolean.  Make correspondence to
12831         section 14.4.2.2 explicit.
12832         (Invocation.OverloadResolve): Update.
12833         (Invocation): Remove is_base field.
12834         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
12835         (Invocation.Emit): Likewise.
12836
12837 2004-09-27  Raja R Harinath  <rharinath@novell.com>
12838
12839         * README: Update to changes.
12840
12841 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
12842
12843         * cs-parser.jay: Reverted 642 warning fix.
12844
12845 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
12846
12847         Fix bug #66615
12848         * decl.cs (FindMemberWithSameName): Indexer can have more than
12849         1 argument.
12850
12851 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
12852
12853         * expression.cs (LocalVariableReference.DoResolveLValue):
12854         Do not report warning 219 for out values.
12855         (EmptyExpression.Null): New member to avoid extra allocations.
12856
12857 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
12858
12859         * cs-parser.jay: Fix wrong warning 642 report.
12860
12861         * cs-tokenizer.cs (CheckNextToken): New helper;
12862         Inspect next character if is same as expected.
12863
12864 2004-09-23  Martin Baulig  <martin@ximian.com>
12865
12866         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
12867         (Convert.ImplicitReferenceConversionExists): Likewise.
12868
12869 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
12870
12871         * class.cs (Operator.Define): Add error 448 and 559 report.
12872
12873 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
12874
12875         * class.cs (MemberBase.IsTypePermitted): New protected
12876         method for checking error CS0610.
12877
12878 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
12879
12880         * class.cs (TypeContainer.HasExplicitLayout): New property
12881         Returns whether container has StructLayout attribute set Explicit.
12882         (FieldMember): New abstract class for consts and fields.
12883         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
12884         (Field): Reuse FieldMember.
12885
12886         * const.cs (Const): Reuse FieldMember.
12887
12888         * rootcontext.cs: EmitConstants call moved to class.
12889
12890 2004-09-22  Martin Baulig  <martin@ximian.com>
12891
12892         Thanks to Peter Sestoft for this bug report.
12893
12894         * expression.cs (Conditional): If both the `trueExpr' and the
12895         `falseExpr' is a NullLiteral, return a NullLiteral.
12896
12897 2004-09-22  Martin Baulig  <martin@ximian.com>
12898
12899         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
12900         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
12901         for the "get_Current" call.
12902
12903 2004-09-22  Martin Baulig  <martin@ximian.com>
12904
12905         Marek and me just fixed one of our oldest bugs: #28562 :-)
12906
12907         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
12908
12909         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
12910         we're an EnumConstant, just return that.
12911         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
12912         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
12913         to get the value which'll actually be written into the attribute.
12914         However, we have to use GetValue() to access the attribute's value
12915         in the compiler.        
12916
12917 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
12918
12919         * constant.cs (Constant.IsNegative): New abstract property
12920         IsNegative.
12921
12922         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
12923         (StackAlloc.DoResolve): Reused IsNegative.
12924
12925 2004-09-21  Martin Baulig  <martin@ximian.com>
12926
12927         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
12928         if we're used in an iterator, we may be called from different
12929         methods.
12930
12931         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
12932         we actually have an exception block.
12933
12934 2004-09-20  John Luke <jluke@cfl.rr.com>
12935
12936         * class.cs, cs-parser.jay: Improve the error report for 1520:
12937         report the actual line where the error happens, not where the
12938         class was declared.
12939
12940         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
12941         Pass location information that was available elsewhere.
12942
12943 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
12944
12945         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
12946         runtime to delay sign assemblies.
12947
12948 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
12949
12950         * cs-parser.jay: Do not report the stack trace, this is barely
12951         used nowadays.
12952
12953 2004-08-22  John Luke  <john.luke@gmail.com>
12954  
12955         * driver.cs : check that a resource id is not already used
12956         before adding it, report CS1508 if it is, bug #63637
12957
12958 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
12959
12960         * ecore.cs: Removed dead code.
12961
12962 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
12963
12964         * class.cs: Do not report warning CS0067 on the interfaces.
12965
12966 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
12967
12968         * cs-parser.jay: Add error 504 report.
12969
12970 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
12971
12972         * rootcontext.cs: WarningLevel is 4 by default now.
12973
12974         * statement.cs (Fixed.Resolve): Do not null
12975         VariableInfo.
12976
12977 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
12978
12979         Fixed bug #55780
12980         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
12981         deep search when property is not virtual.
12982         (PropertyExpr.ResolveAccessors): Make one call for both
12983         accessors.
12984
12985 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
12986
12987         Fixed bug #65766
12988         * statement.cs: Error 152 report constains also location.
12989
12990 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
12991
12992         Fixed bug #65766
12993         * const.cs: Explicitly set constant as static.
12994
12995 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
12996
12997         Fixed bug #64226
12998         * cs-parser.jay: Add error 1017 report.
12999
13000 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
13001
13002         Fixed bug #59980, #64224
13003         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
13004
13005         * typemanager.cs (IsSpecialMethod): Simplified
13006
13007 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13008
13009         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
13010         condition with better params.
13011
13012 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13013
13014         Fixed bug #65238
13015         * attribute.cs (Resolve): Property has to have both
13016         accessors.
13017
13018 2004-09-14  Martin Baulig  <martin@ximian.com>
13019
13020         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
13021
13022 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
13023
13024         Fixed bug #61902
13025         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
13026         called and is obsolete then this member suppress message
13027         when call is inside next [Obsolete] method or type.
13028
13029         * expression.cs: Use TestObsoleteMethodUsage member.
13030
13031 2004-09-14  Martin Baulig  <martin@ximian.com>
13032
13033         * cs-parser.jay: Sync a bit with the GMCS version.
13034
13035 2004-09-14  Martin Baulig  <martin@ximian.com>
13036
13037         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
13038         (CSharpParser.yacc_verbose_flag): New public field.
13039
13040         * genericparser.cs: Removed.
13041
13042 2004-09-14  Raja R Harinath  <rharinath@novell.com>
13043
13044         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
13045
13046 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
13047
13048         * class.cs (MethodCore.CheckBase): Fix bug #65757.
13049
13050 2004-09-10  Martin Baulig  <martin@ximian.com>
13051
13052         Backported my MemberName changes from GMCS into MCS.
13053
13054         - we are now using a special `MemberName' class instead of using
13055         strings; in GMCS, the `MemberName' also contains the type
13056         arguments.
13057
13058         - changed the grammar rules a bit:
13059           * the old `member_name' is now a `namespace_or_type_name':
13060             The rule is that we use `namespace_or_type_name' everywhere
13061             where we expect either a "member name" (GetEnumerator) or a
13062             "member name" with an explicit interface name
13063             (IEnumerable.GetEnumerator).
13064             In GMCS, the explicit interface name may include type arguments
13065             (IEnumerable<T>.GetEnumerator).
13066           * we use `member_name' instead of just `IDENTIFIER' for
13067             "member names":
13068             The rule is that we use `member_name' wherever a member may
13069             have type parameters in GMCS.       
13070
13071         * decl.cs (MemberName): New public class.
13072         (MemberCore.MemberName): New public readonly field.
13073         (MemberCore.ctor): Take a `MemberName' argument, not a string.
13074         (DeclSpace): Likewise.
13075
13076         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
13077         * enum.cs (Enum.ctor): Likewise.
13078
13079         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
13080         MemberName.     
13081         (AliasEntry.ctor): Take a MemberName, not an Expression.
13082         (AliasEntry.UsingAlias): Likewise.
13083
13084         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
13085         (IMethodData.MemberName): Changed type from string to MemberName.
13086         (MemberBase.ExplicitInterfaceName): Likewise.
13087         (AbstractPropertyEventMethod.SetupName): Make this private.
13088         (AbstractPropertyEventMethod.ctor): Added `string prefix'
13089         argument; compute the member name here.
13090         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
13091         on the `member.MemberName' and the `prefix'.
13092
13093         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
13094         not `type_name'.
13095         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
13096         thus, we get a `MemberName' instead of a `string'.  These
13097         declarations may have type parameters in GMCS.
13098         (interface_method_declaration, delegate_declaration): Likewise.
13099         (class_declaration, interface_declaration): Likewise.
13100         (method_header): Use `namespace_or_type_name' instead of
13101         `member_name'.  We may be an explicit interface implementation.
13102         (property_declaration, event_declaration): Likewise.
13103         (member_name): This is now just an `IDENTIFIER', not a
13104         `namespace_or_type_name'.
13105         (type_name, interface_type): Removed.
13106         (namespace_or_type_name): Return a MemberName, not an Expression.
13107         (primary_expression): Use `member_name' instead of `IDENTIFIER';
13108         call GetTypeExpression() on the MemberName to get an expression.
13109         (IndexerDeclaration.interface_type): Changed type from string to
13110         MemberName.
13111         (MakeName): Operate on MemberName's instead of string's.
13112
13113 2004-09-13  Raja R Harinath  <rharinath@novell.com>
13114
13115         Fix bug #55770.
13116         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
13117         (NamespaceEntry.Lookup): Add new argument to flag if we want the
13118         lookup to avoid symbols introduced by 'using'.
13119         * rootcontext.cs (NamespaceLookup): Update.
13120
13121 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13122
13123         * class.cs (TypeContainer.DoDefineMembers): Do not call
13124         DefineDefaultConstructor for static classes.
13125
13126 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
13127
13128         * attribute.cs (Attribute.Resolve): Add error 653 report.
13129
13130         * class.cs (Class.ApplyAttributeBuilder): Add error 641
13131         report.
13132         (Method.ApplyAttributeBuilder): Add error 685 report.
13133         (Operator.Define): Add error 564 report.
13134
13135         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
13136
13137         * expression.cs (Invocation.DoResolve): Add error
13138         245 and 250 report.
13139
13140         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
13141         error 674 report.
13142
13143 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13144
13145         * class.cs (ConstructorInitializer.Resolve):
13146         Wrong error number (515->516).
13147
13148 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13149
13150         * class.cs (Indexer.Define): Add error 631 report.
13151
13152 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13153
13154         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
13155
13156 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
13157
13158         * expression.cs (Probe.DoResolve): Add error CS0241 report.
13159
13160 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
13161
13162         * cs-parser.jay: Added error CS0241 report.
13163
13164 2004-09-10  Raja R Harinath  <rharinath@novell.com>
13165
13166         * cs-parser.jay (fixed_statement): Introduce a scope for the
13167         declaration in the 'fixed' statement.
13168
13169 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13170
13171         * cs-parser.jay: Added CS0230 error report.
13172
13173 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13174
13175         * cs-parser.jay: Added errors CS0231 and CS0257 report.
13176
13177 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13178
13179         * expression.cs (Argument.Resolve): Added error CS0192 and
13180         CS0199 report.
13181
13182 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
13183
13184         C# 2.0 #pragma warning feature
13185
13186         * cs-tokenizer.cs (PreProcessPragma): New method; 
13187         Handles #pragma directive.
13188
13189         * report.cs (WarningRegions): New class; Support
13190         class for #pragma warning directive. It tests whether
13191         warning is enabled for a given line.
13192
13193 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
13194
13195         * const.cs: Add more descriptive error report, tahnks to
13196         Sebastien. 
13197
13198 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
13199
13200         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
13201
13202 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
13203
13204         * expression.cs: Apply patch from Ben: Remove dead code from
13205         ArrayCreation, and remove the TurnintoConstant call in const.cs,
13206         as that code just threw an exception anwyays.
13207
13208         * const.cs: Remove the call to the turnintoconstant, for details
13209         see bug: #63144
13210         
13211         * literal.cs: The type of the null-literal is the null type;  So
13212         we use a placeholder type (literal.cs:System.Null, defined here)
13213         for it.
13214
13215         * expression.cs (Conditional.DoResolve): Remove some old code that
13216         is no longer needed, conversions have been fixed.
13217
13218         (ArrayCreationExpression.DoResolve): Return false if we fail to
13219         resolve the inner expression.
13220
13221 2004-09-07  Raja R Harinath  <rharinath@novell.com>
13222
13223         Fix test-290.cs.
13224         * cs-parser.jay (delegate_declaration): Record a delegate
13225         declaration as a type declaration.
13226         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
13227
13228 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
13229
13230         * parameter.cs: Do not crash if the type can not be resolved. 
13231
13232         * expression.cs: Report errors with unsafe pointers, fixes #64896
13233
13234 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
13235
13236         * expression.cs: Pointer arith always needs to do a conv.i
13237         if the operand is a long. fix 65320
13238
13239 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13240
13241         Fixed cs0619-37.cs, cs0619-38.cs
13242
13243         * enum.cs (GetObsoleteAttribute): Removed.
13244
13245         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
13246         on Enum member is double staged. The first is tested member
13247         and then enum.
13248
13249 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
13250
13251         Fixed #56986, #63631, #65231
13252
13253         * class.cs: (TypeContainer.AddToMemberContainer): New method,
13254         adds member to name container.
13255         (TypeContainer.AddToTypeContainer): New method, adds type to
13256         name container.
13257         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
13258         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
13259         AddOperator): Simplified by reusing AddToMemberContainer.
13260         (TypeContainer.UserDefinedStaticConstructor): Changed to property
13261         instead of field.
13262         (Method.CheckForDuplications): Fixed implementation to test all
13263         possibilities.
13264         (MemberBase): Detection whether member is explicit interface
13265         implementation is now in constructor.
13266         (MemberBase.UpdateMemberName): Handles IndexerName.
13267         (Accessor): Changed to keep also location information.
13268         (AbstractPropertyEventMethod): Is derived from MemberCore.
13269         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
13270         will be emited or not.
13271         (PropertyBase.AreAccessorsDuplicateImplementation):
13272         Tests whether accessors are not in collision with some method.
13273         (Operator): Is derived from MethodCore to simplify common
13274         operations.
13275
13276         * decl.cs (Flags.TestMethodDuplication): Test for duplication
13277         must be performed.
13278         (DeclSpace.AddToContainer): Adds the member to defined_names
13279         table. It tests for duplications and enclosing name conflicts.
13280
13281         * enum.cs (EnumMember): Clean up to reuse the base structures
13282
13283 2004-09-03  Martin Baulig  <martin@ximian.com>
13284
13285         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
13286         into TypeContainer, to make partial classes work again.
13287
13288 2004-09-03  Martin Baulig  <martin@ximian.com>
13289
13290         * rootcontext.cs (RootContext.V2): Removed.
13291
13292 2004-03-23  Martin Baulig  <martin@ximian.com>
13293
13294         * expression.cs (Invocation.OverloadResolve): Added `bool
13295         may_fail' argument and use it instead of the Location.IsNull() hack.
13296
13297 2004-09-03  Martin Baulig  <martin@ximian.com>
13298
13299         Merged latest changes into gmcs.  Please keep this comment in
13300         here, it makes it easier for me to see what changed in MCS since
13301         the last time I merged.
13302
13303 2004-09-03  Raja R Harinath  <rharinath@novell.com>
13304
13305         Fix #61128.
13306         * expression.cs (BetterConversion): Don't allow either conversion 
13307         to be null.  Remove redundant implicit conversion test when 'q ==
13308         null' -- when this function is invoked, we already know that the
13309         implicit conversion exists.
13310         (BetterFunction): Assume that 'best' is non-null.  Remove
13311         redundant reimplementation of IsApplicable when 'best' is null.
13312         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
13313         number of arguments.
13314         (IsAncestralType): Extract from OverloadResolve.
13315         (OverloadResolve): Make robust to the MethodGroupExpr being
13316         unsorted.  Implement all the logic of Section 14.5.5.1, and
13317         support overloading of methods from multiple applicable types.
13318         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
13319
13320         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
13321         (RealError, Warning): Append type of report to related symbol.
13322
13323 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
13324
13325         * enum.cs: Fixed CLS-Compliance checks for enum members.
13326         Error tests cs3008-8.cs, cs3014-8.cs
13327
13328 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13329
13330         Fixed bug #62342, #63102
13331         * class.cs: ImplementIndexer uses member.IsExplicitImpl
13332         like ImplementMethod.
13333
13334 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
13335
13336         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13337         Fixed bug #65170.
13338
13339 2004-09-02  Martin Baulig  <martin@ximian.com>
13340
13341         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
13342         TypeManager.GetArgumentTypes() rather than calling GetParameters()
13343         on the MethodBase.
13344
13345 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
13346
13347         C# 2.0 Static classes implemented
13348
13349         * class.cs (TypeContainer): instance_constructors,
13350         initialized_fields, initialized_static_fields,
13351         default_constructor, base_inteface_types are protected to be
13352         accessible from StaticClass.
13353         (TypeContainer.DefineDefaultConstructor): New virtual method
13354         for custom default constructor generating
13355         (StaticClass): New class to handle "Static classes" feature.
13356
13357         * cs-parser.jay: Handle static keyword on class like instance
13358         of StaticClass.
13359
13360         * driver.cs: Added "/langversion" command line switch with two
13361         options (iso-1, default).
13362
13363 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
13364
13365         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
13366
13367 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
13368
13369         * delegate.cs: Style.
13370
13371 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
13372
13373         * delegate.cs: Add seperate instance expr field for miguel.
13374
13375 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13376
13377         * PointerArithmetic (Resolve): make sure we are not doing
13378         pointer arith on void*. Also, make sure we are resolved
13379         by not setting eclass until resolve.
13380
13381         All callers: Make sure that PointerArithmetic gets resolved.
13382
13383 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
13384
13385         * ArrayCreation (LookupType): If the type does not resolve 
13386         to an array, give an error.
13387
13388 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
13389
13390         * statement.cs (Try.Resolve): Fixed bug #64222
13391
13392 2004-08-27  Martin Baulig  <martin@ximian.com>
13393
13394         * class.cs
13395         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
13396         crash here.     
13397
13398 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13399
13400         * ecore.cs (Constantify): Get underlying type via
13401         System.Enum.GetUnderlyingType to avoid StackOverflow on the
13402         Windows in special cases.
13403
13404 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
13405
13406         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
13407         for obtaining also private methods.
13408         (GetRemoveMethod): Used GetRemoveMethod (true)
13409         for obtaining also private methods.
13410
13411 2004-08-24  Martin Baulig  <martin@ximian.com>
13412
13413         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
13414         MethodAttributes.HideBySig for operators.
13415
13416 2004-08-23  Martin Baulig  <martin@ximian.com>
13417
13418         Back to the old error reporting system :-)
13419
13420         * report.cs (Message): Removed.
13421         (Report.MessageData, ErrorData, WarningData): Removed.
13422         (Report.Error, Warning): Back to the old system.
13423
13424 2004-08-23  Martin Baulig  <martin@ximian.com>
13425
13426         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
13427
13428         * class.cs (TypeContainer.ParentContainer): New public virtual
13429         method; replaces the explicit interface implementation.
13430         (ClassPart.ParentContainer): Override.
13431
13432 2004-08-23  Martin Baulig  <martin@ximian.com>
13433
13434         * statement.cs (Switch): Added support for constant switches; see
13435         #59428 or test-285.cs.
13436
13437 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13438
13439         Fixed bug #62740.
13440         * statement.cs (GetEnumeratorFilter): Removed useless
13441         logic because C# specs is strict. GetEnumerator must be
13442         public.
13443
13444 2004-08-22  Martin Baulig  <martin@ximian.com>
13445
13446         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
13447         a switch and may break, reset the barrier.  Fixes #59867.
13448
13449 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
13450
13451         CLS-Compliance speed up (~5% for corlib)
13452
13453         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
13454         New method. Tests container for CLS-Compliant names
13455
13456         * class.cs (TypeContainer.VerifyClsName): New method.
13457         Checks whether container name is CLS Compliant.
13458         (Constructor): Implements IMethodData.
13459
13460         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
13461         low-case table for CLS Compliance test.
13462         (MemberCache.VerifyClsParameterConflict): New method.
13463         Checks method parameters for CS3006 error.
13464
13465         * enum.cs (EnumMember): Is derived from MemberCore.
13466         (Enum.VerifyClsName): Optimized for better performance.
13467
13468 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13469
13470         * report.cs: Renamed Error_T to Error and changed all
13471         references.
13472
13473 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
13474
13475         * class.cs (TypeContainer.IndexerArrayList): New inner class
13476         container for indexers.
13477         (TypeContainer.DefaultIndexerName): New constant for default
13478         indexer name. Replaced all "Item" with this constant.
13479         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
13480
13481         * typemanager.cs (TypeManager.default_member_ctor): Cache here
13482         DefaultMemberAttribute constructor.
13483
13484 2004-08-05  Martin Baulig  <martin@ximian.com>
13485
13486         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
13487         Fix bug #59429.
13488
13489 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
13490
13491         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
13492         multi platforms problem.
13493
13494         * compiler.csproj: Included shared files.
13495
13496 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13497
13498         Fix bug 60333, 55971 in the more general way
13499         * attribute.cs (Attribute.GetAttributeArgumentExpression):
13500         Added arg_type argument for constant conversion.
13501         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
13502
13503 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13504
13505         Fix bug #59760
13506         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
13507         OperatorArrayList, MethodCoreArrayList for typecontainer
13508         containers. Changed class member types to these new types.
13509         (MethodArrayList.DefineMembers): Added test for CS0659.
13510
13511 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
13512
13513         * cfold.cs: Synchronize the folding with the code in expression.cs
13514         Binary.DoNumericPromotions for uint operands.
13515
13516         * attribute.cs: Revert patch from Raja, it introduced a regression
13517         while building Blam-1.2.1 (hard to isolate a test case).
13518
13519 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
13520
13521         Fix for #55382
13522         * class.cs:
13523         (TypeContainer.Define): Renamed to DefineContainerMembers because of
13524         name collision.
13525         (MethodCore.parent_method): New member. The method we're overriding
13526         if this is an override method.
13527         (MethodCore.CheckBase): Moved from Method class and made common.
13528         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
13529         private.
13530         (MethodCore.CheckForDuplications): New abstract method. For custom
13531         member duplication search in a container
13532         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
13533         method and its return type.
13534         (Event.conflict_symbol): New member. Symbol with same name in the
13535         parent class.
13536
13537         * decl.cs:
13538         (MemberCache.FindMemberWithSameName): New method. The method
13539         is looking for conflict with inherited symbols.
13540
13541 2004-08-04  Martin Baulig  <martin@ximian.com>
13542
13543         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
13544
13545         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
13546
13547 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13548
13549         * report.cs (Message): New enum for better error, warning reference in
13550         the code.
13551         (MessageData): New inner abstract class. It generally handles printing of
13552         error and warning messages.
13553         Removed unused Error, Warning, Message methods.
13554
13555 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13556
13557         Fix for cs0592-8.cs test
13558         * attribute.cs
13559         (Attributable.ValidAttributeTargets): Made public.
13560         (Attribute.ExplicitTarget): New member for explicit target value.
13561         (Attribute.CheckTargets): Now we translate explicit attribute
13562         target to Target here.
13563
13564 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
13565
13566         * ecore.cs (MethodGroupExpr): new IsBase property.
13567
13568         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
13569
13570         * delegate.cs (DelegateCreation): store a MethodGroupExpr
13571         rather than an instance expr.
13572
13573         (DelegateCreation.Emit): Use the method group rather than
13574         the instance expression. Also, if you have base.Foo as the
13575         method for a delegate, make sure to emit ldftn, not ldftnvirt.
13576
13577         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
13578
13579         (NewDelegate.DoResolve): Only check for the existance of Invoke
13580         if the method is going to be needed. Use MethodGroupExpr.
13581
13582         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
13583
13584         * expression.cs: For pointer arith., make sure to use
13585         the size of the type, not the size of the pointer to
13586         the type.
13587
13588 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
13589
13590         Fix for #60722
13591         * class.cs (Class): Added error CS0502 test.
13592
13593 2004-08-03  John Luke  <jluke@cfl.rr.com>
13594             Raja R Harinath  <rharinath@novell.com>
13595
13596         Fix for #60997.
13597         * attribute.cs (Attribute.complained_before): New flag.
13598         (Attribute.ResolveType, Attribute.Resolve),
13599         (Attribute.DefinePInvokeMethod): Set it.
13600         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
13601         
13602 2004-08-03  Martin Baulig  <martin@ximian.com>
13603
13604         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
13605         use a user-defined operator; we still need to do numeric
13606         promotions in case one argument is a builtin type and the other
13607         one has an implicit conversion to that type.  Fixes #62322.
13608
13609 2004-08-02  Martin Baulig  <martin@ximian.com>
13610
13611         * statement.cs (LocalInfo.Flags): Added `IsThis'.
13612         (LocalInfo.IsThis): New public property.
13613         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
13614
13615 2004-08-01  Martin Baulig  <martin@ximian.com>
13616
13617         * class.cs (TypeContainer.GetClassBases): Don't set the default
13618         here since we may get called from GetPartialBases().
13619         (TypeContainer.DefineType): If GetClassBases() didn't return a
13620         parent, use the default one.
13621
13622 2004-07-30  Duncan Mak  <duncan@ximian.com>
13623
13624         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
13625
13626 2004-07-30  Martin Baulig  <martin@ximian.com>
13627
13628         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
13629
13630         * class.cs (SourceMethod): New public class, derive from the
13631         symbol writer's ISourceMethod.
13632         (Method): Use the new symbol writer API.
13633
13634         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
13635         as argument and use the new symbol writer.
13636
13637         * location.cs
13638         (SourceFile): Implement the symbol writer's ISourceFile.
13639         (Location.SymbolDocument): Removed.
13640         (Location.SourceFile): New public property.
13641
13642         * symbolwriter.cs: Use the new symbol writer API.
13643
13644 2004-07-30  Raja R Harinath  <rharinath@novell.com>
13645
13646         * Makefile (install-local): Remove.  Functionality moved to
13647         executable.make.
13648
13649 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
13650
13651         * Makefile: Install mcs.exe.config file together with mcs.exe.
13652         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
13653         correct runtime version.
13654         
13655 2004-07-25  Martin Baulig  <martin@ximian.com>
13656
13657         * class.cs
13658         (TypeContainer.RegisterOrder): Removed, this was unused.
13659         (TypeContainer, interface_order): Removed.
13660         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
13661         TypeContainer as argument since we can also be called with a
13662         `PartialContainer' for a partial class/struct/interface.
13663         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
13664         of checking whether we're an `Interface' - we could be a
13665         `PartialContainer'.
13666         (PartialContainer.Register): Override; call
13667         AddClass()/AddStruct()/AddInterface() on our parent.
13668
13669         * cs-parser.jay (interface_member_declaration): Add things to the
13670         `current_container', not the `current_class'.
13671
13672         * rootcontext.cs (RegisterOrder): The overloaded version which
13673         takes an `Interface' was unused, removed.
13674
13675         * typemanager.cs (TypeManager.LookupInterface): Return a
13676         `TypeContainer', not an `Interface'.
13677         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
13678         contain a `PartialContainer' for an interface, so check it's
13679         `Kind' to figure out what it is.
13680
13681 2004-07-25  Martin Baulig  <martin@ximian.com>
13682
13683         * class.cs (Class.DefaultTypeAttributes): New public constant.
13684         (Struct.DefaultTypeAttributes): Likewise.
13685         (Interface.DefaultTypeAttributes): Likewise.
13686         (PartialContainer.TypeAttr): Override this and add the
13687         DefaultTypeAttributes.
13688
13689 2004-07-25  Martin Baulig  <martin@ximian.com>
13690
13691         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
13692         we can just use the `Parent' field instead.
13693
13694 2004-07-25  Martin Baulig  <martin@ximian.com>
13695
13696         * class.cs (TypeContainer.Emit): Renamed to EmitType().
13697
13698 2004-07-25  Martin Baulig  <martin@ximian.com>
13699
13700         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
13701         our parts before defining any methods.
13702         (TypeContainer.VerifyImplements): Make this virtual.
13703         (ClassPart.VerifyImplements): Override and call VerifyImplements()
13704         on our PartialContainer.
13705
13706 2004-07-25  Martin Baulig  <martin@ximian.com>
13707
13708         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
13709
13710         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
13711         argument, we can just use the `Parent' field instead.
13712
13713         * class.cs
13714         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
13715         (MemberBase.DoDefine): Likewise.
13716
13717 2004-07-24  Martin Baulig  <martin@ximian.com>
13718
13719         * decl.cs (MemberCore.Parent): New public field.
13720         (DeclSpace.Parent): Moved to MemberCore.
13721
13722         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
13723         (MemberBase.ctor): Added TypeContainer argument, pass it to our
13724         parent's .ctor.
13725         (FieldBase, Field, Operator): Likewise.
13726         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
13727         (EventField, Event): Likewise.
13728
13729 2004-07-23  Martin Baulig  <martin@ximian.com>
13730
13731         * class.cs (PartialContainer): New public class.
13732         (ClassPart): New public class.
13733         (TypeContainer): Added support for partial classes.
13734         (TypeContainer.GetClassBases): Splitted some of the functionality
13735         out into GetNormalBases() and GetPartialBases().
13736
13737         * cs-tokenizer.cs (Token.PARTIAL): New token.
13738         (Tokenizer.consume_identifier): Added some hacks to recognize
13739         `partial', but only if it's immediately followed by `class',
13740         `struct' or `interface'.
13741
13742         * cs-parser.jay: Added support for partial clases.
13743
13744 2004-07-23  Martin Baulig  <martin@ximian.com>
13745
13746         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
13747         a `DeclSpace' and also made it readonly.
13748         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
13749         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
13750         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
13751
13752         * cs-parser.jay: Pass the `current_class', not the
13753         `current_container' (at the moment, this is still the same thing)
13754         to a new Method, Property, Event, Indexer or Constructor.
13755
13756 2004-07-23  Martin Baulig  <martin@ximian.com>
13757
13758         * cs-parser.jay (CSharpParser): Added a new `current_class' field
13759         and removed the `current_interface' one.
13760         (struct_declaration, class_declaration, interface_declaration):
13761         Set `current_class' to the newly created class/struct/interface;
13762         set their `Bases' and call Register() before parsing their body.
13763
13764 2004-07-23  Martin Baulig  <martin@ximian.com>
13765
13766         * class.cs (Kind): New public enum.
13767         (TypeContainer): Made this class abstract.
13768         (TypeContainer.Kind): New public readonly field.
13769         (TypeContainer.CheckDef): New public method; moved here from
13770         cs-parser.jay.
13771         (TypeContainer.Register): New public abstract method.
13772         (TypeContainer.GetPendingImplementations): New public abstract
13773         method.
13774         (TypeContainer.GetClassBases): Removed the `is_class' and
13775         `is_iface' parameters.
13776         (TypeContainer.DefineNestedTypes): Formerly known as
13777         DoDefineType().
13778         (ClassOrStruct): Made this class abstract.
13779
13780         * tree.cs (RootTypes): New public type. 
13781
13782 2004-07-20  Martin Baulig  <martin@ximian.com>
13783
13784         * tree.cs (Tree.RecordNamespace): Removed.
13785         (Tree.Namespaces): Removed.
13786
13787         * rootcontext.cs (RootContext.IsNamespace): Removed.
13788
13789         * cs-parser.jay (namespace_declaration): Just create a new
13790         NamespaceEntry here.
13791
13792 2004-07-20  Martin Baulig  <martin@ximian.com>
13793
13794         * statement.cs (ExceptionStatement): New abstract class.  This is
13795         now used as a base class for everyone who's using `finally'.
13796         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
13797         our local variables before using them.
13798
13799         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
13800         virtual method.  This is used by Yield.Resolve() to "steal" an
13801         outer block's `finally' clauses.
13802         (FlowBranchingException): The .ctor now takes an ExceptionStatement
13803         argument.
13804
13805         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
13806         version which takes an ExceptionStatement.  This version must be
13807         used to create exception branchings.
13808
13809         * iterator.cs
13810         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
13811         (Iterator.EmitMoveNext): Added exception support; protect the
13812         block with a `fault' clause, properly handle 'finally' clauses.
13813         (Iterator.EmitDispose): Run all the `finally' clauses here.
13814
13815 2004-07-20  Martin Baulig  <martin@ximian.com>
13816
13817         * iterator.cs: This is the first of a set of changes in the
13818         iterator code.  Match the spec more closely: if we're an
13819         IEnumerable, then GetEnumerator() must be called.  The first time
13820         GetEnumerator() is called, it returns the current instance; all
13821         subsequent invocations (if any) must create a copy.
13822
13823 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
13824
13825         * expression.cs: Resolve the constant expression before returning
13826         it. 
13827
13828 2004-07-19  Martin Baulig  <martin@ximian.com>
13829
13830         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
13831         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
13832         the return type of the new EmitContext.
13833
13834 2004-07-18  Martin Baulig  <martin@ximian.com>
13835
13836         * class.cs (Property.Define): Fix iterators.
13837
13838         * iterators.cs (Iterator.Define): Moved the
13839         `container.AddInterator (this)' call here from the .ctor; only do
13840         it if we resolved successfully.
13841
13842 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
13843
13844         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
13845         `true' for preprocessing directives that we parse.  The return
13846         value indicates whether we should return to regular tokenizing or
13847         not, not whether it was parsed successfully.
13848
13849         In the past if we were in: #if false ... #line #endif, we would
13850         resume parsing after `#line'.  See bug 61604.
13851
13852         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
13853         building: IsEnumType should return true only for enums, not for
13854         enums or System.Enum itself.  This fixes #61593.
13855
13856         Likely what happened is that corlib was wrong: mcs depended on
13857         this bug in some places.  The bug got fixed, we had to add the
13858         hack, which caused bug 61593.
13859
13860         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
13861         that was a workaround for the older conditions.
13862
13863 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
13864
13865         * assign.cs: IAssignMethod has a new interface, as documented
13866         inline. All assignment code now uses this new api.
13867
13868         * ecore.cs, expression.cs: All classes which implement
13869         IAssignMethod now use the new interface.
13870
13871         * expression.cs (Invocation): add a hack to EmitCall so that
13872         IndexerAccess can be the target of a compound assignment without
13873         evaluating its arguments twice.
13874
13875         * statement.cs: Handle changes in Invocation api.
13876
13877 2004-07-16  Martin Baulig  <martin@ximian.com>
13878
13879         * iterators.cs: Rewrote this.  We're now using one single Proxy
13880         class for both the IEnumerable and the IEnumerator interface and
13881         `Iterator' derives from Class so we can use the high-level API.
13882
13883         * class.cs (TypeContainer.AddIterator): New method.
13884         (TypeContainer.DoDefineType): New protected virtual method, which
13885         is called from DefineType().
13886         (TypeContainer.DoDefineMembers): Call DefineType() and
13887         DefineMembers() on all our iterators.
13888         (TypeContainer.Emit): Call Emit() on all our iterators.
13889         (TypeContainer.CloseType): Call CloseType() on all our iterators.
13890
13891         * codegen.cs (EmitContext.CurrentIterator): New public field.
13892
13893 2004-07-15  Martin Baulig  <martin@ximian.com>
13894
13895         * typemanager.cs
13896         (TypeManager.not_supported_exception_type): New type.   
13897
13898 2004-07-14  Martin Baulig  <martin@ximian.com>
13899
13900         * iterators.cs: Use real error numbers.
13901
13902 2004-07-14  Martin Baulig  <martin@ximian.com>
13903
13904         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
13905         requires this to be a System.Collection.IEnumerable and not a
13906         class implementing that interface.
13907         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
13908
13909 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
13910
13911         * class.cs: Fixed previous fix, it broke some error tests.
13912
13913 2004-07-12  Martin Baulig  <martin@ximian.com>
13914
13915         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
13916         Fixes #61293.
13917
13918 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
13919
13920         * assign.cs (LocalTemporary): Add new argument: is_address,If
13921         `is_address' is true, then the value that we store is the address
13922         to the real value, and not the value itself.
13923         
13924         * ecore.cs (PropertyExpr): use the new local temporary
13925         stuff to allow us to handle X.Y += z (where X is a struct)
13926
13927 2004-07-08  Martin Baulig  <martin@ximian.com>
13928
13929         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
13930         not always return, just like we're doing in Using.Resolve().
13931
13932 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
13933
13934         * cs-parser.jay (fixed_statement): flag this as Pinned.
13935
13936 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
13937
13938         * typemanager.cs (TypeManager): Removed MakePinned method, this
13939         mechanism is replaced with the .NET 2.x compatible mechanism of
13940         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
13941
13942         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
13943         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
13944         `IsFixed' property which has a different meaning.
13945
13946 2004-07-02  Raja R Harinath  <rharinath@novell.com>
13947
13948         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
13949         visible from inside a nested class, not just the names of the
13950         immediately enclosing class.
13951         Fix for bug #60730.
13952
13953 2004-06-24  Raja R Harinath  <rharinath@novell.com>
13954
13955         * expression.cs (BetterConversion): Remove buggy special-case
13956         handling of "implicit constant expression conversions".  At this
13957         point, we already know that the conversion is possible -- we're
13958         only checking to see which is better.
13959
13960 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
13961
13962         * cs-parser.jay: Added error CS0210 test.
13963
13964 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
13965
13966         * cs-parser.jay: Added error CS0134 test.
13967
13968 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
13969
13970         Fix bug #52507
13971         * cs-parser.jay: Added error CS0145 test.
13972
13973 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
13974
13975         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
13976
13977 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
13978         
13979         * expression.cs (StackAlloc.Resolve): The argument may not
13980         be a constant; deal with this case.
13981         
13982 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
13983
13984         * attribute.cs (IndexerName_GetIndexerName): Renamed to
13985         GetIndexerAttributeValue.
13986         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
13987
13988         * class.cs (Indexer.Define): Added error tests for CS0415,
13989         CS0609.
13990
13991 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
13992
13993         * attribute.cs (Attribute.Resolve): Keep field code in sync with
13994         property code.
13995
13996 2004-06-23  Martin Baulig  <martin@ximian.com>
13997
13998         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
13999         neither return nor throw, reset the barrier as well.  Fixes #60457.
14000
14001 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
14002
14003         * class.cs : EventAttributes is now set to None by default.
14004           This fixes bug #60459.
14005
14006 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
14007
14008         Fix bug #60219
14009         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14010         Don't throw exception but return null (it's sufficient now).
14011
14012 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
14013
14014         * typemanager.cs (GetArgumentTypes): Faster implementation.
14015
14016 2004-06-18  Martin Baulig  <martin@ximian.com>
14017
14018         * attribute.cs (Attribute.Resolve): Check whether we're an
14019         EmptyCast which a Constant child.  Fixes #60333.
14020
14021 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
14022
14023         * statement.cs (EmitCollectionForeach): Account for the fact that
14024         not all valuetypes are in areas which we can take the address of.
14025         For these variables, we store to a temporary variable. Also, make
14026         sure that we dont emit a `callvirt' on a valuetype method.
14027
14028 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14029
14030         * expression.cs (StackAlloc.DoReSolve): Added test for
14031         negative parameter (CS0247).
14032
14033 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14034
14035         Fix bug #59792
14036         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
14037
14038 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
14039
14040         Fix bug #59781
14041         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
14042         ulong.
14043
14044 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
14045
14046         Fix bug #58254 & cs1555.cs, cs1556.cs
14047         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
14048
14049 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
14050
14051         * cs-parser.jay: Added error CS1669 test for indexers.
14052
14053 2004-06-11  Martin Baulig  <martin@ximian.com>
14054
14055         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
14056         call this twice: for params and varargs methods.
14057
14058 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14059
14060         * class.cs:
14061         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
14062
14063 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14064
14065         * attribute.cs (Attribute.GetValidTargets): Made public.
14066
14067         * class.cs: 
14068         (AbstractPropertyEventMethod): New class for better code sharing.
14069         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
14070         CS1667 report.
14071         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
14072
14073 2004-06-11  Raja R Harinath  <rharinath@novell.com>
14074
14075         Fix bug #59477.
14076         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
14077         that the call to Resolve is part of a MemberAccess.
14078         (Expression.Resolve): Use it for SimpleName resolution.
14079         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
14080         Add 'intermediate' boolean argument.
14081         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
14082         error message when the SimpleName can be resolved ambiguously
14083         between an expression and a type.
14084         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
14085         public.
14086         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
14087         call on the left-side.
14088
14089 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14090
14091         * class.cs:
14092         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
14093
14094 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14095
14096         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
14097
14098 2004-06-11  Martin Baulig  <martin@ximian.com>
14099
14100         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
14101         varargs methods if applicable.
14102
14103 2004-06-11  Martin Baulig  <martin@ximian.com>
14104
14105         * expression.cs (Invocation.EmitCall): Don't use
14106         `method.CallingConvention == CallingConventions.VarArgs' since the
14107         method could also have `CallingConventions.HasThis'.
14108
14109 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
14110
14111         * class.cs (Event.GetSignatureForError): Implemented.
14112         Fixed crash in error test cs3010.cs
14113
14114 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
14115
14116         * cs-tokenizer.cs: Change the way we track __arglist to be
14117         consistent with the other keywords.
14118
14119 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
14120
14121         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
14122         tomorrow.
14123
14124 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
14125
14126         * codegen.cs: Check that all referenced assemblies have a strongname
14127         before strongnaming the compiled assembly. If not report error CS1577.
14128         Fix bug #56563. Patch by Jackson Harper.
14129         * typemanager.cs: Added a method to return all referenced assemblies.
14130         Fix bug #56563. Patch by Jackson Harper.
14131
14132 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14133
14134         * class.cs:
14135         (Method.ApplyAttributeBuilder): Moved and added conditional
14136         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
14137
14138         * delegate.cs:
14139         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
14140
14141 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
14142
14143         Fixed #59640
14144         * class.cs: (EventField.attribute_targets): Changed default target.
14145
14146 2004-06-08  Martin Baulig  <martin@ximian.com>
14147
14148         * expression.cs (Invocation.EmitCall): Enable varargs methods.
14149
14150 2004-06-08  Martin Baulig  <martin@ximian.com>
14151
14152         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
14153
14154 2004-06-07  Martin Baulig  <martin@ximian.com>
14155
14156         Added support for varargs methods.
14157
14158         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
14159         keyword.
14160
14161         * cs-parser.jay: Added support for `__arglist'.
14162
14163         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
14164
14165         * expression.cs (Argument.AType): Added `ArgList'.
14166         (Invocation): Added support for varargs methods.
14167         (ArglistAccess): New public class.
14168         (Arglist): New public class.
14169
14170         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
14171
14172         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
14173         a method's top-level block if the method has varargs.
14174
14175         * support.cs (ReflectionParameters, InternalParameters): Added
14176         support for varargs methods.    
14177
14178 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
14179
14180         * class.cs: Provide location in indexer error report.
14181
14182         * driver.cs: Use standard names.
14183
14184         * namespace.cs: Catch the use of using after a namespace has been
14185         declared also on using aliases.
14186
14187 2004-06-03  Raja R Harinath  <rharinath@novell.com>
14188
14189         Bug #50820.
14190         * typemanager.cs (closure_private_ok, closure_invocation_type)
14191         (closure_qualifier_type, closure_invocation_assembly)
14192         (FilterWithClosure): Move to ...
14193         (Closure): New internal nested class.
14194         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
14195         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
14196         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
14197         (MemberLookup, MemberLookupFailed): Use it.
14198         * expression.cs (New.DoResolve): Treat the lookup for the
14199         constructor as being qualified by the 'new'ed type.
14200         (Indexers.GetIndexersForTypeOrInterface): Update.
14201
14202 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
14203
14204         * attribute.cs
14205         (GetConditionalAttributeValue): New method. Returns
14206         condition of ConditionalAttribute.
14207         (SearchMulti): New method.  Returns all attributes of type 't'.
14208         Use it when attribute is AllowMultiple = true.
14209         (IsConditionalMethodExcluded): New method.
14210
14211         * class.cs
14212         (Method.IsExcluded): Implemented. Returns true if method has conditional
14213         attribute and the conditions is not defined (method is excluded).
14214         (IMethodData): Extended interface for ConditionalAttribute support.
14215         (PropertyMethod.IsExcluded): Implemented.
14216
14217         * decl.cs
14218         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
14219
14220         * expression.cs
14221         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
14222         on the method.
14223
14224 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
14225
14226         * expression.cs (ArrayCreationExpression): Make this just an
14227         `expression'. It can't be a statement, so the code here was
14228         dead.
14229
14230 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14231
14232         Fixed #59072
14233         * typemanager.cs (GetFullNameSignature): New method for
14234         MethodBase types.
14235
14236 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
14237
14238         Fixed #56452
14239         * class.cs (MemberBase.GetSignatureForError): New virtual method.
14240         Use this method when MethodBuilder is null.
14241         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
14242         Added test for error CS0626 (MONO reports error for this situation).
14243         (IMethodData.GetSignatureForError): Extended interface.
14244
14245 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14246
14247         * attribute.cs
14248         (AttributeTester.GetObsoleteAttribute): Returns instance of
14249         ObsoleteAttribute when type is obsolete.
14250
14251         * class.cs
14252         (TypeContainer.VerifyObsoleteAttribute): Override.
14253         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
14254         (MethodCode.VerifyObsoleteAttribute): Override.
14255         (MemberBase.VerifyObsoleteAttribute): Override.
14256
14257         * decl.cs
14258         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
14259         and report proper error.
14260
14261         *delegate.cs
14262         Delegate.VerifyObsoleteAttribute): Override.
14263
14264         * ecore.cs
14265         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
14266         and report proper error.
14267         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
14268
14269         * enum.cs
14270         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
14271         and enum member.
14272
14273         * expression.cs
14274         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
14275         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
14276         Added test for ObsoleteAttribute.
14277
14278         * statement.cs
14279         (Catch): Derived from Statement.
14280
14281 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
14282  
14283         Fixed bug #59071 & cs0160.cs
14284  
14285         * statement.cs (Try.Resolve): Check here whether order of catch
14286         clauses matches their dependencies.
14287
14288 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
14289
14290         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
14291         caused a regression: #59343.  Referencing nested classes from an
14292         assembly stopped working.
14293
14294 2004-05-31  Martin Baulig  <martin@ximian.com>
14295
14296         MCS is now frozen for beta 2.
14297
14298 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14299
14300         * convert.cs: add a trivial cache for overload operator resolution.
14301
14302 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14303
14304         * decl.cs: If possible, use lookuptypedirect here. We can only do
14305         this if there is no `.' after the namespace. Avoids using
14306         LookupType, which does lots of slow processing.
14307         (FindNestedType) New method, does what it says :-).
14308         * namespace.cs: use LookupTypeDirect.
14309         * rootcontext.cs: use membercache, if possible.
14310         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
14311
14312 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14313
14314         * expression.cs:
14315         According to the spec, 
14316
14317         In a member access of the form E.I, if E is a single identifier,
14318         and if the meaning of E as a simple-name (§7.5.2) is a constant,
14319         field, property, localvariable, or parameter with the same type as
14320         the meaning of E as a type-name (§3.8), then both possible
14321         meanings of E are permitted.
14322
14323         We did not check that E as a simple-name had the same type as E as
14324         a type name.
14325
14326         This trivial check gives us 5-7% on bootstrap time.
14327
14328 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
14329
14330         * expression.cs (Invocation.OverloadResolve): Avoid the
14331         use of hashtables and boxing here by allocating on demand.
14332
14333 2004-05-30  Martin Baulig  <martin@ximian.com>
14334
14335         * rootcontext.cs (RootContext.LookupType): Don't cache things if
14336         we're doing a silent lookup.  Don't try to lookup nested types in
14337         TypeManager.object_type (thanks to Ben Maurer).
14338
14339 2004-05-30  Martin Baulig  <martin@ximian.com>
14340
14341         Committing a patch from Ben Maurer.
14342
14343         * rootcontext.cs (RootContext.LookupType): Cache negative results.
14344
14345 2004-05-29  Martin Baulig  <martin@ximian.com>
14346
14347         * class.cs (IMethodData.ShouldIgnore): New method.
14348
14349         * typemanager.cs (TypeManager.MethodFlags): Don't take a
14350         `Location' argument, we don't need it anywhere.  Use
14351         `IMethodData.ShouldIgnore ()' instead of
14352         `MethodData.GetMethodFlags ()'.
14353         (TypeManager.AddMethod): Removed.
14354         (TypeManager.AddMethod2): Renamed to AddMethod.
14355
14356 2004-05-29  Martin Baulig  <martin@ximian.com>
14357
14358         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
14359
14360         * convert.cs (Convert.ImplicitReferenceConversion): If we're
14361         converting from a class type S to an interface type and we already
14362         have an object on the stack, don't box it again.  Fixes #52578.
14363
14364 2004-05-29  Martin Baulig  <martin@ximian.com>
14365
14366         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
14367         Added support for `params' parameters.  Fixes #59267.
14368
14369 2004-05-29  Martin Baulig  <martin@ximian.com>
14370
14371         * literal.cs (NullPointer): Provide a private .ctor which sets
14372         `type' to TypeManager.object_type.  Fixes #59048.
14373
14374 2004-05-29  Martin Baulig  <martin@ximian.com>
14375
14376         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
14377         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
14378
14379         * ecore.cs (EventExpr.instance_expr): Make the field private.
14380
14381 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
14382
14383         Fixed bug #50080 & cs0214-2.cs
14384         * expression.cs (Cast.DoResolve): Check unsafe context here.
14385         
14386         * statement.cs (Resolve.DoResolve): Likewise.
14387
14388 2004-05-26  Martin Baulig  <martin@ximian.com>
14389
14390         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
14391
14392         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
14393         (RootContext.LookupType): Pass down the `silent' flag.
14394
14395 2004-05-25  Martin Baulig  <martin@ximian.com>
14396
14397         * expression.cs
14398         (MethodGroupExpr.IdenticalTypeName): New public property.
14399         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
14400         expression actually refers to a type.
14401
14402 2004-05-25  Martin Baulig  <martin@ximian.com>
14403
14404         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
14405         for #56176 and made it actually work.
14406
14407 2004-05-25  Martin Baulig  <martin@ximian.com>
14408
14409         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
14410         (FieldExpr, PropertyExpr): Override and implement
14411         CacheTemporaries.  Fixes #52279.
14412
14413 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
14414
14415         * location.cs: In the new compiler listing a file twice is a
14416         warning, not an error.
14417
14418 2004-05-24  Martin Baulig  <martin@ximian.com>
14419
14420         * enum.cs (Enum.DefineType): For the `BaseType' to be a
14421         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
14422
14423 2004-05-24  Martin Baulig  <martin@ximian.com>
14424
14425         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
14426         walking the `using' list.  Fixes #53921.
14427
14428 2004-05-24  Martin Baulig  <martin@ximian.com>
14429
14430         * const.cs (Const.LookupConstantValue): Added support for
14431         EmptyCast's; fixes #55251.
14432
14433 2004-05-24  Martin Baulig  <martin@ximian.com>
14434
14435         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
14436         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
14437         which does the CS0135 check.  The reason is that we first need to
14438         check whether the variable actually exists.
14439
14440 2004-05-24  Martin Baulig  <martin@ximian.com>
14441
14442         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
14443         than RootContext.LookupType() to find the explicit interface
14444         type.  Fixes #58584.
14445
14446 2004-05-24  Raja R Harinath  <rharinath@novell.com>
14447
14448         * Makefile: Simplify.  Use executable.make.
14449         * mcs.exe.sources: New file.  List of sources of mcs.exe.
14450
14451 2004-05-24  Anders Carlsson  <andersca@gnome.org>
14452
14453         * decl.cs:
14454         * enum.cs:
14455         Use the invariant culture when doing String.Compare for CLS case
14456         sensitivity.
14457         
14458 2004-05-23  Martin Baulig  <martin@ximian.com>
14459
14460         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
14461         don't have any dots.  Fixes #52622, added cs0246-8.cs.
14462
14463         * namespace.cs (NamespaceEntry.Lookup): Likewise.
14464         
14465 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14466
14467         * class.cs (MemberBase.Define): Reuse MemberType member for 
14468         resolved type. Other methods can use it too.
14469
14470 2004-05-23  Martin Baulig  <martin@ximian.com>
14471
14472         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
14473         the variable also exists in the current block (otherwise, we need
14474         to report a CS0103).  Fixes #58670.
14475
14476 2004-05-23  Martin Baulig  <martin@ximian.com>
14477
14478         * flowanalysis.cs (Reachability.Reachable): Compute this
14479         on-the-fly rather than storing it as a field.
14480
14481 2004-05-23  Martin Baulig  <martin@ximian.com>
14482
14483         * flowanalysis.cs (Reachability.And): Manually compute the
14484         resulting `barrier' from the reachability.      
14485        
14486 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
14487
14488         Fix bug #57835
14489         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
14490         instance of ObsoleteAttribute when symbol is obsolete.
14491
14492         * class.cs
14493         (IMethodData): Extended interface for ObsoleteAttribute support.
14494
14495 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14496
14497         * attribute.cs: Fix bug #55970
14498
14499 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
14500
14501         Fix bug #52705
14502         * attribute.cs
14503         (GetObsoleteAttribute): New method. Creates the instance of
14504         ObsoleteAttribute.
14505         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
14506         ObsoleteAttribute when member is obsolete.
14507         (AttributeTester.Report_ObsoleteMessage): Common method for
14508         Obsolete error/warning reporting.
14509
14510         * class.cs
14511         (TypeContainer.base_classs_type): New member for storing parent type.
14512
14513         * decl.cs
14514         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
14515         for this MemberCore.
14516
14517 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14518
14519         * attribute.cs, const.cs: Fix bug #58590
14520
14521 2004-05-21  Martin Baulig  <martin@ximian.com>
14522
14523         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
14524         out parameters if the end of the method is unreachable.  Fixes
14525         #58098. 
14526
14527 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14528
14529         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
14530         Hari was right, why extra method.
14531
14532 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
14533
14534         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
14535
14536 2004-05-20  Martin Baulig  <martin@ximian.com>
14537
14538         Merged this back from gmcs to keep the differences to a minumum.
14539
14540         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
14541         instead of a Declspace.
14542         (Attribute.ResolveType): Likewise.
14543         (Attributes.Search): Likewise.
14544         (Attributes.Contains): Likewise.
14545         (Attributes.GetClsCompliantAttribute): Likewise.
14546
14547         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
14548         argument.
14549         (MethodData.ApplyAttributes): Take an EmitContext instead of a
14550         DeclSpace.
14551
14552 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
14553
14554         Fix bug #58688 (MCS does not report error when the same attribute
14555         is assigned twice)
14556
14557         * attribute.cs (Attribute.Emit): Distinction between null and default.
14558
14559 2004-05-19  Raja R Harinath  <rharinath@novell.com>
14560
14561         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
14562         of a top-level attribute without an attribute target.
14563         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
14564         Make non-static.
14565         (Attribute.Conditional_GetConditionName), 
14566         (Attribute.Obsolete_GetObsoleteMessage): Update.
14567         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
14568         part of ScanForIndexerName.
14569         (Attribute.CanIgnoreInvalidAttribute): New function.
14570         (Attribute.ScanForIndexerName): Move to ...
14571         (Attributes.ScanForIndexerName): ... here.
14572         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
14573         (Attributes.Search): New internal variant that can choose not to
14574         complain if types aren't resolved.  The original signature now
14575         complains.
14576         (Attributes.GetClsCompliantAttribute): Use internal variant, with
14577         complaints suppressed.
14578         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
14579         only if it not useful.
14580         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
14581         top-level for attributes that are shared between the assembly
14582         and a top-level class.
14583         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
14584         * class.cs: Update to reflect changes.
14585         (DefineIndexers): Fuse loops.
14586         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
14587         a couple more variants of attribute names.
14588
14589 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
14590
14591         Fix bug #52585 (Implemented explicit attribute declaration)
14592
14593         * attribute.cs:
14594         (Attributable.ValidAttributeTargets): New abstract method. It gets
14595         list of valid attribute targets for explicit target declaration.
14596         (Attribute.Target): It holds target itself.
14597         (AttributeSection): Removed.
14598         (Attribute.CheckTargets): New method. It checks whether attribute
14599         target is valid for the current element.
14600
14601         * class.cs:
14602         (EventProperty): New class. For events that are declared like
14603         property (with add and remove accessors).
14604         (EventField): New class. For events that are declared like field.
14605         class.cs
14606
14607         * cs-parser.jay: Implemented explicit attribute target declaration.
14608
14609         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
14610         Override ValidAttributeTargets.
14611
14612         * parameter.cs:
14613         (ReturnParameter): Class for applying custom attributes on 
14614         the return type.
14615         (ParameterAtribute): New class. Class for applying custom
14616         attributes on the parameter type.
14617
14618 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
14619
14620         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
14621         definitions. 
14622
14623         (Method): Allow UNSAFE here.
14624
14625         * modifiers.cs: Support unsafe reporting.
14626
14627 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
14628
14629         * decl.cs: Fix bug #58478.
14630
14631 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14632
14633         * statement.cs: When checking for unreachable code on an EmptyStatement,
14634         set the location. Fixes bug #58488.
14635
14636 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
14637
14638         * driver.cs: Add -pkg handling.
14639
14640         From Gonzalo: UseShelLExecute=false
14641
14642 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
14643
14644         * attribute.cs:
14645         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
14646         for attribute.
14647         (Attribute.IsClsCompliaceRequired): Moved to base for better
14648         accesibility.
14649         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
14650         when attribute is AttributeUsageAttribute.
14651         (Attribute.GetValidTargets): Simplified.
14652         (Attribute.GetAttributeUsage): New method returns AttributeUsage
14653         attribute for this type.
14654         (Attribute.ApplyAttributes): Method renamed to Emit and make
14655         non-static.
14656         (GlobalAttributeSection): New class for special handling of global
14657         attributes (assembly, module).
14658         (AttributeSection.Emit): New method.
14659
14660         * class.cs: Implemented Attributable abstract methods.
14661         (MethodCore.LabelParameters): Moved to Parameter class.
14662         (Accessor): Is back simple class.
14663         (PropertyMethod): Implemented Attributable abstract class.
14664         (DelegateMethod): Implemented Attributable abstract class.
14665         (Event): New constructor for disctintion between normal Event
14666         and Event with accessors.
14667
14668         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
14669
14670         * codegen.cs, const.cs, decl.cs, delegate.cs:
14671         (CommonAssemblyModulClass): Implemented Attributable abstract class
14672         and simplified.
14673
14674         * enum.cs: Implement IAttributeSupport interface.
14675         (EnumMember): New class for emum members. Implemented Attributable
14676         abstract class
14677
14678         * parameter.cs:
14679         (ParameterBase): Is abstract.
14680         (ReturnParameter): New class for easier [return:] attribute handling.
14681
14682         * typemanager.cs: Removed builder_to_attr.
14683
14684 2004-05-11  Raja R Harinath  <rharinath@novell.com>
14685
14686         Fix bug #57151.
14687         * attribute.cs (Attribute.GetPositionalValue): New function.
14688         * class.cs (TypeContainer.VerifyMembers): New function.
14689         (TypeContainer.Emit): Use it.
14690         (ClassOrStruct): New base class for Class and Struct.
14691         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
14692         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
14693         class.
14694         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
14695         then each non-static field should have a FieldOffset attribute.
14696         Otherwise, none of the fields should have a FieldOffset attribute.
14697         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
14698         and FieldOffset attributes.
14699         * typemanager.cs (TypeManager.struct_layout_attribute_type)
14700         (TypeManager.field_offset_attribute_type): New core types.
14701         (TypeManager.InitCoreTypes): Initialize them.
14702
14703 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
14704
14705         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
14706         Return correct type.
14707         From bug #58270.
14708
14709 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
14710
14711         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
14712         be implicitly converted to ulong.
14713         
14714         * expression.cs: The logic for allowing operator &, | and ^ worked
14715         was wrong, it worked before because we did not report an error in
14716         an else branch.  Fixes 57895.
14717
14718         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
14719         allow volatile fields to be reference types.
14720
14721 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
14722
14723         * driver.cs: Add support for /debug-
14724
14725 2004-05-07  Raja R Harinath  <rharinath@novell.com>
14726
14727         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
14728         Add a 'complain' parameter to silence errors.
14729         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
14730         silently overlooked type-resolutions.
14731         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
14732         to reflect changes.
14733         (Attributes.Search): New function.
14734         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
14735         (Attributes.GetAttributeFullName): Remove hack.
14736         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
14737         Update to reflect changes.
14738         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
14739         Use Attributes.Search instead of nested loops.
14740
14741 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
14742
14743         * decl.cs:
14744         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
14745         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
14746         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
14747
14748         * report.cs: (Report.Warning): Renamed to Warning_T because of
14749         parameter collision.
14750
14751 2004-05-05  Raja R Harinath  <rharinath@novell.com>
14752
14753         * expression.cs (MemberAccess.ResolveMemberAccess):
14754         Exit with non-zero status after Report.Error.
14755         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
14756         Likewise.
14757         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
14758
14759 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
14760
14761         * support.cs: Don't hang when the file is empty.
14762
14763 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
14764
14765         * support.cs: In SeekableStreamReader, compute the preamble size of the
14766           underlying stream. Position changes should take into account that initial
14767           count of bytes.
14768
14769 2004-05-03  Todd Berman  <tberman@sevenl.net>
14770
14771         * driver.cs: remove unused GetSysVersion function.
14772
14773 2004-05-03  Todd Berman  <tberman@sevenl.net>
14774
14775         * driver.cs: Remove the hack from saturday, as well as the hack
14776         from jackson (LoadAssemblyFromGac), also adds the CWD to the
14777         link_paths to get that bit proper.
14778
14779 2004-05-01  Todd Berman  <tberman@sevenl.net>
14780
14781         * driver.cs: Try a LoadFrom before a Load, this checks the current
14782         path. This is currently a bug in mono that is be fixed, however, this
14783         provides a workaround for now. This will be removed when the bug
14784         is fixed.
14785
14786 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
14787
14788         * CryptoConvert.cs: Updated to latest version. Fix issue with 
14789         incomplete key pairs (#57941).
14790
14791 2004-05-01  Todd Berman  <tberman@sevenl.net>
14792
14793         * driver.cs: Remove '.' from path_chars, now System.* loads properly
14794         from the GAC
14795
14796 2004-04-30  Jackson Harper  <jackson@ximian.com>
14797
14798         * codegen.cs: Open keys readonly.
14799         
14800 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14801
14802         * typemanager.cs: don't report cyclic struct layout when a struct
14803         contains 2 or more fields of the same type. Failed for Pango.AttrShape
14804         which has 2 Pango.Rectangle fields.
14805
14806 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
14807
14808         * expression.cs: Handle IntPtr comparisons with IL code
14809         rather than a method call.
14810
14811 2004-04-29  Martin Baulig  <martin@ximian.com>
14812
14813         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
14814         the list of PropertyInfo's in class hierarchy and find the
14815         accessor.  Fixes #56013.
14816
14817 2004-04-29  Martin Baulig  <martin@ximian.com>
14818
14819         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
14820
14821 2004-04-29  Martin Baulig  <martin@ximian.com>
14822
14823         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
14824
14825         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
14826
14827 2004-04-29  Martin Baulig  <martin@ximian.com>
14828
14829         * class.cs (ConstructorInitializer.Resolve): Check whether the
14830         parent .ctor is accessible.  Fixes #52146.
14831
14832 2004-04-29  Martin Baulig  <martin@ximian.com>
14833
14834         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
14835
14836         * statement.cs (Using.EmitLocalVariableDecls): Use
14837         TypeManager.idisposable_type, not typeof (IDisposable).
14838         (Foreach.EmitCollectionForeach): Added support for valuetypes.
14839
14840 2004-04-29  Martin Baulig  <martin@ximian.com>
14841
14842         * class.cs (Event.Define): Don't emit the field and don't set
14843         RTSpecialName and SpecialName for events on interfaces.  Fixes
14844         #57703. 
14845
14846 2004-04-29  Raja R Harinath  <rharinath@novell.com>
14847
14848         Refactor Attribute.ApplyAttributes.
14849         * attribute.cs (Attributable): New base class for objects that can
14850         have Attributes applied on them.
14851         (Attribute): Make AttributeUsage fields public.
14852         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
14853         (Attribute.IsInternalCall): New property.
14854         (Attribute.UsageAttr): Convert to a public read-only property.
14855         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
14856         (Attribute.ResolveType, Attribute.Resolve)
14857         (Attribute.ScanForIndexerName): Update to reflect changes.
14858         (Attribute.CheckAttributeTarget): Re-format.
14859         (Attribute.ApplyAttributes): Refactor, to various
14860         Attributable.ApplyAttributeBuilder methods.
14861         * decl.cs (MemberCore): Make Attributable.
14862         * class.cs (Accessor): Make Attributable.
14863         (MethodData.ApplyAttributes): Use proper attribute types, not
14864         attribute names.
14865         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
14866         (TypeContainer.ApplyAttributeBuilder)
14867         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
14868         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
14869         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
14870         (Operator.ApplyAttributeBuilder): New factored-out methods.
14871         * const.cs (Const.ApplyAttributeBuilder): Likewise.
14872         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
14873         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
14874         * parameter.cs (ParameterBase): New Attributable base class
14875         that can also represent Return types.
14876         (Parameter): Update to the changes.
14877
14878 2004-04-29  Jackson Harper  <jackson@ximian.com>
14879
14880         * driver.cs: Prefer the corlib system version when looking for
14881         assemblies in the GAC. This is still a hack, but its a better hack
14882         now.
14883         
14884 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
14885
14886         * decl.cs, enum.cs: Improved error 3005 reporting.
14887   
14888         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
14889         (related_symbols): New private member for list of symbols
14890         related to reported error/warning.
14891         
14892         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
14893
14894 2004-04-29  Martin Baulig  <martin@ximian.com>
14895
14896         * ecore.cs (Expression.Constantify): If we're an enum and
14897         TypeManager.TypeToCoreType() doesn't give us another type, use
14898         t.UnderlyingSystemType.  Fixes #56178.  
14899
14900 2004-04-29  Martin Baulig  <martin@ximian.com>
14901
14902         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
14903         interfaces and for each interface, only add members directly
14904         declared in that interface.  Fixes #53255.
14905
14906 2004-04-28  Martin Baulig  <martin@ximian.com>
14907
14908         * expression.cs (ConditionalLogicalOperator): Use a temporary
14909         variable for `left' to avoid that we evaluate it more than once;
14910         bug #52588.
14911
14912 2004-04-28  Martin Baulig  <martin@ximian.com>
14913
14914         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
14915         `void[]' (CS1547).
14916
14917 2004-04-28  Martin Baulig  <martin@ximian.com>
14918
14919         * statement.cs (LocalInfo.Resolve): Check whether the type is not
14920         void (CS1547).
14921
14922         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
14923         whether the type is not void (CS1547).
14924
14925 2004-04-28  Martin Baulig  <martin@ximian.com>
14926
14927         * expression.cs (Unary.DoResolveLValue): Override this and report
14928         CS0131 for anything but Operator.Indirection.
14929
14930 2004-04-28  Martin Baulig  <martin@ximian.com>
14931
14932         Committing a patch from Ben Maurer; see bug #50820.
14933
14934         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
14935         check for classes.
14936
14937         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
14938         classes.        
14939
14940 2004-04-28  Martin Baulig  <martin@ximian.com>
14941
14942         Committing a patch from Ben Maurer; see bug #50820.
14943
14944         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
14945         check for classes.
14946
14947         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
14948         classes.        
14949
14950 2004-04-28  Martin Baulig  <martin@ximian.com>
14951
14952         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
14953         (Block.AddLabel): Call DoLookupLabel() to only search in the
14954         current block.
14955
14956 2004-04-28  Martin Baulig  <martin@ximian.com>
14957
14958         * cfold.cs (ConstantFold.BinaryFold): Added special support for
14959         comparing StringConstants and NullLiterals in Equality and Inequality.
14960
14961 2004-04-28  Jackson Harper  <jackson@ximian.com>
14962
14963         * driver.cs: Attempt to load referenced assemblies from the
14964         GAC. This is the quick and dirty version of this method that
14965         doesnt take into account versions and just takes the first
14966         canidate found. Will be good enough for now as we will not have more
14967         then one version installed into the GAC until I update this method.
14968
14969 2004-04-28  Martin Baulig  <martin@ximian.com>
14970
14971         * typemanager.cs (TypeManager.CheckStructCycles): New public
14972         static method to check for cycles in the struct layout.
14973
14974         * rootcontext.cs (RootContext.PopulateTypes): Call
14975         TypeManager.CheckStructCycles() for each TypeContainer.
14976         [Note: We only need to visit each type once.]
14977
14978 2004-04-28  Martin Baulig  <martin@ximian.com>
14979
14980         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
14981
14982         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
14983         success and added `out object value'.  Use a `bool resolved' field
14984         to check whether we've already been called rather than
14985         `ConstantValue != null' since this breaks for NullLiterals.
14986
14987 2004-04-28  Raja R Harinath  <rharinath@novell.com>
14988
14989         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
14990         setting of this flag, since the 'set' method may be non-public.
14991
14992 2004-04-28  Raja R Harinath  <rharinath@novell.com>
14993
14994         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
14995         check on current_vector.Block.
14996
14997 2004-04-27  Martin Baulig  <martin@ximian.com>
14998
14999         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
15000         a field initializer.  Fixes #56459.
15001
15002 2004-04-27  Martin Baulig  <martin@ximian.com>
15003
15004         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
15005         we're not attempting to use an indexer.  Fixes #52154.
15006
15007 2004-04-27  Martin Baulig  <martin@ximian.com>
15008
15009         * statement.cs (Return): Don't create a return label if we don't
15010         need it; reverts my change from January 20th.  Thanks to Ben
15011         Maurer for this.
15012
15013 2004-04-27  Martin Baulig  <martin@ximian.com>
15014
15015         According to the spec, `goto' can only leave a nested scope, but
15016         never enter it.
15017
15018         * statement.cs (Block.LookupLabel): Only lookup in the current
15019         block, don't recurse into parent or child blocks.
15020         (Block.AddLabel): Check in parent and child blocks, report
15021         CS0140/CS0158 if we find a duplicate.
15022         (Block): Removed this indexer for label lookups.
15023         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
15024         this already does the error reporting for us.
15025
15026         * flowanalysis.cs
15027         (FlowBranching.UsageVector.Block): New public variable; may be null.
15028         (FlowBranching.CreateSibling): Added `Block' argument.
15029         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
15030         label for the target of a `goto' and check whether we're not
15031         leaving a `finally'.
15032
15033 2004-04-27  Martin Baulig  <martin@ximian.com>
15034
15035         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
15036         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
15037         just for returns).
15038
15039 2004-04-27  Martin Baulig  <martin@ximian.com>
15040
15041         * statement.cs (Block.AddLabel): Also check for implicit blocks
15042         and added a CS0158 check.
15043
15044 2004-04-27  Martin Baulig  <martin@ximian.com>
15045
15046         * flowanalysis.cs (FlowBranchingLoop): New class.
15047         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
15048         UsageVector's instead of an ArrayList.
15049         (FlowBranching.Label): Likewise.
15050         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
15051         (FlowBranching.AddBreakVector): New method.
15052
15053 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
15054
15055         * attribute.cs: Small regression fix: only convert the type if we
15056         the type is different, fixes System.Drawing build.
15057
15058 2004-04-27  Martin Baulig  <martin@ximian.com>
15059
15060         * attribute.cs (Attribute.Resolve): If we have a constant value
15061         for a named field or property, implicity convert it to the correct
15062         type.
15063
15064 2004-04-27  Raja R Harinath  <rharinath@novell.com>
15065
15066         * statement.cs (Block.Block): Implicit blocks share
15067         'child_variable_names' fields with parent blocks.
15068         (Block.AddChildVariableNames): Remove.
15069         (Block.AddVariable): Mark variable as "used by a child block" in
15070         every surrounding block.
15071         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
15072         been used in a child block, complain about violation of "Invariant
15073         meaning in blocks" rule.
15074         * cs-parser.jay (declare_local_variables): Don't use
15075         AddChildVariableNames.
15076         (foreach_statement): Don't create an implicit block: 'foreach'
15077         introduces a scope.
15078
15079 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
15080
15081         * convert.cs (ImplicitNumericConversion): 0 is also positive when
15082         converting from 0L to ulong.  Fixes 57522.
15083
15084 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15085
15086         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
15087         derived class hides via 'new' keyword field from base class (test-242.cs).
15088         TODO: Handle this in the more general way.
15089         
15090         * class.cs (CheckBase): Ditto.
15091
15092 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
15093
15094         * decl.cs (caching_flags): New member for storing cached values
15095         as bit flags.
15096         (MemberCore.Flags): New enum where bit flags for caching_flags
15097         are defined.
15098         (MemberCore.cls_compliance): Moved to caching_flags.
15099         (DeclSpace.Created): Moved to caching_flags.
15100
15101         * class.cs: Use caching_flags instead of DeclSpace.Created
15102         
15103 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
15104
15105         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
15106         if we are only a derived class, not a nested class.
15107
15108         * typemanager.cs: Same as above, but do this at the MemberLookup
15109         level (used by field and methods, properties are handled in
15110         PropertyExpr).   Allow for the qualified access if we are a nested
15111         method. 
15112
15113 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
15114
15115         * class.cs: Refactoring.
15116         (IMethodData): New inteface; Holds links to parent members
15117         to avoid member duplication (reduced memory allocation).
15118         (Method): Implemented IMethodData interface.
15119         (PropertyBase): New inner classes for get/set methods.
15120         (PropertyBase.PropertyMethod): Implemented IMethodData interface
15121         (Event): New inner classes for add/remove methods.
15122         (Event.DelegateMethod): Implemented IMethodData interface.
15123
15124         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
15125         EmitContext (related to class.cs refactoring).
15126
15127 2004-04-21  Raja R Harinath  <rharinath@novell.com>
15128
15129         * delegate.cs (Delegate.VerifyApplicability): If the number of
15130         arguments are the same as the number of parameters, first try to
15131         verify applicability ignoring  any 'params' modifier on the last
15132         parameter.
15133         Fixes #56442.
15134
15135 2004-04-16  Raja R Harinath  <rharinath@novell.com>
15136
15137         * class.cs (TypeContainer.AddIndexer): Use
15138         'ExplicitInterfaceName' to determine if interface name was
15139         explicitly specified.  'InterfaceType' is not initialized at this time.
15140         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
15141         Indexers array is already in the required order.  Initialize
15142         'IndexerName' only if there are normal indexers.
15143         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
15144         (TypeContainer.Emit): Emit DefaultMember attribute only if
15145         IndexerName is initialized.
15146         Fixes #56300.
15147
15148 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
15149
15150         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
15151         Fixes #57007
15152
15153 2004-04-15  Raja R Harinath  <rharinath@novell.com>
15154
15155         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
15156         attributes.
15157         Fix for #56456.
15158
15159         * attribute.cs (Attribute.Resolve): Check for duplicate named
15160         attributes.
15161         Fix for #56463.
15162
15163 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
15164
15165         * iterators.cs (MarkYield): track whether we are in an exception,
15166         and generate code accordingly.  Use a temporary value to store the
15167         result for our state.
15168
15169         I had ignored a bit the interaction of try/catch with iterators
15170         since their behavior was not entirely obvious, but now it is
15171         possible to verify that our behavior is the same as MS .NET 2.0
15172
15173         Fixes 54814
15174
15175 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
15176
15177         * iterators.cs: Avoid creating temporaries if there is no work to
15178         do. 
15179
15180         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
15181         Enumerations, use TypeManager.EnumToUnderlying and call
15182         recursively. 
15183
15184         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
15185         bug #57013
15186
15187         (This.Emit): Use EmitContext.EmitThis to emit our
15188         instance variable.
15189
15190         (This.EmitAssign): Ditto.
15191
15192         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
15193         codepaths, we will move all the functionality into
15194         Mono.CSharp.This 
15195
15196         (FieldExpr.EmitAssign): Ditto.
15197
15198         This fixes several hidden bugs that I uncovered while doing a code
15199         review of this today.
15200
15201         * codegen.cs (EmitThis): reworked so the semantics are more clear
15202         and also support value types "this" instances.
15203
15204         * iterators.cs: Changed so that for iterators in value types, we
15205         do not pass the value type as a parameter.  
15206
15207         Initialization of the enumerator helpers is now done in the caller
15208         instead of passing the parameters to the constructors and having
15209         the constructor set the fields.
15210
15211         The fields have now `assembly' visibility instead of private.
15212
15213 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
15214
15215         * expression.cs (Argument.Resolve): Check if fields passed as ref
15216         or out are contained in a MarshalByRefObject.
15217
15218         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
15219         another compiler type.
15220
15221 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
15222
15223         * class.cs (Indexer.Define): use the new name checking method.
15224         Also, return false on an error.
15225         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
15226         (is_identifier_[start/part]_character): make static.
15227
15228 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
15229
15230         * expression.cs (Binary.ResolveOperator): Do no append strings
15231         twice: since we can be invoked more than once (array evaluation)
15232         on the same concatenation, take care of this here.  Based on a fix
15233         from Ben (bug #56454)
15234
15235 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
15236
15237         * codegen.cs: Fix another case where CS1548 must be reported (when 
15238         delay-sign isn't specified and no private is available #56564). Fix
15239         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
15240         error when MCS is used on the MS runtime and we need to delay-sign 
15241         (which seems unsupported by AssemblyBuilder - see #56621).
15242
15243 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
15244
15245         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
15246         (TypeManager.ComputeNamespaces): Faster implementation for
15247         Microsoft runtime.
15248
15249         * compiler.csproj: Updated AssemblyName to mcs.
15250
15251 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
15252
15253         * rootcontext.cs: Add new types to the boot resolution.
15254
15255         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
15256         MulticastDelegate is not allowed.
15257
15258         * typemanager.cs: Add new types to lookup: System.TypedReference
15259         and ArgIterator.
15260
15261         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
15262         check for TypedReference or ArgIterator, they are not allowed. 
15263
15264         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
15265         makes us properly catch 1510 in some conditions (see bug 56016 for
15266         details). 
15267
15268 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
15269
15270         * CryptoConvert.cs: update from corlib version
15271         with endian fixes.
15272
15273 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
15274
15275         * class.cs (Indexer.Define): Check indexername declaration
15276
15277 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
15278
15279         * attribute.cs (IsClsCompliant): Fixed problem with handling
15280         all three states (compliant, not-compliant, undetected).
15281
15282 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
15283
15284         * attribute.cs (Attribute): Location is now public.
15285         (Resolve): Store resolved arguments (pos_values) in attribute class.
15286         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
15287         (GetClsCompliantAttributeValue): New method that gets
15288         CLSCompliantAttribute value.
15289         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
15290         if exists else null.
15291         (AttributeTester): New class for CLS-Compliant verification routines.
15292
15293         * class.cs (Emit): Add CLS-Compliant verification.
15294         (Method.GetSignatureForError): Implemented.
15295         (Constructor.GetSignatureForError): Implemented
15296         (Constructor.HasCompliantArgs): Returns if constructor has
15297         CLS-Compliant arguments.
15298         (Constructor.Emit): Override.
15299         (Construcor.IsIdentifierClsCompliant): New method; For constructors
15300         is needed to test only parameters.
15301         (FieldBase.GetSignatureForError): Implemented.
15302         (TypeContainer): New member for storing base interfaces.
15303         (TypeContainer.FindMembers): Search in base interfaces too.
15304
15305         * codegen.cs (GetClsComplianceAttribute): New method that gets
15306         assembly or module CLSCompliantAttribute value.
15307         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
15308         for assembly.
15309         (ModuleClass.Emit): Add error 3012 test.
15310
15311         * const.cs (Emit): Override and call base for CLS-Compliant tests.
15312
15313         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
15314         state for all decl types.
15315         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
15316         if CLS-Compliant tests are required.
15317         (IsClsCompliaceRequired): New method. Analyze whether code
15318         must be CLS-Compliant.
15319         (IsExposedFromAssembly): New method. Returns true when MemberCore
15320         is exposed from assembly.
15321         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
15322         value or gets cached value.
15323         (HasClsCompliantAttribute): New method. Returns true if MemberCore
15324         is explicitly marked with CLSCompliantAttribute.
15325         (IsIdentifierClsCompliant): New abstract method. This method is
15326         used to testing error 3005.
15327         (IsIdentifierAndParamClsCompliant): New method. Common helper method
15328         for identifier and parameters CLS-Compliant testing.
15329         (VerifyClsCompliance): New method. The main virtual method for
15330         CLS-Compliant verifications.
15331         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
15332         null. I don't know why is null (too many public members !).
15333         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
15334         and get value of first CLSCompliantAttribute that found.
15335
15336         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
15337         (VerifyClsCompliance): Override and add extra tests.
15338
15339         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
15340         clscheck- disable CLS-Compliant verification event if assembly is has
15341         CLSCompliantAttribute(true).
15342
15343         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
15344         ApllyAttribute is now called in emit section as in the other cases.
15345         Possible future Emit integration.
15346         (IsIdentifierClsCompliant): New override.
15347         (VerifyClsCompliance): New override.
15348         (GetEnumeratorName): Returns full enum name.
15349
15350         * parameter.cs (GetSignatureForError): Implemented.
15351
15352         * report.cs (WarningData): New struct for Warning message information.
15353         (LocationOfPreviousError): New method.
15354         (Warning): New method. Reports warning based on the warning table.
15355         (Error_T): New method. Reports error based on the error table.
15356
15357         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
15358         verifications are done here.
15359
15360         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
15361
15362         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
15363         CLSCompliantAttribute.
15364         (all_imported_types): New member holds all imported types from other
15365         assemblies.
15366         (LoadAllImportedTypes): New method fills static table with exported types
15367         from all referenced assemblies.
15368         (Modules): New property returns all assembly modules.
15369
15370 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
15371
15372         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
15373         throwing a parser error.
15374
15375         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
15376         which removes the hardcoded get_/set_ prefixes for properties, as
15377         IL allows for the properties to be named something else.  
15378
15379         Bug #56013
15380
15381         * expression.cs: Do not override operand before we know if it is
15382         non-null.  Fix 56207
15383
15384 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15385
15386         * typemanager.cs: support for pinned variables.
15387
15388 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15389
15390         * decl.cs, typemanager.cs: Avoid using an arraylist
15391         as a buffer if there is only one result set.
15392
15393 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
15394
15395         * expression.cs: Make sure you cant call a static method
15396         with an instance expression, bug #56174.
15397
15398 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
15399
15400         * class.cs (IsDuplicateImplementation): Improve error reporting to
15401         flag 663 (method only differs in parameter modifier).
15402
15403         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
15404         in preprocessor directives.
15405
15406         * location.cs (LookupFile): Allow for the empty path.
15407
15408         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
15409         better approach for some of that patch, but its failing with the
15410         CharSet enumeration.  For now try/catch will do.
15411
15412         * typemanager.cs: Do not crash if a struct does not have fields.
15413         Fixes 56150.
15414
15415 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15416
15417         * expression.cs: cs0213, cant fix a fixed expression.
15418         fixes 50231.
15419
15420 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15421
15422         * cs-parser.jay: detect invalid embeded statements gracefully.
15423         bug #51113.
15424
15425 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
15426
15427         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
15428         As a regex:
15429         s/
15430         the invocation type may not be a subclass of the tye of the item/
15431         The type of the item must be a subclass of the invocation item.
15432         /g
15433
15434         Fixes bug #50820.
15435
15436 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
15437
15438         * attribute.cs: Added methods to get a string and a bool from an
15439         attribute. Required to information from AssemblyKeyFileAttribute,
15440         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
15441         * codegen.cs: Modified AssemblyName creation to include support for
15442         strongnames. Catch additional exceptions to report them as CS1548.
15443         * compiler.csproj: Updated include CryptoConvert.cs.
15444         * compiler.csproj.user: Removed file - user specific configuration.
15445         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
15446         Mono.Security assembly. The original class is maintained and tested in
15447         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
15448         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
15449         like CSC 8.0 (C# v2) supports.
15450         * Makefile: Added CryptoConvert.cs to mcs sources.
15451         * rootcontext.cs: Added new options for strongnames.
15452
15453 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
15454
15455         * driver.cs: For --expect-error, report error code `2'
15456         if the program compiled with no errors, error code `1' if
15457         it compiled with an error other than the one expected.
15458
15459 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
15460
15461         * compiler.csproj: Updated for Visual Studio .NET 2003.
15462         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
15463         * compiler.sln: Updated for Visual Studio .NET 2003.
15464
15465 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
15466
15467         * expression.cs: Fix bug #47234. We basically need to apply the
15468         rule that we prefer the conversion of null to a reference type
15469         when faced with a conversion to 'object' (csc behaviour).
15470
15471 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15472
15473         * statement.cs: Shorter form for foreach, eliminates
15474         a local variable. r=Martin.
15475
15476 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15477
15478         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
15479         checks if we can use brtrue/brfalse to test for 0.
15480         * expression.cs: use the above in the test for using brtrue/brfalse.
15481         cleanup code a bit.
15482
15483 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15484
15485         * expression.cs: Rewrite string concat stuff. Benefits:
15486
15487         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
15488         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
15489         rather than a concat chain.
15490
15491         * typemanager.cs: Add lookups for more concat overloads.
15492
15493 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
15494
15495         * expression.cs: Emit shorter il code for array init.
15496
15497         newarr
15498         dup
15499         // set 1
15500
15501         // set 2
15502
15503         newarr
15504         stloc.x
15505
15506         ldloc.x
15507         // set 1
15508
15509         ldloc.x
15510         // set 2
15511
15512 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
15513
15514         * statement.cs: Before, two switch blocks would be merged if the
15515         total size of the blocks (end_item - begin_item + 1) was less than
15516         two times the combined sizes of the blocks.
15517
15518         Now, it will only merge if after the merge at least half of the
15519         slots are filled.
15520
15521         fixes 55885.
15522
15523 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
15524
15525         * class.cs : csc build fix for GetMethods(). See bug #52503.
15526
15527 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
15528
15529         * expression.cs: Make sure fp comparisons work with NaN.
15530         This fixes bug #54303. Mig approved this patch a long
15531         time ago, but we were not able to test b/c the runtime
15532         had a related bug.
15533
15534 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
15535
15536         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
15537
15538 2004-03-19  Martin Baulig  <martin@ximian.com>
15539
15540         * class.cs (MemberCore.IsDuplicateImplementation): Report the
15541         error here and not in our caller.
15542
15543 2004-03-19  Martin Baulig  <martin@ximian.com>
15544
15545         * interface.cs: Completely killed this file.
15546         (Interface): We're now a TypeContainer and live in class.cs.
15547
15548         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
15549         argument; we're now also called for interfaces.
15550         (TypeContainer.DefineMembers): Allow this method being called
15551         multiple times.
15552         (TypeContainer.GetMethods): New public method; formerly known as
15553         Interface.GetMethod().  This is used by PendingImplementation.
15554         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
15555         it's now private and non-static.
15556         (Interface): Moved this here; it's now implemented similar to
15557         Class and Struct.
15558         (Method, Property, Event, Indexer): Added `bool is_interface'
15559         argument to their .ctor's.
15560         (MemberBase.IsInterface): New public field.
15561
15562         * cs-parser.jay: Create normal Method, Property, Event, Indexer
15563         instances instead of InterfaceMethod, InterfaceProperty, etc.
15564         (opt_interface_base): Removed; we now use `opt_class_base' instead.
15565         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
15566
15567 2004-03-19  Martin Baulig  <martin@ximian.com>
15568
15569         * class.cs (MethodCore.IsDuplicateImplementation): New private
15570         method which does the CS0111 checking.
15571         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
15572         Use IsDuplicateImplementation().
15573
15574 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
15575
15576         * decl.cs (FindMemberToOverride): New method to find the correct
15577         method or property to override in the base class.
15578         * class.cs
15579             - Make Method/Property use the above method to find the
15580               version in the base class.
15581             - Remove the InheritableMemberSignatureCompare as it is now
15582               dead code.
15583
15584         This patch makes large code bases much faster to compile, as it is
15585         O(n) rather than O(n^2) to do this validation.
15586
15587         Also, it fixes bug 52458 which is that nested classes are not
15588         taken into account when finding the base class member.
15589
15590         Reviewed/Approved by Martin.
15591
15592 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
15593
15594         * interface.cs: In all interface classes removed redundant
15595         member initialization.
15596
15597 2004-03-16  Martin Baulig  <martin@ximian.com>
15598
15599         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
15600
15601 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
15602
15603         * decl.cs (DefineTypeAndParents): New helper method to define a
15604         type's containers before the type itself is defined;  This is a
15605         bug exposed by the recent changes to Windows.Forms when an
15606         implemented interface was defined inside a class that had not been
15607         built yet.   
15608
15609         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
15610
15611         (Check): Loop correctly to report errors modifiers
15612         (UNSAFE was not in the loop, since it was the same as TOP).
15613
15614         * interface.cs: Every interface member now takes a ModFlags,
15615         instead of a "is_new" bool, which we set on the base MemberCore. 
15616
15617         Every place where we called "UnsafeOk" in the interface, now we
15618         call the proper member (InterfaceMethod.UnsafeOK) instead to get
15619         the unsafe settings from the member declaration instead of the
15620         container interface. 
15621
15622         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
15623
15624         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
15625         `set_indexer_name' to the pending bits (one per type).
15626
15627         We fixed a bug today that was picking the wrong method to
15628         override, since for properties the existing InterfaceMethod code
15629         basically ignored the method name.  Now we make sure that the
15630         method name is one of the valid indexer names.
15631
15632 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
15633  
15634         * support.cs (SeekableStreamReader): Keep track of stream byte
15635         positions and don't mix them with character offsets to the buffer.
15636
15637         Patch from Gustavo Giráldez
15638
15639 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
15640
15641         * interface.cs (InterfaceSetGetBase): Removed double member
15642         initialization, base class does it as well.
15643
15644 2004-03-13  Martin Baulig  <martin@ximian.com>
15645
15646         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
15647         when compiling corlib.
15648
15649 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
15650
15651         * convert.cs (ExplicitConversion): We were reporting an error on
15652         certain conversions (object_type source to a value type, when the
15653         expression was `null') before we had a chance to pass it through
15654         the user defined conversions.
15655
15656         * driver.cs: Replace / and \ in resource specifications to dots.
15657         Fixes 50752
15658
15659         * class.cs: Add check for duplicate operators.  Fixes 52477
15660
15661 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
15662
15663         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
15664         that are in the middle of the statements, not only at the end.
15665         Fixes #54987
15666
15667         * class.cs (TypeContainer.AddField): No longer set the
15668         `HaveStaticConstructor' flag, now we call it
15669         `UserDefineStaticConstructor' to diferentiate the slightly
15670         semantic difference.
15671
15672         The situation is that we were not adding BeforeFieldInit (from
15673         Modifiers.TypeAttr) to classes that could have it.
15674         BeforeFieldInit should be set to classes that have no static
15675         constructor. 
15676
15677         See:
15678
15679         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
15680
15681         And most importantly Zoltan's comment:
15682
15683         http://bugzilla.ximian.com/show_bug.cgi?id=44229
15684
15685         "I think beforefieldinit means 'it's ok to initialize the type sometime 
15686          before its static fields are used', i.e. initialization does not need
15687          to be triggered by the first access to the type. Setting this flag
15688          helps the JIT to compile better code, since it can run the static
15689          constructor at JIT time, and does not need to generate code to call it
15690          (possibly lots of times) at runtime. Unfortunately, mcs does not set
15691          this flag for lots of classes like String. 
15692          
15693          csc sets this flag if the type does not have an explicit static 
15694          constructor. The reasoning seems to be that if there are only static
15695          initalizers for a type, and no static constructor, then the programmer
15696          does not care when this initialization happens, so beforefieldinit
15697          can be used.
15698          
15699          This bug prevents the AOT compiler from being usable, since it 
15700          generates so many calls to mono_runtime_class_init that the AOT code
15701          is much slower than the JITted code. The JITted code is faster, 
15702          because it does not generate these calls if the vtable is type is
15703          already initialized, which is true in the majority of cases. But the
15704          AOT compiler can't do this."
15705
15706 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
15707
15708         * class.cs (MethodData.Emit): Refactor the code so symbolic
15709         information is generated for destructors;  For some reasons we
15710         were taking a code path that did not generate symbolic information
15711         before. 
15712
15713 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
15714
15715         * class.cs: Create a Constructor.CheckBase method that
15716         takes care of all validation type code. The method
15717         contains some code that was moved from Define.
15718
15719         It also includes new code that checks for duplicate ctors.
15720         This fixes bug #55148.
15721
15722 2004-03-09  Joshua Tauberer <tauberer@for.net>
15723
15724         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
15725         a { ... }-style array creation invokes EmitStaticInitializers
15726         which is not good for reference-type arrays.  String, decimal
15727         and now null constants (NullCast) are not counted toward
15728         static initializers.
15729
15730 2004-03-05  Martin Baulig  <martin@ximian.com>
15731
15732         * location.cs (SourceFile.HasLineDirective): New public field;
15733         specifies whether the file contains or is referenced by a "#line"
15734         directive.
15735         (Location.DefineSymbolDocuments): Ignore source files which
15736         either contain or are referenced by a "#line" directive.        
15737
15738 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
15739
15740         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
15741         direct access to our parent, so check the method inline there.
15742
15743 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
15744
15745         * expression.cs (Invocation.EmitCall): Miguel's last commit
15746         caused a regression. If you had:
15747
15748             T t = null;
15749             t.Foo ();
15750
15751         In Foo the implict this would be null.
15752
15753 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
15754
15755         * expression.cs (Invocation.EmitCall): If the method is not
15756         virtual, do not emit a CallVirt to it, use Call.
15757
15758         * typemanager.cs (GetFullNameSignature): Improve the method to
15759         cope with ".ctor" and replace it with the type name.
15760
15761         * class.cs (ConstructorInitializer.Resolve): Now the method takes
15762         as an argument the ConstructorBuilder where it is being defined,
15763         to catch the recursive constructor invocations.
15764
15765 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
15766
15767         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
15768         routines to check if a type is an enumerable/enumerator allow
15769         classes that implement the IEnumerable or IEnumerator interfaces.
15770
15771         * class.cs (Property, Operator): Implement IIteratorContainer, and
15772         implement SetYields.
15773
15774         (Property.Define): Do the block swapping for get_methods in the
15775         context of iterators.   We need to check if Properties also
15776         include indexers or not.
15777
15778         (Operator): Assign the Block before invoking the
15779         OperatorMethod.Define, so we can trigger the Iterator code
15780         replacement. 
15781
15782         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
15783         Property and Operator classes are not created when we parse the
15784         declarator but until we have the block completed, so we use a
15785         singleton SimpleIteratorContainer.Simple to flag whether the
15786         SetYields has been invoked.
15787
15788         We propagate this setting then to the Property or the Operator to
15789         allow the `yield' to function.
15790
15791 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
15792
15793         * codegen.cs: Implemented attribute support for modules.
15794         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
15795         Assembly/Module functionality.
15796
15797         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
15798         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
15799         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
15800
15801 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
15802
15803         * interface.cs (FindMembers): The operation is performed on all base
15804         interfaces and not only on the first. It is required for future CLS Compliance patch.
15805
15806 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
15807
15808         * statement.cs, codegen.cs:
15809         This patch deals with patterns such as:
15810
15811         public class List : IEnumerable {
15812
15813                 public MyEnumerator GetEnumerator () {
15814                         return new MyEnumerator(this);
15815                 }
15816
15817                 IEnumerator IEnumerable.GetEnumerator () {
15818                         ...
15819                 }
15820                 
15821                 public struct MyEnumerator : IEnumerator {
15822                         ...
15823                 }
15824         }
15825
15826         Before, there were a few things we did wrong:
15827         1) we would emit callvirt on a struct, which is illegal
15828         2) we emited ldarg when we needed to emit ldarga
15829         3) we would mistakenly call the interface methods on an enumerator
15830         type that derived from IEnumerator and was in another assembly. For example:
15831
15832         public class MyEnumerator : IEnumerator
15833
15834         Would have the interface methods called, even if there were public impls of the
15835         method. In a struct, this lead to invalid IL code.
15836
15837 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
15838
15839         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
15840           renamed to Emit.
15841
15842         * delegate.cs (Define): Fixed crash when delegate type is undefined.
15843
15844 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
15845
15846         * cs-parser.jay: Fix small regression: we were not testing V2
15847         compiler features correctly.
15848
15849         * interface.cs: If the emit context is null, then create one
15850
15851 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
15852
15853         * decl.cs (GetSignatureForError): New virtual method to get full name
15854           for error messages.
15855
15856         * attribute.cs (IAttributeSupport): New interface for attribute setting.
15857           Now it is possible to rewrite ApplyAttributes method to be less if/else.
15858
15859         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
15860           Duplicated members and code in these classes has been removed.
15861           Better encapsulation in these classes.
15862
15863 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
15864
15865         * assign.cs (Assign.DoResolve): When dealing with compound
15866         assignments, there is a new rule in ECMA C# 2.4 (might have been
15867         there before, but it is documented here) that states that in:
15868
15869         a op= b;
15870
15871         If b is of type int, and the `op' is a shift-operator, then the
15872         above is evaluated as:
15873
15874         a = (int) a op b 
15875
15876         * expression.cs (Binary.ResolveOperator): Instead of testing for
15877         int/uint/long/ulong, try to implicitly convert to any of those
15878         types and use that in pointer arithmetic.
15879
15880         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
15881         method to print information for from the type, not from the
15882         null-method we were given.
15883
15884 2004-02-01  Duncan Mak  <duncan@ximian.com>
15885
15886         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
15887         parsing for cmd, fixes bug #53694.
15888
15889 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
15890
15891         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
15892         in the member name duplication tests. Property and operator name duplication
15893         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
15894
15895 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
15896
15897         * interface.cs (PopulateMethod): Fixed crash when interface method
15898         returns not existing type (error test cs0246-3.cs).
15899
15900 2004-02-02  Ravi Pratap M <ravi@ximian.com>
15901
15902         * cs-parser.jay (interface_accessors): Re-write actions to also
15903         store attributes attached to get and set methods. Fix spelling
15904         while at it.
15905
15906         (inteface_property_declaration): Modify accordingly.
15907
15908         (InterfaceAccessorInfo): New helper class to store information to pass
15909         around between rules that use interface_accessors.
15910
15911         * interface.cs (Emit): Apply attributes on the get and set
15912         accessors of properties and indexers too.
15913
15914         * attribute.cs (ApplyAttributes): Modify accordingly to use the
15915         right MethodBuilder when applying attributes to the get and set accessors.
15916
15917 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
15918
15919         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
15920
15921 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
15922
15923         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
15924
15925 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
15926
15927         * cs-parser.jay: Remove YIELD token, instead use the new grammar
15928         changes that treat `yield' specially when present before `break'
15929         or `return' tokens.
15930
15931         * cs-tokenizer.cs: yield is no longer a keyword.
15932
15933 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
15934
15935         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
15936         setting for default constructors.
15937         For default constructors are almost every time set wrong Modifier. The
15938         generated IL code has been alright. But inside mcs this values was
15939         wrong and this was reason why several of my CLS Compliance tests
15940         failed.
15941
15942 2004-01-22  Martin Baulig  <martin@ximian.com>
15943
15944         * cs-parser.jay (namespace_or_type_name): Return an Expression,
15945         not a QualifiedIdentifier.  This is what `type_name_expression'
15946         was previously doing.
15947         (type_name_expression): Removed; the code is now in
15948         `namespace_or_type_name'.
15949         (qualified_identifier): Removed, use `namespace_or_type_name'
15950         instead.
15951         (QualifiedIdentifier): Removed this class.      
15952
15953 2004-01-22  Martin Baulig  <martin@ximian.com>
15954
15955         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
15956         not a string as alias name.
15957
15958 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
15959
15960         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
15961         #52730 bug, and instead compute correctly the need to use a
15962         temporary variable when requesting an address based on the
15963         static/instace modified of the field and the constructor.
15964  
15965 2004-01-21  Martin Baulig  <martin@ximian.com>
15966
15967         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
15968         class and namespace before looking up aliases.  Fixes #52517.
15969
15970 2004-01-21  Martin Baulig  <martin@ximian.com>
15971
15972         * flowanalysis.cs (UsageVector.Merge): Allow variables being
15973         assinged in a 'try'; fixes exception4.cs.
15974
15975 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15976         * class.cs : Implemented parameter-less constructor for TypeContainer
15977
15978         * decl.cs: Attributes are now stored here. New property OptAttributes
15979
15980         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
15981
15982         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
15983
15984 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15985
15986         * typemanager.cs (CSharpSignature): Now reports also inner class name.
15987           (CSharpSignature): New method for indexer and property signature.
15988
15989 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15990
15991         * pending.cs (IsVirtualFilter): Faster implementation.
15992
15993 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15994
15995         * typemanager.cs: Avoid inclusion of same assembly more than once.
15996
15997 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
15998
15999         * cs-parser.jay: Fixed problem where the last assembly attribute
16000           has been applied also to following declaration (class, struct, etc.)
16001           
16002 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
16003
16004         * class.cs: Added error CS0538, CS0539 reporting.
16005         Fixed crash on Microsoft runtime when field type is void.
16006
16007         * cs-parser.jay: Added error CS0537 reporting.
16008
16009         * pending.cs: Added error CS0535 reporting.
16010         Improved error report for errors CS0536, CS0534.
16011
16012 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
16013
16014         Merge a few bits from the Anonymous Method MCS tree.
16015
16016         * statement.cs (ToplevelBlock): New class for toplevel methods,
16017         will hold anonymous methods, lifted variables.
16018
16019         * cs-parser.jay: Create toplevel blocks for delegates and for
16020         regular blocks of code. 
16021
16022 2004-01-20  Martin Baulig  <martin@ximian.com>
16023
16024         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
16025         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
16026         and `NeedExplicitReturn'; added `IsLastStatement'.
16027         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
16028         have a `ReturnLabel' or we're not unreachable.
16029
16030         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
16031         child's reachability; don't just override ours with it.  Fixes
16032         #58058 (lluis's example).
16033         (FlowBranching): Added public InTryOrCatch(), InCatch(),
16034         InFinally(), InLoop(), InSwitch() and
16035         BreakCrossesTryCatchBoundary() methods.
16036
16037         * statement.cs (Return): Do all error checking in Resolve().
16038         Unless we are the last statement in a top-level block, always
16039         create a return label and jump to it.
16040         (Break, Continue): Do all error checking in Resolve(); also make
16041         sure we aren't leaving a `finally'.
16042         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
16043         statement in a top-level block.
16044         (Block.Flags): Added `IsDestructor'.
16045         (Block.IsDestructor): New public property.
16046
16047 2004-01-20  Martin Baulig  <martin@ximian.com>
16048
16049         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
16050
16051 2004-01-20  Martin Baulig  <martin@ximian.com>
16052
16053         * statement.cs (Statement.ResolveUnreachable): New public method.
16054         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
16055         (Block.Resolve): Resolve unreachable statements.
16056
16057 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
16058
16059         * expression.cs: We need to fix the case where we do
16060         not have a temp variable here.
16061
16062         * assign.cs: Only expression compound assignments need
16063         temporary variables.
16064
16065 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
16066
16067         * flowanalysis.cs: Reduce memory allocation in a few ways:
16068           - A block with no variables should not allocate a bit
16069             vector for itself.
16070           - A method with no out parameters does not need any tracking
16071             for assignment of the parameters, so we need not allocate
16072             any data for it.
16073           - The arrays:
16074                 public readonly Type[] VariableTypes;
16075                 public readonly string[] VariableNames;
16076             Are redundant. The data is already stored in the variable
16077             map, so we need not allocate another array for it.
16078           - We need to add alot of checks for if (params | locals) == null
16079             due to the first two changes.
16080
16081 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
16082
16083         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
16084         implement IMemoryLocation, we store a copy on a local variable and
16085         take the address of it.  Patch from Benjamin Jemlich
16086
16087         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
16088         to use a special "type_name_expression" rule which reduces the
16089         number of "QualifiedIdentifier" classes created, and instead
16090         directly creates MemberAccess expressions.
16091
16092 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
16093
16094         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
16095         that fixes #52853.  Null literal assignment to ValueType
16096
16097         * class.cs (MethodData.Emit): Instead of checking the name of the
16098         method to determine if its a destructor, create a new derived
16099         class from Method called Destructor, and test for that.  
16100
16101         * cs-parser.jay: Create a Destructor object instead of a Method.  
16102
16103         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
16104
16105         Fixes: 52933
16106
16107 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
16108
16109         * expression.cs (Binary.ResolveOperator): Perform an implicit
16110         conversion from MethodGroups to their delegate types on the
16111         Addition operation.
16112
16113         * delegate.cs: Introduce a new class DelegateCreation that is the
16114         base class for `NewDelegate' and `ImplicitDelegateCreation',
16115         factor some code in here.
16116
16117         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
16118         conversion from MethodGroups to compatible delegate types. 
16119
16120         * ecore.cs (Expression.Resolve): Do not flag error 654
16121         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
16122         we allow conversions from MethodGroups to delegate types now.
16123
16124         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
16125         assignments in v2 either.
16126
16127 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
16128
16129         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
16130         static read-only fields in ctors.
16131
16132         Applied patch from Benjamin Jemlich 
16133
16134         * expression.cs (UnaryMutator): Avoid leaking local variables. 
16135
16136 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
16137
16138         * cs-tokenizer.cs (IsCastToken): Allow the various native types
16139         here to return true, as they can be used like this:
16140
16141                 (XXX) int.MEMBER ()
16142
16143         Fixed 49836 and all the other dups
16144
16145 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
16146
16147         * driver.cs: Implement /win32res and /win32icon.
16148
16149 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
16150
16151         * cs-parser.jay: Add a rule to improve error handling for the
16152         common mistake of placing modifiers after the type.
16153
16154 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
16155
16156         * cs-parser.jay (interface_event_declaration): Catch
16157         initialization of events on interfaces, and report cs0068
16158
16159         * cs-parser.jay (interface_event_declaration): Catch
16160         initialization of events. 
16161
16162         * ecore.cs: Better report missing constructors.
16163
16164         * expression.cs (Binary.ResolveOperator): My previous bug fix had
16165         the error reporting done in the wrong place.  Fix.
16166
16167         * expression.cs (Binary.ResolveOperator): Catch the 
16168         operator + (E x, E y) error earlier, and later allow for implicit
16169         conversions in operator +/- (E e, U x) from U to the underlying
16170         type of E.
16171
16172         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
16173         52596, if the container class is abstract, the default constructor
16174         is protected otherwise its public (before, we were always public).
16175
16176         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
16177         fixed statement.
16178
16179         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
16180         Jemlich that fixes bug #52597, MCS was generating invalid code for
16181         idisposable structs.   Thanks to Ben for following up with this
16182         bug as well.
16183
16184 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
16185
16186         * driver.cs: Allow assemblies without code to be generated, fixes
16187         52230.
16188
16189 2004-01-07  Nick Drochak <ndrochak@gol.com>
16190
16191         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
16192
16193 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
16194
16195         * cs-parser.jay: Add rules to improve error reporting if fields or
16196         methods are declared at the namespace level (error 116)
16197
16198         * Add rules to catch event add/remove
16199
16200 2004-01-04  David Sheldon <dave-mono@earth.li>
16201
16202   * expression.cs: Added matching ")" to error message for 
16203   CS0077
16204
16205 2004-01-03 Todd Berman <tberman@gentoo.org>
16206
16207         * ecore.cs, attribute.cs:
16208         Applying fix from #52429.
16209
16210 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16211
16212         * ecore.cs, expression.cs, statement.cs:
16213         Total rewrite of how we handle branching. We
16214         now handle complex boolean expressions with fewer
16215         jumps. As well if (x == 0) no longer emits a ceq.
16216
16217         if (x is Foo) is much faster now, because we generate
16218         better code.
16219
16220         Overall, we get a pretty big improvement on our benchmark
16221         tests. The code we generate is smaller and more readable.
16222
16223         I did a full two-stage bootstrap. The patch was reviewed
16224         by Martin and Miguel.
16225
16226 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16227
16228         * cs-parser.jay: Make primary_expression not take a QI.
16229         we dont need this because the member_access rule covers
16230         us here. So we replace the rule with just IDENTIFIER.
16231
16232         This has two good effects. First, we remove a s/r conflict.
16233         Second, we allocate many fewer QualifiedIdentifier objects.
16234
16235 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16236
16237         * attribute.cs: Handle MarshalAs attributes as pseudo, and
16238         set the correct information via SRE. This prevents
16239         hanging on the MS runtime. Fixes #29374.
16240
16241 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
16242
16243         * convert.cs: correctly handle conversions to value types
16244         from Enum and ValueType as unboxing conversions.
16245
16246         Fixes bug #52569. Patch by Benjamin Jemlich.
16247
16248 2004-01-02  Ravi Pratap  <ravi@ximian.com>
16249
16250         * expression.cs (BetterConversion): Prefer int -> uint
16251         over int -> ulong (csc's behaviour). This fixed bug #52046.
16252
16253 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16254
16255         * decl.cs (MemberCache.FindMembers): now returns a
16256         MemberInfo [].
16257
16258         * typemanager.cs: In general, go with with ^^.
16259         (CopyNewMethods): take an IList.
16260         (RealMemberLookup): Only allocate an arraylist
16261         if we copy from two sets of methods.
16262
16263         This change basically does two things:
16264         1) Fewer array lists allocated due to CopyNewMethods.
16265         2) the explicit cast in MemberList costed ALOT.
16266
16267 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
16268
16269         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
16270         a hashtable to avoid needless string allocations when an identifier is
16271         used more than once (the common case).
16272
16273 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16274
16275         * pending.cs: MS's TypeBuilder.GetInterfaces ()
16276         is broken, it will not return anything. So, we
16277         have to use the information we have in mcs to
16278         do the task.
16279
16280         * typemanager.cs: Add a cache for GetInterfaces,
16281         since this will now be used more often (due to ^^)
16282
16283         (GetExplicitInterfaces) New method that gets the
16284         declared, not effective, interfaces on a type
16285         builder (eg, if you have interface IFoo, interface
16286         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
16287         { IBar }.
16288
16289         This patch makes MCS able to bootstrap itself on
16290         Windows again.
16291
16292 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
16293
16294         * expression.cs: Remove the Nop's that Miguel put
16295         in by mistake.
16296
16297 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16298
16299         * report.cs, codegen.cs: Give the real stack trace to
16300         the error when an exception is thrown.
16301
16302 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16303
16304         * decl.cs: only allocate hashtables for ifaces if 
16305         it is an iface!
16306
16307 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
16308
16309         * expression.cs: fix the error from cs0121-2.cs
16310         (a parent interface has two child interfaces that
16311         have a function with the same name and 0 params
16312         and the function is called through the parent).
16313
16314 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
16315
16316         * class.cs, rootcontext.cs, typmanager.cs: do not
16317         leak pointers.
16318
16319 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
16320
16321         * codegen.cs: remove stack for the ec flow branching.
16322         It is already a linked list, so no need.
16323
16324 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
16325
16326         * Makefile: Allow custom profiler here.
16327
16328 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16329
16330         * typemanager.cs (LookupType):
16331           - Use a static char [], because split takes
16332             a param array for args, so it was allocating
16333             every time.
16334           - Do not store true in a hashtable, it boxes.
16335
16336 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
16337
16338         * flowanalysis.cs: bytify common enums.
16339
16340 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16341
16342         * modifiers.cs: Add a new set of flags for the
16343         flags allowed on explicit interface impls.
16344         * cs-parser.jay: catch the use of modifiers in
16345         interfaces correctly.
16346         * class.cs: catch private void IFoo.Blah ().
16347
16348         All related to bug #50572.
16349
16350 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16351
16352         * decl.cs: Rewrite the consistant accessability checking.
16353         Accessability is not linear, it must be implemented in
16354         a tableish way. Fixes #49704.
16355
16356 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
16357
16358         * expression.cs: Handle negation in a checked context.
16359         We must use subtraction from zero. Fixes #38674.
16360
16361 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16362
16363         * class.cs: Ignore static void main in DLLs.
16364         * rootcontext.cs: Handle the target type here,
16365         since we are have to access it from class.cs
16366         * driver.cs: account for the above.
16367
16368 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
16369
16370         * report.cs: Give line numbers and files if available.
16371
16372 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
16373
16374         * driver.cs: Implement /addmodule.
16375
16376         * typemanager.cs:  Change 'modules' field so it now contains Modules not
16377         ModuleBuilders.
16378
16379 2003-12-20  Martin Baulig  <martin@ximian.com>
16380
16381         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
16382         (FieldBase.IsAssigned): Removed this field.
16383         (FieldBase.SetAssigned): New public method.
16384         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
16385
16386 2003-12-20  Martin Baulig  <martin@ximian.com>
16387
16388         * expression.cs (LocalVariableReference.DoResolve): Don't set
16389         `vi.Used' if we're called from DoResolveLValue().
16390
16391         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
16392         returns the usage vector it just merged into the current one -
16393         pass this one to UsageWarning().
16394         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
16395         of the `EmitContext', don't call this recursively on our children.
16396
16397 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
16398
16399         * driver.cs: Implement /target:module.
16400
16401 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
16402
16403         * support.cs (CharArrayHashtable): New helper class.
16404
16405         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
16406         char arrays, not strings, so we can avoid creating a string in
16407         consume_identifier if the identifier is a keyword.
16408
16409 2003-12-16  Martin Baulig  <martin@ximian.com>
16410
16411         * statement.cs (LocalInfo.Assigned): Removed this property.
16412         (LocalInfo.Flags): Removed `Assigned'.
16413         (LocalInfo.IsAssigned): New public method; takes the EmitContext
16414         and uses flow analysis.
16415         (Block.UsageWarning): Made this method private.
16416         (Block.Resolve): Call UsageWarning() if appropriate.
16417
16418         * expression.cs (LocalVariableReference.DoResolve): Always set
16419         LocalInfo.Used here.
16420
16421 2003-12-13  Martin Baulig  <martin@ximian.com>
16422
16423         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
16424         any value here; we're now using flow analysis to figure out
16425         whether a statement/block returns a value.
16426
16427 2003-12-13  Martin Baulig  <martin@ximian.com>
16428
16429         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
16430         working again.
16431         (FlowBranching.MergeFinally): Don't call
16432         `branching.CheckOutParameters()' here, this is called in
16433         MergeTopBlock().
16434         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
16435         when adding the `finally' vector.       
16436
16437 2003-12-13  Martin Baulig  <martin@ximian.com>
16438
16439         * flowanalysis.cs
16440         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
16441         actually work and also fix #48962.
16442
16443 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
16444
16445         * decl.cs: Do not check System.Object for nested types,
16446         since we know it does not have any. Big bang for buck:
16447
16448         BEFORE:
16449            Run 1:   8.35 seconds
16450            Run 2:   8.32 seconds
16451            corlib:  17.99 seconds
16452         AFTER:
16453            Run 1:   8.17 seconds
16454            Run 2:   8.17 seconds
16455            corlib:  17.39 seconds
16456
16457 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
16458
16459         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
16460         time we are returning 0 members, so we save alot here.
16461
16462 2003-12-11  Martin Baulig  <martin@ximian.com>
16463
16464         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
16465         `MergeChild()', also just take the `FlowBranching' as argument;
16466         call Merge() on it and return the result.
16467         (FlowBranching.Merge): We don't need to do anything if we just
16468         have one sibling.
16469
16470 2003-12-11  Martin Baulig  <martin@ximian.com>
16471
16472         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
16473         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
16474         Maurer for this idea.
16475
16476 2003-12-11  Martin Baulig  <martin@ximian.com>
16477
16478         * flowanalysis.cs (MergeResult): This class is now gone; we now
16479         use the `UsageVector' for this.  The reason for this is that if a
16480         branching just has one sibling, we don't need to "merge" them at
16481         all - that's the next step to do.
16482         (FlowBranching.Merge): We now return a `UsageVector' instead of a
16483         `MergeResult'.
16484
16485 2003-12-11  Martin Baulig  <martin@ximian.com>
16486
16487         Reworked flow analyis and made it more precise and bug-free.  The
16488         most important change is that we're now using a special `Reachability'
16489         class instead of having "magic" meanings of `FlowReturns'.  I'll
16490         do some more cleanups and optimizations and also add some more
16491         documentation this week.
16492
16493         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
16494         largely reworked this class.
16495         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
16496         the new `Reachability' class instead of having "magic" values here.
16497         (FlowBranching): We're now using an instance of `Reachability'
16498         instead of having separate `Returns', `Breaks' etc. fields.
16499
16500         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
16501         based on flow analysis; ignore the return value of block.Emit ().
16502
16503 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
16504
16505         * driver.cs typemanager.cs: Find the mono extensions to corlib even
16506         if they are private.
16507
16508 2003-12-09  Martin Baulig  <martin@ximian.com>
16509
16510         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
16511         call them directly on the UsageVector.
16512
16513 2003-12-09  Martin Baulig  <martin@ximian.com>
16514
16515         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
16516         Changed return type from `FlowReturns' to `Reachability'.
16517
16518 2003-12-09  Martin Baulig  <martin@ximian.com>
16519
16520         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
16521         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
16522         `Reachable' fields with a single `Reachability' one.
16523
16524 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16525
16526         * class.cs (FindMembers): Remove foreach's.
16527
16528         Bootstrap times:
16529
16530         BEFORE
16531                 Run 1:   8.74 seconds
16532                 Run 2:   8.71 seconds
16533
16534         AFTER
16535                 Run 1:   8.64 seconds
16536                 Run 2:   8.58 seconds
16537
16538
16539 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16540
16541         * cs-parser.jay:
16542         * gen-treedump.cs:
16543         * statement.cs:
16544         This patch does a few things:
16545                 1. EmptyStatement is now a singleton, so it is never reallocated.
16546                 2. All blah is EmptyStatement constructs have been changed to
16547                    blah == EmptyStatement.Value, which is much faster and valid
16548                    now that EmptyStatement is a singleton.
16549                 3. When resolving a block, rather than allocating a new array for
16550                    the non-empty statements, empty statements are replaced with
16551                    EmptyStatement.Value
16552                 4. Some recursive functions have been made non-recursive.
16553         Mainly the performance impact is from (3), however (1) and (2) are needed for
16554         this to work. (4) does not make a big difference in normal situations, however
16555         it makes the profile look saner.
16556
16557         Bootstrap times:
16558
16559         BEFORE
16560         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16561         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
16562         Total memory allocated: 56397 KB
16563
16564         AFTER
16565         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
16566         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
16567         Total memory allocated: 55666 KB
16568
16569 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16570
16571         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
16572         than the hashtable in a hashtable version
16573
16574         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
16575         we always end up concating a string. This results in a huge perf
16576         loss, because many strings have to be tracked by the GC. In this
16577         patch, we first use a hashtable that works with two keys, so that
16578         the strings do not need to be concat'ed.
16579
16580         Bootstrap times:
16581         BEFORE
16582                 Run 1:   8.74 seconds
16583                 Run 2:   8.71 seconds
16584
16585         AFTER
16586                 Run 1:   8.65 seconds
16587                 Run 2:   8.56 seconds
16588
16589 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
16590
16591         * Makefile: Add a new target `do-time' that does a quick and simple
16592         profile, leaving easy to parse output.
16593
16594 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
16595
16596         * codegen.cs (Init): Create the dynamic assembly with 
16597         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
16598
16599 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
16600
16601         * support.cs: Make the PtrHashtable use only one
16602         instance of its comparer.
16603
16604 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
16605
16606         * typemanager.cs: Fix lookup of GetNamespaces.
16607
16608 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
16609
16610         * expression.cs: Removed redundant line.
16611
16612         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
16613         ArrayLists, use for loops with bounds.  
16614
16615         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
16616         arraylist.
16617
16618         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
16619         arraylists, use for loop with bounds.
16620
16621         The above three changes give us a 0.071 second performance
16622         improvement out of 3.294 seconds down to 3.223.  On my machine
16623         the above changes reduced the memory usage by 1,387 KB during
16624         compiler bootstrap.
16625
16626         * cs-parser.jay (QualifiedIdentifier): New class used to represent
16627         QualifiedIdentifiers.  Before we created a new string through
16628         concatenation, and mostly later on, the result would be
16629         manipulated by DecomposeQI through string manipulation.
16630
16631         This reduced the compiler memory usage for bootstrapping from
16632         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
16633         compile times in 0.05 seconds.
16634
16635 2003-11-28  Dick Porter  <dick@ximian.com>
16636
16637         * support.cs: Do string compares with the Invariant culture.
16638
16639         * rootcontext.cs: 
16640         * gen-treedump.cs: 
16641         * expression.cs: 
16642         * driver.cs: 
16643         * decl.cs: 
16644         * codegen.cs: 
16645         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
16646         the comparison is done with the Invariant culture.
16647
16648 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
16649
16650         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
16651         GetEnumerator method.
16652
16653         (ProbeCollectionType): Iterate starting at the most specific type
16654         upwards looking for a GetEnumerator
16655
16656         * expression.cs: Shift count can be up to 31 for int/uint and 63
16657         for long/ulong.
16658
16659 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
16660
16661         * statement.cs (Block.LookupLabel): Also look for the label on the
16662         children blocks.  Use a hash table to keep track of visited
16663         nodes. 
16664
16665         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
16666         we actually did transform the other operand, otherwise fall back
16667         to the common codepath that casts to long.
16668
16669         * cs-tokenizer.cs: Use the same code pattern as the int case.
16670         Maybe I should do the parsing myself, and avoid depending on the
16671         Parse routines to get this done.
16672
16673 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
16674
16675         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16676         which fixes bug 51347.  This time test it.
16677
16678         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
16679         attributes for example can not tell the difference between these.
16680         The difference was only a syntax feature of the language. 
16681
16682         * attribute.cs: Apply attributes to delegates.
16683
16684         * delegate.cs: Call the apply attributes method.
16685
16686 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
16687
16688         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
16689         comparing 0 vs Byte.MinValue, not the value
16690
16691         (ImplicitConversionRequired): When reporting a conversion error,
16692         use error 31 to print out the constant error instead of the
16693         simpler 29.
16694
16695         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
16696         which fixes bug 51347.
16697
16698 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
16699
16700         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
16701         which fixes the -warnaserror command line option.
16702
16703 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
16704
16705         * cfold.cs (DoNumericPromotions): During constant folding of
16706         additions on UIntConstant, special case intconstants with
16707         IntConstants like we do on the expression binary operator. 
16708
16709 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
16710
16711         * convert.cs (ImplicitReferenceConversion): We were missing a case
16712         (System.Enum are not value types or class types, so we need to
16713         classify them separatedly).
16714
16715         * driver.cs: We do not support error 2007.
16716
16717 2003-11-12 Jackson Harper <jackson@ximian.com>
16718
16719         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
16720         system directory. Also use the full file name so users can
16721         libraries names mscorlib-o-tron.dll in a non system dir.
16722
16723 2003-11-10  Martin Baulig  <martin@ximian.com>
16724
16725         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
16726         (TypeManager.InitCoreTypes): Initialize them here, but instead of
16727         calling `ResolveType()' on them, directly assign their `Type'.
16728
16729 2003-11-08  Martin Baulig  <martin@ximian.com>
16730
16731         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
16732         return value and the `out parent' parameter.
16733         (TypeContainer.DefineType): Moved the CS0644 check into
16734         GetClassBases().  Don't pass the interface types to the
16735         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
16736         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
16737
16738         * ecore.cs (TypeExpr.IsAttribute): New property.
16739         (TypeExpr.GetInterfaces): New method.
16740
16741         * interface.cs (Interface.GetInterfaceTypeByName): Return a
16742         TypeExpr instead of a Type.
16743         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
16744         (Interface.DefineType): Don't pass the interface types to the
16745         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
16746         them later and then call `TypeBulider.AddInterfaceImplementation()'.
16747
16748         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
16749         instead of a `Type[]'.
16750         (TypeManager.RegisterBuilder): Likewise.
16751         (TypeManager.AddUserInterface): Likewise.
16752         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
16753         `Type[]' and also return a `TypeExpr[]'.
16754         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
16755
16756 2003-11-08  Martin Baulig  <martin@ximian.com>
16757
16758         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
16759         Expression.     
16760
16761 2003-11-08  Martin Baulig  <martin@ximian.com>
16762
16763         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
16764         TypeManager.ResolveExpressionTypes().
16765
16766         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
16767         instead of an Expression.
16768         (TypeExpr): This is now an abstract base class for `TypeExpression'.
16769         (TypeExpression): New public class; formerly known as `TypeExpr'.
16770
16771         * expression.cs (ComposedCast): Derive from TypeExpr.
16772
16773         * typemanager.cs (TypeManager.system_*_expr): These are now
16774         TypExpr's instead of Expression's.
16775         (TypeManager.ResolveExpressionTypes): New public static function;
16776         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
16777         of them.        
16778
16779 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
16780
16781         * expression.cs (New.DoResolve): Do not dereference value that
16782         might be a null return.
16783
16784         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
16785         sure that the constant value has the right type.  Fixes an
16786         unreported bug, similar to 50425.
16787
16788         * const.cs (Const.LookupConstantValue): Call
16789         ImplicitStandardConversionExists before doing a conversion to
16790         avoid havng the TypeManager.ChangeType do conversions.
16791
16792         Reduced the number of casts used
16793
16794         (Const.ChangeType): New routine to enable reuse of the constant
16795         type changing code from statement.
16796
16797         * typemanager.cs (ChangeType): Move common initialization to
16798         static global variables.
16799
16800         Fixes #50425.
16801
16802         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
16803         every value type to go through, even if it was void.  Fix that. 
16804
16805         * cs-tokenizer.cs: Use is_identifier_start_character on the start
16806         character of the define, and the is_identifier_part_character for
16807         the rest of the string.
16808
16809 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
16810
16811         * expression.cs (UnaryMutator.EmitCode): When I updated
16812         LocalVariableReference.DoResolve, I overdid it, and dropped an
16813         optimization done on local variable references.
16814
16815 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
16816
16817         * ecore.cs: Convert the return from Ldlen into an int.
16818
16819 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
16820
16821         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
16822         the accessibility, this is a special case for toplevel non-public
16823         classes (internal for instance).
16824
16825 2003-10-20  Nick Drochak <ndrochak@gol.com>
16826
16827         * ecore.cs: Fix typo and build.  Needed another right paren.
16828
16829 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
16830
16831         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
16832         `internal' case regular and protected, but not allowing protected
16833         to be evaluated later.  Bug 49840
16834
16835 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
16836
16837         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
16838         to kb.Nlast, and not the kb.nFirst to isolate the switch
16839         statement.
16840
16841         Extract the underlying type, so enumerations of long/ulong are
16842         treated like long/ulong.
16843
16844 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
16845
16846         * expression.cs (New): Overload the meaning of RequestedType to
16847         track the possible creation of the NewDelegate type, since
16848         DoResolve is invoked more than once for new constructors on field
16849         initialization.
16850
16851         See bugs: #48800 and #37014
16852
16853         * cs-parser.jay (declare_local_constants): Take an arraylist
16854         instead of a single constant.
16855
16856         (local_constant_declaration): It should take a
16857         constant_declarators, not a constant_declarator.  Fixes 49487
16858
16859         * convert.cs: Fix error report.
16860
16861 2003-10-13 Jackson Harper <jackson@ximian.com>
16862
16863         * typemanager.cs (TypeToCoreType): Add float and double this fixes
16864         bug #49611
16865
16866 2003-10-09  Martin Baulig  <martin@ximian.com>
16867
16868         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
16869         to the .ctor.
16870         (MethodCore.DoDefineParameters): Removed the TypeContainer
16871         argument; use the DeclSpace which was passed to the .ctor instead.
16872         (MethodCore.CheckParameter): Take a DeclSpace instead of a
16873         TypeContainer; we only need a DeclSpace here.
16874
16875 2003-10-09  Martin Baulig  <martin@ximian.com>
16876
16877         * class.cs (MethodData): Added additional `DeclSpace ds' argument
16878         to the .ctor.
16879         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
16880         EmitContext's .ctor.    
16881
16882 2003-10-09  Martin Baulig  <martin@ximian.com>
16883
16884         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
16885         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
16886         AsAccessible(), moved them as well.
16887
16888         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
16889
16890 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
16891
16892         * cs-parser.jay : Renamed yyName to yyNames related to jay.
16893
16894 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
16895
16896         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
16897         generation for >=, as spotted by Paolo, bug 48679.  
16898         Patch from David Waite.
16899
16900         * cs-tokenizer.cs: Add handling for #pragma.
16901
16902         * cs-parser.jay: Allow for both yield and yield return in the
16903         syntax.  The anti-cobolization of C# fight will go on!
16904
16905         * class.cs (TypeBuilder.DefineType): Catch error condition here
16906         (Parent.DefineType erroring out and returning null).
16907
16908         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
16909         coping with enumerations variables, we were mistakenly processing
16910         them as a regular value type instead of built-in types.  Fixes the
16911         bug #48063
16912
16913         * typemanager.cs (IsBuiltinOrEnum): New method.
16914
16915 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
16916
16917         * cs-parser.jay: Upgrade: yield now needs the return clause.
16918
16919 2003-09-19  Martin Baulig  <martin@ximian.com>
16920
16921         * decl.cs (MemberCache.SetupCacheForInterface): Take a
16922         `MemberCache parent' argument.  Normally, an interface doesn't
16923         have a parent type except System.Object, but we use this in gmcs
16924         for generic type parameters.
16925
16926 2003-09-18  Martin Baulig  <martin@ximian.com>
16927
16928         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
16929         on `type.IsInterface'; don't check whether the type has a parent
16930         to determine whether it's an interface.
16931
16932 2003-09-15  Martin Baulig  <martin@ximian.com>
16933
16934         * class.cs (TypeContainer.DefineType): Added an error flag to
16935         avoid reporting duplicate CS0146's ("class definition is
16936         circular.").
16937
16938         * driver.cs (Driver.MainDriver): Abort if
16939         RootContext.ResolveTree() reported any errors.
16940
16941 2003-09-07  Martin Baulig  <martin@ximian.com>
16942
16943         * report.cs (Error, Warning): Added overloaded versions which take
16944         a `params object[] args' and call String.Format().
16945
16946 2003-09-07  Martin Baulig  <martin@ximian.com>
16947
16948         * decl.cs (DeclSpace..ctor): Don't call
16949         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
16950         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
16951         (DeclSpace.RecordDecl): New method.
16952
16953         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
16954
16955 2003-09-02  Ravi Pratap  <ravi@ximian.com>
16956
16957         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
16958         value attributes to be applied to ParameterBuilders.
16959
16960         * class.cs (MethodCore.LabelParameters): Make static and more
16961         generic so that it can be used from other places - like interface
16962         methods, for instance.
16963
16964         * interface.cs (Interface.Emit): Call LabelParameters before
16965         emitting attributes on the InterfaceMethod.
16966
16967 2003-08-26  Martin Baulig  <martin@ximian.com>
16968
16969         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
16970         resolving aliases; fixes #47927.
16971
16972 2003-08-26  Martin Baulig  <martin@ximian.com>
16973
16974         * statement.cs (Using.DoResolve): This is internally emitting a
16975         try/finally clause, so we need to set ec.NeedExplicitReturn if we
16976         do not always return.  Fixes #47681.
16977
16978 2003-08-26  Martin Baulig  <martin@ximian.com>
16979
16980         * decl.cs (MemberCore): Moved WarningNotHiding(),
16981         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
16982         into MemberBase.
16983         (AdditionResult): Make this nested in DeclSpace.
16984         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
16985         argument; call NamespaceEntry.Define() unless we're nested in a
16986         class or struct.
16987
16988         * namespace.cs (Namespace.DefineName): New public function.  This
16989         is called from DeclSpace's .ctor to add 
16990         (Namespace.Lookup): Include DeclSpaces in the lookup.
16991
16992         * class.cs (Operator): Derive from MemberBase, not MemberCore.
16993
16994         * const.cs (Const): Derive from MemberBase, not MemberCore.     
16995
16996 2003-08-25  Martin Baulig  <martin@ximian.com>
16997
16998         * convert.cs (Convert.ExplicitReferenceConversion): When
16999         converting from an interface type to a class, unbox if the target
17000         type is a struct type.  Fixes #47822.
17001
17002 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17003
17004         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
17005         #47854.
17006
17007 2003-08-22  Martin Baulig  <martin@ximian.com>
17008
17009         * class.cs (TypeManager.DefineType): When defining a nested type,
17010         call DefineType() on our parent; fixes #47801.
17011
17012 2003-08-22  Martin Baulig  <martin@ximian.com>
17013
17014         * class.cs (MethodData.Define): While checking if a method is an
17015         interface implementation, improve the test a bit more to fix #47654.
17016
17017 2003-08-22  Martin Baulig  <martin@ximian.com>
17018
17019         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
17020         correctly; fixes #47722.
17021
17022 2003-08-22  Martin Baulig  <martin@ximian.com>
17023
17024         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
17025         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
17026
17027         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
17028
17029 2003-08-22  Martin Baulig  <martin@ximian.com>
17030
17031         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
17032         can only be assigned in static constructors.  Fixes #47161.
17033
17034 2003-08-22  Martin Baulig  <martin@ximian.com>
17035
17036         Rewrote and improved the flow analysis code.
17037
17038         * flowbranching.cs (FlowBranching): Make this class abstract.
17039         (FlowBranching.CreateBranching): New static function to create a
17040         new flow branching.
17041         (FlowBranchingBlock, FlowBranchingException): New classes.
17042         (FlowBranching.UsageVector.Type): New public readonly field.
17043         (FlowBranching.UsageVector.Breaks): Removed the setter.
17044         (FlowBranching.UsageVector.Returns): Removed the setter.
17045         (FlowBranching.UsageVector): Added Break(), Return(),
17046         NeverReachable() and Throw() methods to modify the reachability.
17047         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
17048         done by FlowBranching.Merge().
17049         (FlowBranching.UsageVector.MergeChild): New method; merges the
17050         merge result into the current vector.
17051         (FlowBranching.Merge): New abstract method to merge a branching.
17052
17053 2003-08-12  Martin Baulig  <martin@ximian.com>
17054
17055         * expression.cs (Indirection.CacheTemporaries): Create the
17056         LocalTemporary with the pointer type, not its element type.
17057
17058 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
17059
17060         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
17061         token was a keyword or not.
17062
17063         Add `error' options where an IDENTIFIER was expected;  Provide
17064         CheckToken and CheckIdentifierToken convenience error reporting
17065         functions. 
17066
17067         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
17068
17069         * decl.cs: Rename `NamespaceEntry Namespace' public field into
17070         NameSpaceEntry NameSpaceEntry.
17071
17072         (LookupInterfaceOrClass): Avoid creating a full qualified name
17073         from namespace and name: avoid doing lookups when we know the
17074         namespace is non-existant.   Use new Tree.LookupByNamespace which
17075         looks up DeclSpaces based on their namespace, name pair.
17076
17077         * driver.cs: Provide a new `parser verbose' to display the
17078         exception thrown during parsing.  This is turned off by default
17079         now, so the output of a failure from mcs is more graceful.
17080
17081         * namespace.cs: Track all the namespaces defined in a hashtable
17082         for quick lookup.
17083
17084         (IsNamespace): New method
17085
17086 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
17087
17088         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
17089         we know that we need to concatenate (full typename can never be
17090         null). 
17091
17092         * class.cs: ditto.
17093
17094         * statement.cs: Use a bitfield;  Do not initialize to null things
17095         which are done by the constructor by default.
17096
17097         * cs-parser.jay: bug fix, parameter was 4, not 3.
17098
17099         * expression.cs: Just use the property;
17100
17101         * statement.cs: No need for GetVariableInfo method.
17102
17103 2003-08-08  Martin Baulig  <martin@ximian.com>
17104
17105         * flowanalysis.cs (FlowReturns): This is now nested in the
17106         `FlowBranching' class.
17107         (MyBitVector): Moved this here from statement.cs.
17108         (FlowBranching.SiblingType): New enum type.
17109         (FlowBranching.CreateSibling): Added `SiblingType' argument.
17110
17111 2003-08-07  Martin Baulig  <martin@ximian.com>
17112
17113         * flowanalysis.cs (FlowBranchingType): This is now nested in the
17114         `FlowBranching' class and called `BranchingType'.
17115
17116 2003-08-07  Martin Baulig  <martin@ximian.com>
17117
17118         * flowanalysis.cs: Moved all the control flow analysis code into
17119         its own file.
17120
17121 2003-08-07  Martin Baulig  <martin@ximian.com>
17122
17123         * assign.cs (Assign.DoResolve): `target' must either be an
17124         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
17125         #37319.
17126
17127 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
17128
17129         * expression.cs (BinaryMethod): This kind of expression is created by the
17130         Binary class if it determines that the operator has to be handled
17131         by a method.
17132
17133         (BinaryDelegate): This kind of expression is created if we are
17134         dealing with a + or - operator on delegates.
17135
17136         (Binary): remove method, argumetns, and DelegateOperator: when
17137         dealing with methods, 
17138
17139         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
17140
17141         * statement.cs (Block): use bitfields for the three extra booleans
17142         we had in use.   Remove unused topblock parameter.
17143
17144         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
17145
17146         * assign.cs: Drop extra unneeded tests.
17147
17148 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
17149
17150         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
17151
17152         * statement.cs (Foreach): Use VariableStorage instead of
17153         LocalBuilders.   
17154
17155         * codegen.cs (VariableStorage): New class used by clients that
17156         require a variable stored: locals or fields for variables that
17157         need to live across yield.
17158
17159         Maybe provide a convenience api for EmitThis+EmitLoad?
17160
17161         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
17162         these bad boys.
17163
17164 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
17165
17166         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
17167         RemapParameterLValue): New methods that are used to turn a
17168         precomputed FieldInfo into an expression like this:
17169
17170                 instance.FieldInfo
17171
17172         The idea is to use this instead of making LocalVariableReference
17173         have more than one meaning.
17174
17175         * cs-parser.jay: Add error production to BASE.
17176
17177         * ecore.cs: Deal with TypeManager.GetField returning null, which
17178         is now a valid return value.
17179
17180         (FieldExprNoAddress): New expression for Fields whose address can
17181         not be taken.
17182
17183         * expression.cs (LocalVariableReference): During the resolve
17184         phases, create new expressions if we are in a remapping context.
17185         Remove code that dealt with remapping here.
17186
17187         (ParameterReference): same.
17188
17189         (ProxyInstance): New expression, like the `This' expression, but
17190         it is born fully resolved.  We know what we are doing, so remove
17191         the errors that are targeted to user-provided uses of `this'.
17192
17193         * statement.cs (Foreach): our variable is now stored as an
17194         Expression;  During resolution, follow the protocol, dont just
17195         assume it will return this.
17196
17197 2003-08-06  Martin Baulig  <martin@ximian.com>
17198
17199         * support.cs (SeekableStreamReader.cs): New public class.
17200
17201         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
17202         SeekableStreamReader instead of the normal StreamReader.
17203
17204 2003-08-04  Martin Baulig  <martin@ximian.com>
17205
17206         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
17207         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
17208         deambiguate casts and delegate invocations.
17209         (parenthesized_expression): Use the new tokens to ensure this is
17210         not a cast of method invocation.
17211
17212         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
17213         when reading a `)' and Deambiguate_CloseParens () was previously
17214         called.
17215
17216         * expression.cs (ParenthesizedExpression): New class.  This is
17217         just used for the CS0075 test.
17218         (Binary.DoResolve): Check for CS0075.   
17219
17220 2003-07-29  Ravi Pratap  <ravi@ximian.com>
17221
17222         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
17223         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
17224         reference comparison.
17225
17226         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
17227         examine the ReturnType for equality - this is necessary in the
17228         cases of implicit and explicit operators whose signature also
17229         includes the return type.
17230
17231 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
17232
17233         * namespace.cs: Cache the result of the namespace computation,
17234         instead of computing it every time.
17235
17236 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
17237
17238         * decl.cs: Use a global arraylist that we reuse over invocations
17239         to avoid excesive memory consumption.  Reduces memory usage on an
17240         mcs compile by one meg (45 average).
17241
17242         * typemanager.cs (LookupTypeReflection): In .NET pointers are
17243         private, work around that.
17244
17245 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
17246
17247         * literal.cs (IntLiteral): Define Zero and One static literals. 
17248
17249         * cs-parser.jay (integer_literal): use static literals to reduce
17250         memory usage for the most used literals (0, 1 and -1).  211kb
17251         reduced in memory usage.
17252
17253         Replace all calls to `new ArrayList' with `new
17254         ArrayList(4)' which is a good average number for most allocations,
17255         and also requires only 16 bytes of memory for its buffer by
17256         default. 
17257
17258         This reduced MCS memory usage in seven megabytes for the RSS after
17259         bootstrapping.
17260
17261 2003-07-28  Ravi Pratap  <ravi@ximian.com>
17262
17263         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
17264         handle params methods the correct way by forming only one
17265         applicable set with params and normal methods in them. Earlier we
17266         were looking at params methods only if we found no normal methods
17267         which was not the correct thing to do.
17268
17269         (Invocation.BetterFunction): Take separate arguments indicating
17270         when candidate and the best method are params methods in their
17271         expanded form.
17272
17273         This fixes bugs #43367 and #46199.
17274
17275         * attribute.cs: Documentation updates.
17276
17277         (CheckAttribute): Rename to CheckAttributeTarget.
17278         (GetValidPlaces): Rename to GetValidTargets.
17279
17280         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
17281         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
17282
17283         Fixes bug #44468.
17284
17285 2003-07-28  Martin Baulig  <martin@ximian.com>
17286
17287         * class.cs (TypeContainer.DefineMembers): Use the base type's full
17288         name when looking up the base class of a nested class.  Fixes #46977.
17289
17290 2003-07-26  Martin Baulig  <martin@ximian.com>
17291
17292         * expression.cs (Indexers.Indexer): New nested struct; contains
17293         getter, setter and the indexer's type.
17294         (Indexers.Properties): This is now an ArrayList of
17295         Indexers.Indexer's.
17296         (IndexerAccess.DoResolveLValue): Correctly set the type if the
17297         indexer doesn't have any getters.
17298
17299         * assign.cs (Assign.DoResolve): Also do the implicit conversions
17300         for embedded property and indexer assignments.
17301
17302 2003-07-26  Martin Baulig  <martin@ximian.com>
17303
17304         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
17305         preprocessor directive is not the first non-whitespace character
17306         on a line.
17307
17308 2003-07-26  Martin Baulig  <martin@ximian.com>
17309
17310         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
17311         namespace parsing, follow the spec more closely.
17312
17313         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
17314         NamespaceEntry.Lookup().
17315
17316 2003-07-25  Martin Baulig  <martin@ximian.com>
17317
17318         * MethodCore.cs (OverridesSomething): New public field; it's set
17319         from TypeContainer.DefineMembers if this method overrides
17320         something (which doesn't need to be a method).  Fix #39462.
17321
17322 2003-07-25  Ravi Pratap  <ravi@ximian.com>
17323
17324         * typemanager.cs (GetMembers): Ensure that the list of members is
17325         reversed. This keeps things in sync.
17326
17327         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
17328         find an AttributeUsage attribute.
17329
17330         * expression.cs (Invocation.OverloadResolve): Perform the check
17331         which disallows Invoke to be directly called on a Delegate.
17332
17333         (Error_InvokeOnDelegate): Report error cs1533.
17334
17335 2003-07-25  Martin Baulig  <martin@ximian.com>
17336
17337         * expression.cs (Indexers.GetIndexersForType): Only look in the
17338         interface hierarchy if the requested type is already an
17339         interface.  Fixes #46788 while keeping #46502 fixed.
17340
17341 2003-07-25  Martin Baulig  <martin@ximian.com>
17342
17343         * class.cs (TypeContainer.DefineMembers): Check whether all
17344         readonly fields have been assigned and report warning CS0649 if
17345         not.
17346
17347         * statement.cs (LocalInfo.IsFixed): Always return true if this is
17348         a valuetype.
17349
17350 2003-07-24  Ravi Pratap  <ravi@ximian.com>
17351
17352         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
17353         returned from GetMethods to make things consistent with the
17354         assumptions MCS makes about ordering of methods.
17355
17356         This should comprehensively fix bug #45127 and it does :-)
17357
17358         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
17359         ordering is actually reverse.
17360
17361         * Clean up some debug messages I left lying around.
17362
17363         * interface.cs (Populate*): Get rid of code which emits attributes
17364         since the stage in which we emit attributes is the 'Emit' stage,
17365         not the define stage.
17366
17367         (Emit): Move attribute emission for interface members here.
17368
17369 2003-07-22  Ravi Pratap  <ravi@ximian.com>
17370
17371         * expression.cs (Invocation.OverloadResolve): Follow the spec more
17372         closely: we eliminate methods in base types when we have an
17373         applicable method in a top-level type.
17374
17375         Please see section 14.5.5.1 for an exact description of what goes
17376         on. 
17377
17378         This fixes bug #45127 and a host of other related to corlib compilation.
17379
17380         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
17381         array is the method corresponding to the top-level type (this is
17382         because of the changes made to icall.c) so we change this
17383         accordingly.
17384
17385         (MethodGroupExpr.Name): This too.
17386
17387         * typemanager.cs (GetElementType): New method which does the right
17388         thing when compiling corlib. 
17389
17390         * everywhere: Make use of the above in the relevant places.
17391
17392 2003-07-22  Martin Baulig  <martin@ximian.com>
17393
17394         * cs-parser.jay (invocation_expression): Moved
17395         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
17396         `cast_expression', but create a InvocationOrCast which later
17397         resolves to either an Invocation or a Cast.
17398
17399         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
17400         method; call this before EmitStatement() to make sure that this
17401         expression can be used as a statement.
17402
17403         * expression.cs (InvocationOrCast): New class; resolves to either
17404         an Invocation or a Cast.
17405
17406         * statement.cs (StatementExpression): Call ResolveStatement() on
17407         the ExpressionStatement before emitting it.
17408
17409 2003-07-21  Martin Baulig  <martin@ximian.com>
17410
17411         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
17412         `ref' and `out' attributes match; fixes #46220.
17413         (MemberAccess.ResolveMemberAccess): You can't reference a type
17414         through an expression; fixes #33180.
17415         (Indexers.GetIndexersForType): Don't return the indexers from
17416         interfaces the class implements; fixes #46502.
17417
17418 2003-07-21  Martin Baulig  <martin@ximian.com>
17419
17420         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
17421         CS0661 checks; fixes bug #30442.
17422
17423 2003-07-21  Martin Baulig  <martin@ximian.com>
17424
17425         * decl.cs (AdditionResult): Added `Error'.
17426
17427         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
17428
17429         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
17430         makes cs0031.cs actually work.
17431
17432 2003-07-20  Martin Baulig  <martin@ximian.com>
17433
17434         * namespace.cs: Fixed that bug which caused a crash when compiling
17435         the debugger's GUI.
17436
17437 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
17438
17439         * typemanager.cs (LookupTypeReflection): Never expose types which
17440         are NotPublic, NestedPrivate, NestedAssembly, or
17441         NestedFamANDAssem.  We used to return these, and later do a check
17442         that would report a meaningful error, but the problem is that we
17443         would not get the real match, if there was a name override.
17444
17445 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
17446
17447         * namespace.cs (Namespace, Name): Do not compute the namespace
17448         name dynamically, compute it in the constructor.  This reduced
17449         memory usage by 1697 KB.
17450
17451         * driver.cs: Use --pause to pause at the end.
17452
17453 2003-07-17  Peter Williams  <peter@newton.cx>
17454
17455         * Makefile: Change the name of the test target so that it doesn't
17456         conflict with the recursive test target.
17457
17458 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
17459
17460         * expression.cs (LocalVariableReference.Emit, EmitAssign,
17461         AddressOf): Do not use EmitThis, that was wrong, use the actual
17462         this pointer.
17463
17464 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
17465
17466         * class.cs (MethodData.Define): While checking if a method is an
17467         interface implementation, improve the test: If we are not public
17468         (use new test here: use the computed MethodAttributes directly,
17469         instead of the parsed modifier flags) check if the `implementing'
17470         method comes from an interface or not.
17471
17472         * pending.cs (VerifyPendingMethods): Slightly better error
17473         message.
17474
17475         * makefile: add test target that does the mcs bootstrap.
17476
17477 2003-07-16  Ravi Pratap  <ravi@ximian.com>
17478
17479         * interface.cs (Define): Do nothing here since there are no
17480         members to populate etc. Move the attribute emission out of here
17481         since this was just totally the wrong place to put it. Attribute
17482         application happens during the 'Emit' phase, not in the 'Define'
17483         phase.
17484
17485         (Emit): Add this method and move the attribute emission here
17486
17487         * rootcontext.cs (EmitCode): Call the Emit method on interface
17488         types too.
17489
17490 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17491
17492         * expression.cs (OverloadResolve): Report error only if Location
17493         is not 'Null' which means that there was a probe going on.
17494
17495 2003-07-14  Martin Baulig  <martin@ximian.com>
17496
17497         * expression.cs (ConditionalLogicalOperator): New public class to
17498         implement user defined conditional logical operators.
17499         This is section 14.11.2 in the spec and bug #40505.
17500
17501 2003-07-14  Martin Baulig  <martin@ximian.com>
17502
17503         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
17504
17505 2003-07-14  Martin Baulig  <martin@ximian.com>
17506
17507         * codegen.cs (EmitContext.InFixedInitializer): New public field.
17508
17509         * ecore.cs (IVariable.VerifyFixed): New interface method.
17510
17511         * expression.cs (Unary.ResolveOperator): When resolving the `&'
17512         operator, check whether the variable is actually fixed.  Fixes bug
17513         #36055.  Set a variable definitely assigned when taking its
17514         address as required by the spec.
17515
17516         * statement.cs (LocalInfo.IsFixed): New field.
17517         (LocalInfo.MakePinned): Set `IsFixed' to true.
17518
17519 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
17520
17521         * attribute.cs (Attribute.Resolve): While doing a Member lookup
17522         for .ctors, ensure that we only ask for members declared in the
17523         attribute type (BindingFlags.DeclaredOnly).
17524
17525         Fixes bug #43632.
17526
17527         * expression.cs (Error_WrongNumArguments): Report error 1501
17528         correctly the way CSC does.
17529
17530 2003-07-13  Martin Baulig  <martin@ximian.com>
17531
17532         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
17533         lookup on the fully qualified name, to make things like "X.X" work
17534         where "X.X" is a fully qualified type name, but we also have a
17535         namespace "X" in the using list.  Fixes #41975.
17536
17537 2003-07-13  Martin Baulig  <martin@ximian.com>
17538
17539         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
17540         function. If we're a CompoundAssign, we need to create an embedded
17541         CompoundAssign, not an embedded Assign.
17542         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
17543         Fixes #45854.
17544
17545 2003-07-13  Martin Baulig  <martin@ximian.com>
17546
17547         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
17548         work to fix bug #46088.
17549
17550 2003-07-13  Ravi Pratap <ravi@ximian.com>
17551
17552         * class.cs (Operator.Emit): Do not emit attributes here - it is
17553         taken care of by the Method class that we delegate too. This takes
17554         care of bug #45876.
17555
17556 2003-07-10  Martin Baulig  <martin@ximian.com>
17557
17558         * expression.cs (TypeOfVoid): New class.
17559         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
17560
17561 2003-07-10  Martin Baulig  <martin@ximian.com>
17562
17563         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
17564         bug #35957.
17565
17566 2003-07-10  Martin Baulig  <martin@ximian.com>
17567
17568         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
17569         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
17570
17571         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
17572
17573         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
17574
17575 2003-07-10  Martin Baulig  <martin@ximian.com>
17576
17577         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
17578         of decimal.  Fixes #42850.
17579
17580         NOTE: I also fixed the created byte blob, but this doesn't work on
17581         the MS runtime and csc never produces any byte blobs for decimal
17582         arrays.
17583
17584 2003-07-10  Martin Baulig  <martin@ximian.com>
17585
17586         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
17587         structs; fixes #32068.
17588         (Block.AddChildVariableNames): Fixed #44302.
17589
17590 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17591
17592         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
17593
17594 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17595
17596         * attribute.cs: And this test is onger needed.
17597
17598 2003-07-08  Martin Baulig  <martin@ximian.com>
17599
17600         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
17601         inaccessible types.  Fixes #36313.
17602
17603         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
17604
17605         * namespace.cs (NamespaceEntry): Create implicit entries for all
17606         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
17607         implicit entries for N1.N2 and N1.
17608
17609 2003-07-08  Martin Baulig  <martin@ximian.com>
17610
17611         Rewrote the handling of namespaces to fix a lot of the issues
17612         wrt. `using' aliases etc.
17613
17614         * namespace.cs (Namespace): Splitted this class into a
17615         per-assembly `Namespace' and a per-file `NamespaceEntry'.
17616
17617         * typemanager.cs (TypeManager.IsNamespace): Removed.
17618         (TypeManager.ComputeNamespaces): Only compute namespaces from
17619         loaded assemblies here, not the namespaces from the assembly we're
17620         currently compiling.
17621
17622 2003-07-08  Martin Baulig  <martin@ximian.com>
17623
17624         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
17625
17626 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17627
17628         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
17629         already fixed it.  
17630
17631         I thought about the memory savings here, but LookupTypeReflection
17632         is used under already very constrained scenarios.  Compiling
17633         corlib or mcs only exposes one hit, so it would not really reduce
17634         any memory consumption.
17635
17636 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17637
17638         * typemanager.cs: fixes bug #45889 by only adding public types from
17639         other assemblies to the list of known types.
17640
17641 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
17642
17643         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
17644         on the type we resolved.
17645
17646 2003-07-05  Martin Baulig  <martin@ximian.com>
17647
17648         * pending.cs (PendingImplementation.ParentImplements): Don't
17649         create the proxy if the parent is abstract.
17650
17651         * class.cs (TypeContainer.DefineIndexers): Process explicit
17652         interface implementations first.  Fixes #37714.
17653
17654 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
17655
17656         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
17657         defined recursively;  but since we modify the input parameters
17658         (left is set to `this' temporarily), we reset this value if the
17659         left_is_explicit is false, which gives the original semantics to
17660         the code.  
17661
17662         * literal.cs (NullPointer): new class used to represent a null
17663         literal in a pointer context.
17664
17665         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
17666         type is a pointer, use a NullPointer object instead of a
17667         NullLiteral.   Closes 43687
17668
17669         (ExplicitConversion): Convert pointer values using
17670         the conv opcode to the proper type.
17671
17672         * ecore.cs (New): change ValueTypeVariable property into a method,
17673         that returns whether the valuetype is suitable for being used.
17674
17675         * expression.cs (Binary.DoNumericPromotions): Only return if we
17676         the int constant was a valid uint, and we can return both left and
17677         right as uints.  If not, we continue processing, to trigger the
17678         type conversion.  This fixes 39018.
17679
17680         * statement.cs (Block.EmitMeta): During constant resolution, set
17681         the CurrentBlock property on the emitcontext, so that we resolve
17682         constants propertly.
17683
17684 2003-07-02  Martin Baulig  <martin@ximian.com>
17685
17686         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
17687         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
17688
17689         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
17690         than emitting it here.
17691
17692         * statement.cs: Fixed some more flow analysis bugs.
17693
17694 2003-07-02  Martin Baulig  <martin@ximian.com>
17695
17696         * class.cs (MethodData.Define): When implementing interface
17697         methods, set Final unless we're Virtual.
17698
17699         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
17700         check work for interface methods.
17701
17702 2003-07-01  Martin Baulig  <martin@ximian.com>
17703
17704         * ecore.cs (EmitContext.This): Replaced this property with a
17705         GetThis() method which takes a Location argument.  This ensures
17706         that we get the correct error location for a CS0188.
17707
17708 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
17709
17710         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
17711         ImplicitStandardConversion.
17712
17713         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
17714
17715 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
17716
17717         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
17718         optimization.
17719
17720 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
17721
17722         * class.cs (Constructor.Define): Turn off initlocals for unsafe
17723         constructors.
17724
17725         (MethodData.Define): Turn off initlocals for unsafe methods.
17726
17727 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
17728
17729         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
17730         complete;  Fixes #37521.
17731
17732         * delegate.cs: Use Modifiers.TypeAttr to compute the
17733         TypeAttributes, instead of rolling our own.  This makes the flags
17734         correct for the delegates.
17735
17736 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
17737
17738         * class.cs (Constructor.Define): Set the private flag for static
17739         constructors as well.
17740
17741         * cs-parser.jay (statement_expression): Set the return value to
17742         null, to avoid a crash when we catch an error.
17743
17744 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
17745
17746         * cs-parser.jay: Applied patch from Jackson that adds support for
17747         extern and unsafe modifiers to destructor declarations.
17748
17749         * expression.cs: Report error 21 if the user is trying to index a
17750         System.Array.
17751
17752         * driver.cs: Add an error message, suggested by the bug report.
17753
17754         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
17755         if we do not have a ": this ()" constructor initializer.  Fixes 45149
17756
17757 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
17758
17759         * namespace.cs: Add some information to reduce FAQs.
17760
17761 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
17762
17763         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
17764         underlying enumeration types.  Fixes #43915.
17765
17766         * expression.cs: Treat ushort/short as legal values to be used in
17767         bitwise operations.
17768
17769 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
17770
17771         * delegate.cs: transfer custom attributes for paramenters from
17772         the delegate declaration to Invoke and BeginInvoke.
17773
17774 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
17775
17776         * attribute.cs: handle custom marshalers and emit marshal info
17777         for fields, too.
17778
17779 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
17780
17781         * makefile.gnu: Added anonymous.cs to the compiler sources.
17782
17783 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
17784
17785         * iterators.cs: Change the name of the proxy class to include two
17786         underscores.
17787
17788         * cs-parser.jay: Update grammar to include anonymous methods.
17789
17790         * anonymous.cs: new file.
17791
17792 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
17793
17794         * class.cs (Field.Define): Add missing test for pointers and
17795         safety. 
17796
17797 2003-05-27  Ravi Pratap  <ravi@ximian.com>
17798
17799         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
17800         we use the stobj opcode.
17801
17802         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
17803         since it wasn't the correct fix. 
17804
17805         It still is puzzling that we are required to use stobj for IntPtr
17806         which seems to be a ValueType.
17807
17808 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
17809
17810         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
17811         during regular simple name resolution.   Now, the trick is that
17812         instead of returning for processing the simplename, we do a
17813         TypeManager.LookupType (ie, a rooted lookup as opposed to a
17814         contextual lookup type).   If a match is found, return that, if
17815         not, return for further composition.
17816
17817         This fixes long-standing 30485.
17818
17819         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
17820         using the address to initialize an object, do an Stobj instead of
17821         using the regular Stelem.
17822
17823         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
17824         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
17825         Because if we are a BaseIndexerAccess that value will be true.
17826         Fixes 43643.
17827
17828         * statement.cs (GotoCase.Resolve): Return after reporting an
17829         error, do not attempt to continue. 
17830
17831         * expression.cs (PointerArithmetic.Emit): If our operand is a
17832         long, convert our constants to match the operand before
17833         multiplying.  Convert to I type before adding.   Fixes 43670.
17834
17835 2003-05-14  Ravi Pratap  <ravi@ximian.com>
17836
17837         * enum.cs (ImplicitConversionExists) : Rename to
17838         ImplicitEnumConversionExists to remove ambiguity. 
17839
17840         * ecore.cs (NullCast): New type of cast expression class which
17841         basically is very similar to EmptyCast with the difference being
17842         it still is a constant since it is used only to cast a null to
17843         something else
17844         (eg. (string) null)
17845
17846         * convert.cs (ImplicitReferenceConversion): When casting a null
17847         literal, we return a NullCast.
17848
17849         * literal.cs (NullLiteralTyped): Remove - I don't see why this
17850         should be around anymore.
17851
17852         The renaming (reported was slightly wrong). Corrections:
17853
17854         ConvertImplicitStandard -> ImplicitConversionStandard
17855         ConvertExplicitStandard -> ExplicitConversionStandard
17856
17857         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
17858         before passing them in !
17859
17860         * convert.cs (ImplicitConversionStandard): When comparing for
17861         equal expr and target types, ensure that expr is not a
17862         NullLiteral.
17863
17864         In general, we must not be checking (expr_type ==
17865         target_type) in the top level conversion methods
17866         (ImplicitConversion, ExplicitConversion etc). This checking is
17867         done in the methods that they delegate to.
17868
17869 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
17870
17871         * convert.cs: Move Error_CannotConvertType,
17872         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
17873         ImplicitNumericConversion, ImplicitConversionExists,
17874         ImplicitUserConversionExists, StandardConversionExists,
17875         FindMostEncompassedType, FindMostSpecificSource,
17876         FindMostSpecificTarget, ImplicitUserConversion,
17877         ExplicitUserConversion, GetConversionOperators,
17878         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
17879         TryImplicitIntConversion, Error_CannotConvertImplicit,
17880         ConvertImplicitRequired, ConvertNumericExplicit,
17881         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
17882         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
17883         its own file.
17884
17885         Perform the following renames:
17886
17887         StandardConversionExists -> ImplicitStandardConversionExists
17888         ConvertImplicit -> ImplicitConversion
17889         ConvertImplicitStandard -> ImplicitStandardConversion
17890         TryImplicitIntConversion -> ImplicitIntConversion
17891         ConvertImplicitRequired -> ImplicitConversionRequired
17892         ConvertNumericExplicit -> ExplicitNumericConversion
17893         ConvertReferenceExplicit -> ExplicitReferenceConversion
17894         ConvertExplicit -> ExplicitConversion
17895         ConvertExplicitStandard -> ExplicitStandardConversion
17896
17897 2003-05-19  Martin Baulig  <martin@ximian.com>
17898
17899         * statement.cs (TypeInfo.StructInfo): Made this type protected.
17900         (TypeInfo): Added support for structs having structs as fields.
17901
17902         * ecore.cs (FieldExpr): Implement IVariable.
17903         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
17904         VariableInfo for the field.
17905
17906 2003-05-18  Martin Baulig  <martin@ximian.com>
17907
17908         * expression.cs (This.DoResolve): Report a CS0027 if we're
17909         emitting a field initializer.
17910
17911 2003-05-18  Martin Baulig  <martin@ximian.com>
17912
17913         * expression.cs (This.ResolveBase): New public function.
17914         (This.DoResolve): Check for CS0188.
17915
17916         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
17917         This.Resolve().
17918
17919         * ecore.cs (MethodGroupExpr.DoResolve): Set the
17920         `instance_expression' to null if we don't have any non-static
17921         methods.
17922
17923 2003-05-18  Martin Baulig  <martin@ximian.com>
17924
17925         Reworked the way how local variables and parameters are handled by
17926         the flow analysis code.
17927
17928         * statement.cs (TypeInfo, VariableMap): New public classes.
17929         (VariableInfo): New public class.  This is now responsible for
17930         checking whether a variable has been assigned.  It is used for
17931         parameters and local variables.
17932         (Block.EmitMeta): Take the InternalParameters as argument; compute
17933         the layout of the flow vectors here.
17934         (Block.LocalMap, Block.ParameterMap): New public properties.
17935         (FlowBranching): The .ctor doesn't get the InternalParameters
17936         anymore since Block.EmitMeta() now computes the layout of the flow
17937         vector.
17938         (MyStructInfo): This class is now known as `StructInfo' and nested
17939         in `TypeInfo'; we don't access this directly anymore.
17940
17941         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
17942         property and removed IsAssigned(), IsFieldAssigned(),
17943         SetAssigned() and SetFieldAssigned(); we now call them on the
17944         VariableInfo so we don't need to duplicate this code everywhere.
17945
17946         * expression.cs (ParameterReference): Added `Block block' argument
17947         to the .ctor.
17948         (LocalVariableReference, ParameterReference, This): The new
17949         VariableInfo class is now responsible for all the definite
17950         assignment stuff.
17951
17952         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
17953         IsParameterAssigned, SetParameterAssigned): Removed.
17954
17955 2003-05-18  Martin Baulig  <martin@ximian.com>
17956
17957         * typemanager.cs (InitCoreTypes): Try calling
17958         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
17959         the 3-args-version.  Corlib now also needs our `void_type'.
17960         (GetMethod): Added overloaded version which takes an optional
17961         `bool report_errors' to allow lookups of optional methods.
17962
17963 2003-05-12  Martin Baulig  <martin@ximian.com>
17964
17965         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
17966         only used for locals and not for parameters.
17967
17968 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
17969
17970         * support.cs (InternalParameters.ParameterType): Return the
17971         ExternalType of the parameter.
17972
17973         * parameter.cs (Parameter.ExternalType): drop the two arguments,
17974         they were unused.
17975
17976 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
17977
17978         * class.cs (MethodData.Define): Do not set the `newslot' on
17979         interface members, if they are also flagged as "override".
17980
17981         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
17982         better code for ++i and i++.  This only works for static fields
17983         and local variables.
17984
17985         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
17986         want to pull the DeclSpace out of the builder_to_declspace instead
17987         of the TypeBuilder (like in TypeContainer.FindMembers).
17988
17989         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
17990         instead of LookupTypeContainer.  Fixes the crash on .NET for
17991         looking up interface members.
17992
17993         * const.cs: Create our own emit context during the Definition
17994         stage, so that constants are evaluated in the proper context, when
17995         a recursive definition happens.
17996
17997 2003-05-11  Martin Baulig  <martin@ximian.com>
17998
17999         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
18000         new block for a switch section.
18001         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
18002         the adding/lookup in the switch block.  Fixes #39828.
18003
18004 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
18005
18006         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
18007         functionality: I needed to convert the data after I had performed
18008         the add/sub operation into the operands type size.
18009
18010         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
18011         pass the type for the box operation, otherwise the resulting
18012         object would have been of type object.
18013
18014         (BoxedCast): Add constructor to specify the type to box as.
18015
18016 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
18017
18018         * iterators.cs: I was reusing the `count' variable inadvertently,
18019         take steps to not allow this to happen.
18020
18021 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
18022
18023         * attribute.cs (Attribute.Resolve): Params attributes are encoded
18024         by creating an array at the point where the params starts and
18025         putting all those arguments there, then adjusting the size of the
18026         array.
18027
18028 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
18029
18030         * expression.cs (New.AddressOf): Implement interface
18031         IMemoryLocation.  This is used when the `new' operator is used in
18032         the context of an invocation to a method on a value type.
18033
18034         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
18035         example. 
18036
18037         * namespace.cs: Also check the using aliases here.
18038
18039         * driver.cs: Move the test for using validity after the types have
18040         been entered, so we do a single pass that also includes the using
18041         aliases. 
18042
18043         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
18044         in the regular case.   CreateSiblingForFinally is doing extra
18045         error checking.
18046
18047         * attribute.cs (GetAttributeArgumentExpression): Store the result
18048         on an out value, and use the return value to indicate failure
18049         instead of using null (which is a valid return for Constant.GetValue).
18050
18051         * statement.cs: Perform the analysis flow for the increment
18052         portion after the statement, because this will be the real flow of
18053         execution.  Fixes #42385
18054
18055         * codegen.cs (EmitContext.EmitArgument,
18056         EmitContext.EmitStoreArgument): New helper functions when the
18057         RemapToProxy flag is set.
18058
18059         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
18060         function.
18061
18062         Add support for remapping parameters. 
18063
18064         * iterators.cs: Propagate parameter values;  Store parameter
18065         values in the proxy classes.
18066
18067 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
18068
18069         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
18070         need a proxy reference;  I do not know what I was thinking
18071
18072         * cs-parser.jay (constructor_initializer): catch another error,
18073         and display nice message.
18074
18075         (field_declaration): catch void field declaration
18076         to flag a better error. 
18077
18078         * class.cs (MemberBase.CheckBase): Report an error instead of a
18079         warning if a new protected member is declared in a struct. 
18080         (Field.Define): catch the error of readonly/volatile.
18081
18082         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
18083
18084         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
18085         volatile variable is taken
18086
18087 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
18088
18089         * statement.cs (Fixed.Resolve): Report an error if we are not in
18090         an unsafe context.
18091
18092 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
18093
18094         * typemanager.cs: reuse the code that handles type clashes for
18095         delegates and enumerations.
18096
18097         * class.cs (Report28): Always report.
18098
18099         * expression.cs (EncodeAsAttribute): Allow nulls here.
18100
18101 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
18102
18103         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
18104         the functionality for testing whether an expression is valid for
18105         an attribute here.  Also handle the case of arrays of elements
18106         being stored. 
18107
18108         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
18109         encoding a linear array into an array of objects that are suitable
18110         to be passed to an CustomAttributeBuilder.
18111
18112         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
18113
18114         * ecore.cs: (FieldExpr): Handle field remapping here.
18115
18116         * iteratators.cs: Pass the instance variable (if the method is an
18117         instance method) to the constructors, so we can access the field
18118         variables on the class.
18119
18120         TODO: Test this with structs.  I think the THIS variable on
18121         structs might have to be a pointer, and not a refenrece
18122
18123 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
18124
18125         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
18126         local variables to fields in a proxy class.
18127
18128         * iterators.cs (PopulateProxy): Rename our internal fields to
18129         <XXX>.  
18130         Create a <THIS> field if we are an instance method, so we can
18131         reference our parent container variables.
18132         (MapVariable): Called back from the EmitContext code to enter a
18133         new variable to field mapping into the proxy class (we just create
18134         a FieldBuilder).
18135
18136         * expression.cs
18137         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
18138         for using the remapped locals to fields.
18139
18140         I placed the code here, because that gives the same semantics to
18141         local variables, and only changes the Emit code.
18142
18143         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
18144         statements inside iterators.
18145         (VariableInfo): Add a FieldBuilder for the cases when we are
18146         remapping local variables to fields in a proxy class
18147
18148         * ecore.cs (SimpleNameResolve): Avoid testing two times for
18149         current_block != null.
18150
18151         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
18152         not cope with strings, as it has been moved to the
18153         TableSwitchEmit.  Fixed bug in switch generation.
18154
18155         * expression.cs (New.DoResolve): Provide more context for the user
18156         when reporting an error.
18157
18158         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
18159         pointers. 
18160
18161         * expression.cs (MemberAccess.DoResolve): When we get a type back,
18162         check the permissions for it.  Note than in a type-resolution
18163         context the check was already present in DeclSpace.ResolveType,
18164         but was missing from the MemberAccess.
18165
18166         (ArrayCreation.CheckIndices): warn if the user has
18167         more nested levels of expressions, but there are no more
18168         dimensions specified.  Avoids crash on bug 41906.
18169
18170 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
18171
18172         * statement.cs (Block): replace Implicit bool, for a generic
18173         flags.   
18174         New flag: `Unchecked'.  This is used during the EmitMeta phase
18175         (which is out-of-line with the regular Resolve/Emit process for a
18176         statement, as this is done ahead of time, but still gets a chance
18177         to call constant resolve).
18178
18179         (Block.Flags): new enum for adding a new flag.
18180
18181         (Block.EmitMeta): track the state of unchecked.
18182
18183         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
18184         to enable constant resolution to work there as well.
18185
18186 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
18187
18188         * typemanager.cs (ienumerable_type): Also look up
18189         System.Collections.IEnumerable. 
18190
18191 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
18192
18193         TODO: Test more than one conditional per method.
18194
18195         * class.cs (Indexer.Define): Report the location where the user is
18196         referencing the unsupported feature.
18197
18198         (MethodData): Overload the use of `conditionals' to
18199         minimize the creation of needless ArrayLists.   This saves roughly
18200         212kb on my machine.
18201
18202         (Method): Implement the new IIteratorContainer interface.
18203         (Method.SetYields): Implement the method by setting the ModFlags
18204         to contain METHOD_YIELDS.
18205
18206         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
18207         which just got set to null.
18208
18209         * iterators.cs: New file.
18210
18211         (Yield, YieldBreak): New statements.
18212
18213         * statement.cs (Return.Resolve): Flag an error if we are used in
18214         an iterator method.
18215
18216         * codegen.cs (InIterator): New flag set if the code is being
18217         compiled in an iterator method.
18218
18219         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
18220         internal modifier, and we just use it to avoid adding extra
18221         fields, as this is seldom used.  
18222
18223         * cs-parser.jay: Add yield_statement (yield and yield break).
18224
18225         * driver.cs: New flag -v2 to turn on version 2 features. 
18226
18227         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
18228         hashtable when v2 is enabled.
18229
18230 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
18231
18232         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
18233         there is already a namespace defined with this name.
18234
18235         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
18236         people upgraded their corlibs.
18237
18238         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
18239         always use fully qualified types, no need to use the compiler
18240         front end.
18241
18242         (TypeManager.IsNamespace): Use binarysearch.
18243
18244         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
18245         AddDelegate): I did not quite use the new IsValid API properly: I
18246         have to pass the short-name and the fullname.  I was passing only
18247         the basename instead of the fullname sometimes. 
18248
18249         (TypeContainer.DefineType): call NamespaceClash.
18250
18251         * interface.cs (Interface.DefineType): use NamespaceClash before
18252         defining the type.
18253
18254         * delegate.cs (Delegate.DefineType): use NamespaceClash before
18255         defining the type.
18256
18257         * enum.cs: (Enum.DefineType): use NamespaceClash before
18258         defining the type.
18259
18260         * typemanager.cs (: 3-line patch that gives us some tasty 11%
18261         speed increase.  First, use the negative_hits cache when we get a
18262         negative.  Second, add the type with its full original name
18263         instead of the new . and + encoded name (reflection uses + to
18264         separate type from a nested type).  Use LookupTypeReflection
18265         directly which bypasses the type->name hashtable (that we already
18266         know does not contain the type.
18267
18268         * decl.cs (DeclSpace.ResolveTypeExpr): track the
18269         location/container type. 
18270
18271         * driver.cs: When passing utf8, use directly the UTF8Encoding.
18272
18273 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
18274
18275         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
18276
18277         * delegate.cs (NewDelegate.Resolve): Test whether an instance
18278         method is being referenced in the method group from a static
18279         context, and report error 120 if so.
18280
18281         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
18282         Error118. 
18283
18284         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
18285         is created, we create the A namespace).
18286
18287         * cs-parser.jay: A namespace also introduces a DeclarationFound.
18288         Fixes #41591
18289
18290 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
18291
18292         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
18293         invocation to ModuleBuilder.GetType with the same values will
18294         return a new type instance, so we need to cache its return
18295         values. 
18296
18297         * expression.cs (Binary.ResolveOperator): Only allow the compare
18298         operators on enums if they are of the same type.
18299
18300         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
18301         types of ValueType on their own case.  Before we were giving them
18302         the same treatment as objects.
18303
18304         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
18305         fullname.  Short name is used to compare against container name.
18306         Fullname is used to check against defined namespace names.
18307
18308         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
18309         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
18310
18311         (Method.CheckBase): Call parent.
18312         (MemberBase.CheckBase): Check for protected members on sealed
18313         classes.
18314         (PropertyBase.CheckBase): Call parent.
18315         (Field.Define): Call parent.
18316
18317         * report.cs: Negative error codes are now mapped to 8000 - code,
18318         so that the display is render more nicely.
18319
18320         * typemanager.cs: Do not use try/catch, instead report a regular
18321         error. 
18322
18323         (GetPointerType, GetReferenceType): These methods provide
18324         mechanisms to obtain the T* and T& from a T.  We had the code
18325         previously scattered around the code base, and it also used
18326         TypeManager.LookupType that would go through plenty of caches.
18327         This one goes directly to the type source.
18328
18329         In some places we did the Type.GetType followed by
18330         ModuleBuilder.GetType, but not in others, so this unifies the
18331         processing as well.
18332
18333         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
18334         statements now that we have namespace information.
18335
18336         * typemanager.cs (IsNamespace): New method, returns whether the
18337         string presented is a namespace or not.
18338
18339         (ComputeNamespaces): New public entry point, computes the list of
18340         available namespaces, using the GetNamespaces API call in Mono, or
18341         the slower version in MS.NET.   
18342
18343         Now before we start the semantic analysis phase, we have a
18344         complete list of namespaces including everything that the user has
18345         provided.
18346
18347         Deleted old code to cache namespaces in .nsc files.
18348
18349 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
18350
18351         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
18352         class/struct location definition Location for the implicit
18353         constructor location.
18354
18355         (Operator.Define): Use the location of the operator for the
18356         implicit Method definition.
18357
18358         (Constructor.Emit): use the constructor location for the implicit
18359         base initializer constructor.
18360
18361         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
18362         and the Expression class now contains two new methods:
18363
18364         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
18365         isolate type lookup from the rest of the resolution process.
18366
18367         Since we use Expressions to hold type definitions due to the way
18368         we parse the input we have historically overloaded Resolve to
18369         perform the Type lookups if a special flag is passed.  Now this is
18370         eliminated and two methods take their place. 
18371
18372         The differences in the two methods between xStep and xTerminal is
18373         that xStep is involved in our current lookup system that uses
18374         SimpleNames to compose a name, while xTerminal is used just to
18375         catch the case where the simplename lookup failed.
18376
18377 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
18378
18379         * expression.cs (ResolveMemberAccess): Remove redundant code.
18380         TypeExpr expressions are always born fully resolved.
18381
18382         * interface.cs (PopulateMethod): Do not lookup the types twice.
18383         We were doing it once during SemanticAnalysis and once during
18384         PopulateMethod.
18385
18386         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
18387         in local variable type definitions, were being returned as a
18388         SimpleName (we decomposed everything into a string), that is
18389         because primary_expression was being used instead of a type in the
18390         grammar (reduce/reduce conflicts).
18391
18392         The part that was wrong is that we converted the expression into a
18393         string (an oversimplification in one hand, compounded with primary
18394         expressions doing string concatenation).
18395
18396         So things like:
18397
18398         A.B.C [] x;
18399
18400         Would return "A.B.C[]" as a SimpleName.  This stopped things like
18401         using clauses from working on this particular context.  And a type
18402         was being matched directly against "A.B.C[]".
18403
18404         We now use the correct approach, and allow for ComposedCast to be
18405         part of the unary expression.  So the "A.B.C []" become a composed
18406         cast of "A.B.C" (as a nested group of MemberAccess with a
18407         SimpleName at the end) plus the rank composition "[]". 
18408
18409         Also fixes 35567
18410
18411 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
18412
18413         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
18414         for the access level checking.
18415
18416         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
18417         `TypeContainer container', because I kept getting confused when I
18418         was debugging this code.
18419
18420         * expression.cs (Indexers): Instead of tracking getters/setters,
18421         we now track them in parallel.  We create one arraylist less, but
18422         most importantly it is possible now for the LValue code to find a
18423         matching get for a set.
18424
18425         (IndexerAccess.DoResolveLValue): Update the code.
18426         GetIndexersForType has been modified already to extract all the
18427         indexers from a type.  The code assumed it did not.
18428
18429         Also make the code set the correct return type for the indexer.
18430         This was fixed a long time ago for properties, but was missing for
18431         indexers.  It used to be void_type.
18432
18433         (Binary.Emit): Test first for doubles instead of
18434         floats, as they are more common.
18435
18436         (Binary.EmitBranchable): Use the .un version of the branch opcodes
18437         when dealing with floats and the <=, >= operators.  This fixes bug
18438         #39314 
18439
18440         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
18441         to load the array value by emitting a load on the foreach variable
18442         type.  This was incorrect.  
18443
18444         We now emit the code to load an element using the the array
18445         variable type, and then we emit the conversion operator.
18446
18447         Fixed #40176
18448
18449 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
18450
18451         * attribute.cs: Avoid allocation of ArrayLists in the common case.
18452
18453 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
18454
18455         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
18456         test for protection before we test for signatures. 
18457
18458         (MethodSignature.ToString): implement.
18459
18460         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
18461         to the case where we reduced into a LongConstant.
18462
18463         * decl.cs (CheckAccessLevel): If the type is an array, we can not
18464         depend on whether the information is acurrate, because the
18465         Microsoft runtime will always claim that the array type is public,
18466         regardless of the real state.
18467
18468         If the type is a pointer, another problem happens: the type is
18469         reported as non-public in Microsoft.  
18470
18471         In both cases we have to call CheckAccessLevel recursively with
18472         the underlying type as the argument to be tested.
18473
18474 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
18475
18476         * assign.cs (Assign.Emit): If we are dealing with a compound
18477         assignment expression, we should use the code path that stores the
18478         intermediate result in a temporary value.  This fixes #40903.
18479
18480         *expression.cs (Indirection.ToString): Provide ToString method for
18481         debugging. 
18482
18483 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
18484
18485         * class.cs: Null out fields holding references to Block objects so
18486         they can be garbage collected.
18487
18488         * expression.cs (OverloadResolve): Remove unused local.
18489
18490 2003-04-07  Martin Baulig  <martin@ximian.com>
18491
18492         * codegen.cs (EmitContext.CurrentFile): New public field.
18493         (EmitContext.Mark): Use the CurrentFile to check whether the
18494         location is in the correct file.
18495         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
18496
18497 2003-04-07  Martin Baulig  <martin@ximian.com>
18498
18499         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
18500
18501         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
18502         location.  [FIXME: The location argument which gets passed to this
18503         method is sometimes wrong!]
18504
18505 2003-04-07  Nick Drochak <ndrochak@gol.com>
18506
18507         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
18508
18509 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
18510
18511         * expression.cs (Indirection.EmitAssign): We were using the
18512         temporary, but returning immediately instead of continuing the
18513         EmitAssing flow.
18514
18515 2003-04-06  Martin Baulig  <martin@ximian.com>
18516
18517         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
18518         if it's a nested child, but also deriving from the outer class.
18519         See test 190.cs.
18520
18521         * typemanager.cs (IsNestedChildOf): Make this work if it's a
18522         nested child, but also deriving from the outer class.  See
18523         test-190.cs.
18524         (FilterWithClosure): We may access private members of the outer
18525         class if we're a nested child and deriving from the outer class.
18526         (RealMemberLookup): Only set `closure_private_ok' if the
18527         `original_bf' contained BindingFlags.NonPublic.
18528
18529 2003-04-05  Martin Baulig  <martin@ximian.com>
18530
18531         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
18532
18533 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
18534
18535         * class.cs (Event.Define): Do not allow abstract events to have
18536         initializers. 
18537
18538 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
18539
18540         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
18541         block in event declarations.
18542
18543         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
18544         value type, get its address.
18545
18546         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
18547         leaving a class on the stack instead of a boolean value (int
18548         0/1).  Change the code so we compare against null, and then the
18549         result against zero.
18550
18551         * class.cs (TypeContainer.GetClassBases): We were checking for the
18552         parent class being sealed too late.
18553
18554         * expression.cs (Binary.Emit): For <= and >= when dealing with
18555         floating point values, use cgt.un and clt.un instead of cgt and
18556         clt alone.
18557
18558 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
18559
18560         * statement.cs: Apply the same optimization as MS: skip the 
18561         GetEnumerator returning an IEnumerator, and use the one returning a 
18562         CharEnumerator instead. This allows us to avoid the try-finally block 
18563         and the boxing.
18564
18565 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
18566
18567         * cs-parser.jay: Attributes cannot be applied to
18568                          namespaces. Fixes #40473
18569
18570 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18571
18572         * class.cs:
18573         (Add*): check if the name is valid using the full name for constants,
18574         fields, properties and events.
18575
18576 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
18577
18578         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
18579         char constants to be part of the enumeration.
18580
18581         * expression.cs (Conditional.DoResolve): Add support for operator
18582         true. Implements the missing functionality from 14.12
18583
18584         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
18585         operator true/false as required by the spec.
18586
18587         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
18588         implicit conversion to boolean.
18589
18590         * statement.cs (Statement.ResolveBoolean): A boolean expression is
18591         also one where the type implements `operator true'. 
18592
18593         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
18594         get an expression that will invoke operator true based on an
18595         expression.  
18596
18597         (GetConversionOperators): Removed the hack that called op_True
18598         here.  
18599
18600         (Expression.ResolveBoolean): Move this from Statement.
18601
18602 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
18603
18604         * ecore.cs (FieldExpr): do not allow initialization of initonly
18605         fields on derived classes
18606
18607 2003-03-13  Martin Baulig  <martin@ximian.com>
18608
18609         * statement.cs (Block.Emit): Call ig.BeginScope() and
18610         ig.EndScope() when compiling with debugging info; call
18611         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
18612
18613 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
18614
18615         * expression.cs (Indexers): Do not construct immediately, allow
18616         for new members to be appended as we go.  Fixes 38143
18617
18618 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18619
18620         * expression.cs: save/restore context when resolving an unchecked
18621         expression.
18622
18623 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
18624
18625         * cfold.cs: Catch division by zero in modulus operator during
18626         constant folding.
18627
18628 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
18629
18630         * interface.cs (Interface.DefineMembers): Avoid defining members
18631         twice. 
18632
18633 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
18634
18635         * driver.cs: handle the +/- options for -noconfig
18636
18637         * statement.cs (Unckeched.Resolve): Also track the state of
18638         unchecked in the Resolve phase.
18639
18640 2003-02-27  Martin Baulig  <martin@ximian.com>
18641
18642         * ecore.cs (Expression.MemberLookup): Don't create a
18643         MethodGroupExpr for something which is not a method.  Fixes #38291.
18644
18645 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
18646
18647         * class.cs (MemberBase.CheckParameters): Also check that the type
18648         is unmanaged if it is a pointer.
18649
18650         * expression.cs (SizeOf.Resolve): Add location information.
18651
18652         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
18653         a managed type is declared.
18654
18655         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
18656         parameter modifiers as well.  Fixes bug 38606
18657
18658         * class.cs: Very sad.  Am backing out the speed up changes
18659         introduced by the ArrayList -> Array in the TypeContainer, as they
18660         were not actually that much faster, and introduced a bug (no error
18661         reports on duplicated methods).
18662
18663         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
18664         source first, this will guarantee that we have a valid expression
18665         before calling in lower levels functions that will require a
18666         resolved object.  Then use this original_source in the
18667         target.ResolveLValue instead of the original source that was
18668         passed to us.
18669
18670         Another change.  Use target.Resolve instead of LValueResolve.
18671         Although we are resolving for LValues, we will let the Assign code
18672         take care of that (it will be called again from Resolve).  This
18673         basically allows code like this:
18674
18675         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
18676         class Y { void A (X x) { x [0] += o; }
18677
18678         The problem was that the indexer was trying to resolve for
18679         set_Item (idx, object o) and never finding one.  The real set_Item
18680         was set_Item (idx, X).  By delaying the process we get the right
18681         semantics. 
18682
18683         Fixes bug 36505
18684
18685 2003-02-23  Martin Baulig  <martin@ximian.com>
18686
18687         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
18688         while calling DoEmit ().
18689
18690         * codegen.cs (EmitContext.Mark): Don't mark locations in other
18691         source files; if you use the #line directive inside a method, the
18692         compiler stops emitting line numbers for the debugger until it
18693         reaches the end of the method or another #line directive which
18694         restores the original file.
18695
18696 2003-02-23  Martin Baulig  <martin@ximian.com>
18697
18698         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
18699
18700 2003-02-23  Martin Baulig  <martin@ximian.com>
18701
18702         * statement.cs (Block.AddChildVariableNames): We need to call this
18703         recursively, not just for our immediate children.
18704
18705 2003-02-23  Martin Baulig  <martin@ximian.com>
18706
18707         * class.cs (Event.Define): Always make the field private, like csc does.
18708
18709         * typemanager.cs (TypeManager.RealMemberLookup): Make events
18710         actually work, fixes bug #37521.
18711
18712 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
18713
18714         * delegate.cs: When creating the various temporary "Parameters"
18715         classes, make sure that we call the ComputeAndDefineParameterTypes
18716         on those new parameters (just like we do with the formal ones), to
18717         allow them to be resolved in the context of the DeclSpace.
18718
18719         This fixes the bug that Dick observed in Bugzilla #38530.
18720
18721 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
18722
18723         * expression.cs (ResolveMemberAccess): When resolving a constant,
18724         do not attempt to pull a constant if the value was not able to
18725         generate a valid constant.
18726
18727         * const.cs (LookupConstantValue): Do not report more errors than required.
18728
18729 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18730
18731         * expression.cs: fixes bug #38328.
18732
18733 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
18734
18735         * class.cs: Changed all the various members that can be part of a
18736         class from being an ArrayList to be an Array of the right type.
18737         During the DefineType type_list, interface_list, delegate_list and
18738         enum_list are turned into types, interfaces, delegates and enums
18739         arrays.  
18740
18741         And during the member population, indexer_list, event_list,
18742         constant_list, field_list, instance_constructor_list, method_list,
18743         operator_list and property_list are turned into their real arrays.
18744
18745         Although we could probably perform this operation earlier, for
18746         good error reporting we need to keep the lists and remove the
18747         lists for longer than required.
18748
18749         This optimization was triggered by Paolo profiling the compiler
18750         speed on the output of `gen-sample-program.pl' perl script. 
18751
18752         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
18753         not crash in methods like MemberLookupFailed that use this field.  
18754
18755         This problem arises when the compiler fails to resolve a type
18756         during interface type definition for example.
18757
18758 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
18759
18760         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
18761         inherit from System.Object, so we have to stop at null, not only
18762         when reaching System.Object.
18763
18764 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
18765
18766         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
18767         DeclaredOnly because the parent indexer might have had a different
18768         name, but did not loop until the top of the hierarchy was reached.
18769
18770         The problem this one fixes is 35492: when a class implemented an
18771         indexer from an interface, we were getting the interface method
18772         (which was abstract) and we were flagging an error (can not invoke
18773         abstract method).
18774
18775         This also keeps bug 33089 functioning, and test-148 functioning.
18776
18777         * typemanager.cs (IsSpecialMethod): The correct way of figuring
18778         out if a method is special is to see if it is declared in a
18779         property or event, or whether it is one of the predefined operator
18780         names.   This should fix correctly #36804.
18781
18782 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
18783
18784         The goal here is to remove the dependency on EmptyCast.Peel ().
18785         Killing it completely.
18786
18787         The problem is that currently in a number of places where
18788         constants are expected, we have to "probe" for an EmptyCast, and
18789         Peel, which is not the correct thing to do, as this will be
18790         repetitive and will likely lead to errors. 
18791
18792         The idea is to remove any EmptyCasts that are used in casts that
18793         can be reduced to constants, so we only have to cope with
18794         constants. 
18795
18796         This bug hunt was triggered by Bug 37363 and the desire to remove
18797         the duplicate pattern where we were "peeling" emptycasts to check
18798         whether they were constants.  Now constants will always be
18799         constants.
18800
18801         * ecore.cs: Use an enumconstant here instead of wrapping with
18802         EmptyCast.  
18803
18804         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
18805         throwing me off.  By handling this we can get rid of a few hacks.
18806
18807         * statement.cs (Switch): Removed Peel() code.
18808
18809 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
18810
18811         * class.cs: Location information for error 508
18812
18813         * expression.cs (New.DoResolve): Add a guard against double
18814         resolution of an expression.  
18815
18816         The New DoResolve might be called twice when initializing field
18817         expressions (see EmitFieldInitializers, the call to
18818         GetInitializerExpression will perform a resolve on the expression,
18819         and later the assign will trigger another resolution
18820
18821         This leads to bugs (#37014)
18822
18823         * delegate.cs: The signature for EndInvoke should contain any ref
18824         or out parameters as well.  We were not doing this in the past. 
18825
18826         * class.cs (Field.Define): Do not overwrite the type definition
18827         inside the `volatile' group.  Turns out that volatile enumerations
18828         were changing the type here to perform a validity test, which
18829         broke conversions. 
18830
18831 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
18832
18833         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
18834         and structs, we do not want to load the instance variable
18835
18836         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
18837         enum_type has to be handled like an object reference (implicit
18838         conversions exists from this to object), but the regular IsClass
18839         and IsValueType tests will never return true for this one.
18840
18841         Also we use TypeManager.IsValueType instead of type.IsValueType,
18842         just for consistency with the rest of the code (this is only
18843         needed if we ever use the construct exposed by test-180.cs inside
18844         corlib, which we dont today).
18845
18846 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
18847
18848         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
18849         just InternalCall.
18850
18851 2003-02-09  Martin Baulig  <martin@ximian.com>
18852
18853         * namespace.cs (Namespace..ctor): Added SourceFile argument.
18854         (Namespace.DefineNamespaces): New static public method; this is
18855         called when we're compiling with debugging to add all namespaces
18856         to the symbol file.
18857
18858         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
18859         pass it to the Namespace's .ctor.
18860
18861         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
18862         and MethodBase arguments; pass the namespace ID to the symwriter;
18863         pass the MethodBase instead of the token to the symwriter.
18864         (SymbolWriter.DefineNamespace): New method to add a namespace to
18865         the symbol file.
18866
18867 2003-02-09  Martin Baulig  <martin@ximian.com>
18868
18869         * symbolwriter.cs: New file.  This is a wrapper around
18870         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
18871         methods here in near future.
18872
18873 2003-02-09  Martin Baulig  <martin@ximian.com>
18874
18875         * codegen.cs (EmitContext.Mark): Just pass the arguments to
18876         ILGenerator.MarkSequencePoint() which are actually used by the
18877         symbol writer.
18878
18879 2003-02-09  Martin Baulig  <martin@ximian.com>
18880
18881         * location.cs (SourceFile): New public sealed class.  This
18882         contains the name and an index which is used in the location's token.
18883         (Location): Reserve an appropriate number of bits in the token for
18884         the source file instead of walking over that list, this gives us a
18885         really huge performance improvement when compiling with debugging.
18886
18887         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
18888         `SourceFile' argument instead of a string.
18889         (Driver.ProcessFile): Add all the files via Location.AddFile(),
18890         but don't parse/tokenize here, we need to generate the list of all
18891         source files before we do that.
18892         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
18893         the files.
18894
18895         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
18896         instead of a string.
18897
18898         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
18899         of a string.
18900
18901 2003-02-09  Martin Baulig  <martin@ximian.com>
18902
18903         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
18904         filename on `#line default'.
18905
18906 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
18907
18908         * statement.cs: don't clear the pinned var when the fixed statement
18909         returns from the method (fixes bug#37752).
18910
18911 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
18912
18913         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
18914         to IsValueType.
18915
18916 2003-02-07  Martin Baulig  <martin@ximian.com>
18917
18918         * driver.cs: Removed the `--debug-args' command line argument.
18919
18920         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
18921         automatically by the AsssemblyBuilder.
18922         (CodeGen.InitializeSymbolWriter): We don't need to call any
18923         initialization function on the symbol writer anymore.  This method
18924         doesn't take any arguments.
18925
18926 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
18927
18928         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
18929         from referenced assemblies as well.
18930
18931 2003-02-02  Martin Baulig  <martin@ximian.com>
18932
18933         * class.cs (MethodData.Emit): Generate debugging info for external methods.
18934
18935 2003-02-02  Martin Baulig  <martin@ximian.com>
18936
18937         * class.cs (Constructor.Emit): Open the symbol writer before
18938         emitting the constructor initializer.
18939         (ConstructorInitializer.Emit): Call ec.Mark() to allow
18940         single-stepping through constructor initializers.
18941
18942 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
18943
18944         * class.cs: Handle error 549: do not allow virtual methods in
18945         sealed classes. 
18946
18947 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
18948
18949         * decl.cs: Check access levels when resolving types
18950
18951 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
18952
18953         * statement.cs: Add parameters and locals set in catch blocks that might 
18954         return to set vector
18955
18956 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
18957
18958         * class.cs (Operator): Set the SpecialName flags for operators.
18959
18960         * expression.cs (Invocation.DoResolve): Only block calls to
18961         accessors and operators on SpecialName methods.
18962
18963         (Cast.TryReduce): Handle conversions from char constants.
18964
18965
18966 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
18967
18968         * statement.cs: small memory and time optimization in FlowBranching.
18969
18970 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
18971
18972         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
18973         problem that the last fix but in the other sid (Set).
18974
18975         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
18976         access when there is no indexer in the hierarchy.
18977
18978 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
18979
18980         * class.cs: Combine some if statements.
18981
18982 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18983
18984         * driver.cs: fixed bug #37187.
18985
18986 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
18987
18988         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
18989         any indexer, it's needed to build a list with all the indexers in the
18990         hierarchy (AllGetters), else we have problems. Fixes #35653.
18991
18992 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
18993
18994         * class.cs (MethodData.Define): It is wrong for an interface
18995         implementation to be static in both cases: explicit and implicit.
18996         We were only handling this in one case.
18997
18998         Improve the if situation there to not have negations.
18999
19000         * class.cs (Field.Define): Turns out that we do not need to check
19001         the unsafe bit on field definition, only on usage.  Remove the test.
19002
19003 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19004
19005         * driver.cs: use assembly.Location instead of Codebase (the latest
19006         patch made mcs fail when using MS assemblies).
19007
19008 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
19009
19010         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
19011         get the path to *corlib.dll.
19012
19013 2003-01-21  Nick Drochak <ndrochak@gol.com>
19014
19015         * cs-tokenizer.cs:
19016         * pending.cs:
19017         * typemanager.cs: Remove compiler warnings
19018
19019 2003-01-20  Duncan Mak  <duncan@ximian.com>
19020
19021         * AssemblyInfo.cs: Bump the version number to 0.19.
19022
19023 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19024
19025         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
19026
19027 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
19028
19029         * class.cs (Constructor::Emit): Emit debugging info for constructors.
19030
19031 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
19032
19033         * cs-parser.jay: Small fix: we were not comparing the constructor
19034         name correctly.   Thanks to Zoltan for the initial pointer.
19035
19036 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
19037
19038         * cs-tokenizer.cs: Set file name when specified with #line
19039
19040 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
19041
19042         * cs-parser.jay: Only perform the constructor checks here if we
19043         are named like the class;  This will help provider a better
19044         error.  The constructor path is taken when a type definition is
19045         not found, but most likely the user forgot to add the type, so
19046         report that rather than the constructor error.
19047
19048 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
19049
19050         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
19051         allocations.
19052
19053 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19054
19055         * cs-parser.jay: Add cleanup call.
19056
19057 2003-01-13  Duncan Mak  <duncan@ximian.com>
19058
19059         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
19060         consistent with other methods.
19061
19062 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
19063
19064         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
19065
19066 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
19067
19068         * attribute.cs: only set GuidAttr to true when we have a
19069         GuidAttribute.
19070
19071 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19072
19073         * ecore.cs:
19074         * expression.cs:
19075         * typemanager.cs: fixes to allow mcs compile corlib with the new
19076         Type.IsSubclassOf fix.
19077
19078 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
19079
19080         * expression.cs (LocalVariableReference.DoResolve): Classify a
19081         constant as a value, not as a variable.   Also, set the type for
19082         the variable.
19083
19084         * cs-parser.jay (fixed_statement): take a type instead of a
19085         pointer_type, so we can produce a better error message later.
19086
19087         * statement.cs (Fixed.Resolve): Flag types that are not pointers
19088         as an error.  
19089
19090         (For.DoEmit): Make inifinite loops have a
19091         non-conditional branch back.
19092
19093         (Fixed.DoEmit): First populate the pinned variables, then emit the
19094         statement, then clear the variables.  Before I was emitting the
19095         code once for each fixed piece.
19096
19097
19098 2003-01-08  Martin Baulig  <martin@ximian.com>
19099
19100         * statement.cs (FlowBranching.MergeChild): A break in a
19101         SWITCH_SECTION does not leave a loop.  Fixes #36155.
19102
19103 2003-01-08  Martin Baulig  <martin@ximian.com>
19104
19105         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
19106         lives in the same number space than `param_map'.  Fixes #36154.
19107
19108 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
19109
19110         * cs-parser.jay (constructor_declaration): Set the
19111         Constructor.ModFlags before probing for it.  This makes the
19112         compiler report 514, 515 and 132 (the code was there, but got
19113         broken). 
19114
19115         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
19116         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
19117         (GotoCase.Resolve): Set `Returns' to ALWAYS.
19118
19119 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
19120
19121         * enum.cs: create the enum static fields using the enum type.
19122
19123 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
19124
19125         * class.cs: don't try to create the ParamBuilder for the return
19126         type if it's not needed (and handle it breaking for the ms runtime
19127         anyway).
19128
19129 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
19130
19131         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
19132
19133 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
19134
19135         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
19136         the command.   This showed up while compiling the JANET source
19137         code, which used \r as its only newline separator.
19138
19139 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
19140
19141         * class.cs (Method.Define): If we are an operator (because it
19142         reuses our code), then set the SpecialName and HideBySig.  #36128
19143
19144 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
19145
19146         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
19147         exception, report error 120 `object reference required'.
19148
19149         * driver.cs: Add --pause option, used during to measure the size
19150         of the process as it goes with --timestamp.
19151
19152         * expression.cs (Invocation.DoResolve): Do not allow methods with
19153         SpecialName to be invoked.
19154
19155 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
19156
19157         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
19158         number before adding it.
19159
19160 2002-12-21  Ravi Pratap  <ravi@ximian.com>
19161
19162         * ecore.cs (StandardImplicitConversion): When in an unsafe
19163         context, we allow conversion between void * to any other pointer
19164         type. This fixes bug #35973.
19165
19166 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
19167
19168         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
19169         is not thrown when extensionless outputs are used 
19170
19171 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19172
19173         * rootcontext.cs: fixed compilation of corlib.
19174
19175 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
19176
19177         * attribute.cs (Attributes.Contains): Add new method.
19178
19179         * class.cs (MethodCore.LabelParameters): if the parameter is an
19180         `out' parameter, check that no attribute `[In]' has been passed.
19181
19182         * enum.cs: Handle the `value__' name in an enumeration.
19183
19184 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
19185
19186         * decl.cs: Added special case to allow overrides on "protected
19187         internal" methods
19188
19189 2002-12-18  Ravi Pratap  <ravi@ximian.com>
19190
19191         * attribute.cs (Attributes.AddAttributeSection): Rename to this
19192         since it makes much more sense.
19193
19194         (Attributes.ctor): Don't require a Location parameter.
19195
19196         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
19197
19198         * attribute.cs (ApplyAttributes): Remove extra Location parameters
19199         since we already have that information per attribute.
19200
19201         * everywhere : make appropriate changes.
19202
19203         * class.cs (LabelParameters): Write the code which actually
19204         applies attributes to the return type. We can't do this on the MS
19205         .NET runtime so we flag a warning in the case an exception is
19206         thrown.
19207
19208 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
19209
19210         * const.cs: Handle implicit null conversions here too.
19211
19212 2002-12-17  Ravi Pratap  <ravi@ximian.com>
19213
19214         * class.cs (MethodCore.LabelParameters): Remove the extra
19215         Type [] parameter since it is completely unnecessary. Instead
19216         pass in the method's attributes so that we can extract
19217         the "return" attribute.
19218
19219 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
19220
19221         * cs-parser.jay (parse): Use Report.Error to flag errors instead
19222         of ignoring it and letting the compile continue.
19223
19224         * typemanager.cs (ChangeType): use an extra argument to return an
19225         error condition instead of throwing an exception.
19226
19227 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
19228
19229         * expression.cs (Unary.TryReduce): mimic the code for the regular
19230         code path.  Perform an implicit cast in the cases where we can
19231         implicitly convert to one of the integral types, and then reduce
19232         based on that constant.   This fixes bug #35483.
19233
19234 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19235
19236         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
19237
19238 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19239
19240         * namespace.cs: fixed bug #35489.
19241
19242 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
19243
19244         * class.cs: Remove some dead code.
19245
19246         * cs-parser.jay: Estimate the number of methods needed
19247         (RootContext.MethodCount);
19248
19249         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
19250         numbers instead of StringBuilders.
19251
19252         * support.cs (PtrHashtable): Add constructor with initial size;
19253         We can now reduce reallocations of the method table.
19254
19255 2002-12-10  Ravi Pratap  <ravi@ximian.com>
19256
19257         * attribute.cs (ApplyAttributes): Keep track of the emitted
19258         attributes on a per-target basis. This fixes bug #35413.
19259
19260 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
19261
19262         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
19263         default to the Windows 1252 encoding.
19264
19265         (UnixParseOption): Support version, thanks to Alp for the missing
19266         pointer. 
19267
19268         * AssemblyInfo.cs: Add nice assembly information.
19269
19270         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
19271         (bug 35169).
19272
19273         * cs-parser.jay: Allow a trailing comma before the close bracked
19274         in the attribute_section production.
19275
19276         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
19277         address of the instance was being taken, I will take this out,
19278         because we take the address of the object immediately here.
19279
19280 2002-12-09  Ravi Pratap  <ravi@ximian.com>
19281
19282         * typemanager.cs (AreMultipleAllowed): Take care of the most
19283         obvious case where attribute type is not in the current assembly -
19284         stupid me ;-)
19285
19286 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
19287
19288         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
19289         definitions, instead of doing that afterwards.  
19290
19291         Also we use a nice little hack, depending on the constructor, we
19292         know if we are a "composed" name or a simple name.  Hence, we
19293         avoid the IndexOf test, and we avoid 
19294
19295         * codegen.cs: Add code to assist in a bug reporter to track down
19296         the source of a compiler crash. 
19297
19298 2002-12-07  Ravi Pratap  <ravi@ximian.com>
19299
19300         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
19301         types have been emitted for a given element and flag an error
19302         if something which does not have AllowMultiple set is used more
19303         than once.
19304
19305         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
19306         attribute types and their corresponding AllowMultiple properties
19307
19308         (AreMultipleAllowed): Check the property for a given type.
19309
19310         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
19311         property in the case we have a TypeContainer.
19312
19313         (Attributes.AddAttribute): Detect duplicates and just skip on
19314         adding them. This trivial fix catches a pretty gross error in our
19315         attribute emission - global attributes were being emitted twice!
19316
19317         Bugzilla bug #33187 is now fixed.
19318
19319 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
19320
19321         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
19322         instead of pp_and).
19323
19324         * expression.cs (Binary.ResolveOperator): I can only use the
19325         Concat (string, string, string) and Concat (string, string,
19326         string, string) if the child is actually a concatenation of
19327         strings. 
19328
19329 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
19330
19331         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
19332         context where we need a 2-character lookahead.
19333
19334         * pending.cs (PendingImplementation): Rework so we can keep track
19335         of interface types all the time, and flag those which were
19336         implemented by parents as optional.
19337
19338 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
19339
19340         * expression.cs (Binary.ResolveOperator): Use
19341         String.Concat(string,string,string) or
19342         String.Concat(string,string,string,string) when possible. 
19343
19344         * typemanager: More helper methods.
19345
19346
19347 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
19348
19349         * pending.cs: remove the bogus return from GetMissingInterfaces()
19350         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
19351
19352 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19353
19354         * namespace.cs: avoid duplicated 'using xxx' being added to
19355         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
19356         when we get more than one 'using' statement for the same namespace.
19357         Report a CS0105 warning for it.
19358
19359 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
19360
19361         * cs-tokenizer.cs (consume_identifier): use read directly, instead
19362         of calling getChar/putback, uses internal knowledge of it.    
19363
19364         (xtoken): Reorder tokenizer so most common patterns are checked
19365         first.  This reduces the compilation time in another 5% (from 8.11s
19366         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
19367
19368         The parsing time is 22% of the compilation in mcs, and from that
19369         64% is spent on the tokenization process.  
19370
19371         I tried using a binary search for keywords, but this is slower
19372         than the hashtable.  Another option would be to do a couple of
19373         things:
19374
19375                 * Not use a StringBuilder, instead use an array of chars,
19376                   with a set value.  Notice that this way we could catch
19377                   the 645 error without having to do it *afterwards*.
19378
19379                 * We could write a hand-parser to avoid the hashtable
19380                   compares altogether.
19381
19382         The identifier consumption process takes 37% of the tokenization
19383         time.  Another 15% is spent on is_number.  56% of the time spent
19384         on is_number is spent on Int64.Parse:
19385
19386                 * We could probably choose based on the string length to
19387                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
19388                   computations. 
19389
19390         Another 3% is spend on wrapping `xtoken' in the `token' function.
19391
19392         Handle 0xa0 as whitespace (#34752)
19393
19394 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
19395
19396         * typemanager.cs (IsCLRType): New routine to tell whether a type
19397         is one of the builtin types.  
19398
19399         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
19400         typecode in more places instead of doing pointer comparissions.
19401         We could leverage some knowledge about the way the typecodes are
19402         laid out.
19403
19404         New code to cache namespaces in assemblies, it is currently not
19405         invoked, to be used soon.
19406
19407         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
19408
19409         * expression.cs (Binary.ResolveOperator): specially handle
19410         strings, and do not perform user-defined operator overloading for
19411         built-in types.
19412
19413 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
19414
19415         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
19416         internalcall as it is a pretty simple operation;  Avoid whenever
19417         possible to call Char.IsLetter.
19418
19419         (consume_identifier): Cut by half the number of
19420         hashtable calls by merging the is_keyword and GetKeyword behavior.
19421
19422         Do not short-circuit, because if we do, we
19423         report errors (ie, #if false && true would produce an invalid
19424         directive error);
19425
19426
19427 2002-11-24  Martin Baulig  <martin@ximian.com>
19428
19429         * expression.cs (Cast.TryReduce): If we're in checked syntax,
19430         check constant ranges and report a CS0221.  Fixes #33186.
19431
19432 2002-11-24  Martin Baulig  <martin@ximian.com>
19433
19434         * cs-parser.jay: Make this work for uninitialized variable
19435         declarations in the `for' initializer.  Fixes #32416.
19436
19437 2002-11-24  Martin Baulig  <martin@ximian.com>
19438
19439         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
19440         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
19441
19442 2002-11-24  Martin Baulig  <martin@ximian.com>
19443
19444         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
19445         argument; if true, we also check for user-defined conversions.
19446         This is only needed if both arguments are of a user-defined type.
19447         Fixes #30443, added test-175.cs.
19448         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
19449
19450         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
19451
19452 2002-11-24  Martin Baulig  <martin@ximian.com>
19453
19454         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
19455         function to get the store opcode.
19456         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
19457         only emit the Ldelema if the store opcode is Stobj.  You must run
19458         both test-34 and test-167 to test this.  Fixes #34529.
19459
19460 2002-11-23  Martin Baulig  <martin@ximian.com>
19461
19462         * ecore.cs (Expression.MemberLookup): Added additional
19463         `qualifier_type' argument which is used when we're being called
19464         from MemberAccess.DoResolve() and null if we're called from a
19465         SimpleName lookup.
19466         (Expression.MemberLookupFailed): New method to report errors; this
19467         does the CS1540 check and reports the correct error message.
19468
19469         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
19470         argument for the CS1540 check and redone the way how we're dealing
19471         with private members.  See the comment in the source code for details.
19472         (FilterWithClosure): Reverted this back to revision 1.197; renamed
19473         `closure_start_type' to `closure_qualifier_type' and check whether
19474         it's not null.  It was not this filter being broken, it was just
19475         being called with the wrong arguments.
19476
19477         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
19478         and pass it the correct `qualifier_type'; this also does the error
19479         handling for us.
19480
19481 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
19482
19483         * expression.cs (Invocation.EmitParams): If the we are dealing
19484         with a non-built-in value type, load its address as well.
19485
19486         (ArrayCreation): Use a a pretty constant instead
19487         of the hardcoded value 2.   Use 6 instead of 2 for the number of
19488         static initializers.  
19489
19490         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
19491         because they are not really value types, just glorified integers. 
19492
19493         * driver.cs: Do not append .exe, the CSC compiler does not do it.
19494
19495         * ecore.cs: Remove redundant code for enumerations, make them use
19496         the same code path as everything else, fixes the casting issue
19497         with enumerations in Windows.Forms.
19498
19499         * attribute.cs: Do only cast to string if it is a string, the
19500         validation happens later.
19501
19502         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
19503         people upgrade their corlibs.
19504
19505         * ecore.cs: Oops, enumerations were not following the entire code path
19506
19507 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
19508
19509         * typemanager.cs (FilterWithClosure): Commented out the test for
19510         1540 in typemanager.cs, as it has problems when accessing
19511         protected methods from a parent class (see test-174.cs). 
19512
19513         * attribute.cs (Attribute.ValidateGuid): new method.
19514         (Attribute.Resolve): Use above.
19515
19516 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
19517
19518         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
19519
19520         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
19521         handling for enumerations, as we only needed the TypeContainer
19522         functionality to begin with (this is required for the fix below to
19523         work for enums that reference constants in a container class for
19524         example). 
19525
19526         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
19527
19528         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
19529         a valid TypeBuilder to perform lookups on.o
19530
19531         * class.cs (InheritableMemberSignatureCompare): Use true in the
19532         call to GetGetMethod and GetSetMethod, because we are comparing
19533         the signature, and we need to get the methods *even* if they are
19534         private. 
19535
19536         (PropertyBase.CheckBase): ditto.
19537
19538         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
19539         GotoCase.Resolve): Use Peel on EmpytCasts.
19540
19541         * ecore.cs (EmptyCast): drop child, add Peel method.
19542
19543 2002-11-17  Martin Baulig  <martin@ximian.com>
19544
19545         * ecore.cs (EmptyCast.Child): New public property.
19546
19547         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
19548         label resolved to an EmptyCast.  Fixes #34162.
19549         (GotoCase.Resolve): Likewise.
19550         (Block.EmitMeta): Likewise.
19551
19552 2002-11-17  Martin Baulig  <martin@ximian.com>
19553
19554         * expression.cs (Invocation.BetterConversion): Prefer int over
19555         uint; short over ushort; long over ulong for integer literals.
19556         Use ImplicitConversionExists instead of StandardConversionExists
19557         since we also need to check for user-defined implicit conversions.
19558         Fixes #34165.  Added test-173.cs.
19559
19560 2002-11-16  Martin Baulig  <martin@ximian.com>
19561
19562         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
19563         with the `true' and `false' literals.  Fixes #33151.
19564
19565 2002-11-16  Martin Baulig  <martin@ximian.com>
19566
19567         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
19568         October 22nd; don't do the cs1540 check for static members.
19569
19570         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
19571         now using our own filter here and doing the cs1540 check again.
19572
19573 2002-11-16  Martin Baulig  <martin@ximian.com>
19574
19575         * support.cs (InternalParameters): Don't crash if we don't have
19576         any fixed parameters.  Fixes #33532.
19577
19578 2002-11-16  Martin Baulig  <martin@ximian.com>
19579
19580         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
19581         when looking up static methods to make this work on Windows.
19582         Fixes #33773.
19583
19584 2002-11-16  Martin Baulig  <martin@ximian.com>
19585
19586         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
19587         a setter rather than using PropertyInfo.CanWrite.
19588
19589 2002-11-15  Nick Drochak  <ndrochak@gol.com>
19590
19591         * class.cs: Allow acces to block member by subclasses. Fixes build
19592         breaker.
19593
19594 2002-11-14  Martin Baulig  <martin@ximian.com>
19595
19596         * class.cs (Constructor.Emit): Added the extern/block check.
19597         Fixes bug #33678.
19598
19599 2002-11-14  Martin Baulig  <martin@ximian.com>
19600
19601         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
19602         iteration while looking for indexers, this is needed because the
19603         indexer may have a different name in our base classes.  Fixed the
19604         error reporting (no indexers at all, not get accessor, no
19605         overloaded match).  Fixes bug #33089.
19606         (IndexerAccess.DoResolveLValue): Likewise.
19607
19608 2002-11-14  Martin Baulig  <martin@ximian.com>
19609
19610         * class.cs (PropertyBase.CheckBase): Make this work for multiple
19611         indexers.  Fixes the first part of bug #33089.
19612         (MethodSignature.InheritableMemberSignatureCompare): Added support
19613         for properties.
19614
19615 2002-11-13  Ravi Pratap  <ravi@ximian.com>
19616
19617         * attribute.cs (Attribute.Resolve): Catch the
19618         NullReferenceException and report it since it isn't supposed to
19619         happen. 
19620
19621 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
19622
19623         * expression.cs (Binary.EmitBranchable): Also handle the cases for
19624         LogicalOr and LogicalAnd that can benefit from recursively
19625         handling EmitBranchable.  The code now should be nice for Paolo.
19626
19627 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
19628
19629         * typemanager.cs (LookupType): Added a negative-hit hashtable for
19630         the Type lookups, as we perform quite a number of lookups on
19631         non-Types.  This can be removed once we can deterministically tell
19632         whether we have a type or a namespace in advance.
19633
19634         But this might require special hacks from our corlib.
19635
19636         * TODO: updated.
19637
19638         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
19639         and double which avoids a conversion from an integer to a double.
19640
19641         * expression.cs: tiny optimization, avoid calling IsConstant,
19642         because it effectively performs the lookup twice.
19643
19644 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
19645
19646         But a bogus return here to keep the semantics of the old code
19647         until the Mono runtime is fixed.
19648
19649         * pending.cs (GetMissingInterfaces): New method used to remove all
19650         the interfaces that are already implemented by our parent
19651         classes from the list of pending methods. 
19652
19653         * interface.cs: Add checks for calls after ResolveTypeExpr.
19654
19655 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
19656
19657         * class.cs (Class.Emit): Report warning 67: event not used if the
19658         warning level is beyond 3.
19659
19660         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
19661         being a NullLiteral.
19662
19663         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
19664         specifiers. 
19665
19666         * class.cs (TypeContainer.GetClassBases): Cover a missing code
19667         path that might fail if a type can not be resolved.
19668
19669         * expression.cs (Binary.Emit): Emit unsigned versions of the
19670         operators. 
19671
19672         * driver.cs: use error 5.
19673
19674 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
19675
19676         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
19677
19678 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
19679
19680         * cs-parser.jay (switch_section): A beautiful patch from Martin
19681         Baulig that fixed 33094.
19682
19683 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
19684
19685         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
19686         Check whether the base is abstract and report an error if so.
19687
19688         * expression.cs (IndexerAccess.DoResolveLValue,
19689         IndexerAccess.DoResolve): ditto. 
19690
19691         (Invocation.DoResolve): ditto.
19692
19693         (Invocation.FullMethodDesc): Improve the report string.
19694
19695         * statement.cs (Block): Eliminate IsVariableDefined as it is
19696         basically just a wrapper for GetVariableInfo.
19697
19698         * ecore.cs (SimpleName): Use new 
19699
19700         * support.cs (ReflectionParamter.ParameterType): We unwrap the
19701         type, as we return the actual parameter ref/unref state on a
19702         different call.
19703
19704 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
19705
19706         * support.cs: Return proper flags REF/OUT fixing the previous
19707         commit.  
19708
19709         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
19710         not used to mean `ref' but `ref or out' in ParameterReference
19711
19712         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
19713         full type signature instead of calling TypeManger.CSharpName
19714         ourselves. 
19715
19716         * support.cs (InternalParameters.ParameterDesc): Do not compare
19717         directly to the modflags, because REF/OUT will actually be bitsets
19718         if set. 
19719
19720         * delegate.cs (VerifyMethod): Check also the modifiers.
19721
19722         * cs-tokenizer.cs: Fix bug where floating point values with an
19723         exponent where a sign was missing was ignored.
19724
19725         * driver.cs: Allow multiple assemblies to be specified in a single
19726         /r: argument
19727
19728 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
19729
19730         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
19731         because identifiers after a parenthesis would end up in this kind
19732         of production, and we needed to desamiguate it for having casts
19733         like:
19734
19735                 (UserDefinedType *) xxx
19736
19737 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
19738
19739         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
19740         we should set on the Bindingflags.NonPublic, but not turn on
19741         private_ok.  private_ok controls whether a Private member is
19742         returned (this is chekced on the filter routine), while the
19743         BindingFlags.NonPublic just controls whether private/protected
19744         will be allowed.   This fixes the problem part of the problem of
19745         private properties being allowed to be used in derived classes.
19746
19747         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
19748         so we can call the children DoResolveLValue method (this will
19749         properly signal errors on lvalue assignments to base properties)
19750
19751         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
19752         getter are null, and we have a property info, we know that this
19753         happened because the lookup failed, so we report an error 122 for
19754         protection level violation.
19755
19756         We also silently return if setter and getter are null in the
19757         resolve functions, this condition only happens if we have flagged
19758         the error before.  This is the other half of the problem. 
19759
19760         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
19761         not have accessibility information, that is why we were returning
19762         true in the filter function in typemanager.cs.
19763
19764         To properly report 122 (property is inaccessible because of its
19765         protection level) correctly, we report this error in ResolveAccess
19766         by failing if both the setter and the getter are lacking (ie, the
19767         lookup failed). 
19768
19769         DoResolve and DoLResolve have been modified to check for both
19770         setter/getter being null and returning silently, the reason being
19771         that I did not want to put the knowledge about this error in upper
19772         layers, like:
19773
19774         int old = Report.Errors;
19775         x = new PropertyExpr (...);
19776         if (old != Report.Errors)
19777                 return null;
19778         else
19779                 return x;
19780
19781         So the property expr is returned, but it is invalid, so the error
19782         will be flagged during the resolve process. 
19783
19784         * class.cs: Remove InheritablePropertySignatureCompare from the
19785         class, as we no longer depend on the property signature to compute
19786         whether it is possible to implement a method or not.
19787
19788         The reason is that calling PropertyInfo.GetGetMethod will return
19789         null (in .NET, in Mono it works, and we should change this), in
19790         cases where the Get Method does not exist in that particular
19791         class.
19792
19793         So this code:
19794
19795         class X { public virtual int A { get { return 1; } } }
19796         class Y : X { }
19797         class Z : Y { public override int A { get { return 2; } } }
19798
19799         Would fail in Z because the parent (Y) would not have the property
19800         defined.  So we avoid this completely now (because the alternative
19801         fix was ugly and slow), and we now depend exclusively on the
19802         method names.
19803
19804         (PropertyBase.CheckBase): Use a method-base mechanism to find our
19805         reference method, instead of using the property.
19806
19807         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
19808         routines are gone now.
19809
19810         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
19811         names, they were incorrectly named.
19812
19813         * cs-tokenizer.cs: Return are more gentle token on failure. 
19814
19815         * pending.cs (PendingImplementation.InterfaceMethod): This routine
19816         had an out-of-sync index variable, which caused it to remove from
19817         the list of pending methods the wrong method sometimes.
19818
19819 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
19820
19821         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
19822         CanWrite, because those refer to this particular instance of the
19823         property, and do not take into account the fact that we can
19824         override single members of a property.
19825
19826         Constructor requires an EmitContext.  The resolution process does
19827         not happen here, but we need to compute the accessors before,
19828         because the resolution does not always happen for properties.
19829
19830         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
19831         subclass, before we did not update this flag, but we did update
19832         bindingflags. 
19833
19834         (GetAccessors): Drop this routine, as it did not work in the
19835         presence of partially overwritten set/get methods. 
19836
19837         Notice that this broke the cs1540 detection, but that will require
19838         more thinking. 
19839
19840 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19841
19842         * class.cs:
19843         * codegen.cs:
19844         * driver.cs: issue a warning instead of an error if we don't support
19845         debugging for the platform. Also ignore a couple of errors that may
19846         arise when trying to write the symbols. Undo my previous patch.
19847
19848 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19849
19850         * driver.cs: ignore /debug switch except for Unix platforms.
19851
19852 2002-10-23  Nick Drochak  <ndrochak@gol.com>
19853
19854         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
19855
19856 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
19857
19858         * driver.cs: Do not make mcs-debug conditional, so we do not break
19859         builds that use it.
19860
19861         * statement.cs (UsageVector.MergeChildren): I would like Martin to
19862         review this patch.  But basically after all the children variables
19863         have been merged, the value of "Breaks" was not being set to
19864         new_breaks for Switch blocks.  I think that it should be set after
19865         it has executed.  Currently I set this to the value of new_breaks,
19866         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
19867         conservative, but I do not understand this code very well.
19868
19869         I did not break anything in the build, so that is good ;-)
19870
19871         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
19872
19873 2002-10-20  Mark Crichton  <crichton@gimp.org>
19874
19875         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
19876
19877 2002-10-20  Nick Drochak  <ndrochak@gol.com>
19878
19879         * cfold.cs: Fixed compile blocker.
19880
19881 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
19882
19883         * driver.cs: I was chekcing the key, not the file.
19884
19885 2002-10-19  Ravi Pratap  <ravi@ximian.com>
19886
19887         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
19888         message that we were generating - we just need to silently return
19889         a null.
19890
19891 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
19892
19893         * class.cs (Event.Define): Change my previous commit, as this
19894         breaks the debugger.  This is a temporary hack, as it seems like
19895         the compiler is generating events incorrectly to begin with.
19896
19897         * expression.cs (Binary.ResolveOperator): Added support for 
19898         "U operator - (E x, E y)"
19899
19900         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
19901         y)".
19902
19903         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
19904         init-only variables, but this path did not take into account that
19905         there might be also instance readonly variables.  Correct this
19906         problem. 
19907
19908         This fixes bug 32253
19909
19910         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
19911         delegates as well.
19912
19913         * driver.cs: Change the extension for modules to `netmodule'
19914
19915         * cs-parser.jay: Improved slightly the location tracking for
19916         the debugger symbols.
19917
19918         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
19919         modifiers that were specified instead of the hardcoded value
19920         (FamAndAssem).  This was basically ignoring the static modifier,
19921         and others.  Fixes 32429.
19922
19923         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
19924         fixed a bug in the process (32476)
19925
19926         * expression.cs (ArrayAccess.EmitAssign): Patch from
19927         hwang_rob@yahoo.ca that fixes bug 31834.3
19928
19929 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
19930
19931         * driver.cs: Make the module extension .netmodule.
19932
19933 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
19934
19935         * driver.cs: Report an error if the resource file is not found
19936         instead of crashing.
19937
19938         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
19939         false, like Emit does.
19940
19941 2002-10-16  Nick Drochak  <ndrochak@gol.com>
19942
19943         * typemanager.cs: Remove unused private member.  Also reported mcs
19944         bug to report this as a warning like csc.
19945
19946 2002-10-15  Martin Baulig  <martin@gnome.org>
19947
19948         * statement.cs (Statement.Emit): Made this a virtual method; emits
19949         the line number info and calls DoEmit().
19950         (Statement.DoEmit): New protected abstract method, formerly knows
19951         as Statement.Emit().
19952
19953         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
19954
19955 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
19956
19957         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
19958         have fixed a remaining problem: not every AddXXXX was adding a
19959         fully qualified name.  
19960
19961         Now everyone registers a fully qualified name in the DeclSpace as
19962         being defined instead of the partial name.  
19963
19964         Downsides: we are slower than we need to be due to the excess
19965         copies and the names being registered this way.  
19966
19967         The reason for this is that we currently depend (on the corlib
19968         bootstrap for instance) that types are fully qualified, because
19969         we dump all the types in the namespace, and we should really have
19970         types inserted into the proper namespace, so we can only store the
19971         basenames in the defined_names array.
19972
19973 2002-10-10  Martin Baulig  <martin@gnome.org>
19974
19975         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
19976         from bug #31834, see the bug report for a testcase which is
19977         miscompiled.
19978
19979 2002-10-10  Martin Baulig  <martin@gnome.org>
19980
19981         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
19982         flow analysis code for this.
19983
19984         * statement.cs (Do, While, For): Tell the flow analysis code about
19985         infinite loops.
19986         (FlowBranching.UsageVector): Added support for infinite loops.
19987         (Block.Resolve): Moved the dead code elimination here and use flow
19988         analysis to do it.
19989
19990 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
19991
19992         * class.cs (Field.Define): Catch cycles on struct type
19993         definitions. 
19994
19995         * typemanager.cs (IsUnmanagedtype): Do not recursively check
19996         fields if the fields are static.  We only need to check instance
19997         fields. 
19998
19999         * expression.cs (As.DoResolve): Test for reference type.
20000
20001         * statement.cs (Using.ResolveExpression): Use
20002         ConvertImplicitRequired, not ConvertImplicit which reports an
20003         error on failture
20004         (Using.ResolveLocalVariableDecls): ditto.
20005
20006         * expression.cs (Binary.ResolveOperator): Report errors in a few
20007         places where we had to.
20008
20009         * typemanager.cs (IsUnmanagedtype): Finish implementation.
20010
20011 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
20012
20013         * expression.cs: Use StoreFromPtr instead of extracting the type
20014         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
20015
20016         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
20017         an enumeration value to a System.Enum, but System.Enum is not a
20018         value type, but an class type, so we need to box.
20019
20020         (Expression.ConvertExplicit): One codepath could return
20021         errors but not flag them.  Fix this.  Fixes #31853
20022
20023         * parameter.cs (Resolve): Do not allow void as a parameter type.
20024
20025 2002-10-06  Martin Baulig  <martin@gnome.org>
20026
20027         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
20028         if it's a class type and not a struct.  Fixes #31815.
20029
20030 2002-10-06  Martin Baulig  <martin@gnome.org>
20031
20032         * statement.cs: Reworked the flow analysis code a bit to make it
20033         usable for dead code elimination.
20034
20035 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20036
20037         * cs-parser.jay: allow empty source files. Fixes bug #31781.
20038
20039 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
20040
20041         * expression.cs (ComposedCast.DoResolveType): A quick workaround
20042         to fix the test 165, will investigate deeper.
20043
20044 2002-10-04  Martin Baulig  <martin@gnome.org>
20045
20046         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
20047         finally blocks actually work.
20048         (Try.Resolve): We don't need to create a sibling for `finally' if
20049         there is no finally block.
20050
20051 2002-10-04  Martin Baulig  <martin@gnome.org>
20052
20053         * class.cs (Constructor.Define): The default accessibility for a
20054         non-default constructor is private, not public.
20055
20056 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
20057
20058         * class.cs (Constructor): Make AllowedModifiers public, add
20059         EXTERN.
20060
20061         * cs-parser.jay: Perform the modifiers test here, as the
20062         constructor for the Constructor class usually receives a zero
20063         because of the way we create it (first we create, later we
20064         customize, and we were never checking the modifiers).
20065
20066         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
20067         is a version of LookupTypeReflection that includes the type-name
20068         cache.  This can be used as a fast path for functions that know
20069         the fully qualified name and are only calling into *.GetType() to
20070         obtain a composed type.
20071
20072         This is also used by TypeManager.LookupType during its type
20073         composition.
20074
20075         (LookupType): We now also track the real type name, as sometimes
20076         we can get a quey for the real type name from things like
20077         ComposedCast.  This fixes bug 31422.
20078
20079         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
20080         complete type fullname, it does not have to go through the type
20081         resolution system to obtain the composed version of the type (for
20082         obtaining arrays or pointers).
20083
20084         (Conditional.Emit): Use the EmitBoolExpression to
20085         generate nicer code, as requested by Paolo.
20086
20087         (ArrayCreation.CheckIndices): Use the patch from
20088         hwang_rob@yahoo.ca to validate the array initializers. 
20089
20090 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
20091
20092         * class.cs (ConstructorInitializer.Emit): simplify code by using
20093         Invocation.EmitCall, and at the same time, fix the bugs in calling
20094         parent constructors that took variable arguments. 
20095
20096         * ecore.cs (Expression.ConvertNumericExplicit,
20097         Expression.ImplicitNumericConversion): Remove the code that
20098         manually wrapped decimal (InternalTypeConstructor call is now gone
20099         as well).
20100
20101         * expression.cs (Cast.TryReduce): Also handle decimal types when
20102         trying to perform a constant fold on the type.
20103
20104         * typemanager.cs (IsUnmanagedtype): Partially implemented.
20105
20106         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
20107         that only turned off an error report, and did nothing else. 
20108
20109 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
20110
20111         * driver.cs: Handle and ignore /fullpaths
20112
20113 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
20114
20115         * expression.cs (Binary.ResolveOperator): Catch the case where
20116         DoNumericPromotions returns true, 
20117
20118         (Binary.DoNumericPromotions): Simplify the code, and the tests.
20119
20120 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
20121
20122         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
20123         report error 70.
20124
20125 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
20126
20127         * ecore.cs (ConvertNumericExplicit): It is not enough that the
20128         conversion exists, but it is also required that the conversion be
20129         performed.  This manifested in "(Type64Enum) 2".  
20130
20131         * class.cs (TypeManager.AddMethod): The fix is not to change
20132         AddEnum, because that one was using a fully qualified name (every
20133         DeclSpace derivative does), but to change the AddMethod routine
20134         that was using an un-namespaced name.  This now correctly reports
20135         the duplicated name.
20136
20137         Revert patch until I can properly fix it.  The issue
20138         is that we have a shared Type space across all namespaces
20139         currently, which is wrong.
20140
20141         Options include making the Namespace a DeclSpace, and merge
20142         current_namespace/current_container in the parser.
20143
20144 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
20145
20146         * cs-parser.jay: Improve error reporting when we get a different
20147         kind of expression in local_variable_type and
20148         local_variable_pointer_type. 
20149
20150         Propagate this to avoid missleading errors being reported.
20151
20152         * ecore.cs (ImplicitReferenceConversion): treat
20153         TypeManager.value_type as a target just like object_type.   As
20154         code like this:
20155
20156         ValueType v = 1;
20157
20158         Is valid, and needs to result in the int 1 being boxed before it
20159         is assigned to the value type v.
20160
20161         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
20162         to validate the enumeration name.
20163
20164         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
20165         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
20166         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
20167
20168         * ecore.cs (TryImplicitIntConversion): When doing an
20169         implicit-enumeration-conversion, check if the type is 64-bits and
20170         perform a conversion before passing to EnumConstant.
20171
20172 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
20173
20174         * decl.cs (Error_AmbiguousTypeReference); New routine used to
20175         report ambiguous type references.  Unlike the MS version, we
20176         report what the ambiguity is.   Innovation at work ;-)
20177
20178         (DeclSpace.FindType): Require a location argument to
20179         display when we display an ambiguous error.
20180
20181         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
20182
20183         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
20184
20185         * expression.cs (EmitDynamicInitializers): Apply patch from
20186         hwang_rob@yahoo.ca that fixes the order in which we emit our
20187         initializers. 
20188
20189 2002-09-21  Martin Baulig  <martin@gnome.org>
20190
20191         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
20192         delegate takes no arguments.
20193
20194 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
20195
20196         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
20197         from integers.
20198
20199         * expression.cs: Extract the underlying type.
20200
20201         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
20202
20203         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
20204
20205 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
20206
20207         * class.cs (TypeContainer.DefineType): We can not use the nice
20208         PackingSize with the size set to 1 DefineType method, because it
20209         will not allow us to define the interfaces that the struct
20210         implements.
20211
20212         This completes the fixing of bug 27287
20213
20214         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
20215         means also structs.  This fixes part of the problem. 
20216         (Expresion.ImplicitReferenceConversionExists): ditto.
20217
20218         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
20219         error if there were no errors reported during the type lookup
20220         process, to avoid duplicates or redundant errors.  Without this
20221         you would get an ambiguous errors plus a type not found.  We have
20222         beaten the user enough with the first error.  
20223
20224         (DeclSparce.FindType): Emit a warning if we have an ambiguous
20225         reference. 
20226
20227         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
20228         during the resolution process, stop the lookup, this avoids
20229         repeated error reports (same error twice).
20230
20231         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
20232
20233         * typemanager.cs (LookupType): Redo the type lookup code to match
20234         the needs of System.Reflection.  
20235
20236         The issue is that System.Reflection requires references to nested
20237         types to begin with a "+" sign instead of a dot.  So toplevel
20238         types look like: "NameSpace.TopLevelClass", and nested ones look
20239         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
20240         levels. 
20241
20242 2002-09-19  Martin Baulig  <martin@gnome.org>
20243
20244         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
20245         says that a method always returns or always throws an exception,
20246         don't report the CS0161.
20247
20248         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
20249         set `Returns = new_returns'.
20250
20251 2002-09-19  Martin Baulig  <martin@gnome.org>
20252
20253         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
20254         to an enum constant, check for a CS0176.
20255
20256 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
20257
20258         * class.cs (TypeContainer.CheckPairedOperators): Now we check
20259         for operators that must be in pairs and report errors.
20260
20261         * ecore.cs (SimpleName.DoResolveType): During the initial type
20262         resolution process, when we define types recursively, we must
20263         check first for types in our current scope before we perform
20264         lookups in the enclosing scopes.
20265
20266         * expression.cs (MakeByteBlob): Handle Decimal blobs.
20267
20268         (Invocation.VerifyArgumentsCompat): Call
20269         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
20270         I thought we were supposed to always call this, but there are a
20271         few places in the code where we dont do it.
20272
20273 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
20274
20275         * driver.cs: Add support in -linkres and -resource to specify the
20276         name of the identifier.
20277
20278 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20279
20280         * ecore.cs (StandardConversionExists): Sync with the conversion
20281         code: allow anything-* to void* conversions.
20282
20283         (FindMostSpecificSource): Use an Expression argument
20284         instead of a Type, because we might be handed over a Literal which
20285         gets a few more implicit conversions that plain types do not.  So
20286         this information was being lost.
20287
20288         Also, we drop the temporary type-holder expression when not
20289         required.
20290
20291 2002-09-17  Martin Baulig  <martin@gnome.org>
20292
20293         * class.cs (PropertyBase.CheckBase): Don't check the base class if
20294         this is an explicit interface implementation.
20295
20296 2002-09-17  Martin Baulig  <martin@gnome.org>
20297
20298         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
20299         different `IndexerName' attributes.
20300
20301         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
20302         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
20303         virtual CommonResolve().
20304
20305 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
20306
20307         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
20308         and convert that to the UnderlyingType.
20309
20310         * statement.cs (Foreach.Resolve): Indexers are just like variables
20311         or PropertyAccesses.
20312
20313         * cs-tokenizer.cs (consume_string): Track line numbers and columns
20314         inside quoted strings, we were not doing this before.
20315
20316 2002-09-16  Martin Baulig  <martin@gnome.org>
20317
20318         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
20319         resolve it.  This is needed for the definite assignment check of the
20320         instance expression, fixes bug #29846.
20321         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
20322
20323 2002-09-16  Nick Drochak  <ndrochak@gol.com>
20324
20325         * parameter.cs: Fix compile error.  Cannot reference static member
20326         from an instance object.  Is this an mcs bug?
20327
20328 2002-09-14  Martin Baulig  <martin@gnome.org>
20329
20330         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
20331         multiple times.  Fixes bug #30295, added test-166.cs.
20332
20333 2002-09-14  Martin Baulig  <martin@gnome.org>
20334
20335         * statement.cs (Block.Emit): Don't emit unreachable code.
20336         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
20337         `break' statements.
20338         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
20339
20340 2002-09-14  Martin Baulig  <martin@gnome.org>
20341
20342         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
20343         is set.
20344
20345 2002-09-14  Martin Baulig  <martin@gnome.org>
20346
20347         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
20348         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
20349         be false on the ms runtime.
20350
20351 2002-09-13  Martin Baulig  <martin@gnome.org>
20352
20353         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
20354         the CS0038 error message.
20355
20356 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
20357
20358         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
20359         constant inside, return it.
20360
20361 2002-09-12  Martin Baulig  <martin@gnome.org>
20362
20363         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
20364         implicit conversion can be done between enum types.
20365
20366         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
20367         check whether an implicit conversion to the current enum's UnderlyingType
20368         exists and report an error if not.
20369
20370         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
20371         without debugging support.
20372
20373         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
20374         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
20375
20376 2002-09-12  Martin Baulig  <martin@gnome.org>
20377
20378         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
20379
20380         * ecore.cs (IMemberExpr.DeclaringType): New property.
20381         (SimpleName.SimpleNameResolve): Check whether we're accessing a
20382         nonstatic member of an outer type (CS0038).
20383
20384 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
20385
20386         * driver.cs: Activate the using-error detector at warning level
20387         4 (at least for MS-compatible APIs).
20388
20389         * namespace.cs (VerifyUsing): Small buglett fix.
20390
20391         * pending.cs (PendingImplementation): pass the container pointer. 
20392
20393         * interface.cs (GetMethods): Allow for recursive definition.  Long
20394         term, I would like to move every type to support recursive
20395         definitions, not the current ordering mechanism that we have right
20396         now.
20397
20398         The situation is this: Attributes are handled before interfaces,
20399         so we can apply attributes to interfaces.  But some attributes
20400         implement interfaces, we will now handle the simple cases
20401         (recursive definitions will just get an error).  
20402
20403         * parameter.cs: Only invalidate types at the end if we fail to
20404         lookup all types.  
20405
20406 2002-09-09  Martin Baulig  <martin@gnome.org>
20407
20408         * ecore.cs (PropertyExpr.Emit): Also check for
20409         TypeManager.system_int_array_get_length so this'll also work when
20410         compiling corlib.  Fixes #30003.
20411
20412 2002-09-09  Martin Baulig  <martin@gnome.org>
20413
20414         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
20415         and throw an exception if we can't get the type's size.  Fixed #30040,
20416         added test-165.cs.
20417
20418 2002-09-09  Martin Baulig  <martin@gnome.org>
20419
20420         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
20421
20422         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
20423         context.  Fixes bug #30027.
20424
20425         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
20426         virtual functions.  Fixes bug #30043, added test-164.cs.
20427
20428 2002-09-08  Ravi Pratap  <ravi@ximian.com>
20429
20430         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
20431
20432 2002-09-08  Nick Drochak  <ndrochak@gol.com>
20433
20434         * driver.cs: Use an object to get the windows codepage since it's not a
20435         static property.
20436
20437 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
20438
20439         * statement.cs (For.Emit): for infinite loops (test == null)
20440         return whether there is a break inside, not always "true".
20441
20442         * namespace.cs (UsingEntry): New struct to hold the name of the
20443         using definition, the location where it is defined, and whether it
20444         has been used in a successful type lookup.
20445
20446         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
20447         strings.
20448
20449         * decl.cs: ditto.
20450
20451 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20452
20453         * attribute.cs : Fix incorrect code which relied on catching
20454         a NullReferenceException to detect a null being passed in
20455         where an object was expected.
20456
20457 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
20458
20459         * statement.cs (Try): flag the catch variable as assigned
20460
20461         * expression.cs (Cast): Simplified by using ResolveType instead of
20462         manually resolving.
20463
20464         * statement.cs (Catch): Fix bug by using ResolveType.
20465
20466 2002-09-06  Ravi Pratap  <ravi@ximian.com>
20467
20468         * expression.cs (BetterConversion): Special case for when we have
20469         a NullLiteral as the argument and we have to choose between string
20470         and object types - we choose string the way csc does.
20471
20472         * attribute.cs (Attribute.Resolve): Catch the
20473         NullReferenceException and report error #182 since the Mono
20474         runtime no more has the bug and having this exception raised means
20475         we tried to select a constructor which takes an object and is
20476         passed a null.
20477
20478 2002-09-05  Ravi Pratap  <ravi@ximian.com>
20479
20480         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
20481         message (1502, 1503) when we can't locate a method after overload
20482         resolution. This is much more informative and closes the bug
20483         Miguel reported.
20484
20485         * interface.cs (PopulateMethod): Return if there are no argument
20486         types. Fixes a NullReferenceException bug.
20487
20488         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
20489         expressions too. Previously we were checking only in one place for
20490         positional arguments leaving out named arguments.
20491
20492         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
20493         type to the enum type is not allowed. Remove code corresponding to
20494         that.
20495
20496         (ConvertNumericExplicit): Allow explicit conversions from
20497         the underlying type to enum type. This precisely follows the spec
20498         and closes a bug filed by Gonzalo.
20499
20500 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20501
20502         * compiler.csproj:
20503         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
20504
20505 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
20506
20507         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
20508         it was important that we stored the right value after the
20509         reduction in `converted'.
20510
20511 2002-09-04  Martin Baulig  <martin@gnome.org>
20512
20513         * location.cs (Location.SymbolDocument): Use full pathnames for the
20514         source files.
20515
20516 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
20517
20518         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
20519         of the expression resolve mechanism, because that will catch the
20520         SimpleName error failures.
20521
20522         (Conditional): If we can not resolve the
20523         expression, return, do not crash.
20524
20525 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20526
20527         * cs-tokenizer.cs:
20528         (location): display token name instead of its number.
20529
20530 2002-08-28  Martin Baulig  <martin@gnome.org>
20531
20532         * expression.cs (Binary.ResolveOperator): Don't silently return
20533         but return an error if an operator cannot be applied between two
20534         enum types.
20535
20536 2002-08-28  Martin Baulig  <martin@gnome.org>
20537
20538         * class.cs (Constructor.Define): Set the permission attributes
20539         correctly instead of making all constructors public.
20540
20541 2002-08-28  Martin Baulig  <martin@gnome.org>
20542
20543         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
20544         for private members before reporting a CS0103; if we find anything,
20545         it's a CS0122.
20546
20547 2002-08-28  Martin Baulig  <martin@gnome.org>
20548
20549         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
20550         to check whether `closure_start_type == closure_invocation_type',
20551         we also need to check whether `m.DeclaringType == closure_invocation_type'
20552         before bypassing the permission checks.  We might be accessing
20553         protected/private members from the base class.
20554         (TypeManager.RealMemberLookup): Only set private_ok if private
20555         members were requested via BindingFlags.NonPublic.
20556
20557         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
20558
20559         * expression.cs (MemberAccess.ResolveMemberAccess): Set
20560         MethodGroupExpr.IsExplicitImpl if appropriate.
20561         (Invocation.DoResolve): Don't report the CS0120 for explicit
20562         interface implementations.
20563
20564 2002-08-27  Martin Baulig  <martin@gnome.org>
20565
20566         * expression.cs (Invocation.DoResolve): If this is a static
20567         method and we don't have an InstanceExpression, we must report
20568         a CS0120.
20569
20570 2002-08-25  Martin Baulig  <martin@gnome.org>
20571
20572         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
20573         `==' between a valuetype and an object.
20574
20575 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
20576
20577         * ecore.cs (TypeExpr): Provide a ToString method.
20578
20579 2002-08-24  Martin Baulig  <martin@gnome.org>
20580
20581         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
20582         now called proggie.dbg and it's a binary file.
20583
20584 2002-08-23  Martin Baulig  <martin@gnome.org>
20585
20586         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
20587
20588 2002-08-23  Martin Baulig  <martin@gnome.org>
20589
20590         * struct.cs (MyStructInfo.ctor): Make this work with empty
20591         structs; it's not allowed to use foreach() on null.
20592
20593 2002-08-23  Martin Baulig  <martin@gnome.org>
20594
20595         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
20596         writer the full pathname of the generated assembly.
20597
20598 2002-08-23  Martin Baulig  <martin@gnome.org>
20599
20600         * statements.cs (FlowBranching.UsageVector.MergeChildren):
20601         A `finally' block never returns or breaks; improved handling of
20602         unreachable code.
20603
20604 2002-08-23  Martin Baulig  <martin@gnome.org>
20605
20606         * statement.cs (Throw.Resolve): Allow `throw null'.
20607
20608 2002-08-23  Martin Baulig  <martin@gnome.org>
20609
20610         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
20611         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
20612         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
20613         MemberLookup would return a wrong event if this is an explicit
20614         interface implementation and the class has an event with the same
20615         name.
20616
20617 2002-08-23  Martin Baulig  <martin@gnome.org>
20618
20619         * statement.cs (Block.AddChildVariableNames): New public method.
20620         (Block.AddChildVariableName): Likewise.
20621         (Block.IsVariableNameUsedInChildBlock): Likewise.
20622         (Block.AddVariable): Check whether a variable name has already
20623         been used in a child block.
20624
20625         * cs-parser.jay (declare_local_variables): Mark all variable names
20626         from the current block as being used in a child block in the
20627         implicit block.
20628
20629 2002-08-23  Martin Baulig  <martin@gnome.org>
20630
20631         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
20632         find the symbol writer.
20633
20634         * driver.cs: csc also allows the arguments to /define being
20635         separated by commas, not only by semicolons.
20636
20637 2002-08-23  Martin Baulig  <martin@gnome.org>
20638
20639         * interface.cs (Interface.GetMembers): Added static check for events.
20640
20641 2002-08-15  Martin Baulig  <martin@gnome.org>
20642
20643         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
20644         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
20645
20646         * ecore.cs (Expression.MemberLookup): Added documentation and explained
20647         why the MethodData.EmitDestructor() change was necessary.
20648
20649 2002-08-20  Martin Baulig  <martin@gnome.org>
20650
20651         * class.cs (TypeContainer.FindMembers): Added static check for events.
20652
20653         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
20654
20655         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
20656         use Type.GetEvents(), not Type.FindMembers().
20657
20658 2002-08-20  Martin Baulig  <martin@gnome.org>
20659
20660         * decl.cs (MemberCache): Added a special method cache which will
20661         be used for method-only searched.  This ensures that a method
20662         search will return a MethodInfo with the correct ReflectedType for
20663         inherited methods.      
20664
20665 2002-08-20  Martin Baulig  <martin@gnome.org>
20666
20667         * decl.cs (DeclSpace.FindMembers): Made this public.
20668
20669 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20670
20671         * delegate.cs: fixed build on windows.
20672         [FIXME:  Filed as bug #29150: MCS must report these errors.]
20673
20674 2002-08-19  Ravi Pratap  <ravi@ximian.com>
20675
20676         * ecore.cs (StandardConversionExists): Return a false
20677         if we are trying to convert the void type to anything else
20678         since that is not allowed.
20679
20680         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
20681         we flag error 70 in the event an event is trying to be accessed
20682         directly from outside the declaring type.
20683
20684 2002-08-20  Martin Baulig  <martin@gnome.org>
20685
20686         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
20687         MemberCache from typemanager.cs to decl.cs.
20688
20689 2002-08-19  Martin Baulig  <martin@gnome.org>
20690
20691         * class.cs (TypeContainer): Implement IMemberContainer.
20692         (TypeContainer.DefineMembers): Create the MemberCache.
20693         (TypeContainer.FindMembers): Do better BindingFlags checking; only
20694         return public members if BindingFlags.Public was given, check
20695         whether members are static.
20696
20697 2002-08-16  Martin Baulig  <martin@gnome.org>
20698
20699         * decl.cs (DeclSpace.Define): Splitted this in Define and
20700         DefineMembers.  DefineMembers is called first and initializes the
20701         MemberCache.
20702
20703         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
20704         DefineMembers() on all our DeclSpaces.
20705
20706         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
20707         but call DefineMembers() on all nested interfaces.  We call their
20708         Define() in our new Define() function.
20709
20710         * interface.cs (Interface): Implement IMemberContainer.
20711         (Interface.Define): Moved all code except the attribute stuf to
20712         DefineMembers().
20713         (Interface.DefineMembers): Initialize the member cache.
20714
20715         * typemanager.cs (IMemberFinder): Removed this interface, we don't
20716         need this anymore since we can use MemberCache.FindMembers directly.
20717
20718 2002-08-19  Martin Baulig  <martin@gnome.org>
20719
20720         * typemanager.cs (MemberCache): When creating the cache for an
20721         interface type, add all inherited members.
20722         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
20723         to `out bool used_cache' and documented it.
20724         (TypeManager.MemberLookup): If we already used the cache in the first
20725         iteration, we don't need to do the interfaces check.
20726
20727 2002-08-19  Martin Baulig  <martin@gnome.org>
20728
20729         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
20730         here from IMemberFinder and don't implement this interface anymore.
20731         (DeclSpace.MemberCache): Moved here from IMemberFinder.
20732
20733         * typemanager.cs (IMemberFinder): This interface is now only used by
20734         classes which actually support the member cache.
20735         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
20736         since we only put DeclSpaces into this Hashtable.
20737         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
20738         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
20739
20740 2002-08-16  Martin Baulig  <martin@gnome.org>
20741
20742         * typemanager.cs (ICachingMemberFinder): Removed.
20743         (IMemberFinder.MemberCache): New property.
20744         (TypeManager.FindMembers): Merged this with RealFindMembers().
20745         This function will never be called from TypeManager.MemberLookup()
20746         so we can't use the cache here, just the IMemberFinder.
20747         (TypeManager.MemberLookup_FindMembers): Check whether the
20748         IMemberFinder has a MemberCache and call the cache's FindMembers
20749         function.
20750         (MemberCache): Rewrote larger parts of this yet another time and
20751         cleaned it up a bit.
20752
20753 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
20754
20755         * driver.cs (LoadArgs): Support quoting.
20756
20757         (Usage): Show the CSC-like command line arguments.
20758
20759         Improved a few error messages.
20760
20761 2002-08-15  Martin Baulig  <martin@gnome.org>
20762
20763         * typemanager.cs (IMemberContainer.Type): New property.
20764         (IMemberContainer.IsInterface): New property.
20765
20766         The following changes are conditional to BROKEN_RUNTIME, which is
20767         defined at the top of the file.
20768
20769         * typemanager.cs (MemberCache.MemberCache): Don't add the base
20770         class'es members, but add all members from TypeHandle.ObjectType
20771         if we're an interface.
20772         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
20773         is the current type.
20774         (MemberCache.CacheEntry.Container): Removed this field.
20775         (TypeHandle.GetMembers): Include inherited members.
20776
20777 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20778
20779         * typemanager.cs: fixed compilation and added a comment on a field that
20780         is never used.
20781
20782 2002-08-15  Martin Baulig  <martin@gnome.org>
20783
20784         * class.cs (ConstructorInitializer.Resolve): In the
20785         Expression.MemberLookup call, use the queried_type as
20786         invocation_type.
20787
20788         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
20789         declared' attribute, it's always true.
20790         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
20791         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
20792         temporary wrapper for FindMembers which tells MemberLookup whether
20793         members from the base classes are included in the return value.
20794         This will go away soon.
20795         (TypeManager.MemberLookup): Use this temporary hack here; once the
20796         new MemberCache is completed, we don't need to do the DeclaredOnly
20797         looping here anymore since the MemberCache will take care of this.
20798         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
20799         (MemberCache): When creating the MemberCache for a class, get
20800         members from the current class and all its base classes.
20801         (MemberCache.CacheEntry.Container): New field.  This is a
20802         temporary hack until the Mono runtime is fixed to distinguish
20803         between ReflectedType and DeclaringType.  It allows us to use MCS
20804         with both the MS runtime and the unfixed Mono runtime without
20805         problems and without accecting performance.
20806         (MemberCache.SearchMembers): The DeclaredOnly looping from
20807         TypeManager.MemberLookup is now done here.      
20808
20809 2002-08-14  Martin Baulig  <martin@gnome.org>
20810
20811         * statement.cs (MyStructInfo.MyStructInfo): Don't call
20812         Type.GetFields on dynamic types but get the fields from the
20813         corresponding TypeContainer.
20814         (MyStructInfo.GetStructInfo): Added check for enum types.
20815
20816         * typemanager.cs (MemberList.IsSynchronized): Implemented.
20817         (MemberList.SyncRoot): Implemented.
20818         (TypeManager.FilterWithClosure): No need to check permissions if
20819         closure_start_type == closure_invocation_type, don't crash if
20820         closure_invocation_type is null.
20821
20822 2002-08-13  Martin Baulig  <martin@gnome.org>
20823
20824         Rewrote TypeContainer.FindMembers to use a member cache.  This
20825         gives us a speed increase of about 35% for the self-hosting MCS
20826         build and of about 15-20% for the class libs (both on GNU/Linux).
20827
20828         * report.cs (Timer): New class to get enhanced profiling.  This
20829         whole class is "TIMER" conditional since it remarkably slows down
20830         compilation speed.
20831
20832         * class.cs (MemberList): New class.  This is an IList wrapper
20833         which we're now using instead of passing MemberInfo[]'s around to
20834         avoid copying this array unnecessarily.
20835         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
20836         (ICachingMemberFinder, IMemberContainer): New interface.
20837         (TypeManager.FilterWithClosure): If `criteria' is null, the name
20838         has already been checked, otherwise use it for the name comparision.
20839         (TypeManager.FindMembers): Renamed to RealMemberFinder and
20840         provided wrapper which tries to use ICachingMemberFinder.FindMembers
20841         if possible.  Returns a MemberList, not a MemberInfo [].
20842         (TypeHandle): New class, implements IMemberContainer.  We create
20843         one instance of this class per type, it contains a MemberCache
20844         which is used to do the member lookups.
20845         (MemberCache): New class.  Each instance of this class contains
20846         all members of a type and a name-based hash table.
20847         (MemberCache.FindMembers): This is our new member lookup
20848         function.  First, it looks up all members of the requested name in
20849         the hash table.  Then, it walks this list and sorts out all
20850         applicable members and returns them.
20851
20852 2002-08-13  Martin Baulig  <martin@gnome.org>
20853
20854         In addition to a nice code cleanup, this gives us a performance
20855         increase of about 1.4% on GNU/Linux - not much, but it's already
20856         half a second for the self-hosting MCS compilation.
20857
20858         * typemanager.cs (IMemberFinder): New interface.  It is used by
20859         TypeManager.FindMembers to call FindMembers on a TypeContainer,
20860         Enum, Delegate or Interface.
20861         (TypeManager.finder_to_member_finder): New PtrHashtable.
20862         (TypeManager.finder_to_container): Removed.
20863         (TypeManager.finder_to_delegate): Removed.
20864         (TypeManager.finder_to_interface): Removed.
20865         (TypeManager.finder_to_enum): Removed.
20866
20867         * interface.cs (Interface): Implement IMemberFinder.
20868
20869         * delegate.cs (Delegate): Implement IMemberFinder.
20870
20871         * enum.cs (Enum): Implement IMemberFinder.
20872
20873         * class.cs (TypeContainer): Implement IMemberFinder.
20874
20875 2002-08-12  Martin Baulig  <martin@gnome.org>
20876
20877         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
20878
20879 2002-08-12  Martin Baulig  <martin@gnome.org>
20880
20881         * ecore.cs (ITypeExpression): New interface for expressions which
20882         resolve to a type.
20883         (TypeExpression): Renamed to TypeLookupExpression.
20884         (Expression.DoResolve): If we're doing a types-only lookup, the
20885         expression must implement the ITypeExpression interface and we
20886         call DoResolveType() on it.
20887         (SimpleName): Implement the new ITypeExpression interface.
20888         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
20889         hack, the situation that we're only looking up types can't happen
20890         anymore when this method is called.  Moved the type lookup code to
20891         DoResolveType() and call it.
20892         (SimpleName.DoResolveType): This ITypeExpression interface method
20893         is now doing the types-only lookup.
20894         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
20895         (ResolveFlags): Added MaskExprClass.
20896
20897         * expression.cs (MemberAccess): Implement the ITypeExpression
20898         interface.
20899         (MemberAccess.DoResolve): Added support for a types-only lookup
20900         when we're called via ITypeExpression.DoResolveType().
20901         (ComposedCast): Implement the ITypeExpression interface.
20902
20903         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
20904         Expression.Resolve() with ResolveFlags.Type instead.
20905
20906 2002-08-12  Martin Baulig  <martin@gnome.org>
20907
20908         * interface.cs (Interface.Define): Apply attributes.
20909
20910         * attribute.cs (Attribute.ApplyAttributes): Added support for
20911         interface attributes.
20912
20913 2002-08-11  Martin Baulig  <martin@gnome.org>
20914
20915         * statement.cs (Block.Emit): Only check the "this" variable if we
20916         do not always throw an exception.
20917
20918         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
20919         whether the property has a set accessor.
20920
20921 2002-08-11  Martin Baulig  <martin@gnome.org>
20922
20923         Added control flow analysis support for structs.
20924
20925         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
20926         with control flow analysis turned off.
20927         (IVariable): New interface.
20928         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
20929         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
20930         (FieldExpr.DoResolve): Resolve the instance expression with flow
20931         analysis turned off and do the definite assignment check after the
20932         resolving when we know what the expression will resolve to.
20933
20934         * expression.cs (LocalVariableReference, ParameterReference):
20935         Implement the new IVariable interface, only call the flow analysis
20936         code if ec.DoFlowAnalysis is true.
20937         (This): Added constructor which takes a Block argument.  Implement
20938         the new IVariable interface.
20939         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
20940         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
20941         This does the definite assignment checks for struct members.
20942
20943         * class.cs (Constructor.Emit): If this is a non-static `struct'
20944         constructor which doesn't have any initializer, call
20945         Block.AddThisVariable() to tell the flow analysis code that all
20946         struct elements must be initialized before control returns from
20947         the constructor.
20948
20949         * statement.cs (MyStructInfo): New public class.
20950         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
20951         argument to this indexer.  If non-zero, check an individual struct
20952         member, not the whole struct.
20953         (FlowBranching.CheckOutParameters): Check struct members.
20954         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
20955         overloaded versions of these methods which take an additional
20956         `int field_idx' argument to check struct members.
20957         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
20958         overloaded versions of these methods which take an additional
20959         `string field_name' argument to check struct member.s
20960         (VariableInfo): Implement the IVariable interface.
20961         (VariableInfo.StructInfo): New public property.  Returns the
20962         MyStructInfo instance of the variable if it's a struct or null.
20963         (Block.AddThisVariable): New public method.  This is called from
20964         Constructor.Emit() for non-static `struct' constructor which do
20965         not have any initializer.  It creates a special variable for the
20966         "this" instance variable which will be checked by the flow
20967         analysis code to ensure that all of the struct's fields are
20968         initialized before control returns from the constructor.
20969         (UsageVector): Added support for struct members.  If a
20970         variable/parameter is a struct with N members, we reserve a slot
20971         in the usage vector for each member.  A struct is considered fully
20972         initialized if either the struct itself (slot 0) or all its
20973         members are initialized.
20974
20975 2002-08-08  Martin Baulig  <martin@gnome.org>
20976
20977         * driver.cs (Driver.MainDriver): Only report an error CS5001
20978         if there were no compilation errors.
20979
20980         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
20981         `UnsafeContext' property to determine whether the parent is in
20982         unsafe context rather than checking the parent's ModFlags:
20983         classes nested in an unsafe class are unsafe as well.
20984
20985 2002-08-08  Martin Baulig  <martin@gnome.org>
20986
20987         * statement.cs (UsageVector.MergeChildren): Distinguish between
20988         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
20989         we return.  Added test17() and test18() to test-154.cs.
20990
20991 2002-08-08  Martin Baulig  <martin@gnome.org>
20992
20993         * typemanager.cs (TypeManager.FilterWithClosure): If we have
20994         Family access, make sure the invoking type isn't a subclass of the
20995         queried type (that'd be a CS1540).
20996
20997         * ecore.cs (Expression.MemberLookup): Added overloaded version of
20998         this method which takes an additional `Type invocation_type'.
20999
21000         * expression.cs (BaseAccess.DoResolve): Use the base type as
21001         invocation and query type.
21002         (MemberAccess.DoResolve): If the lookup failed and we're about to
21003         report a CS0122, try a lookup with the ec.ContainerType - if this
21004         succeeds, we must report a CS1540.
21005
21006 2002-08-08  Martin Baulig  <martin@gnome.org>
21007
21008         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
21009         (MethodGroupExpr): Implement the IMemberExpr interface.
21010
21011         * expression (MemberAccess.ResolveMemberAccess): No need to have
21012         any special code for MethodGroupExprs anymore, they're now
21013         IMemberExprs.   
21014
21015 2002-08-08  Martin Baulig  <martin@gnome.org>
21016
21017         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
21018         Family, FamANDAssem and FamORAssem permissions.
21019         (TypeManager.IsSubclassOrNestedChildOf): New public method.
21020
21021 2002-08-08  Martin Baulig  <martin@gnome.org>
21022
21023         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
21024         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
21025         or loop block.
21026
21027 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
21028
21029         * driver.cs: implemented /resource option to embed managed resources.
21030
21031 2002-08-07  Martin Baulig  <martin@gnome.org>
21032
21033         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
21034         (FieldBase.HasFieldInitializer): New public property.
21035         (FieldBase.GetInitializerExpression): New public method.  Resolves and
21036         returns the field initializer and makes sure it is only resolved once.
21037         (TypeContainer.EmitFieldInitializers): Call
21038         FieldBase.GetInitializerExpression to get the initializer, this ensures
21039         that it isn't resolved multiple times.
21040
21041         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
21042         the resolving process (SimpleName/MemberLookup) that we're currently
21043         emitting a field initializer (which must not access any instance members,
21044         this is an error CS0236).
21045
21046         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
21047         argument, if the `IsFieldInitializer' flag is set, we must report and
21048         error CS0236 and not an error CS0120.   
21049
21050 2002-08-07  Martin Baulig  <martin@gnome.org>
21051
21052         * ecore.cs (IMemberExpr): New public interface.
21053         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
21054         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
21055         if the expression is an IMemberExpr.
21056
21057         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
21058         to be null, implicitly default to `this' if we're non-static in
21059         this case.  Simplified the code a lot by using the new IMemberExpr
21060         interface.  Also fixed bug #28176 here.
21061
21062 2002-08-06  Martin Baulig  <martin@gnome.org>
21063
21064         * cs-parser.jay (SimpleLookup): Removed.  We need to create
21065         ParameterReferences during semantic analysis so that we can do a
21066         type-only search when resolving Cast, TypeOf and SizeOf.
21067         (block): Pass the `current_local_parameters' to the Block's
21068         constructor.
21069
21070         * class.cs (ConstructorInitializer): Added `Parameters parameters'
21071         argument to the constructor.
21072         (ConstructorInitializer.Resolve): Create a temporary implicit
21073         block with the parameters.
21074
21075         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
21076         references here if we aren't doing a type-only search.
21077
21078         * statement.cs (Block): Added constructor which takes a
21079         `Parameters parameters' argument.
21080         (Block.Parameters): New public property.
21081
21082         * support.cs (InternalParameters.Parameters): Renamed `parameters'
21083         to `Parameters' and made it public readonly.
21084
21085 2002-08-06  Martin Baulig  <martin@gnome.org>
21086
21087         * ecore.cs (Expression.Warning): Made this public as well.
21088
21089         * report.cs (Report.Debug): Print the contents of collections.
21090
21091 2002-08-06  Martin Baulig  <martin@gnome.org>
21092
21093         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
21094         used to tell Resolve() which kinds of expressions it may return.
21095         (Expression.Resolve): Added overloaded version of this method which
21096         takes a `ResolveFlags flags' argument.  This can be used to tell
21097         Resolve() which kinds of expressions it may return.  Reports a
21098         CS0118 on error.
21099         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
21100         ResolveFlags.SimpleName.
21101         (Expression.Error118): Added overloaded version of this method which
21102         takes a `ResolveFlags flags' argument.  It uses the flags to determine
21103         which kinds of expressions are allowed.
21104
21105         * expression.cs (Argument.ResolveMethodGroup): New public method.
21106         Resolves an argument, but allows a MethodGroup to be returned.
21107         This is used when invoking a delegate.
21108
21109         * TODO: Updated a bit.
21110
21111 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21112
21113         Fixed compilation with csc.
21114
21115         * ecore.cs: Expression.Error made public. Is this correct? Should
21116         Warning be made public too?
21117
21118         * expression.cs: use ea.Location instead of ea.loc.
21119         [FIXME:  Filed as bug #28607: MCS must report these errors.]
21120
21121 2002-08-06  Martin Baulig  <martin@gnome.org>
21122
21123         * ecore.cs (Expression.loc): Moved the location here instead of
21124         duplicating it in all derived classes.
21125         (Expression.Location): New public property.
21126         (Expression.Error, Expression.Warning): Made them non-static and
21127         removed the location argument.
21128         (Expression.Warning): Added overloaded version which takes an
21129         `int level' argument.
21130         (Expression.Error118): Make this non-static and removed the
21131         expression and location arguments.
21132         (TypeExpr): Added location argument to the constructor.
21133
21134         * expression.cs (StaticCallExpr): Added location argument to
21135         the constructor.
21136         (Indirection, PointerArithmetic): Likewise.
21137         (CheckedExpr, UnCheckedExpr): Likewise.
21138         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
21139         (StringPtr): Likewise.
21140
21141
21142 2002-08-05  Martin Baulig  <martin@gnome.org>
21143
21144         * expression.cs (BaseAccess.DoResolve): Actually report errors.
21145
21146         * assign.cs (Assign.DoResolve): Check whether the source
21147         expression is a value or variable.
21148
21149         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
21150         while resolving the corresponding blocks.
21151
21152         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
21153         an error, don't silently return null.
21154
21155         * statement.cs (Block.AddVariable): Do the error reporting here
21156         and distinguish between CS0128 and CS0136.
21157         (Block.DoResolve): Report all unused labels (warning CS0164).
21158         (LabeledStatement): Pass the location to the constructor.
21159         (LabeledStatement.HasBeenReferenced): New property.
21160         (LabeledStatement.Resolve): Set it to true here.
21161
21162         * statement.cs (Return.Emit): Return success even after reporting
21163         a type mismatch error (CS0126 or CS0127), this is what csc does and
21164         it avoids confusing the users with any consecutive errors.
21165
21166 2002-08-05  Martin Baulig  <martin@gnome.org>
21167
21168         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
21169
21170         * const.cs (Const.LookupConstantValue): Catch circular definitions.
21171
21172         * expression.cs (MemberAccess.DoResolve): Silently return if an
21173         error has already been reported.
21174
21175         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
21176         error has already been reported.
21177
21178 2002-08-05  Martin Baulig  <martin@gnome.org>
21179
21180         * statement.cs (UsageVector): Only initialize the `parameters'
21181         vector if we actually have any "out" parameters.
21182
21183 2002-08-05  Martin Baulig  <martin@gnome.org>
21184
21185         * expression.cs (Binary.ResolveOperator): When combining delegates,
21186         they must have the same type.
21187
21188 2002-08-05  Martin Baulig  <martin@gnome.org>
21189
21190         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
21191         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
21192         work with the ms runtime and we also don't need it: if we're a
21193         PropertyBuilder and not in the `indexer_arguments' hash, then we
21194         are a property and not an indexer.
21195
21196         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
21197         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
21198         since the latter one doesn't work with the ms runtime.
21199
21200 2002-08-03  Martin Baulig  <martin@gnome.org>
21201
21202         Fixed bugs #27998 and #22735.
21203
21204         * class.cs (Method.IsOperator): New public field.
21205         (Method.CheckBase): Report CS0111 if there's already a method
21206         with the same parameters in the current class.  Report CS0508 when
21207         attempting to change the return type of an inherited method.
21208         (MethodData.Emit): Report CS0179 if a method doesn't have a body
21209         and it's not marked abstract or extern.
21210         (PropertyBase): New abstract base class for Property and Indexer.
21211         (PropertyBase.CheckBase): Moved here from Property and made it work
21212         for indexers.
21213         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
21214         the same so we can reuse it there.
21215         (Property, Indexer): Derive from PropertyBase.
21216         (MethodSignature.inheritable_property_signature_filter): New delegate
21217         to find properties and indexers.
21218
21219         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
21220         argument and improved error reporting.
21221
21222         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
21223         EmptyReadOnlyParameters and made it a property.
21224
21225         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
21226         version of this method which takes a `PropertyInfo indexer'.
21227         (TypeManager.RegisterIndexer): New method.
21228
21229         * class.cs: Added myself as author of this file :-)
21230
21231 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21232
21233         * class.cs: fixed compilation on windoze.
21234
21235 2002-08-03  Martin Baulig  <martin@gnome.org>
21236
21237         * interface.cs (Interface.GetInterfaceBases): Check whether all
21238         base interfaces are at least as accessible than the current one.
21239
21240         * class.cs (TypeContainer.GetClassBases): Check whether base types
21241         are at least as accessible than the current type.
21242         (TypeContainer.AsAccessible): Implemented and made non-static.
21243         (MemberBase.CheckParameters): Report errors if the accessibility
21244         checks fail.
21245
21246         * delegate.cs (Delegate.Delegate): The default visibility is
21247         internal for top-level types and private for nested types.
21248         (Delegate.Define): Report errors if the accessibility checks fail.
21249
21250         * enum.cs (Enum.Enum): The default visibility is internal for
21251         top-level types and private for nested types.
21252         (Enum.DefineType): Compute the correct visibility.
21253
21254         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
21255         function which takes a `bool is_toplevel' instead of a TypeContainer.
21256
21257         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
21258         builtin type.
21259
21260 2002-08-02  Martin Baulig  <martin@gnome.org>
21261
21262         * expression.cs (LocalVariableReferenc): Added constructor which
21263         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
21264         (LocalVariableReference.IsReadOnly): New property.
21265         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
21266         variable is readonly, use our own readonly flag to do this; you can
21267         use the new constructor to get a writable reference to a read-only
21268         variable.
21269
21270         * cs-parser.jay (foreach_statement, using_statement): Get a writable
21271         reference to the local variable.
21272
21273 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
21274
21275         * rootcontext.cs (ResolveCore): Also include System.Exception
21276
21277         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
21278         we reach an EmptyStatement.
21279
21280         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
21281         is also fine.
21282
21283         * expression.cs (Binary.ResolveOperator): Check error result in
21284         two places.
21285
21286         use brtrue/brfalse directly and avoid compares to null.
21287
21288 2002-08-02  Martin Baulig  <martin@gnome.org>
21289
21290         * class.cs (TypeContainer.Define): Define all nested interfaces here.
21291         Fixes bug #28407, added test-155.cs.
21292
21293 2002-08-01  Martin Baulig  <martin@gnome.org>
21294
21295         * class.cs (Event.EmitDefaultMethod): Make this work with static
21296         events.  Fixes #28311, added verify-3.cs.
21297
21298 2002-08-01  Martin Baulig  <martin@gnome.org>
21299
21300         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
21301         `is_disposable' fields.
21302         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
21303         `hm.is_disposable' if we're using the collection pattern.
21304         (Foreach.EmitCollectionForeach): Use the correct type for the
21305         enumerator's local variable, only emit the try/finally block if
21306         necessary (fixes #27713).
21307
21308 2002-08-01  Martin Baulig  <martin@gnome.org>
21309
21310         * ecore.cs (Expression.report118): Renamed to Error118 and made
21311         it public static.
21312
21313         * statement.cs (Throw.Resolve): Check whether the expression is of
21314         the correct type (CS0118) and whether the type derives from
21315         System.Exception (CS0155).
21316         (Catch.Resolve): New method.  Do the type lookup here and check
21317         whether it derives from System.Exception (CS0155).
21318         (Catch.CatchType, Catch.IsGeneral): New public properties.
21319
21320         * typemanager.cs (TypeManager.exception_type): Added.
21321
21322 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
21323
21324         * driver.cs: Updated About function.
21325
21326 2002-07-31  Martin Baulig  <martin@gnome.org>
21327
21328         Implemented Control Flow Analysis.
21329
21330         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
21331         (EmitContext.CurrentBranching): Added.
21332         (EmitContext.StartFlowBranching): Added.
21333         (EmitContext.EndFlowBranching): Added.
21334         (EmitContext.KillFlowBranching): Added.
21335         (EmitContext.IsVariableAssigned): Added.
21336         (EmitContext.SetVariableAssigned): Added.
21337         (EmitContext.IsParameterAssigned): Added.
21338         (EmitContext.SetParameterAssigned): Added.
21339         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
21340         Added control flow analysis stuff here.
21341
21342         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
21343         resolve the expression as lvalue.
21344         (LocalVariableReference.DoResolve): Check whether the variable has
21345         already been assigned.
21346         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
21347         the parameter as assigned here.
21348         (ParameterReference.DoResolve): Check whether the parameter has already
21349         been assigned.
21350         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
21351         expression as lvalue.
21352
21353         * statement.cs (FlowBranching): New class for the flow analysis code.
21354         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
21355         (LabeledStatement.IsDefined): New public property.
21356         (LabeledStatement.AddUsageVector): New public method to tell flow
21357         analyis that the label may be reached via a forward jump.
21358         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
21359         flow analysis.
21360         (VariableInfo.Number): New public field.  This is used by flow analysis
21361         to number all locals of a block.
21362         (Block.CountVariables): New public property.  This is the number of
21363         local variables in this block (including the locals from all parent
21364         blocks).
21365         (Block.EmitMeta): Number all the variables.
21366
21367         * statement.cs: Added flow analysis support to all classes.
21368
21369 2002-07-31  Martin Baulig  <martin@gnome.org>
21370
21371         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
21372         To get debugging messages, compile mcs with /define:MCS_DEBUG and
21373         then use this argument.
21374
21375         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
21376
21377         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
21378         use this to specify /define options.
21379
21380 2002-07-29  Martin Baulig  <martin@gnome.org>
21381
21382         * statement.cs (Fixed): Moved all code that does variable lookups
21383         and resolvings from Emit to Resolve.
21384
21385         * statement.cs (For): Moved all code that does variable lookups
21386         and resolvings from Emit to Resolve.
21387
21388         * statement.cs (Using): Moved all code that does variable lookups
21389         and resolvings from Emit to Resolve.
21390
21391 2002-07-29  Martin Baulig  <martin@gnome.org>
21392
21393         * attribute.cs (Attribute.Resolve): Explicitly catch a
21394         System.NullReferenceException when creating the
21395         CustromAttributeBuilder and report a different warning message.
21396
21397 2002-07-29  Martin Baulig  <martin@gnome.org>
21398
21399         * support.cs (ParameterData.ParameterName): Added method to
21400         get the name of a parameter.
21401
21402         * typemanager.cs (TypeManager.IsValueType): New public method.
21403
21404 2002-07-29  Martin Baulig  <martin@gnome.org>
21405
21406         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
21407         is a flag which specifies that it's either ref or out.
21408         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
21409         the out parameter to `out Parameter.Modifier mod', also set the
21410         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
21411
21412         * support.cs (InternalParameters.ParameterModifier): Distinguish
21413         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21414         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21415
21416         * expression.cs (Argument.GetParameterModifier): Distinguish
21417         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
21418         Parameter.Modifier.ISBYREF flag if it's either ref or out.
21419
21420 2002-07-29  Martin Baulig  <martin@gnome.org>
21421
21422         * expression.cs (ParameterReference.ParameterReference): Added
21423         `Location loc' argument to the constructor.
21424
21425         * cs-parser.jay: Pass location to ParameterReference.
21426
21427 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
21428
21429         * statement.cs (Try): Initialize the location.
21430
21431         * cs-parser.jay: pass location to Try.
21432
21433         * expression.cs (Unary.Reduce): Change the prototype to return
21434         whether a constant fold could be performed or not.  The result is
21435         returned in an out parameters.  In the case of Indirection and
21436         AddressOf, we want to perform the full tests.
21437
21438 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
21439
21440         * statement.cs (Statement.Emit): Flag dead code.
21441
21442 2002-07-27  Andrew Birkett  <andy@nobugs.org>
21443
21444         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
21445
21446 2002-07-27  Martin Baulig  <martin@gnome.org>
21447
21448         * class.cs (MethodData.Define): Put back call to
21449         TypeManager.AddMethod(), accidentally commented this out.
21450
21451         * report.cs (Debug): New public method to print debugging information,
21452         this is `[Conditional ("DEBUG")]'.
21453
21454 2002-07-26  Martin Baulig  <martin@gnome.org>
21455
21456         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
21457         (switch_statement): Push the current_block to the switch_stack and
21458         pop it again when we're done with the switch.
21459         (switch_section): The new block is a child of the current_block.
21460         Fixes bug #24007, added test-152.cs.
21461
21462 2002-07-27  Martin Baulig  <martin@gnome.org>
21463
21464         * expression.cs (Invocation.EmitArguments): When calling a varargs
21465         function with only its fixed arguments, we need to pass an empty
21466         array.
21467
21468 2002-07-27  Martin Baulig  <martin@gnome.org>
21469
21470         Mono 0.13 has been released.
21471
21472 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
21473
21474         * driver.cs: Rename --resource to --linkres, because that is what
21475         we do currently, we dont support --resource yet.
21476
21477         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
21478
21479 2002-07-25  Martin Baulig  <martin@gnome.org>
21480
21481         * class.cs (MethodData): New public class.  This is a `method builder'
21482         class for a method or one accessor of a Property/Indexer/Event.
21483         (MethodData.GetMethodFlags): Moved here from MemberBase.
21484         (MethodData.ApplyAttributes): Likewise.
21485         (MethodData.ApplyObsoleteAttribute): Likewise.
21486         (MethodData.ApplyConditionalAttribute): Likewise.
21487         (MethodData.ApplyDllImportAttribute): Likewise.
21488         (MethodData.CheckAbstractAndExternal): Likewise.
21489         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
21490         (MethodData.Emit): Formerly known as Method.Emit().
21491         (MemberBase): Moved everything which was specific to a single
21492         accessor/method to MethodData.
21493         (Method): Create a new MethodData and call Define() and Emit() on it.
21494         (Property, Indexer, Event): Create a new MethodData objects for each
21495         accessor and call Define() and Emit() on them.
21496
21497 2002-07-25  Martin Baulig  <martin@gnome.org>
21498
21499         Made MethodCore derive from MemberBase to reuse the code from there.
21500         MemberBase now also checks for attributes.
21501
21502         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
21503         (MemberBase.GetMethodFlags): Moved here from class Method and marked
21504         as virtual.
21505         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
21506         `CallingConventions cc' and `Attributes opt_attrs' arguments.
21507         (MemberBase.ApplyAttributes): New virtual method; applies the
21508         attributes to a method or accessor.
21509         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
21510         (MemberBase.ApplyConditionalAttribute): Likewise.
21511         (MemberBase.ApplyDllImportAttribute): Likewise.
21512         (MemberBase.CheckAbstractAndExternal): Likewise.
21513         (MethodCore.ParameterTypes): This is now a property instead of a
21514         method, it's initialized from DoDefineParameters().
21515         (MethodCore.ParameterInfo): Removed the set accessor.
21516         (MethodCore.DoDefineParameters): New protected virtual method to
21517         initialize ParameterTypes and ParameterInfo.
21518         (Method.GetReturnType): We can now simply return the MemberType.
21519         (Method.GetMethodFlags): Override the MemberBase version and add
21520         the conditional flags.
21521         (Method.CheckBase): Moved some code from Define() here, call
21522         DoDefineParameters() here.
21523         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
21524         here to avoid some larger code duplication.
21525         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
21526         ensure that abstract and external accessors don't declare a body.
21527
21528         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
21529         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
21530         lookup in the attribute's parent classes, so we need to abort as soon
21531         as we found the first match.
21532         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
21533         the attribute has no arguments.
21534
21535         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
21536         of a Method.
21537
21538 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21539
21540         * cs-parser.jay: reverted previous patch.
21541
21542 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21543
21544         * cs-parser.jay: fixed bug #22119.
21545
21546 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21547
21548         * attribute.cs: fixed compilation. The error was:
21549         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
21550         be assigned to before control leaves the current method."
21551         [FIXME:  Filed as bug #28186: MCS must report this error.]
21552
21553 2002-07-25  Martin Baulig  <martin@gnome.org>
21554
21555         * attribute.cs (Attribute.Conditional_GetConditionName): New static
21556         method to pull the condition name ouf of a Conditional attribute.
21557         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
21558         the obsolete message and error flag out of an Obsolete attribute.
21559
21560         * class.cs (Method.GetMethodFlags): New public method to get the
21561         TypeManager.MethodFlags for this method.
21562         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
21563         private methods.
21564         (Method.Define): Get and apply the Obsolete and Conditional attributes;
21565         if we're overriding a virtual function, set the new private variable
21566         `parent_method'; call the new TypeManager.AddMethod().
21567
21568         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
21569         the MethodBuilder and the Method in a PtrHashtable.
21570         (TypeManager.builder_to_method): Added for this purpose.
21571         (TypeManager.MethodFlags): Added IsObsoleteError.
21572         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
21573         Obsolete and Conditional arguments in MethodBuilders.  If we discover
21574         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
21575         the message from the attribute.
21576
21577 2002-07-24  Martin Baulig  <martin@gnome.org>
21578
21579         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
21580         preprocessor directives, ensure that the argument to #define/#undef is
21581         exactly one identifier and that it's actually an identifier.
21582
21583         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
21584         did not work ....
21585
21586 2002-07-24  Martin Baulig  <martin@gnome.org>
21587
21588         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
21589         initialize it to TypeManager.object_type in the constructor.
21590         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
21591         of the `hm.get_current' method if we're using the collection pattern.
21592         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
21593         for the explicit conversion to make it work when we're using the collection
21594         pattern and the `Current' property has a different return type than `object'.
21595         Fixes #27713.
21596
21597 2002-07-24  Martin Baulig  <martin@gnome.org>
21598
21599         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
21600         does not match, but don't report any errors.  This method is called in
21601         order for all methods in a MethodGroupExpr until a matching method is
21602         found, so we don't want to bail out if the first method doesn't match.
21603         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
21604         matches, report the 123.  Fixes #28070.
21605
21606 2002-07-24  Martin Baulig  <martin@gnome.org>
21607
21608         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
21609         TypeManager.TypeToCoreType() to the top of the method so the
21610         following equality checks will work.  Fixes #28107.
21611
21612 2002-07-24  Martin Baulig  <martin@gnome.org>
21613
21614         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
21615         operand is of type uint, and the other operand is of type sbyte,
21616         short or int, the operands are converted to type long." -
21617         Actually do what this comment already told us.  Fixes bug #28106,
21618         added test-150.cs.
21619
21620 2002-07-24  Martin Baulig  <martin@gnome.org>
21621
21622         * class.cs (MethodBase): New abstract class.  This is now a base
21623         class for Property, Indexer and Event to avoid some code duplication
21624         in their Define() and DefineMethods() methods.
21625         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
21626         generic methods for Define() and DefineMethods().
21627         (FieldBase): Derive from MemberBase, not MemberCore.
21628         (Property): Derive from MemberBase, not MemberCore.
21629         (Property.DefineMethod): Moved all the code from this method to the
21630         new MethodBase.DefineAccessor(), just call it with appropriate
21631         argumetnts.
21632         (Property.Define): Call the new Property.DoDefine(), this does some
21633         sanity checks and we don't need to duplicate the code everywhere.
21634         (Event): Derive from MemberBase, not MemberCore.
21635         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
21636         accessors, this will also make them work with interface events.
21637         (Indexer): Derive from MemberBase, not MemberCore.
21638         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
21639         (Indexer.Define): Use the new MethodBase functions.
21640
21641         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
21642         argument to the constructor.
21643         (Interface.FindMembers): Added support for interface events.
21644         (Interface.PopluateEvent): Implemented.
21645
21646         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
21647
21648 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
21649
21650         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
21651         but this is required to check for a method name being the same as
21652         the containing class.  
21653
21654         Handle this now.
21655
21656 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21657
21658         * interface.cs: initialize variable.
21659
21660 2002-07-23  Martin Baulig  <martin@gnome.org>
21661
21662         Implemented the IndexerName attribute in interfaces.
21663
21664         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
21665         name if this is an explicit interface implementation.
21666         (Indexer.InterfaceIndexerName): New public variable.  If we're
21667         implementing an interface indexer, this is the IndexerName in that
21668         interface.  Otherwise, it's the IndexerName.
21669         (Indexer.DefineMethod): If we're implementing interface indexer,
21670         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
21671         and Pending.ImplementIndexer methods.
21672         (Indexer.Define): Also define the PropertyBuilder if we're
21673         implementing an interface indexer and this is neither an explicit
21674         interface implementation nor do the IndexerName match the one in
21675         the interface.
21676
21677         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
21678         If a method is defined here, then we always need to create a proxy
21679         for it.  This is used when implementing interface indexers.
21680         (Pending.IsInterfaceIndexer): New public method.
21681         (Pending.ImplementIndexer): New public method.
21682         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
21683         This is used when implementing interface indexers to define a proxy
21684         if necessary.
21685         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
21686         define a proxy if necessary.
21687
21688         * interface.cs (Interface.IndexerName): New public variable.
21689         (Interface.PopulateIndexer): Set the IndexerName.
21690         (Interface.DefineIndexers): New private method.  Populate all the
21691         indexers and make sure their IndexerNames match.
21692
21693         * typemanager.cs (IndexerPropertyName): Added support for interface
21694         indexers.
21695
21696 2002-07-22  Martin Baulig  <martin@gnome.org>
21697
21698         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
21699         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
21700         ret if HasReturnLabel.
21701         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
21702         variables.
21703
21704         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
21705         and set the ec.LoopBeginTryCatchLevel.
21706         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
21707         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
21708         the current ec.TryCatchLevel, the branch goes out of an exception
21709         block.  In this case, we need to use Leave and not Br.
21710
21711 2002-07-22  Martin Baulig  <martin@gnome.org>
21712
21713         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
21714         block unless the block does not always return or it is contained in
21715         another try { ... } catch { ... } block.  Fixes bug #26506.
21716         Added verify-1.cs to the test suite.
21717
21718 2002-07-22  Martin Baulig  <martin@gnome.org>
21719
21720         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
21721         then we do not always return.  Fixes bug #24985.
21722
21723 2002-07-22  Martin Baulig  <martin@gnome.org>
21724
21725         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
21726         lookup on a per-class level; ie. walk up the class hierarchy until we
21727         found at least one applicable method, then choose the best among them.
21728         Fixes bug #24463 and test-29.cs.
21729
21730 2002-07-22  Martin Baulig  <martin@gnome.org>
21731
21732         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
21733         return types of the methods.  The return type is not part of the
21734         signature and we must not check it to make the `new' modifier work.
21735         Fixes bug #27999, also added test-147.cs.
21736         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
21737
21738         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
21739         on the method's return type.
21740
21741 2002-07-21  Martin Baulig  <martin@gnome.org>
21742
21743         * assign.cs: Make this work if the rightmost source is a constant and
21744         we need to do an implicit type conversion.  Also adding a few more tests
21745         to test-38.cs which should have caught this.
21746
21747         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
21748         target in the makefile for this.  The makefile.gnu is primarily intended
21749         for end-users who don't want to debug the compiler.
21750
21751 2002-07-21  Martin Baulig  <martin@gnome.org>
21752
21753         * assign.cs: Improved the Assign class so it can now handle embedded
21754         assignments (X = Y = Z = something).  As a side-effect this'll now also
21755         consume less local variables.  test-38.cs now passes with MCS, added
21756         a few new test cases to that test.
21757
21758 2002-07-20  Martin Baulig  <martin@gnome.org>
21759
21760         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
21761         instructions.  Fixes bug #27977, also added test-146.cs.
21762
21763 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21764
21765         * cs-tokenizer.cs: fixed getHex ().
21766
21767 2002-07-19  Martin Baulig  <martin@gnome.org>
21768
21769         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
21770         not Type.GetType() to lookup the array type.  This is needed when
21771         we're constructing an array of a user-defined type.
21772         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
21773         single-dimensional arrays, but also for single-dimensial arrays of
21774         type decimal.
21775
21776 2002-07-19  Martin Baulig  <martin@gnome.org>
21777
21778         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
21779         this function is called, it's not allowed to share LocalBuilders
21780         among ILGenerators.
21781
21782 2002-07-19  Martin Baulig  <martin@gnome.org>
21783
21784         * expression.cs (Argument.Resolve): Report an error 118 when trying
21785         to pass a type as argument.
21786
21787 2002-07-18  Martin Baulig  <martin@gnome.org>
21788
21789         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
21790         Conv_R_Un for the signed `long' type.
21791
21792 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
21793
21794         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
21795         `expr' for the temporary result, as that will fail if we do
21796         multiple resolves on the same expression.
21797
21798 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
21799
21800         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
21801         ec.TypeContainer for looking up aliases. 
21802
21803         * class.cs (TypeContainer): Remove LookupAlias from here.
21804
21805         * decl.cs (DeclSpace); Move here.
21806
21807 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
21808
21809         * class.cs (FindMembers): Only call filter if the constructor
21810         bulider is not null.
21811
21812         Also handle delegates in `NestedTypes' now.  Now we will perform
21813         type lookups using the standard resolution process.  This also
21814         fixes a bug.
21815
21816         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
21817         This uses Expressions (the limited kind that can be parsed by the
21818         tree) instead of strings.
21819
21820         * expression.cs (ComposedCast.ToString): Implement, used to flag
21821         errors since now we have to render expressions.
21822
21823         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
21824         FormArrayType. 
21825
21826         * ecore.cs (SimpleName.ToString): ditto.
21827
21828         * cs-parser.jay: Instead of using strings to assemble types, use
21829         Expressions to assemble the type (using SimpleName, ComposedCast,
21830         MemberAccess).  This should fix the type lookups in declarations,
21831         because we were using a different code path for this.
21832
21833         * statement.cs (Block.Resolve): Continue processing statements
21834         even when there is an error.
21835
21836 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
21837
21838         * class.cs (Event.Define): Also remove the `remove' method from
21839         the list of pending items.
21840
21841         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
21842         generate more compact code. 
21843
21844 2002-07-17  Martin Baulig  <martin@gnome.org>
21845
21846         * const.cs (Const.LookupConstantValue): Add support for constant
21847         `unchecked' and `checked' expressions.
21848         Also adding test case test-140.cs for this.
21849
21850 2002-07-17  Martin Baulig  <martin@gnome.org>
21851
21852         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
21853         check whether mi.ReturnType implements the IEnumerator interface; the
21854         `==' and the IsAssignableFrom() will fail in this situation.
21855
21856 2002-07-16  Ravi Pratap  <ravi@ximian.com>
21857
21858         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
21859         here too.
21860
21861 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
21862
21863         * expression.cs: fixed bug #27811.
21864
21865 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
21866
21867         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
21868         Molaro: when we are a ref, the value already contains a pointer
21869         value, do not take the address of it.
21870
21871 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
21872         * removed mb-parser.jay and mb-tokenizer.cs
21873
21874 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
21875
21876         * expression.cs: check against the building corlib void type.
21877
21878 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
21879
21880         * ecore.cs: fix for valuetype static readonly fields: when 
21881         initializing them, we need their address, not the address of a copy.
21882
21883 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
21884
21885         * typemanager.cs: register also enum_type in corlib.
21886
21887 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
21888
21889         * class.cs: allow calling this (but not base) initializers in structs.
21890
21891 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
21892
21893         * ecore.cs: make sure we compare against the building base types
21894         in GetTypeSize ().
21895
21896 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
21897
21898         * typemanager.cs: fix TypeToCoreType() to handle void and object
21899         (corlib gets no more typerefs after this change).
21900
21901 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
21902
21903         * expression.cs (ArrayCreation.EmitArrayArguments): use
21904         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
21905
21906         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
21907         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
21908         array indexes, the runtime actually forbids them.
21909
21910         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
21911         for array arguments here.
21912
21913         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
21914         instead of the default for ValueTypes.
21915
21916         (New.DoEmit): Use IsValueType instead of
21917         IsSubclassOf (value_type)
21918         (New.DoResolve): ditto.
21919         (Invocation.EmitCall): ditto.
21920
21921         * assign.cs (Assign): ditto.
21922
21923         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
21924         Statements *are* currently doing part of their resolution during
21925         Emit.  
21926
21927         Expressions do always resolve during resolve, but statements are
21928         only required to propagate resolution to their children.
21929
21930 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
21931
21932         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
21933
21934         (LoadAssembly): Do not add the dll if it is already specified
21935
21936         (MainDriver): Add the System directory to the link path at the end,
21937         after all the other -L arguments. 
21938
21939         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
21940         wrong opcode for loading bytes and bools (ldelem.i1 instead of
21941         ldelem.u1) and using the opposite for sbytes.
21942
21943         This fixes Digger, and we can finally run it.
21944
21945         * driver.cs (UnixParseOption): Move the option parsing here.  
21946         (CSCParseOption): Implement CSC-like parsing of options.
21947
21948         We now support both modes of operation, the old Unix way, and the
21949         new CSC-like way.  This should help those who wanted to make cross
21950         platform makefiles.
21951
21952         The only thing broken is that /r:, /reference: and /lib: are not
21953         implemented, because I want to make those have the same semantics
21954         as the CSC compiler has, and kill once and for all the confussion
21955         around this.   Will be doing this tomorrow.
21956
21957         * statement.cs (Unsafe.Resolve): The state is checked during
21958         resolve, not emit, so we have to set the flags for IsUnsfe here.
21959
21960 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
21961
21962         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
21963         not catch the Error_ObjectRefRequired in SimpleName (as it is
21964         possible to have a class/instance variable name that later gets
21965         deambiguated), we have to check this here.      
21966
21967 2002-07-10  Ravi Pratap  <ravi@ximian.com>
21968
21969         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
21970         make static and put into Expression.
21971
21972         (Event.Define): Register the private field of the event with the 
21973         TypeManager so that GetFieldFromEvent can get at it.
21974
21975         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
21976         keep track of the private field associated with an event which
21977         has no accessors.
21978
21979         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
21980         private field.
21981
21982         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
21983
21984 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
21985
21986         * expression.cs (Binary.EmitBranchable): this routine emits the
21987         Binary expression in a branchable context.  This basically means:
21988         we need to branch somewhere, not just get the value on the stack.
21989
21990         This works together with Statement.EmitBoolExpression.
21991
21992         * statement.cs (Statement.EmitBoolExpression): Use
21993         EmitBranchable. 
21994
21995 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
21996
21997         * statement.cs (For): Reduce the number of jumps in loops.
21998
21999         (For): Implement loop inversion for the For statement.
22000
22001         (Break): We can be breaking out of a Try/Catch controlled section
22002         (foreach might have an implicit try/catch clause), so we need to
22003         use Leave instead of Br.
22004
22005         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
22006         now).  If the instace expression supports IMemoryLocation, we use
22007         the AddressOf method from the IMemoryLocation to extract the
22008         address instead of emitting the instance.
22009
22010         This showed up with `This', as we were emitting the instance
22011         always (Emit) instead of the Address of This.  Particularly
22012         interesting when This is a value type, as we dont want the Emit
22013         effect (which was to load the object).
22014
22015 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
22016
22017         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
22018
22019         * statement.cs (Checked): Set the CheckedState during the resolve
22020         process too, as the ConvCast operations track the checked state on
22021         the resolve process, and not emit.
22022
22023         * cs-parser.jay (namespace_member_declaration): Flag that we have
22024         found a declaration when we do.  This is used to flag error 1529
22025
22026         * driver.cs: Report ok when we display the help only.
22027
22028 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
22029
22030         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
22031
22032 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
22033
22034         * cs-tokenizer.cs (define): We also have to track locally the
22035         defines.  AllDefines is just used for the Conditional Attribute,
22036         but we also need the local defines for the current source code. 
22037
22038 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
22039
22040         * statement.cs (While, For, Do): These loops can exit through a
22041         Break statement, use this information to tell whether the
22042         statement is the last piece of code.
22043
22044         (Break): Flag that we break.
22045
22046         * codegen.cs (EmitContexts): New `Breaks' state variable.
22047
22048 2002-07-03  Martin Baulig  <martin@gnome.org>
22049
22050         * class.cs (TypeContainer.MethodModifiersValid): Allow override
22051         modifiers in method declarations in structs.  Otherwise, you won't
22052         be able to override things like Object.Equals().
22053
22054 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
22055
22056         * class.cs (Method, Property, Indexer): Do not allow the public
22057         modifier to be used in explicit interface implementations.
22058
22059         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
22060         override modifiers in method declarations in structs
22061
22062 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
22063
22064         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
22065         integer or real overflow, report an error
22066
22067 2002-07-02  Martin Baulig  <martin@gnome.org>
22068
22069         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
22070         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
22071         to tell the runtime about our newly created System.Object and
22072         System.ValueType types.
22073
22074 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
22075
22076         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
22077         struct instead of Ldarg/Starg.
22078
22079 2002-07-02  Martin Baulig  <martin@gnome.org>
22080
22081         * expression.cs (Indirection.Indirection): Call
22082         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
22083
22084 2002-07-02  Martin Baulig  <martin@gnome.org>
22085
22086         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
22087         ValueType, call TypeManager.TypeToCoreType() on it.
22088         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
22089         the OpCodes.Newarr argument.
22090
22091 2002-07-02  Martin Baulig  <martin@gnome.org>
22092
22093         * expression.cs (Invocation.EmitCall): When compiling corlib,
22094         replace all calls to the system's System.Array type to calls to
22095         the newly created one.
22096
22097         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
22098         System.Array methods.
22099         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
22100         from the system's System.Array type which must be replaced.
22101
22102 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
22103
22104         * typemanager.cs: load unverifiable_code_ctor so we can build
22105         corlib using the correct type. Avoid using GetTypeCode() with
22106         TypeBuilders.
22107         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
22108         TypeManager.object_type to allow building corlib.
22109
22110 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
22111
22112         * ecore.cs: handle System.Enum separately in LoadFromPtr().
22113
22114 2002-07-01  Martin Baulig  <martin@gnome.org>
22115
22116         * class.cs: Make the last change actually work, we need to check
22117         whether `ifaces != null' to avoid a crash.
22118
22119 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
22120
22121         * class.cs: when we build structs without fields that implement
22122         interfaces, we need to add the interfaces separately, since there is
22123         no API to both set the size and add the interfaces at type creation
22124         time.
22125
22126 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
22127
22128         * expression.cs: the dimension arguments to the array constructors
22129         need to be converted if they are a long.
22130
22131 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
22132
22133         * class.cs: don't emit ldarg.0 if there is no parent constructor
22134         (fixes showstopper for corlib).
22135
22136 2002-06-29  Martin Baulig  <martin@gnome.org>
22137
22138         MCS now compiles corlib on GNU/Linux :-)
22139
22140         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
22141         ie. check for MethodImplOptions.InternalCall.
22142
22143         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
22144         and TypeManager.attribute_type are null, so we must explicitly check
22145         whether parent is not null to find out whether it's an attribute type.
22146         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
22147         and SetBuilder, not only if the property is neither abstract nor external.
22148         This is necessary to set the MethodImplOptions on the accessor methods.
22149         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
22150         SetBuilder, see Property.Emit().
22151
22152         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
22153         populate "System.Object", "System.ValueType" and "System.Attribute" since
22154         they've already been populated from BootCorlib_PopulateCoreTypes().
22155
22156 2002-06-29  Martin Baulig  <martin@gnome.org>
22157
22158         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
22159         is the NullLiteral, we also need to make sure that target_type is not
22160         an enum type.   
22161
22162 2002-06-29  Martin Baulig  <martin@gnome.org>
22163
22164         * rootcontext.cs (RootContext.ResolveCore): We must initialize
22165         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
22166         before calling BootstrapCorlib_ResolveDelegate ().
22167
22168 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
22169
22170         * statement.cs: fixed build-breaker. All tests passed ok.
22171
22172 2002-06-27  Martin Baulig  <martin@gnome.org>
22173
22174         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
22175         for System.Decimal when compiling corlib.
22176
22177 2002-06-27  Martin Baulig  <martin@gnome.org>
22178
22179         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
22180         switch blocks which contain nothing but a default clause.
22181
22182 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
22183
22184        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
22185
22186 2002-06-27  Martin Baulig  <martin@gnome.org>
22187
22188         * ecore.cs (PropertyExpr.PropertyExpr): Call
22189         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
22190
22191         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
22192         is already a TypeBuilder.
22193
22194 2002-06-27  Martin Baulig  <martin@gnome.org>
22195
22196         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
22197         `target_type == TypeManager.array_type', not IsAssignableFrom() in
22198         the "from an array-type to System.Array" case.  This makes it work
22199         when compiling corlib.
22200
22201 2002-06-27  Martin Baulig  <martin@gnome.org>
22202
22203         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
22204         non-static PropertyExpr, set its InstanceExpression.  This makes
22205         the `ICollection.Count' property work in System/Array.cs.
22206
22207 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
22208
22209         * driver.cs: Made error handling more consistent.  Errors now
22210         tracked by Report class, so many methods which used to return int
22211         now return void.  Main() now prints success/failure and 
22212         errors/warnings message.
22213
22214         Renamed '--probe' compiler argument to '--expect-error'.  Removed
22215         the magic number return values (123 and 124).  Now, if the
22216         expected error occurs, the compiler exits with success (exit value
22217         0).  If the compilation completes without seeing that particular
22218         error, the compiler exits with failure (exit value 1).  The
22219         makefile in mcs/errors has been changed to handle the new behaviour.
22220
22221         * report.cs: Made 'expected error' number a property and renamed
22222         it from 'Probe' to 'ExpectedError'.
22223
22224         * genericparser.cs: Removed error handling support, since it is
22225         now all done by Report class.
22226
22227         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
22228         class, so parse() no longer returns an int.
22229
22230         * namespace.cs: Use Report.Error instead of GenericParser.error
22231
22232 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
22233
22234         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
22235         TypeContainer.AddOperator): At the front of the list put the
22236         explicit implementations, so they get resolved/defined first. 
22237
22238 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
22239
22240         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
22241         interface type is implemented by this TypeContainer.  Used during
22242         explicit interface implementation.
22243
22244         (Property.Define, Indexer.Define, Method.Define): Validate that
22245         the given interface in the explicit implementation is one of the
22246         base classes for the containing type.
22247
22248         Also if we are explicitly implementing an interface, but there is
22249         no match in the pending implementation table, report an error.
22250
22251         (Property.Define): Only define the property if we are
22252         not explicitly implementing a property from an interface.  Use the
22253         correct name also for those properties (the same CSC uses,
22254         although that is really not needed).
22255
22256         (Property.Emit): Do not emit attributes for explicitly implemented
22257         properties, as there is no TypeBuilder.
22258
22259         (Indexer.Emit): ditto.
22260
22261         Hiding then means that we do not really *implement* a pending
22262         implementation, which makes code fail.
22263
22264 2002-06-22  Martin Baulig  <martin@gnome.org>
22265
22266         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
22267         the return value of Object.GetType().  [FIXME: we need to do this whenever
22268         we get a type back from the reflection library].
22269
22270 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
22271
22272         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
22273
22274 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
22275
22276         * attribute.cs: Return null if we can not look up the type.
22277
22278         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
22279         the interface types found.
22280
22281         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
22282         interface types found.
22283
22284         * typemanager.cs (GetInterfaces): Make this routine returns alll
22285         the interfaces and work around the lame differences between
22286         System.Type and System.Reflection.Emit.TypeBuilder in the results
22287         result for GetInterfaces.
22288
22289         (ExpandInterfaces): Given an array of interface types, expand and
22290         eliminate repeated ocurrences of an interface.  This expands in
22291         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
22292         be IA, IB, IC.
22293
22294 2002-06-21  Martin Baulig  <martin@gnome.org>
22295
22296         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
22297         on System.Enum.
22298
22299 2002-06-21  Martin Baulig  <martin@gnome.org>
22300
22301         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
22302         and called with one of the core types, return the corresponding typebuilder for
22303         that type.
22304
22305         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
22306         element type.
22307
22308 2002-06-21  Martin Baulig  <martin@gnome.org>
22309
22310         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
22311         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
22312         (Expression.ConvertReferenceExplicit): Likewise.
22313
22314         * expression.cs (ElementAccess.DoResolve): Likewise.
22315         (ElementAccess.DoResolveLValue): Likewise.
22316
22317 2002-06-10  Martin Baulig  <martin@gnome.org>
22318
22319         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
22320         add the "value" parameter to the parameter list.
22321
22322         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
22323         to our caller.
22324
22325 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
22326
22327         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
22328         the argument to an int, uint, long or ulong, per the spec.  Also
22329         catch negative constants in array creation.
22330
22331 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
22332
22333         * class.cs: do not allow the same interface to appear twice in
22334         the definition list.
22335
22336 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
22337
22338         * ecore.cs: don't use ldlen with System.Array.
22339
22340 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
22341
22342         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
22343
22344 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
22345
22346         * modifiers.cs: produce correct field attributes for protected
22347         internal. Easy fix so miguel can work on ther harder stuff:-)
22348
22349 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
22350
22351         * pending.cs: New file.  Move the code from class.cs here.
22352         Support clearning the pending flag for all methods (when not doing
22353         explicit interface implementation).
22354
22355 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
22356
22357         * rootcontext.cs: added a couple more types needed to bootstrap.
22358
22359 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
22360
22361         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
22362         constructor in the type, instead of any constructor in the type
22363         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
22364         a bug in the Mono runtime when applying the params attribute). 
22365
22366 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
22367         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
22368
22369 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
22370
22371         * expression.cs (Unary.ResolveOperator): Use TypeManager
22372         to resolve the type.
22373
22374 2002-06-13  Ravi Pratap  <ravi@ximian.com>
22375
22376         * cs-parser.jay (enum_member_declaration): Pass in the attributes
22377         attached.
22378
22379         * enum.cs (AddEnumMember): Add support to store the attributes associated 
22380         with each member too.
22381
22382         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
22383         field builders too - this takes care of the enum member case.
22384
22385 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
22386
22387         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
22388         address-of operator on both value types and pointers.
22389
22390 2002-06-10  Martin Baulig  <martin@gnome.org>
22391
22392         * interface.cs (Interface.PopulateIndexer): Add the indexer's
22393         PropertyBuilder to the `property_builders' list.
22394
22395         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
22396         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
22397         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
22398         find any indexers which are inherited from an interface.
22399
22400 2002-06-09  Martin Baulig  <martin@gnome.org>
22401
22402         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
22403         the same type as the constant if necessary.  There's also a test-130.cs
22404         for this.
22405
22406         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
22407
22408         * typemanager.cs (TypeManager.ChangeType): Previously known as
22409         Enum.ChangeEnumType().
22410
22411 2002-06-09  Martin Baulig  <martin@gnome.org>
22412
22413         * expression.cs (Cast.TryReduce): Added support for consts.
22414
22415 2002-06-08  Ravi Pratap  <ravi@ximian.com>
22416
22417         * class.cs (Accessor): Hold attributes information so we can pass
22418         it along.
22419
22420         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
22421         Modify to pass in attributes attached to the methods.
22422
22423         (add_accessor_declaration, remove_accessor_declaration): Ditto.
22424
22425         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
22426         to handle the Accessor kind :-)
22427
22428         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
22429
22430 2002-06-08  Martin Baulig  <martin@gnome.org>
22431
22432         * expression.cs (Unary.TryReduceNegative): Added support for
22433         ULongConstants.
22434
22435 2002-06-08  Martin Baulig  <martin@gnome.org>
22436
22437         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
22438         name can't be found in the `defined_names' - the caller will do a
22439         MemberLookup in this case and thus find methods in System.Enum
22440         such as Enum.IsDefined().
22441
22442 2002-06-08  Martin Baulig  <martin@gnome.org>
22443
22444         * enum.cs (Enum.ChangeEnumType): This is a custom version of
22445         Convert.ChangeType() which works with TypeBuilder created types.
22446         (Enum.LookupEnumValue, Enum.Define): Use it here.
22447
22448         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
22449         `TypeBuilder.BaseType != null' check.
22450         (TypeContainer.FindMembers): Only lookup parent members if we
22451         actually have a parent.
22452         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
22453         (ConstructorInitializer.Resolve): Likewise.
22454
22455         * interface.cs (Interface.FindMembers): Added
22456         `TypeBuilder.BaseType != null' check.
22457
22458         * rootcontext.cs (RootContext.ResolveCore): Added
22459         "System.Runtime.CompilerServices.IndexerNameAttribute" to
22460         classes_second_stage.
22461
22462         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
22463         debug_type and trace_type when compiling with --nostdlib.       
22464
22465 2002-06-07  Martin Baulig  <martin@gnome.org>
22466
22467         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
22468         (AddField): Set it to true when adding a non-static field.
22469         (DefineType): Use `have_nonstatic_fields' to find out whether we
22470         have non-static fields, not `Fields != null'.
22471
22472 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
22473
22474         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
22475         dereferencing a null on the static-field code path)
22476
22477 2002-05-30  Martin Baulig  <martin@gnome.org>
22478
22479         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
22480         to take command line arguments.  Use reflection to call the new
22481         custom `Initialize' function on the symbol writer and pass it the
22482         command line arguments.
22483
22484         * driver.cs (--debug-args): New command line argument to pass command
22485         line arguments to the symbol writer.
22486
22487 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
22488
22489         * assign.cs (DoResolve): Forgot to do the implicit conversion to
22490         the target type for indexers and properties.  Thanks to Joe for
22491         catching this.
22492
22493 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
22494
22495         * typemanager.cs (MethodFlags): returns the method flags
22496         (Obsolete/ShouldIgnore) that control warning emission and whether
22497         the invocation should be made, or ignored. 
22498
22499         * expression.cs (Invocation.Emit): Remove previous hack, we should
22500         not do this on matching a base type, we should do this based on an attribute
22501
22502         Only emit calls to System.Diagnostics.Debug and
22503         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
22504         on the command line.
22505
22506         * rootcontext.cs: Global settings for tracing and debugging.
22507
22508         * cs-tokenizer.cs (define): New utility function to track
22509         defines.   Set the global settings for TRACE and DEBUG if found.
22510
22511 2002-05-25  Ravi Pratap  <ravi@ximian.com>
22512
22513         * interface.cs (Populate*): Pass in the TypeContainer as well as
22514         the DeclSpace as parameters so that we can create EmitContexts and
22515         then use that to apply attributes etc.
22516
22517         (PopulateMethod, PopulateEvent, PopulateProperty)
22518         (PopulateIndexer): Apply attributes everywhere.
22519
22520         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
22521         etc.
22522
22523         (ApplyAttributes): Update accordingly.
22524
22525         We now apply interface attributes for all members too.
22526
22527 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
22528
22529         * class.cs (Indexer.Define); Correctly check if we are explicit
22530         implementation (instead of checking the Name for a ".", we
22531         directly look up if the InterfaceType was specified).
22532
22533         Delay the creation of the PropertyBuilder.
22534
22535         Only create the PropertyBuilder if we are not an explicit
22536         interface implementation.   This means that explicit interface
22537         implementation members do not participate in regular function
22538         lookups, and hence fixes another major ambiguity problem in
22539         overload resolution (that was the visible effect).
22540
22541         (DefineMethod): Return whether we are doing an interface
22542         implementation. 
22543
22544         * typemanager.cs: Temporary hack until we get attributes in
22545         interfaces (Ravi is working on that) and we get IndexerName
22546         support in interfaces.
22547
22548         * interface.cs: Register the indexers as properties.
22549
22550         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
22551         warning, I have verified that this is a bug in the .NET runtime
22552         (JavaScript suffers of the same problem).
22553
22554         * typemanager.cs (MemberLookup): When looking up members for
22555         interfaces, the parent of an interface is the implicit
22556         System.Object (so we succeed in searches of Object methods in an
22557         interface method invocation.  Example:  IEnumerable x;  x.ToString
22558         ()) 
22559
22560 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
22561
22562         * class.cs (Event): Events should also register if they do
22563         implement the methods that an interface requires.
22564
22565         * typemanager.cs (MemberLookup); use the new GetInterfaces
22566         method. 
22567
22568         (GetInterfaces): The code used to lookup interfaces for a type is
22569         used in more than one place, factor it here. 
22570
22571         * driver.cs: Track the errors at the bottom of the file, we kept
22572         on going.
22573
22574         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
22575         instance if the method we are calling is static!
22576
22577 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
22578
22579         * attribute.cs (ApplyAttributes): Make this function filter out
22580         the IndexerName attribute (as that attribute in reality is never
22581         applied) and return the string constant for the IndexerName
22582         attribute. 
22583
22584         * class.cs (TypeContainer.Emit): Validate that all the indexers
22585         have the same IndexerName attribute, and if so, set the
22586         DefaultName attribute on the class. 
22587
22588         * typemanager.cs: The return value might contain other stuff (not
22589         only methods).  For instance, consider a method with an "Item"
22590         property and an Item method.
22591
22592         * class.cs: If there is a problem with the parameter types,
22593         return. 
22594
22595 2002-05-24  Ravi Pratap  <ravi@ximian.com>
22596
22597         * ecore.cs (ImplicitConversionExists): Wrapper function which also
22598         looks at user defined conversion after making a call to 
22599         StandardConversionExists - we need this for overload resolution.
22600
22601         * expression.cs : Update accordingly the various method calls.
22602
22603         This fixes 2 bugs filed against implicit user defined conversions 
22604
22605 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
22606
22607         * statement.cs: Track the result of the assignment.
22608
22609 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
22610
22611         * expression.cs (MemberAccess): Improved error reporting for
22612         inaccessible members.
22613
22614 2002-05-22  Martin Baulig  <martin@gnome.org>
22615
22616         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
22617         itself with debugging support.
22618
22619 2002-05-22  Martin Baulig  <martin@gnome.org>
22620
22621         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
22622         Removed, this isn't needed anymore.
22623
22624 2002-05-20  Martin Baulig  <martin@gnome.org>
22625
22626         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
22627         be underlying type for an enum.
22628
22629 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
22630
22631         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
22632         that splits out the loading of just the core types.
22633
22634         * rootcontext.cs (ResolveCore): Split the struct resolution in
22635         two, so we can load the enumeration underlying types before any
22636         enums are used.
22637
22638         * expression.cs (Is): Bandaid until we fix properly Switch (see
22639         bug #24985 for details).
22640
22641         * typemanager.cs (ImplementsInterface): The hashtable will contain
22642         a null if there are no interfaces implemented.
22643
22644 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
22645
22646         * cs-parser.jay (indexer_declarator): It is fine to have array
22647         parameters
22648
22649 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22650
22651         * typemanager.cs: (RegisterBuilder): New function used to register
22652         TypeBuilders that implement interfaces.  Since
22653         TypeBuilder.GetInterfaces (as usual) does not work with lame
22654         Reflection.Emit. 
22655         (AddUserType): register interfaces.
22656
22657         (ImplementsInterface): Use the builder_to_ifaces hash if we are
22658         dealing with TypeBuilder.  Also, arrays are showing up as
22659         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
22660         methods can not be invoked on them!
22661
22662         * ecore.cs (ExplicitReferenceConversionExists): Made public.
22663         (ImplicitReferenceConversionExists): Split out from
22664         StandardConversionExists. 
22665
22666         * expression.cs (As): We were only implementing one of the three
22667         cases for the as operator.  We now implement them all.
22668         (Is): Implement the various other cases for Is as well.
22669
22670         * typemanager.cs (CACHE): New define used to control if we want or
22671         not the FindMembers cache.  Seems to have a negative impact on
22672         performance currently
22673
22674         (MemberLookup): Nested types have full acess to
22675         enclosing type members
22676
22677         Remove code that coped with instance/static returns for events, we
22678         now catch this in RealFindMembers.
22679
22680         (RealFindMembers): only perform static lookup if the instance
22681         lookup did not return a type or an event.  
22682
22683 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
22684
22685         * assign.cs (CompoundAssign): We pass more semantic information
22686         now to Compound Assignments than we did before: now we have all
22687         the information at hand, and now we resolve the target *before* we
22688         do the expression expansion, which allows the "CacheValue" method
22689         to have the effect we intended (before, a [x] += 1 would generate
22690         two differen ArrayAccess expressions from the ElementAccess,
22691         during the resolution process).
22692
22693         (CompoundAssign.DoResolve): Resolve target and original_source here.
22694
22695 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
22696
22697         * expression.cs (ArrayAccess): dropped debugging information. 
22698
22699         * typemanager.cs: Small bug fix: I was always returning i_members,
22700         instead of one of i_members or s_members (depending on which had
22701         the content).
22702
22703         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
22704         method is invoked before any code generation takes place, and it
22705         is a mechanism to inform that the expression will be invoked more
22706         than once, and that the method should use temporary values to
22707         avoid having side effects
22708
22709         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
22710
22711         * ecore.cs (Expression.CacheTemporaries): Provide empty default
22712         implementation.
22713
22714         * expression.cs (Indirection, ArrayAccess): Add support for
22715         CacheTemporaries in these two bad boys. 
22716
22717         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
22718         ldobj or ldind_ref.  
22719         (StoreFromPtr): Handle stobj as well.
22720
22721         * expression.cs (UnaryMutator): Share more code.
22722
22723         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
22724         down: I was not tracking the Filter function as well, which
22725         was affecting the results of the cache.
22726
22727 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
22728
22729         * attribute.cs: Remove the hack to handle the CharSet property on
22730         StructLayouts. 
22731
22732 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
22733
22734         * attribute.cs (DoResolve): More uglyness, we now only try to
22735         resolve the attribute partially, to extract the CharSet
22736         information (only if we are a StructLayout attribute).  Otherwise 
22737
22738         (GetExtraTypeInfo): Add some code to conditionally kill in the
22739         future this.   I am more and more convinced that the .NET
22740         framework has special code to handle the attribute setting on
22741         certain elements.
22742
22743         * expression.cs (IsParamsMethodApplicable): Revert my previous
22744         foreach change here, it was wrong.
22745
22746 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
22747
22748         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
22749         (pp_expr): do not abort on unknown input, just return.
22750         (eval): abort if there are pending chars.
22751
22752         * attribute.cs (Attribute.Resolve): Positional parameters are
22753         optional.  Deal with that case.
22754
22755         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
22756         the Ansi/Unicode/Auto information for the type.
22757
22758         (TypeContainer.DefineType): instantiate the EmitContext here, as
22759         we will be using it during the type definition (to resolve
22760         attributes) and during the emit phase.
22761
22762         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
22763         to pull type information out of the attributes
22764
22765         (Attribute.Resolve): track the constructor builder, and allow for
22766         multiple invocations (structs and classes will use this).
22767
22768         * ecore.cs (MemberLookupFinal): new version with all the
22769         parameters customizable.
22770
22771         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
22772         constructors.  Return if the result value is null (as the error
22773         would have been flagged already by MemberLookupFinal)
22774
22775         Do not allow instances of abstract classes or interfaces to be
22776         created.
22777
22778         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
22779         We have to compare the assembly property here when dealing with
22780         FamANDAssem and Assembly access modifiers, because we might be
22781         creating an assembly from *modules* (that means that we are not
22782         getting TypeBuilders for types defined in other modules that are
22783         part of this assembly).
22784
22785         (Method.Emit): If the method is marked abstract and has a body,
22786         emit an error. 
22787
22788         (TypeContainer.DefineMembers): If both the defined member and the
22789         parent name match are methods, then do not emit any warnings: let
22790         the Method.Define routine take care of flagging warnings.  But if
22791         there is a mismatch (method overrides something else, or method is
22792         overriwritten by something, then emit warning).
22793
22794         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
22795         set to null, this means `do not check for the return type on the
22796         signature'. 
22797
22798         (Method.Define): set the return type for the method signature to
22799         null, so that we get methods with the same name and parameters and
22800         different return types.  This is used to flag warning 114 (you are
22801         hiding a method, and you probably want to use the new/override
22802         keywords instead).
22803
22804         * typemanager.cs (MemberLookup): Implemented proper access
22805         control, closing a long standing set of bug reports.  The problem
22806         was that the Framework only has two bits: Public and NonPublic,
22807         and NonPublic includes private and protected methods, but we need
22808         to enforce the FamANDAssem, FamOrAssem and Family. 
22809
22810 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
22811
22812         * statement.cs (GotoCase): Return true: Ammounts to giving up
22813         knowledge on whether we return or not, and letting the other case
22814         be responsible for it.
22815
22816 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
22817
22818         * driver.cs: Do not load directories for each file processed, only
22819         do it if there is a pattern.
22820
22821         * ecore.cs: Report readonly assigns here as well, as we might have
22822         been resolved only by MemberAccess.
22823
22824         (SimpleName.SimpleNameResolve): Also be useful for LValue
22825         resolution.   We need this to propagate assign to local readonly variables
22826
22827         * typemanager.cs: Use a ptrhashtable for the criteria, because we
22828         do not want to reuse potential criteria memory.
22829
22830         * class.cs (MyEventBuilder): Set reflected_type;
22831
22832         * ecore.cs (Constantify): Added support for constifying bools.
22833
22834         (RootContext.LookupType): Added a cache for values looked up in
22835         the declaration space.
22836
22837         * typemanager.cs (FindMembers): Now is a front-end to
22838         RealFindMembers, and provides a two-level hashtable-based cache to
22839         the request.  
22840
22841         15% performance improvement: from 22.5 to 19.2 seconds.
22842
22843         * expression.cs (IsParamsMethodApplicable): use foreach.
22844         (Invocation.DoResolve): ditto.
22845         (New.DoResolve): ditto.
22846         (ArrayCreation.DoResolve): ditto.
22847
22848         * ecore.cs (FindMostEncompassingType): use foreach.
22849
22850         * delegate.cs (NewDelegate.DoResolve): Use foreach
22851
22852         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
22853         (RemoveMethods): use foreach.
22854
22855         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
22856         nested foreach statements instead of for, and also break out of
22857         the inner loop once a match is found.
22858
22859         (Invocation.OverloadResolve): Use foreach, simplify the code. 
22860
22861 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
22862
22863         * cfold.cs (BinaryFold): During an enumeration evaluation context,
22864         we actually unwrap the expression to allow for extra information
22865         to be extracted. 
22866
22867         * expression.cs: Use Shr_Un on unsigned operations. 
22868
22869 2002-05-08  Ravi Pratap  <ravi@ximian.com>
22870
22871         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
22872         applicable operators was not being considered correctly. This closes
22873         the bug Miguel reported.
22874
22875 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
22876
22877         * attribute.cs: check that the type derives from System.Attribute
22878         and report the correct error in that case (moved the duplicate code to
22879         its own method, too).
22880
22881 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
22882
22883         * attribute.cs: lookup attribute type name as the spec says: first the
22884         bare attribute name and then name + "Attribute" (nant compiles with
22885         mcs after this fix).
22886
22887 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
22888
22889         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
22890         Because of the way we parse things, we should try to see if a
22891         UIntConstant can fit in an integer.
22892
22893 2002-05-07  Ravi Pratap  <ravi@ximian.com>
22894
22895         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
22896         when we are in an explicit context.
22897
22898         (ConvertReferenceExplicit): When converting from Iface type S to Class
22899         T make sure the rules are implemented as an OR.
22900
22901         * parameter.cs (ParameterType): Make it a property for now although the
22902         purpose really isn't anything immediate.
22903
22904         * expression.cs (Is*Applicable): Do better checking on the parameter type
22905         of a ref/out parameter. The ones from the system assemblies are already 
22906         marked with the correct type so we don't need to do any correction.
22907
22908         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
22909         the object type is standard too so include that.
22910
22911 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
22912
22913         * ecore.cs (StandardConversionExists): Augment with missing code:
22914         deal with IntConstant, LongConstants and Enumerations.
22915
22916         * assign.cs: Report the error, instead of failing silently
22917
22918         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
22919         typecontainer that they are declared, because the
22920         typecontainer/namespace will have the list of using clauses that
22921         need to be applied.
22922
22923         Assembly Attributes were escaping the normal registration
22924         mechanism. 
22925
22926         (EmitCode): Apply attributes within an EmitContext that represents
22927         the container they were declared on.
22928
22929         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
22930
22931 2002-05-06  Ravi Pratap  <ravi@ximian.com>
22932
22933         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
22934         Revamp completely - make much cleaner as we now operate only
22935         on a set of Types.
22936
22937         (FindMostSpecificSource, FindMostSpecificTarget): New methods
22938         to implement the logic detailed in the spec more correctly.
22939
22940         (UserDefinedConversion): Update accordingly.
22941
22942 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
22943
22944         * statement.cs: Return flow analysis information up.
22945
22946         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
22947         and the default.
22948
22949         (token): Do not consume an extra character before calling
22950         decimal_digits.
22951
22952 2002-05-06  Piers Haken <piersh@friskit.com>
22953
22954         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
22955
22956 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
22957
22958         * class.cs (Constructor.Emit): Set the IsStatic flag in the
22959         EmitContext during the instance constructor initializer
22960         resolution, to stop access to instance variables.
22961
22962         This is mandated by the spec, last paragraph of the `constructor
22963         initializers' section. 
22964
22965 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
22966
22967         * cs-parser.jay, class.cs (Accessor): new class used to represent
22968         an accessor (get or set).  In the past we used `null' to represent
22969         a missing accessor.  But this is ambiguous because there was no
22970         way to tell in abstract indexers/properties if one of them was
22971         specified.
22972
22973         Now there is a way of addressing that.
22974
22975         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
22976         instead of FindMembers.
22977
22978         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
22979         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
22980
22981         * attribute.cs: Treat indexers and properties as the same in terms
22982         of applying attributes
22983
22984         * ecore.cs (FindMostEncompassedType): Use statically initialized
22985         EmptyExpressions()s like we do elsewhere to avoid creating useless
22986         objects (and we take this out of the tight loop).
22987
22988         (GetConversionOperators): Move the code to extract the actual
22989         operators to a separate routine to clean things up.
22990
22991 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
22992
22993         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
22994         events are always registered FieldBuilders.
22995
22996         * class.cs (FieldBase): New class shared by Fields 
22997
22998         * delegate.cs: If we are a toplevel delegate, use our full name.
22999         If we are a nested delegate, then only use our tail name.
23000
23001 2002-05-02  Ravi Pratap  <ravi@ximian.com>
23002
23003         * expression.cs (IsApplicable): Ensure that we add the "&" to
23004         ref/out types before comparing it with the type of the argument.
23005
23006         (IsParamsMethodApplicable): Ditto.
23007
23008         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
23009         silly me ;-)
23010
23011         * delegate.cs : Handle the case when we have more than one applicable
23012         method. Flag an error only when we finish checking all.
23013
23014 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
23015
23016         * expression.cs: Add support for boolean static initializers.
23017
23018 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
23019
23020         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
23021
23022         * parameter.cs (ComputeParameterTypes,
23023         ComputeAndDefineParameterTypes): Better error handling: now we
23024         clear the `types' cache if we fail during any of the type lookups.
23025         We also return the status code correctly to our caller
23026
23027         * delegate.cs: If we fail to define a delegate, abort the extra
23028         steps. 
23029
23030         * expression.cs (Binary.ResolveOperator): for
23031         operator==(object,object) and operator !=(object, object) we also
23032         have to verify that there is an implicit conversion from one to
23033         the other.
23034
23035         (ArrayAccess.DoResolve): Array Access can operate on
23036         non-variables. 
23037
23038 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
23039
23040         * assign.cs (CompoundAssign): A new class used as a "flag" that
23041         the assignment actually is happening as part of a compound
23042         assignment operator.
23043
23044         During compound assignment, a few new rules exist to enable things
23045         like:
23046
23047         byte b |= 1 + 2
23048
23049         From the spec:
23050
23051         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
23052         to the type of x) if y is implicitly convertible to the type of x,
23053         and the operator is a builtin operator and the return type of the
23054         operator is explicitly convertible to the type of x. 
23055
23056         * rootcontext.cs: Reset warning level to 2.  4 catches various
23057         "interesting" features in mcs, we must clean this up at some
23058         point, but currently am trying to kill other bugs ;-)
23059
23060         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
23061         in container classes as well.  
23062
23063         * expression.cs (Binary.ResolveOperator): Handle string case
23064         before anything else (as operator overloading does emit an error
23065         before doing anything else).
23066
23067         This code could go away when we move to a table driven model, but
23068         i could not come up with a good plan last night.
23069
23070 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
23071
23072         * typemanager.cs (CSharpName): reimplementation using regex.
23073         * class.cs: added null check for fields in Emit
23074         * rootcontext.cs: set warninglevel to 4
23075
23076 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
23077
23078         * typemanager.cs (CSharpName): reimplemented with Lupus
23079         suggestion.
23080
23081 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
23082
23083         * statement.cs (If): correclty implement Resolve, because we were
23084         not catching sem errors in there.  The same process is needed
23085         everywhere else. 
23086         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
23087
23088
23089         (Statement.Warning_DeadCodeFound): Factorize code.
23090         (While): Report dead code here too.
23091
23092         (Statement): Added Resolve virtual method to allow
23093         for resolution split from the emit code.
23094
23095 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23096
23097         * statement.cs (EmitBoolExpression): No longer try to resolve the
23098         expression here.    
23099         (MakeBoolean): New utility function that resolve, implicitly
23100         converts to boolean and tags the expression. 
23101
23102
23103         (If, Do): Implement dead code elimination.
23104         (While): Implement loop inversion
23105
23106         (Do, While, For, If): Resolve the expression prior to calling our
23107         code generation.
23108
23109 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
23110
23111         * class.cs:
23112           - added method Report28 (warning: program has more than one entry point)
23113           - added method IsEntryPoint, implements paragraph 10.1 of the spec
23114           - modified method Method.Define, the part at the end of the method
23115
23116         * rootcontext.cs: added static public Location EntryPointLocation;
23117           
23118         * ../errors/cs0028.cs : Add test case for the above warning.              
23119
23120         * typemanager.cs:
23121           - modified method CSharpName to allow arrays of primitive type to
23122             be printed nicely (e.g. instead of System.Int32[][] it now prints
23123             int[][])
23124           - added method CSharpSignature: returns the signature of a method
23125             in string format to be used in reporting errors, warnings, etc.
23126
23127         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
23128         with String.Empty.
23129
23130 2002-04-26  Ravi Pratap  <ravi@ximian.com>
23131
23132         * delegate.cs (Define): Fix extremely silly bug where I was
23133         setting the type of the 'object' parameter of the BeginInvoke
23134         method to System.IAsyncResult instead of System.Object ;-)
23135
23136 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
23137
23138         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
23139         here. 
23140
23141         (Constructor.Emit): return if we fail to initialize the
23142         constructor.  Another door closed!  
23143
23144         * expression.cs (New.DoResolve): Improve error message (from -6 to
23145         1501).  Use DeclaredOnly lookup to find the exact constructor.
23146
23147         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
23148         loop.  This is useful.
23149
23150         * cs-parser.jay: Adjust the default parameters so that destructors
23151         have the proper signature.
23152
23153 2002-04-26  Martin Baulig  <martin@gnome.org>
23154
23155         * driver.cs (LoadAssembly): If `assembly' contains any characters
23156         which are only valid in path names and not in assembly names
23157         (currently slash, backslash and point), use Assembly.LoadFrom ()
23158         instead of Assembly.Load () on the `assembly' (before iteration
23159         over the link_paths).
23160
23161 2002-04-26  Martin Baulig  <martin@gnome.org>
23162
23163         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
23164
23165 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
23166
23167         * class.cs (Property): use the new typemanager.MemberLookup
23168
23169         (TypeContainer.MemberLookup): Implement using the
23170         TypeManager.MemberLookup now. 
23171
23172         * typemanager.cs: Make MemberLookup a function of the TypeManager,
23173         and return MemberInfos, so that these can be used without an
23174         EmitContext (what we had before).
23175
23176 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
23177
23178         * expression.cs: Fix the case where the argument to params if the
23179         type of the params.  I omitted handling this before.   Fixed
23180
23181 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23182
23183         * driver.cs: Call BootCorlib_PopulateCoreType
23184
23185         * class.cs (Property.CheckBase): Check for properties only, not
23186         for all members. 
23187
23188         * interface.cs: Temporary hack: try/catch around the
23189         CustomAttributeBuilder, because I am getting an exception that I
23190         do not understand.
23191
23192         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
23193         types whose definitions are required to be there (attributes are
23194         defined before standard types).
23195
23196         Compute definitions as we boot the various types, as they are used
23197         immediately (value_type class will need object_type, but if we do
23198         not initialize object_type, we will pass a null, which will let
23199         the runtime pick the System.Object from the existing corlib, which
23200         is not what we want).
23201
23202 2002-04-22  Patrik Torstensson <totte@labs2.com>
23203
23204         * cs-tokenizer.cs: fixed a number of trim() issues.
23205
23206 2002-04-22  Ravi Pratap  <ravi@ximian.com>
23207
23208         * expression.cs (Argument.Type): Ensure that we return the correct
23209         type when we have out or ref parameters [in which case we 
23210         append a "&"].
23211
23212 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
23213
23214         * class.cs (Property, Indexer): Allow extern modifier in there. 
23215
23216         * typemanager.cs (InitBaseTypes): Initializes object_type and
23217         value_type, since those will be used early on during the bootstrap
23218         process to compile corlib.
23219
23220         (InitCoreTypes): Move code from here to InitBaseTypes.
23221
23222 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
23223
23224         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
23225         single-dimension arrays as using the ldlen opcode.  
23226
23227         Daniel Lewis discovered this optimization.  
23228
23229         * typemanager.cs: Add signature for System.Array::get_Length
23230
23231 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23232
23233         * statement.cs: report the error when the foreach does not apply to an
23234         array nor a collection.
23235
23236 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
23237
23238         * expression.cs: Add implicit conversions to the operator ~.
23239
23240         * constant.cs (DecimalConstant.Emit): Emit decimal value.
23241
23242         * typemanager.cs: Locate the decimal constructor.
23243
23244 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23245
23246         * attribute.cs: use the new property of TypeOf.
23247         * expression.cs: added 'get' property around typearg.
23248
23249         These changes fix a build breaker reported by NickD. Is this the
23250         correct way to fix?  If not, please, revert my changes and make it
23251         work :-).
23252
23253 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
23254
23255         * attribute.cs: Add support for typeof in attribute invocations.
23256         I am not sure that this is right though.
23257
23258 2002-04-14  Duncan Mak  <duncan@ximian.com>
23259
23260         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
23261         Binary.Operator.Division case.
23262
23263 2002-04-13  Ravi Pratap  <ravi@ximian.com>
23264
23265         * class.cs (DefineType): Ensure that we do a proper check on
23266         attribute types and also register it with the TypeManager.
23267
23268         (TypeContainer.Targets): The default for attribute types is
23269         AttributeTargets.All.
23270
23271         * attribute.cs (ApplyAttributes): Registering the attribute type
23272         is done elsewhere, not when we discover we have a Usage attribute.
23273
23274 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23275
23276         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
23277         and get rid of is_delegate parameter.
23278
23279         * everywhere : update.
23280
23281 2002-04-12  Ravi Pratap  <ravi@ximian.com>
23282
23283         * cs-parser.jay (compilation_unit): Revamp completely to use
23284         some new ideas that I got from Rhys' grammar to solve the problems
23285         with assembly level attributes.
23286
23287         (outer_declaration): New grammar production.
23288
23289         (attribute_sections): Add.
23290
23291         (opt_attributes): Base on attribute_sections
23292
23293         (namespace_declaration): Allow opt_attributes to tackle the case
23294         when we have assembly level attributes - we are clever in this
23295         regard now ;-)
23296
23297         * attribute.cs (ApplyAttributes): Do not worry about assembly 
23298         attributes in the non-global context.
23299
23300         * rootcontext.cs (AddGlobalAttributes): Go back to using this
23301         instead of SetGlobalAttributes.
23302
23303         * class.cs, rootcontext.cs : Ensure we define and generate 
23304         attribute types before anything else.
23305
23306         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
23307         and flag the new error -20 for the case when the attribute type
23308         does not have valid targets specified. csc does not catch this.
23309
23310         * ../errors/errors.txt : update for error # -20
23311
23312 2002-04-11  Ravi Pratap  <ravi@ximian.com>
23313
23314         * support.cs (InternalParameters.ParameterModifier): Do some null
23315         checking and return sane values.
23316
23317         * class.cs (Method.Define): If we are a PInvoke method, ensure
23318         that we are static and extern. Report error # 601
23319
23320         * ../errors/cs0601.cs : Add test case for the above error.
23321
23322 2002-04-07  Ravi Pratap  <ravi@ximian.com>
23323
23324         * rootcontext.cs (attribute_types): We need to keep type of
23325         all attribute types separately and emit code for them first.
23326
23327         (RegisterAttribute) : Implement.
23328
23329         * class.cs (DefineType): Check if the current Type is a custom
23330         attribute type and register it accordingly.
23331
23332         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
23333         adding the first attribute twice and rename to
23334
23335         (SetGlobalAttributes): this.
23336
23337         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
23338         lookups.
23339
23340         * attribute.cs (ApplyAttributes): Take an additional argument telling us
23341         if we are processing global arguments. Hmm, I am unsure of this.
23342
23343 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
23344
23345         * expression.cs: added static array of strings to avoid calling
23346         Enum.ToString () for Operator in Binary. Significant recover of
23347         performance.
23348
23349 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
23350
23351         * class.cs (FindMembers): Allow the Builders of the various
23352         members to be null.  If they are skip them.  This only happens
23353         during the PInvoke declaration.
23354
23355 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
23356
23357         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
23358         failure, so we do not keep going afterwards.
23359
23360         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
23361         wanted to pass `false' as the `is_delegate' argument.  If this is
23362         the case, why not use delegate_type == null to mean `is_delegate =
23363         false' and anything else as is_delegate = true.
23364
23365 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
23366
23367         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
23368         code for the section, not the beginning of the tests.
23369
23370 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
23371
23372         * cfold.cs: Handle operator + (Enum x, Underlying x) 
23373
23374         * expression.cs (Binary): same.  Warn about errors where we have
23375         Enum/Enum in operator + as well.
23376
23377 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
23378
23379         * statement.cs:
23380                 - added support for switch(bool)
23381                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
23382                 - add TableSwitchEmit() to handle table-based switch statements
23383
23384 2002-04-05  Ravi Pratap  <ravi@ximian.com>
23385
23386         * expression.cs (Invocation.OverloadResolve): Factor out code which
23387         does parameter compatibility checking with arguments so that we can 
23388         re-use the code even from Delegate.VerifyApplicability
23389
23390         (VerifyArgumentsCompat): Move above code here.
23391
23392         * delegate.cs (VerifyApplicability): Get rid of duplicate code
23393         and instead make a call to the above method.
23394
23395 2002-03-31  Ravi Pratap  <ravi@ximian.com>
23396
23397         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
23398         We use it to keep track of classes which are attribute types.
23399
23400 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
23401
23402         * delegate.cs (Delegate.Define): Correctly define the types in the
23403         presence of fixed and array parameters.
23404
23405         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
23406         doing FindMembers.
23407
23408         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
23409         include NonPublic after the first iteration.
23410
23411         * class.cs (Indexer.CheckBase): Only check if both parents are
23412         non-null. 
23413
23414         * cs-parser.jay (accessor_body): If empty, set to null.
23415
23416         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
23417         same code path here to resolve constants names that we did have in
23418         MemberAccess.DoResolve.  There is too much code duplicated here.
23419
23420 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
23421
23422         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
23423
23424         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
23425         to MakeUnionSet.
23426
23427         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
23428         tokens, numbers and strings.
23429
23430         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
23431         parenthesis.
23432
23433         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
23434         asyncronous parameters and the regular parameters.  
23435
23436         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
23437         specify the target directory.
23438
23439         * expression.cs: (This.DoResolve): Simplify
23440         (As.Emit): Optimize, do not generate IsInst if the expression is
23441         always of the given type.
23442
23443         (Is.DoResolve): Bug fix, we were reporting both always/never for
23444         the is expression.
23445
23446         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
23447         creating too many unnecessary arrays.
23448
23449 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
23450
23451         * class.cs (EmitFieldInitializer): Use Assign expression to assign
23452         fields instead of rolling our own initializer.   Takes care of all
23453         implicit conversions, and drops unnecessary static checks/argument.
23454
23455 2002-03-31  Dick Porter  <dick@ximian.com>
23456
23457         * driver.cs: use the GetDirectories() return values properly, and
23458         use "/" as path separator.
23459
23460 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
23461
23462         * expression.cs (Unary): Optimize - - expr into expr.
23463         (Binary): Optimize a + (-b) into a -b.
23464
23465         * codegen.cs (CodeGen): Made all methods static.
23466
23467 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
23468
23469         * rootcontext.cs: 
23470
23471         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
23472         TypeBuilder property.
23473
23474         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
23475         instead. 
23476
23477         * tree.cs: Removed the various RecordXXXX, and replaced with a
23478         single RecordDecl.  Removed all the accessor methods, and just
23479         left a single access point Type 
23480
23481         * enum.cs: Rename DefineEnum to DefineType.
23482
23483         * decl.cs: New abstract method `DefineType' used to unify the
23484         Defines for Enumerations, Interfaces, TypeContainers and
23485         Delegates.
23486
23487         (FindType): Moved LookupInterfaceOrClass here.  Moved the
23488         LookupBaseClasses method that used to live in class.cs and
23489         interface.cs here, and renamed to FindType.
23490
23491         * delegate.cs: Implement DefineType.  Take advantage of the
23492         refactored pattern for locating the parent builder without taking
23493         the parent_builder argument (which we know does not work if we are
23494         nested, and triggering a toplevel definition).
23495
23496 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23497
23498         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
23499         accessibility of a member has changed during override and report
23500         an error if so.
23501
23502         * class.cs (Method.Define, Property.Define): Only complain on
23503         overrides if the method is private, any other accessibility is
23504         fine (and since we just checked the permission is the same, we are
23505         good to go).
23506
23507         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
23508         and elif are processed always.  The other pre-processing
23509         directives are only processed if we are "taking" the path
23510
23511 2002-03-29  Martin Baulig  <martin@gnome.org>
23512
23513         * class.cs (Method.Emit): Only emit symbolic debugging info if the
23514         current location is not Null.
23515
23516         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
23517         a separate method so we can profile it.
23518
23519         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
23520         `span.Seconds' are just seconds, but no minutes or hours.
23521         (MainDriver): Profile the CodeGen.SaveSymbols calls.
23522
23523 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23524
23525         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
23526         Remove the gratuitous set of Final:
23527
23528                                 // If an interface implementation, then we can set Final.
23529                                 if (((flags & MethodAttributes.Abstract) == 0) &&
23530                                     implementing.DeclaringType.IsInterface)
23531                                         flags |= MethodAttributes.Final;
23532
23533         I do not know what I was smoking when I used that.
23534
23535
23536         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
23537         step into fixing the name resolution issues for delegates and
23538         unifying the toplevel name resolution.
23539
23540 2002-03-28  Martin Baulig  <martin@gnome.org>
23541
23542         * class.cs (Method.Emit): If we have a symbol writer, call its
23543         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
23544         tell it about the current method.
23545
23546         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
23547         writer that we're going to emit the first byte of IL code for a new
23548         statement (a new source line).
23549         (EmitContext.EmitTopBlock): If we have a symbol writer, call
23550         EmitContext.Mark() before emitting any code.
23551
23552         * location.cs (SymbolDocument): Return null when we're Null.
23553
23554         * statement.cs (Statement): Moved the `Location loc' variable here.
23555         (Statement.EmitBoolExpression): If we have a symbol writer, call
23556         ec.Mark() before emitting any code to tell it that we're at the
23557         beginning of a new statement.
23558         (StatementExpression): Added `Location' argument to the constructor.
23559         (Block): Added public readonly variable `StartLocation' and public
23560         variable `EndLocation'.  The latter is to be set using SetEndLocation().
23561         (Block): Added constructor which takes a start and end location.
23562         (Block.SetEndLocation): New method. This sets the end location.
23563         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
23564         local variables we create.
23565         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
23566         each statement and do also mark the begin and end of the block.
23567
23568         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
23569         tell it the current lexer.Location, use Location.Null for the end of the
23570         block.
23571         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
23572         current block, set its end location using SetEndLocation().
23573         (statement_expression): StatementExpression constructor now takes the
23574         lexer.Location as additional argument.
23575         (for_statement, declare_local_variables): Likewise.
23576         (declare_local_variables): When creating a new implicit block, use the
23577         new Block constructor and pass it the lexer.Location.
23578
23579 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
23580
23581         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
23582         members also on the parent interfaces recursively.
23583
23584 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
23585
23586         * report.cs: Use new formats, since Gonzalo finished the missing
23587         bits. 
23588
23589         * expression.cs (Binary.ResolveOperator): added missing operator|
23590         operator& and operator^ for bool/bool.
23591
23592         * cs-parser.jay: CheckDef now takes a Location argument that is
23593         used to report errors more precisly (instead of reporting the end
23594         of a definition, we try to track something which is a lot closer
23595         to the source of the problem).
23596
23597         * cs-tokenizer.cs: Track global token use, so we can properly flag
23598         the use of #define/#undef after the first token has been seen.
23599
23600         Also, rename the reportXXXX to Error_DescriptiveName
23601
23602         * decl.cs (DeclSpace.IsTopLevel): Move property here from
23603         TypeContainer, so that Enum and Interface can use this too.
23604
23605         * class.cs (TypeContainer.LookupInterfaceOrClass,
23606         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
23607         `builder' argument.  Typically this was used to pass the parent
23608         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
23609         the definition).  
23610
23611         The problem is that a nested class could trigger the definition of
23612         a toplevel class, and the builder would be obviously wrong in that
23613         case. 
23614
23615         So we drop this argument, and we compute dynamically the
23616         TypeBuilder/ModuleBuilder (the correct information was available
23617         to us anyways from DeclSpace.Parent)
23618
23619         * interface.cs (Interface.DefineInterface): Drop builder
23620         parameter cleanup like class.cs
23621
23622         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
23623         like class.cs
23624
23625         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
23626         values. 
23627
23628         (Try.Emit): Propagate the returns value from the statement.
23629
23630         (Return.Emit): Even if we are leavning 
23631
23632         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
23633
23634         * modifiers.cs: Fix the computation of MethodAttributes flags.
23635
23636 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
23637
23638         * driver.cs: allow compilation of files that start with '/'.
23639         Add a default case when checking the argument of --target.
23640
23641 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
23642
23643         * interface.cs: Implement the same search algorithm for types in
23644         the interface code.
23645
23646         * delegate.cs: Do not allow multiple definition.
23647
23648         * Recovered ChangeLog that got accidentally amputated
23649
23650         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
23651
23652         * rootcontext.cs: Load manually enum to allow core classes to
23653         contain enumerations.
23654
23655         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
23656         Update to new static methods in TypeManager.
23657
23658         * typemanager.cs (GetMethod, GetConstructor): Use our
23659         implementation of FindMembers to find the members, since during
23660         corlib compilation, the types are TypeBuilders and GetMethod and
23661         GetConstructor do not work.
23662
23663         Make all methods in TypeManager static.
23664
23665         (InitCodeHelpers): Split the functionality from
23666         the InitCodeTypes function.
23667
23668         * driver.cs: Call InitCodeHelpers after we have populated the
23669         types. 
23670
23671         * cs-parser.jay (delegate_declaration): we did not used to compute
23672         the delegate name correctly for void delegates.
23673
23674 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
23675
23676         * rootcontext.cs (RootContext): Init the interface_resolve_order
23677         and type_container_resolve_order always.
23678
23679         (ResolveCore, BootstrapCorlib_ResolveClass,
23680         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
23681         compiler when compiling with --nostdlib
23682
23683         * class.cs (TypeContainer.DefineType): Check that our parent is
23684         not null.  This test is most important when we are bootstraping
23685         the core types.
23686
23687         * codegen.cs: Split out the symbol writing code.
23688
23689 2002-03-25  Martin Baulig  <martin@gnome.org>
23690
23691         * driver.cs (-g): Made -g an alias for --debug.
23692
23693 2002-03-24  Martin Baulig  <martin@gnome.org>
23694
23695         * codegen.cs (SymbolWriter): New public variable. Returns the
23696         current symbol writer.
23697         (CodeGen): Added `bool want_debugging_support' argument to the
23698          constructor. If true, tell the ModuleBuild that we want debugging
23699         support and ask it for the ISymbolWriter.
23700         (Save): If we have a symbol writer, call it's Close() method after
23701         saving the assembly.
23702
23703         * driver.c (--debug): New command line argument to create a
23704         debugger information file.
23705
23706         * location.cs (SymbolDocument): New public property. Returns an
23707         ISymbolDocumentWriter object for the current source file or null
23708         if we don't have a symbol writer.
23709
23710 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
23711
23712         * driver.cs (LoadAssembly): Correctly return when all the paths
23713         have been tried and not before.
23714
23715         * statement.cs (Switch.Emit): return the actual coverage for this
23716         statement (returns/not-returns)
23717
23718         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
23719         switch of the statement if we are the last switch section.  That
23720         kills two problems: try/catch problems (we used to emit an empty
23721         nop at the end) and switch statements where all branches would
23722         return. 
23723
23724 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
23725
23726         * driver.cs: Add default assemblies (the equivalent to the
23727         Microsoft CSC.RSP file)
23728
23729         * cs-tokenizer.cs: When updating `cols and setting it to zero,
23730         also update tokens_seen and set it to false.
23731
23732         * driver.cs: Implement --recurse for Mike.
23733
23734         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
23735         correctly splitting out the paths.
23736
23737 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
23738
23739         * interface.cs (Interface.PopulateProperty): Instead of using
23740         `parent' as the declaration space for the set parameters, use
23741         `this' 
23742
23743         * support.cs (InternalParameters): InternalParameters constructor
23744         takes a DeclSpace instead of a TypeContainer.
23745
23746         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
23747         types are being initialized, load the address of it before calling
23748         the function.  
23749
23750         (New): Provide a mechanism to disable the generation of local
23751         value type temporaries when the caller will be providing us with
23752         an address to store it.
23753
23754         (ArrayCreation.EmitDynamicInitializers): Use it.
23755
23756 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
23757
23758         * expression.cs (Invocation.EmitArguments): Only probe for array
23759         property if there is more than one argument.  Sorry about that.
23760
23761         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
23762         empty param arrays.
23763
23764         * class.cs (Method.LabelParameters): Fix incorrect code path that
23765         prevented the `ParamArrayAttribute' from being applied to the
23766         params attribute.
23767
23768 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
23769
23770         * support.cs (ReflectionParameters): Correctly compute whether the
23771         last argument is a params array.  Fixes the problem with
23772         string.Split ('a')
23773
23774         * typemanager.cs: Make the assemblies array always be non-null
23775         (empty, but non-null)
23776
23777         * tree.cs (RecordDecl): New function that abstracts the recording
23778         of names.  This reports error 101, and provides a pointer to the
23779         previous declaration.  Fixes a crash in the compiler.
23780
23781         * cs-parser.jay (constructor_declaration): Update to new grammar,
23782         and provide a constructor_body that can be empty.
23783
23784 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
23785
23786         * driver.cs: Add support for --resources.
23787
23788         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
23789         Make all types for the various array helper methods be integer.
23790
23791         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
23792         CheckState to ConvCast.
23793
23794         (ConvCast): Now it takes a `checked' state argument, to avoid
23795         depending on the emit context for the conversion, and just using
23796         the resolve time setting.
23797
23798         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
23799         instead of Invocation.EmitArguments.  We do not emit the original
23800         arguments, instead we emit those which have been converted to
23801         unsigned int expressions.
23802
23803         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
23804
23805         * codegen.cs: ditto.
23806
23807         * expression.cs (LocalVariableReference): Drop the use of the
23808         Store function that depended on the variable index.
23809
23810         * statement.cs (VariableInfo): Drop the `Idx' property from this
23811         class, as this is not taking into account the indexes for
23812         temporaries tat we generate during the execution, getting the
23813         indexes wrong.
23814
23815         * class.cs: First emit class initializers, then call the parent
23816         constructor. 
23817
23818         * expression.cs (Binary): Fix opcode emision.
23819         (UnaryMutator.EmitCode): Support checked code generation
23820
23821         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
23822         matches for events for both the Static and Instance scans,
23823         pointing to the same element.   Fix that.
23824
23825 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
23826
23827         * rootcontext.cs (ResolveTree): Always set the
23828         interface_resolve_order, because nested interfaces will be calling
23829         into us.
23830
23831         * class.cs (GetInterfaceOrClass): Track the same resolution
23832         process used by TypeManager.LookupType.  This fixes the nested
23833         type lookups in class declarations (separate path from
23834         LookupType). 
23835
23836         (TypeContainer.DefineType): Also define nested interfaces.
23837         (TypeContainer.RegisterOrder): New public function used to
23838         register the order in which child interfaces need to be closed.
23839
23840         Nested interfaces need to be closed after their parents have been
23841         created. 
23842
23843         * interface.cs (InterfaceAttr): Put all the logic for computing
23844         the interface attribute here. 
23845
23846         (DefineInterface): Register our interface order with the
23847         RootContext or with the TypeContainer depending on the case.
23848
23849 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
23850
23851         * cs-parser.jay: rework foreach statement to work with the new
23852         changes to the policy on SimpleNames.
23853
23854         * report.cs: support Stacktrace on warnings as well.
23855
23856         * makefile: drop --unsafe and /unsafe from the compile.
23857
23858 2002-03-13  Ravi Pratap  <ravi@ximian.com>
23859
23860         * ecore.cs (StandardConversionExists): Modify to take an Expression
23861         as the first parameter. Ensure we do null -> reference type conversion
23862         checking.
23863
23864         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
23865         temporary Expression objects.
23866
23867 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
23868
23869         * interface.cs: workaround bug in method overloading resolution
23870         (there is already a bugzilla bug for it).
23871
23872 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
23873
23874         We could also solve this problem by having a separate path for
23875         performing type lookups, instead of DoResolve, we could have a
23876         ResolveType entry point, and only participating pieces of the
23877         production (simplename, deref, array) would implement this. 
23878
23879         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
23880         signal SimpleName to only resolve type names and not attempt to
23881         resolve anything else.
23882
23883         * expression.cs (Cast): Set the flag.
23884
23885         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
23886
23887         * class.cs: Only report 108 if there is no `new' modifier.
23888
23889         * cs-parser.jay: rework foreach statement to work with the new
23890         changes to the policy on SimpleNames.
23891
23892         * report.cs: support Stacktrace on warnings as well.
23893
23894         * makefile: drop --unsafe and /unsafe from the compile.
23895
23896 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
23897
23898         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
23899         lookups here, instead of doing that at parse time.  This means
23900         that our grammar will not introduce `LocalVariableReferences' as
23901         expressions at this point.  That solves the problem of code like
23902         this:
23903
23904         class X {
23905            static void Main ()
23906            { int X = 1;
23907             { X x = null }}}
23908
23909         This is only half the fix.  The full fix requires parameters to
23910         also be handled in this way.
23911
23912         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
23913         makes the use more obvious of the DeclSpace.  The
23914         ec.TypeContainer.TypeBuilder is now only used to pull the
23915         TypeBuilder for it.
23916
23917         My theory is that I can get rid of the TypeBuilder completely from
23918         the EmitContext, and have typecasts where it is used (from
23919         DeclSpace to where it matters).  
23920
23921         The only pending problem is that the code that implements Aliases
23922         is on TypeContainer, and probably should go in DeclSpace.
23923
23924         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
23925         lookups here, instead of doing that at parse time.  This means
23926         that our grammar will not introduce `LocalVariableReferences' as
23927         expressions at this point.  That solves the problem of code like
23928         this:
23929
23930         class X {
23931            static void Main ()
23932            { int X = 1;
23933             { X x = null }}}
23934
23935         This is only half the fix.  The full fix requires parameters to
23936         also be handled in this way.
23937
23938         * class.cs (Property.DefineMethod): When implementing an interface
23939         method, set newslot, when implementing an abstract method, do not
23940         set the flag (before we tried never setting it, or always setting
23941         it, which is the difference).
23942         (Indexer.DefineMethod): same.
23943         (Method.DefineMethod): same.
23944
23945         * ecore.cs: Only set the status used flag if we get back a Field.
23946
23947         * attribute.cs: Temporary hack, so Paolo can keep working.
23948
23949 2002-03-08  Ravi Pratap  <ravi@ximian.com>
23950
23951         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
23952         the unmanaged type in the case we have a MarshalAs attribute.
23953
23954         (Resolve): Handle the case when we are parsing the special MarshalAs
23955         attribute [we need to store the unmanaged type to use later]
23956
23957         * typemanager.cs (marshal_as_attr_type): Built in type for the 
23958         MarshalAs Attribute.
23959
23960         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
23961         on parameters and accordingly set the marshalling info.
23962
23963 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
23964
23965         * class.cs: Optimizing slightly by removing redundant code after
23966         we switched to the `NoTypes' return value.
23967         (Property.DefineMethod): use NoTypes here too.
23968
23969         This fixes the bug I introduced in my last batch of changes.
23970
23971 2002-03-05  Ravi Pratap  <ravi@ximian.com>
23972
23973         * tree.cs (RecordEnum): Add. We now keep track of enums too.
23974
23975         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
23976         Enums since those are types too. 
23977
23978         * cs-parser.jay (enum_declaration): Record enums as we parse them.
23979
23980         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
23981         thanks to a call during the lookup process.
23982
23983 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
23984
23985         * statement.cs (Foreach): Lots of work to accomodate a particular
23986         kind of foreach statement that I had not kept in mind.  It is
23987         possible to have foreachs on classes that provide a GetEnumerator
23988         method that return objects that implement the "pattern" for using
23989         a foreach, there is no need to support GetEnumerator
23990         specifically. 
23991
23992         This is needed to compile nant.
23993
23994         * decl.cs: Only report 114 if the member is not `Finalize' and if
23995         the warning level is at least 2.
23996
23997         * class.cs: Moved the compare function from Method to
23998         MethodSignature. 
23999
24000         (MethodSignature.InheritableMemberSignatureCompare): Add new
24001         filter function that is used to extract inheritable methods from a
24002         class. 
24003
24004         (Method.Define): Use the new `inheritable_method_signature_filter'
24005         delegate
24006
24007         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
24008         command. 
24009
24010 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
24011
24012         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
24013
24014         * cs-parser.jay: Add opt_semicolon to the interface declaration.
24015
24016         * expression.cs: Pass location information to
24017         ConvertImplicitStandard. 
24018
24019         * class.cs: Added debugging code to track return values from
24020         interfaces. 
24021
24022 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
24023
24024         * expression.cs (Is.DoResolve): If either side of the `is' is an
24025         interface, do not flag the warning.
24026
24027         * ecore.cs (ImplicitReferenceConversion): We need a separate test
24028         for interfaces
24029
24030         * report.cs: Allow for --fatal to be used with --probe.
24031
24032         * typemanager.cs (NoTypes): Move the definition for the empty Type
24033         array here. 
24034
24035         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
24036         properties. 
24037         (TypeContainer.DefineProxy): New function used to proxy to parent
24038         implementations when implementing interfaces.
24039         (TypeContainer.ParentImplements): used to lookup if our parent
24040         implements a public function that is required by an interface.
24041         (TypeContainer.VerifyPendingMethods): Hook this up.
24042
24043         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
24044         `modules' and `assemblies' arraylists into arrays.  We only grow
24045         these are the very early start up of the program, so this improves
24046         the speedof LookupType (nicely measured).
24047
24048         * expression.cs (MakeByteBlob): Replaced unsafe code with
24049         BitConverter, as suggested by Paolo.
24050
24051         * cfold.cs (ConstantFold.Binary): Special case: perform constant
24052         folding of string concatenation, but if either side is a string,
24053         and the other is not, then return null, and let the runtime use
24054         the concatenation on the string plus the object (using
24055         `Object.ToString'). 
24056
24057 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
24058
24059         Constant Folding has been implemented now.
24060
24061         * expression.cs (Unary.Reduce): Do not throw an exception, catch
24062         the error instead on types that are not supported in one's
24063         complement. 
24064
24065         * constant.cs (Constant and all children): New set of functions to
24066         perform implict and explicit conversions.
24067
24068         * ecore.cs (EnumConstant): Implement the new functions to perform
24069         conversion by proxying to the child expression.
24070
24071         * codegen.cs: (ConstantCheckState): Constant evaluation has its
24072         own separate setting that can not be turned off from the command
24073         line using --unchecked or --checked and is only controlled using
24074         the checked/unchecked statements and expressions.  This setting is
24075         used by the constant folder to flag errors.
24076
24077         * expression.cs (CheckedExpr, UncheckedExpr): Set the
24078         ConstantCheckState as well.   
24079
24080         During Resolve, they also have to flag the state, because the
24081         constant folder runs completely in the Resolve phase.
24082
24083         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
24084         well.
24085
24086 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24087
24088         * cfold.cs: New file, this file contains the constant folder.
24089
24090         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
24091         argument to track whether we are using the resulting address to
24092         load or store a value and provide better error messages. 
24093
24094         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
24095         new AddressOf arguments.
24096
24097         * statement.cs (Foreach.EmitCollectionForeach): Update
24098
24099         * expression.cs (Argument.Emit): Call AddressOf with proper
24100         arguments to track usage.
24101
24102         (New.DoEmit): Call AddressOf with new arguments.
24103
24104         (Unary.Emit): Adjust AddressOf call.
24105
24106 2002-03-01  Ravi Pratap  <ravi@ximian.com>
24107
24108         * cs-parser.jay (member_access): Change the case for pre-defined types
24109         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
24110         this suggestion.
24111
24112         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
24113         a method body.
24114
24115         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
24116         essentially like methods and apply attributes like MethodImplOptions to them too.
24117
24118         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
24119         not being null.
24120
24121         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
24122         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
24123         is the DeclSpace.
24124
24125         * Update code everywhere accordingly.
24126
24127         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
24128
24129         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
24130
24131 2002-02-28  Ravi Pratap  <ravi@ximian.com>
24132
24133         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
24134         try performing lookups against those instead of jumping straight into using
24135         the 'using' clauses.
24136
24137         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
24138
24139         (LookupType): Perform lookups in implicit parents too.
24140
24141         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
24142         sequence as RootContext.LookupType. 
24143
24144         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
24145         the various cases of namespace lookups into this method.
24146
24147 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
24148
24149         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
24150         in positional arguments)
24151
24152         * class.cs (Operator): Update the AllowedModifiers to contain
24153         extern. 
24154
24155         * cs-parser.jay: Update operator declaration to allow for the
24156         operator body to be empty.
24157
24158         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
24159         values. 
24160
24161 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
24162
24163         * class.cs (Method.Emit): Label parameters.
24164
24165         * driver.cs: Return 1 or 0 as the program exit code.
24166
24167 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
24168
24169         * expression.cs: Special case the `null' object when trying to
24170         auto-compute the type, as anything can be explicitly converted to
24171         that. 
24172
24173         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
24174         spotting this Paolo.
24175
24176         (Expression.ImplicitNumericConversion): Perform comparissions of
24177         the type using the underlying type in the case of an enumeration
24178         rather than using the enumeration type for the compare.
24179
24180         Cope with the underlying == type case, which is not possible to
24181         catch before. 
24182
24183         (Expression.ConvertNumericExplicit): Perform comparissions of
24184         the type using the underlying type in the case of an enumeration
24185         rather than using the enumeration type for the compare.
24186
24187         * driver.cs: If the user does not supply an extension, assume .exe
24188
24189         * cs-parser.jay (if_statement): Rewrote so that we can track the
24190         location for the if statement.
24191
24192         * expression.cs (Binary.ConstantFold): Only concat strings when
24193         the operation is "+", not everything ;-)
24194
24195         * statement.cs (Statement.EmitBoolExpression): Take a location
24196         argument. 
24197         (If, While, Do): Track location.
24198
24199         * expression.cs (Binary.ResolveOperator): In the object + string
24200         case, I was missing a call to ConvertImplicit
24201
24202 2002-02-25  Ravi Pratap  <ravi@ximian.com>
24203
24204         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
24205         Location arguments. Ensure we use RootContext.LookupType to do our work
24206         and not try to do a direct Type.GetType and ModuleBuilder.GetType
24207
24208         * interface.cs (PopulateMethod): Handle the type of the parameter being
24209         null gracefully.
24210
24211         * expression.cs (Invocation.BetterFunction): Handle the case when we 
24212         have a params method with no fixed arguments and a call is made with no
24213         arguments.
24214
24215 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
24216
24217         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
24218         the verbatim-string-literal
24219
24220         * support.cs (InternalParameters.ParameterModifier): handle null
24221         fixed parameters.
24222         (InternalParameters.ParameterType): ditto.
24223
24224         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
24225         duplicating the name of the variable parameter.
24226         (GetParameterByName): Fix bug where we were not looking up array
24227         paramters if they were the only present (thanks Paolo!).
24228         (GetParameterInfo): We only have an empty set of types if both
24229         fixed and array are set to null.
24230         (GetParameterInfo-idx): Handle FixedParameter == null
24231
24232         * cs-parser.jay: Handle the case where there is no catch
24233         statements (missing null test).
24234
24235 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
24236
24237         * driver.cs (MainDriver): Be conservative on our command line
24238         handling.
24239
24240         Catch DirectoryNotFoundException when calling GetFiles.
24241
24242         (SplitPathAndPattern): Used to split the input specification into
24243         a path and a pattern that we can feed to Directory.GetFiles.
24244
24245 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
24246
24247         * statement.cs (Fixed): Implement the last case of the Fixed
24248         statement (string handling).
24249
24250         * expression.cs (StringPtr): New class used to return a char * to
24251         a string;  Used by the Fixed statement.
24252
24253         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
24254
24255         * expression.cs (Binary.ResolveOperator): Remove redundant
24256         MemberLookup pn parent type.
24257         Optimize union call, we do not need a union if the types are the same.
24258         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
24259         type.
24260
24261         Specialize the use of MemberLookup everywhere, instead of using
24262         the default settings. 
24263
24264         (StackAlloc): Implement stackalloc keyword.
24265
24266         * cs-parser.jay: Add rule to parse stackalloc.
24267
24268         * driver.cs: Handle /h, /help, /?
24269
24270         * expression.cs (MakeByteBlob): Removed the hacks we had in place
24271         before we supported unsafe code.
24272
24273         * makefile: add --unsafe to the self compilation of mcs.
24274
24275 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
24276
24277         * expression.cs (PointerArithmetic): New class that is used to
24278         perform pointer arithmetic.
24279         (Binary.Resolve): Handle pointer arithmetic
24280         Handle pointer comparission.
24281         (ArrayPtr): Utility expression class that is used to take the
24282         address of an array.
24283
24284         (ElementAccess): Implement array access for pointers
24285
24286         * statement.cs (Fixed): Implement fixed statement for arrays, we
24287         are missing one more case before we are done.
24288
24289         * expression.cs (Indirection): Implement EmitAssign and set the
24290         ExprClass to Variable.  This allows pointer dereferences to be
24291         treated as variables, and to have values assigned to them.
24292
24293         * ecore.cs (Expression.StoreFromPtr): New utility function to
24294         store values dereferencing.
24295
24296 2002-02-20  Ravi Pratap  <ravi@ximian.com>
24297
24298         * expression.cs (Binary.ResolveOperator): Ensure that we are
24299         not trying to operate on a void type - this fixes the reported
24300         bug.
24301
24302         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
24303         the parent implementation is sealed.
24304
24305         * ../errors/cs0239.cs : Add.
24306
24307         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
24308
24309         * typemanager.cs (unverifiable_code_type): Corresponds to 
24310         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
24311         which have unsafe code in them.
24312
24313         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
24314         unsafe context.
24315
24316 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
24317
24318         * cs-tokenizer.cs: Add support for @"litreal strings"
24319
24320         Make tokenizer accept pre-processor directives
24321         on any column (remove the old C-like limitation). 
24322
24323         * rootcontext.cs (EmitCode): Emit any global attributes.
24324         (AddGlobalAttributes): Used to keep track of assembly attributes. 
24325
24326         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
24327
24328         * cs-parser.jay: Add support for global attributes.  
24329
24330 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
24331
24332         * expression.cs (Indirection): New helper class.  Unary will
24333         create Indirection classes to be able to implement the
24334         IMemoryLocation interface on it.
24335
24336 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
24337
24338         * cs-parser.jay (fixed_statement): reference the right statement.
24339
24340         * statement.cs (Fixed.Emit): Finish implementing the fixed
24341         statement for the &x case.
24342
24343 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
24344
24345         * class.cs (Property.Define, Method.Define): Remove newslot when
24346         `implementing'.  
24347
24348         * modifiers.cs: My use of NewSlot when `Abstract' was set was
24349         wrong.  NewSlot should only be used if the `new' keyword is present.
24350
24351         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
24352         locating our system dir.  Sorry about this.
24353
24354 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24355
24356         * driver.cs (GetSystemDir): Compute correctly the location of our
24357         system assemblies.  I was using the compiler directory instead of
24358         the library directory.
24359
24360 2002-02-13  Ravi Pratap  <ravi@ximian.com>
24361
24362         * expression.cs (BetterFunction): Put back in what Miguel commented out
24363         since it is the correct fix. The problem is elsewhere ;-)
24364
24365         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
24366         parameters of the parms method are themselves compatible or not !
24367
24368         (StandardConversionExists): Fix very dangerous bug where we were forgetting
24369         to check that a class implements an interface before saying that an implicit
24370         conversion was allowed. Use ImplementsInterface to do the checking.
24371
24372 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
24373
24374         * class.cs (Method.Define): Track whether we are an explicit
24375         implementation or not.  And only call DefineMethodOverride if we
24376         are an explicit implementation.
24377
24378         (Property.DefineMethod): Ditto.
24379
24380 2002-02-11  Ravi Pratap  <ravi@ximian.com>
24381
24382         * expression.cs (BetterFunction): Catch hideous bug which was
24383          preventing us from detecting ambiguous calls due to implicit casts i.e
24384         cs0121.
24385
24386 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
24387
24388         * support.cs (Pair): Remove un-needed method.  I figured why I was
24389         getting the error in cs-parser.jay, the variable in a foreach loop
24390         is readonly, and the compiler does not really treat this as a variable.
24391
24392         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
24393         instead of EQUALS in grammar.  
24394
24395         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
24396
24397         * expression.cs (Unary.DoResolve): Check whether the argument is
24398         managed or not.
24399
24400 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
24401
24402         * support.cs: Api for Pair to set a value.  Despite the fact that
24403         the variables are public the MS C# compiler refuses to compile
24404         code that accesses the field if the variable is part of a foreach
24405         statement. 
24406
24407         * statement.cs (Fixed): Begin implementation of the fixed
24408         statement.
24409
24410         (Block.AddVariable): Return the VariableInfo on success and null
24411         on failure instead of true/false. 
24412
24413         * cs-parser.jay (foreach): Catch errors on variables already
24414         defined (we were ignoring this value before) and properly unwind
24415         the block hierarchy
24416
24417         (fixed_statement): grammar for the fixed statement.
24418
24419 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
24420
24421         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
24422         pointer types to be incretemented.
24423
24424         (SizeOf): Implement.
24425
24426         * cs-parser.jay (pointer_member_access): Implement
24427         expr->IDENTIFIER production.
24428
24429         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
24430         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
24431         on safe contexts.
24432
24433         (Unary): Implement indirection.
24434
24435         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
24436         use in non-unsafe context).
24437
24438         (SimpleName.DoResolve): Check for pointers in field access on safe
24439         contexts. 
24440
24441         (Expression.LoadFromPtr): Factor the load-indirect code in this
24442         function.  This was duplicated in UnboxCast and ParameterReference
24443
24444 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
24445
24446         * expression.cs (ComposedCast): report an error if a pointer cast
24447         is used in a safe region.
24448
24449         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
24450         pointer type casts in unsafe context.
24451
24452         * codegen.cs (EmitContext): Set up IsUnsafe.
24453
24454         * cs-parser.jay (non_expression_type): Add productions for pointer
24455         casts. 
24456
24457         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
24458         code.  We should not use force into static mode if the method is
24459         not virtual.  Fixes bug in MIS
24460
24461         * statement.cs (Do.Emit, While.Emit, For.Emit,
24462         Statement.EmitBoolExpression): Add support to Do and While to
24463         propagate infinite loop as `I do return' semantics.
24464
24465         Improve the For case to also test for boolean constants.
24466
24467         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
24468         to the list of attributes we can add.
24469
24470         Remove `EmitContext' argument.
24471
24472         * class.cs (Method.Define): Apply parameter attributes.
24473         (Constructor.Define): Apply parameter attributes.
24474         (MethodCore.LabelParameters): Move here the core of labeling
24475         parameters. 
24476
24477         * support.cs (ReflectionParameters.ParameterModifier,
24478         InternalParameters.ParameterModifier): Use IsByRef on the type and
24479         only return the OUT bit for these parameters instead of in/out/ref
24480         flags.
24481
24482         This is because I miss-understood things.  The ParameterInfo.IsIn
24483         and IsOut represent whether the parameter has the [In] and [Out]
24484         attributes set.  
24485
24486 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
24487
24488         * ecore.cs (FieldExpr.Emit): Release temporaries.
24489
24490         * assign.cs (LocalTemporary.Release): new function.
24491
24492         * codegen.cs (EmitContext.GetTemporaryStorage,
24493         EmitContext.FreeTemporaryStorage): Rework the way we deal with
24494         temporary storage.  Now we can "put back" localbuilders when we
24495         are done with them
24496
24497 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
24498
24499         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
24500         need to make a copy of the variable to generate verifiable code.
24501
24502 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
24503
24504         * driver.cs: Compute dynamically the system directory.
24505
24506         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
24507         Slower, but more generally useful.  Used by the abstract
24508         registering implementation. 
24509
24510         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
24511         the rules for the special rule on Type/instances.  First check if
24512         we have the same name, and if so, try that special static path
24513         rather than the instance path.
24514
24515 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
24516
24517         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
24518         for, while and if.
24519
24520         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
24521         Enum, ValueType, Delegate or Array for non-corlib compiles.
24522
24523         * cs-tokenizer.cs: Catch long identifiers (645)
24524
24525         * typemanager.cs (IndexerPropetyName): Ravi never tested this
24526         piece of code.
24527
24528         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
24529         fix, we were returning too early, so we were not registering
24530         pending methods from abstract classes.
24531
24532         Do not register pending methods if the class is abstract.
24533
24534         * expression.cs (Conditional.DoResolve): Report circular implicit
24535         conversions when we neecd to compute it for conditional
24536         expressions. 
24537
24538         (Is.DoResolve): If the expression is always of the provided type,
24539         flag warning 183.  If the expression can not ever be of the
24540         provided type flag warning 184.
24541
24542         * class.cs: Catch 169 as well.
24543
24544         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
24545         read. 
24546
24547 2002-01-18  Nick Drochak  <ndrochak@gol.com>
24548
24549         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
24550
24551 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
24552
24553         * interface.cs: (PopulateMethod): Check for pointers being defined
24554         only if the unsafe context is active.
24555         (PopulateProperty): ditto.
24556         (PopulateIndexer): ditto.
24557
24558         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
24559         specified.  If pointers are present, make sure that they are
24560         present in an unsafe context.
24561         (Constructor, Constructor.Define): ditto.
24562         (Field, Field.Define): ditto.
24563         (Property, Property.Define): ditto.
24564         (Event, Event.Define): ditto.
24565
24566         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
24567         hashtable if there are classes or structs defined.
24568
24569         * expression.cs (LocalVariableReference.DoResolve): Simplify this
24570         code, as the constant resolution moved.
24571
24572         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
24573         the metadata, so we can flag error 133. 
24574
24575         * decl.cs (MemberCore.UnsafeOK): New function to test that a
24576         pointer is being declared in an unsafe context.
24577
24578 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
24579
24580         * modifiers.cs (Modifiers.Check): Require a Location argument.
24581         Report error 227 for Unsafe use.
24582
24583         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
24584
24585         * statement.cs (For.Emit): If the test is null, then report that
24586         we do `return', as we wont reach anything afterwards.
24587
24588         (Switch.SwitchGoverningType): Track the expression that matched
24589         the conversion.
24590
24591         * driver.cs: Allow negative numbers as an error code to flag.
24592
24593         * cs-parser.jay: Handle 1551.
24594
24595         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
24596
24597 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24598
24599         * cs-parser.jay: Report 1518 (type declaration can only contain
24600         class, struct, interface, enum or delegate)
24601
24602         (switch_label): Report 1523 (keywords `case' or `default' must
24603         preced code)
24604
24605         (opt_switch_sections): Report 1522 (empty switch)
24606
24607         * driver.cs: Report 1515 (response file specified multiple times)
24608         Report 1516 (Source file specified multiple times).
24609
24610         * expression.cs (Argument.Resolve): Signal 1510
24611
24612         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
24613         access not allowed in static code)
24614
24615 2002-01-11  Ravi Pratap  <ravi@ximian.com>
24616
24617         * typemanager.cs (IsPointerType): Utility method which we are going
24618         to need a lot.
24619
24620         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
24621         the object type, so we take care of that.
24622
24623         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
24624
24625         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
24626         added to non-params parameters :-)
24627
24628         * typemanager.cs (CSharpName): Include 'void' type too. 
24629
24630         (void_ptr_type): Include in the set of core types.
24631
24632         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
24633         duplicating code.
24634
24635         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
24636         an unsafe context.
24637
24638         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
24639         completely forgotten about it.
24640
24641 2002-01-10  Ravi Pratap  <ravi@ximian.com>
24642
24643         * cs-parser.jay (pointer_type): Add. This begins our implementation
24644         of parsing rules for unsafe code.
24645
24646         (unsafe_statement): Implement.
24647
24648         (embedded_statement): Modify to include the above.
24649
24650         * statement.cs (Unsafe): Implement new class for unsafe blocks.
24651
24652         * codegen.cs (EmitContext.InUnsafe): Add. This determines
24653         if the current context is an unsafe one.
24654
24655         * cs-parser.jay (local_variable_pointer_type): Since local variable types
24656         are handled differently, we need separate rules for them.
24657
24658         (local_variable_declaration): Update to use local_variable_pointer_type
24659         to allow variable declarations of unmanaged pointer types.
24660
24661         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
24662         in unsafe contexts.
24663
24664         * ../errors/cs0214.cs : Add.
24665
24666 2002-01-16  Nick Drochak  <ndrochak@gol.com>
24667
24668         * makefile: remove 'response' file when cleaning.
24669
24670 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
24671
24672         * cs-parser.jay: Report 1524.
24673
24674 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
24675
24676         * typemanager.cs (RegisterMethod): drop checking if we have
24677         registered this from here
24678
24679 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
24680
24681         * class.cs (Method.EmitDestructor): Implement calling our base
24682         destructor. 
24683
24684         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
24685         value of InFinally.
24686
24687         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
24688         this routine and will wrap the call in a try/catch block.  Deal
24689         with the case.
24690
24691 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
24692
24693         * ecore.cs (Expression.MemberLookup): instead of taking a
24694         parameter `same_type' that was used to tell whether we could
24695         access private members we compute our containing type from the
24696         EmitContext.
24697
24698         (FieldExpr): Added partial support for volatile fields.  This does
24699         not work for volatile fields exposed from assemblies, as I can not
24700         figure out how to extract the modreq from it.
24701
24702         Updated all the source files to use this.
24703
24704         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
24705         because it is referenced by MemberLookup very often. 
24706
24707 2002-01-09  Ravi Pratap  <ravi@ximian.com>
24708
24709         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
24710         TypeBuilder.GetCustomAttributes to retrieve what we need.
24711
24712         Get rid of redundant default_member_attr_type as this is the same as
24713         default_member_type which already exists.
24714
24715         * interface.cs, attribute.cs : Update accordingly.
24716
24717 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
24718
24719         * typemanager.cs: Enable IndexerPropertyName again.  It does not
24720         work for TYpeBuilders though.  Ravi, can you please fix this?
24721
24722         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
24723
24724         * expression.cs (Argument.Emit): Handle the case of ref objects
24725         being passed to ref functions;  
24726
24727         (ParameterReference.EmitLoad): Loads the content of the pointer
24728         without dereferencing.
24729
24730 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24731
24732         * cs-tokenizer.cs: Implemented the pre-processing expressions.
24733
24734 2002-01-08  Ravi Pratap  <ravi@ximian.com>
24735
24736         * class.cs (Indexer.DefineMethod): Incorporate the interface
24737         type in the name of the method if we are doing explicit interface
24738         implementation.
24739
24740         * expression.cs (ConversionExists): Remove as it is completely obsolete.
24741
24742         (BetterConversion): Fix extremely trivial bug where we were referring to
24743         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
24744         again !
24745
24746         * ../errors/bug16.cs : Add although we have fixed it.
24747
24748 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
24749
24750         * expression.cs (BaseIndexer): Begin implementation.
24751
24752         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
24753
24754         * cs-parser.jay (indexer_declarator): Use qualified_identifier
24755         production directly to remove a shift/reduce, and implement
24756         explicit interface implementation.
24757
24758         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
24759         after a floating point suffix.
24760
24761         * expression.cs (DoNumericPromotions): Improved the conversion for
24762         uint/uint.  If we have a constant, we avoid doing a typecast to a
24763         larger type.
24764
24765         * class.cs (Indexer): Implement explicit interface implementation
24766         for indexers.
24767
24768 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
24769
24770         * class.cs: make the default instance constructor public and hidebysig.
24771
24772 2001-01-03  Ravi Pratap  <ravi@ximian.com>
24773
24774         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
24775         so we can call it from elsewhere.
24776
24777         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
24778         we emit it internally if the class has a defined indexer; otherwise the user
24779         emits it by decorating the class definition with the DefaultMemberAttribute.
24780
24781         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
24782         attribute is not used on a type which defines an indexer.
24783
24784         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
24785         character when we skip whitespace.
24786
24787         * ../errors/cs0646.cs : Add.
24788
24789 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
24790
24791         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
24792         again. 
24793
24794         * makefile: Add practical target `mcs3.exe' which builds the third
24795         generation compiler. 
24796
24797         * expression.cs (New): Fix structures constructor calling.
24798
24799         * class.cs (Property, Method, Indexer): Emit Final flag on the
24800         method if we are an interface implementation and we are not
24801         abstract. 
24802
24803         * ecore.cs (PropertyExpr): New public field `IsBase', tells
24804         whether this property is referencing a `base' method.
24805
24806         * expression.cs (Invocation.EmitCall): take an extra argument:
24807         is_base, this is used to determine whether the `call' or
24808         `callvirt' opcode should be used.
24809
24810
24811         * delegate.cs: update EmitCall.
24812
24813         * class.cs (Method.Define): Set NewSlot for the cases where we are
24814         not implementing an interface method.
24815
24816         (Property.Define): ditto.
24817
24818 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
24819
24820         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
24821         'r'.  Allows mcs to parse itself fully.
24822
24823 2002-01-02  Ravi Pratap  <ravi@ximian.com>
24824
24825         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
24826         of the number of initializers that require the InitializeArray method.
24827
24828         (CheckIndices): Store the Expression in all cases - not the plain value. Also
24829         update the above field where necessary.
24830
24831         (MakeByteBlob): Update accordingly.
24832
24833         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
24834         greater than 2.
24835
24836         (EmitDynamicInitializers): Update in accordance with the new optimization.
24837
24838         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
24839         same OpCode applies.
24840
24841         * cs-parser.jay : Fix some glaring errors I introduced.
24842
24843 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
24844
24845         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
24846         so that we can check for name clashes there too.
24847
24848         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
24849         for interface indexers.
24850
24851         * interfaces.cs (Define): Emit the default member attribute.
24852
24853         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
24854         variable was being referred to while setting the value ;-)
24855
24856 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
24857
24858         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
24859         byte-by-byte information when we know the data is zero.
24860
24861         Make the block always a multiple of 4, because
24862         DefineInitializedData has a bug.
24863
24864         * assign.cs: Fix, we should assign from the temporary, not from
24865         the source. 
24866
24867         * expression.cs (MakeByteBlob): Fix my incorrect code.
24868
24869 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
24870
24871         * typemanager.cs (EnumToUnderlying): This function is used to get
24872         the underlying type from an enumeration, because it does not
24873         always work. 
24874
24875         * constant.cs: Use the I4_S form for values between -128 and 127.
24876
24877         * statement.cs (Block.LookupLabel): Looks up a label.
24878         (Block): Drop support for labeled blocks.
24879
24880         (LabeledStatement): New kind of statement that represents a label
24881         only.
24882
24883         (Goto): Finally implement this bad boy.
24884
24885         * cs-parser.jay: Update to reflect new mechanism to implement
24886         labels.
24887
24888 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
24889
24890         * codegen.cs (EmitContext.This): a codegen property that keeps the
24891         a single instance of this instead of creating many different this
24892         instances. 
24893
24894         * delegate.cs (Delegate.DoResolve): Update to use the property;
24895
24896         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
24897
24898         * expression.cs (BaseAccess.DoResolve): Ditto.
24899
24900 2001-12-29  Ravi Pratap  <ravi@ximian.com>
24901
24902         * typemanager.cs (methodimpl_attr_type): Add to hold the type
24903         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
24904
24905         (InitCoreTypes): Update accordingly.
24906
24907         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
24908         so we can quickly store the state.
24909
24910         (ApplyAttributes): Set the correct implementation flags
24911         for InternalCall methods.
24912
24913 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
24914
24915         * expression.cs (EmitCall): if a method is not virtual, then do
24916         not use callvirt on it.
24917
24918         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
24919         user defined stuff) requires the use of stobj, which takes an
24920         address on the stack instead of an array and an index.  So emit
24921         the Ldelema operation for it.
24922
24923         (EmitStoreOpcode): Use stobj for valuetypes.
24924
24925         (UnaryMutator.EmitCode): Use the right 1 value depending on
24926         whether we are dealing with int64/uint64, float or doubles.
24927
24928         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
24929         constructors that I implemented last night.
24930
24931         (Constructor.IsDefault): Fix to work properly for static
24932         constructors.
24933
24934         * cs-parser.jay (CheckDef): report method signature errors.
24935         Update error number 103 to be 132.
24936
24937         * decl.cs: New AdditionResult enumeration value: MethodExists.
24938         Although we do this check for methods later on in the semantic
24939         analysis, catching repeated default constructors is so easy that
24940         we catch these here. 
24941
24942         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
24943         promotions code.
24944
24945         (ParameterReference.EmitAssign, Emit): handle
24946         bools as bytes.
24947
24948         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
24949         (ArrayAccess.EmitStoreOpcode): ditto.
24950
24951         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
24952
24953         * expression.cs (MakeByteBlob): Complete all the missing types
24954         (uint, short, ushort, byte, sbyte)
24955
24956         * class.cs: Only init instance field initializers on instance
24957         constructors. 
24958
24959         Rename `constructors' to instance_constructors. 
24960
24961         (TypeContainer.AddConstructor): Only add constructors to the list
24962         if it is not static.
24963
24964         Make sure that we handle default_static_constructor independently
24965         everywhere where we handle instance_constructors
24966
24967 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
24968
24969         * class.cs: Do not lookup or create a base initializer for a
24970         static constructor.
24971
24972         (ConstructorInitializer.Resolve): use the proper type to lookup
24973         for constructors.
24974
24975         * cs-parser.jay: Report error 1585 (modifiers between type and name).
24976
24977         * enum.cs, interface.cs: Remove CloseType, this is taken care by
24978         in DeclSpace. 
24979
24980         * decl.cs: CloseType is now an virtual method, the default
24981         implementation just closes this type.
24982
24983 2001-12-28  Ravi Pratap  <ravi@ximian.com>
24984
24985         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
24986         to PreserveSig by default. Also emit HideBySig on such methods.
24987
24988         Basically, set the defaults to standard values.
24989
24990         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
24991         argument, if candidate is better, it can't be worse than the best !
24992
24993         (Invocation): Re-write bits to differentiate between methods being
24994         applicable in their expanded form and their normal form - for params
24995         methods of course.
24996
24997         Get rid of use_standard everywhere as only standard conversions are allowed
24998         in overload resolution. 
24999
25000         More spec conformance.
25001
25002 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
25003
25004         * driver.cs: Add --timestamp, to see where the compiler spends
25005         most of its time.
25006
25007         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
25008         `this' in static code.
25009
25010         (SimpleName.DoResolve): Implement in terms of a helper function
25011         that allows static-references to be passed upstream to
25012         MemberAccess.
25013
25014         (Expression.ResolveWithSimpleName): Resolve specially simple
25015         names when called by MemberAccess to implement the special
25016         semantics. 
25017
25018         (Expression.ImplicitReferenceConversion): Handle conversions from
25019         Null to reference types before others, as Null's type is
25020         System.Object. 
25021
25022         * expression.cs (Invocation.EmitCall): Handle the special case of
25023         calling methods declared on a reference type from a ValueType
25024         (Base classes System.Object and System.Enum)
25025
25026         (MemberAccess.Resolve): Only perform lookups on Enumerations if
25027         the left hand side is a TypeExpr, not on every enumeration. 
25028
25029         (Binary.Resolve): If types are reference types, then do a cast to
25030         object on operators != and == of both arguments.
25031
25032         * typemanager.cs (FindMembers): Extract instance and static
25033         members if requested.
25034
25035         * interface.cs (PopulateProperty): Use void_type instead of null
25036         as the return type for the setter method.
25037
25038         (PopulateIndexer): ditto.
25039
25040 2001-12-27  Ravi Pratap  <ravi@ximian.com>
25041
25042         * support.cs (ReflectionParameters): Fix minor bug where we
25043         were examining the wrong parameter for the ParamArray attribute.
25044
25045         Cope with requests for the type of the parameter at position
25046         greater than the params parameter's. We now return the element
25047         type of the params array as that makes more sense.
25048
25049         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
25050         accordingly as we no longer have to extract the element type
25051         ourselves.
25052
25053         (Invocation.OverloadResolve): Update.
25054
25055 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
25056
25057         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
25058         against IEnumerator, test whether the return value is a descendant
25059         of the IEnumerator interface.
25060
25061         * class.cs (Indexer.Define): Use an auxiliary method to implement
25062         the other bits of the method definition.  Begin support for
25063         explicit interface implementation.
25064
25065         (Property.DefineMethod): Use TypeManager.void_type instead of null
25066         for an empty return value.
25067
25068 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
25069
25070         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
25071         dealing with a FieldExpr which is composed of a FieldBuilder, in
25072         the code path we did extract the constant, but we should have
25073         obtained the underlying value to be able to cast it (otherwise we
25074         end up in an infinite loop, this is what Ravi was running into).
25075
25076         (ArrayCreation.UpdateIndices): Arrays might be empty.
25077
25078         (MemberAccess.ResolveMemberAccess): Add support for section
25079         14.5.4.1 that deals with the special case of E.I when E is a type
25080         and something else, that I can be a reference to a static member.
25081
25082         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
25083         handle a particular array type to create byte blobs, it is just
25084         something we dont generate byteblobs for.
25085
25086         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
25087         arguments. 
25088
25089         * location.cs (Push): remove the key from the hashtable that we
25090         are about to add.   This happens for empty files.
25091
25092         * driver.cs: Dispose files after we have parsed them.
25093
25094         (tokenize): new function that only runs the tokenizer on its
25095         input, for speed testing.
25096
25097 2001-12-26  Ravi Pratap  <ravi@ximian.com>
25098
25099         * class.cs (Event.Define): Define the private field only if there
25100         are no accessors defined.
25101
25102         * expression.cs (ResolveMemberAccess): If there is no associated
25103         field with the event, that means we have an event defined with its
25104         own accessors and we should flag error cs0070 since transforming
25105         ourselves into a field is not valid in that case.
25106
25107         * ecore.cs (SimpleName.DoResolve): Same as above.
25108
25109         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
25110         and charset to sane values.
25111
25112 2001-12-25  Ravi Pratap  <ravi@ximian.com>
25113
25114         * assign.cs (DoResolve): Perform check on events only if they 
25115         are being accessed outside the declaring type.
25116
25117         * cs-parser.jay (event_declarations): Update rules to correctly
25118         set the type of the implicit parameter etc.
25119
25120         (add_accessor, remove_accessor): Set current local parameters.
25121
25122         * expression.cs (Binary): For delegate addition and subtraction,
25123         cast the return value from the method into the appropriate delegate
25124         type.
25125
25126 2001-12-24  Ravi Pratap  <ravi@ximian.com>
25127
25128         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
25129         of these as the workaround is unnecessary.
25130
25131         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
25132         delegate data - none of that is needed at all.
25133
25134         Re-write bits to extract the instance expression and the delegate method
25135         correctly.
25136
25137         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
25138         on delegates too.
25139
25140         * attribute.cs (ApplyAttributes): New method to take care of common tasks
25141         of attaching attributes instead of duplicating code everywhere.
25142
25143         * everywhere : Update code to do attribute emission using the above method.
25144
25145 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25146
25147         * expression.cs (IsParamsMethodApplicable): if there are not
25148         parameters, return immediately.
25149
25150         * ecore.cs: The 0 literal can be implicity converted to an enum
25151         type. 
25152
25153         (SimpleName.DoResolve): First lookup the type, then lookup the
25154         members. 
25155
25156         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
25157         want to get its address.  If the InstanceExpression is not
25158         addressable, store the result in a temporary variable, then get
25159         the address of it.
25160
25161         * codegen.cs: Only display 219 errors on warning level or above. 
25162
25163         * expression.cs (ArrayAccess): Make it implement the
25164         IMemoryLocation interface.
25165
25166         (Binary.DoResolve): handle the operator == (object a, object b)
25167         and operator != (object a, object b) without incurring into a
25168         BoxedCast (because 5 != o should never be performed).
25169
25170         Handle binary enumerator operators.
25171
25172         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
25173         value type, otherwise use Ldelem_ref.
25174
25175         Use precomputed names;
25176
25177         (AddressOf): Implement address of
25178
25179         * cs-parser.jay (labeled_statement): Fix recursive block
25180         addition by reworking the production.
25181
25182         * expression.cs (New.DoEmit): New has a special case:
25183                 
25184                  If we are dealing with a ValueType, we have a few
25185                  situations to deal with:
25186                 
25187                     * The target of New is a ValueType variable, that is
25188                       easy, we just pass this as the variable reference
25189                 
25190                     * The target of New is being passed as an argument,
25191                       to a boxing operation or a function that takes a
25192                       ValueType.
25193                 
25194                       In this case, we need to create a temporary variable
25195                       that is the argument of New.
25196
25197
25198 2001-12-23  Ravi Pratap  <ravi@ximian.com>
25199
25200         * rootcontext.cs (LookupType): Check that current_type is not null before
25201         going about looking at nested types.
25202
25203         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
25204         not implement the IAssignMethod interface any more.
25205
25206         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
25207         where we tranform them into FieldExprs if they are being resolved from within
25208         the declaring type.
25209
25210         * ecore.cs (SimpleName.DoResolve): Do the same here.
25211
25212         * assign.cs (DoResolve, Emit): Clean up code considerably. 
25213
25214         * ../errors/bug10.cs : Add.
25215
25216         * ../errors/cs0070.cs : Add.
25217
25218         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
25219
25220         * assign.cs : Get rid of EventIsLocal everywhere.
25221
25222 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
25223
25224         * ecore.cs (ConvertIntLiteral): finished the implementation.
25225
25226         * statement.cs (SwitchLabel): Convert the value we are using as a
25227         key before looking up the table.
25228
25229 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25230
25231         * codegen.cs (EmitTopBlock): Require a Location argument now.
25232
25233         * cs-parser.jay (constructor_declarator): We need to setup
25234         current_local_parameters before we parse the
25235         opt_constructor_initializer, to allow the variables to be bound
25236         to the constructor arguments.
25237
25238         * rootcontext.cs (LookupType): First lookup nested classes in our
25239         class and our parents before we go looking outside our class.
25240
25241         * expression.cs (ConstantFold): Extract/debox the values at the
25242         beginnning. 
25243
25244         * rootcontext.cs (EmitCode): Resolve the constants first before we
25245         resolve the types.  This is not really needed, but it helps debugging.
25246
25247         * statement.cs: report location.
25248
25249         * cs-parser.jay: pass location to throw statement.
25250
25251         * driver.cs: Small bug fix.
25252
25253         * report.cs: Updated format to be 4-zero filled digits.
25254
25255 2001-12-22  Ravi Pratap  <ravi@ximian.com>
25256
25257         * expression.cs (CheckIndices): Fix minor bug where the wrong
25258         variable was being referred to ;-)
25259
25260         (DoEmit): Do not call EmitStaticInitializers when the 
25261         underlying type is System.Object.
25262
25263 2001-12-21  Ravi Pratap  <ravi@ximian.com>
25264
25265         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
25266         and do the usual workaround for SRE.
25267
25268         * class.cs (MyEventBuilder.EventType): New member to get at the type
25269         of the event, quickly.
25270
25271         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
25272
25273         * assign.cs (Assign.DoResolve): Handle the case when the target
25274         is an EventExpr and perform the necessary checks.
25275
25276         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
25277         interface.
25278
25279         (SimpleName.MemberStaticCheck): Include check for EventExpr.
25280
25281         (EventExpr): Set the type in the constructor itself since we 
25282         are meant to be born fully resolved.
25283
25284         (EventExpr.Define): Revert code I wrote earlier.
25285                 
25286         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
25287         instance expression is null. The instance expression is a This in that case
25288         or a null, depending on whether it is a static method or not.
25289
25290         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
25291         refers to more than one method.
25292
25293         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
25294         and accordingly flag errors.
25295
25296 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25297
25298         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
25299
25300 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
25301
25302         * location.cs (ToString): Provide useful rutine.
25303
25304 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
25305
25306         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
25307         objects, return the actual integral boxed.
25308
25309         * statement.cs (SwitchLabel): define an ILLabel for each
25310         SwitchLabel. 
25311
25312         (Switch.CheckSwitch): If the value is a Literal, extract
25313         the underlying literal.
25314
25315         Also in the unused hashtable we had, add the SwitchLabel so we can
25316         quickly look this value up.
25317
25318         * constant.cs: Implement a bunch of new constants.  Rewrite
25319         Literal based on this.  Made changes everywhere to adapt to this.
25320
25321         * expression.cs (Expression.MakeByteBlob): Optimize routine by
25322         dereferencing array only once, and also copes with enumrations.
25323
25324         bytes are two bytes wide, not one.
25325
25326         (Cast): Perform constant conversions.
25327
25328         * ecore.cs (TryImplicitIntConversion): Return literals instead of
25329         wrappers to the literals here.
25330
25331         * expression.cs (DoNumericPromotions): long literals can converted
25332         to ulong implicity (this is taken care of elsewhere, but I was
25333         missing this spot).
25334
25335         * ecore.cs (Expression.Literalize): Make the return type Literal,
25336         to improve type checking.
25337
25338         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
25339
25340 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25341
25342         * literal.cs: Revert code from ravi that checked the bounds.  The
25343         bounds are sane by the definition of the type itself. 
25344
25345         * typemanager.cs: Fix implementation of ImplementsInterface.  We
25346         need to actually look up in our parent hierarchy for interfaces
25347         implemented. 
25348
25349         * const.cs: Use the underlying type for enumerations
25350
25351         * delegate.cs: Compute the basename for the delegate creation,
25352         that should fix the delegate test case, and restore the correct
25353         Type Lookup semantics in rootcontext
25354
25355         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
25356         referencing a nested type with the Reflection API is using the "+"
25357         sign. 
25358
25359         * cs-parser.jay: Do not require EOF token at the end.
25360
25361 2001-12-20  Ravi Pratap  <ravi@ximian.com>
25362
25363         * rootcontext.cs (LookupType): Concatenate type names with
25364         a '.' instead of a '+' The test suite passes again.
25365
25366         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
25367         field of the enumeration.
25368
25369         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
25370         the case when the member is an EventExpr.
25371
25372         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
25373         static has an associated instance expression.
25374
25375         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
25376
25377         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
25378
25379         * class.cs (Event.Define): Register event and perform appropriate checks
25380         for error #111.
25381
25382         We define the Add and Remove methods even if the use provides none because
25383         in that case, we provide default implementations ourselves.
25384
25385         Define a private field of the type of the event. This is done by the CSC compiler
25386         and we should be doing it too ;-)
25387
25388         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
25389         More methods we use in code we generate.
25390
25391         (multicast_delegate_type, delegate_type): Two separate types since the distinction
25392         is important.
25393
25394         (InitCoreTypes): Update accordingly for the above.
25395
25396         * class.cs (Event.Emit): Generate code for default accessors that we provide
25397
25398         (EmitDefaultMethod): Do the job in the above.
25399
25400         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
25401         appropriate place.
25402
25403 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
25404
25405         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
25406         builders even if we were missing one.
25407
25408         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
25409         pass the Basename as our class name instead of the Name.  The
25410         basename will be correctly composed for us.
25411
25412         * parameter.cs (Paramters): Now takes a Location argument.
25413
25414         * decl.cs (DeclSpace.LookupType): Removed convenience function and
25415         make all the code call directly LookupType in RootContext and take
25416         this chance to pass the Location information everywhere.
25417
25418         * Everywhere: pass Location information.
25419
25420 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
25421
25422         * class.cs (Constructor.Define): Updated way of detecting the
25423         length of the parameters.
25424
25425         (TypeContainer.DefineType): Use basename as the type name for
25426         nested types.
25427
25428         (TypeContainer.Define): Do not recursively define types here, as
25429         definition is taken care in order by the RootContext.
25430
25431         * tree.cs: Keep track of namespaces in a per-file basis.
25432
25433         * parameter.cs (Parameter.ComputeSignature): Update to use
25434         DeclSpace. 
25435
25436         (Parameters.GetSignature): ditto.
25437
25438         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
25439         instead of a TypeContainer.
25440
25441         (Interface.SemanticAnalysis): Use `this' instead of our parent to
25442         resolve names.  Because we need to be resolve in our context, not
25443         our parents.
25444
25445         * driver.cs: Implement response files.
25446
25447         * class.cs (TypeContainer.DefineType): If we are defined, do not
25448         redefine ourselves.
25449
25450         (Event.Emit): Emit the code for add/remove handlers.
25451         (Event.Define): Save the MethodBuilders for add/remove.
25452
25453         * typemanager.cs: Use pair here too.
25454
25455         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
25456         DictionaryEntry requires the first argument to be non-null.  
25457
25458         (enum_declaration): Compute full name for registering the
25459         enumeration.
25460
25461         (delegate_declaration): Instead of using
25462         formal_parameter_list, use opt_formal_parameter_list as the list
25463         can be empty.
25464
25465         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
25466         (EventParsing): New property that controls whether `add' and
25467         `remove' are returned as tokens or identifiers (for events);
25468
25469 2001-12-19  Ravi Pratap  <ravi@ximian.com>
25470
25471         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
25472         use MyEventBuilder only and let it wrap the real builder for us.
25473
25474         (MyEventBuilder): Revamp constructor etc.
25475
25476         Implement all operations that we perform on EventBuilder in precisely the same
25477         way here too.
25478
25479         (FindMembers): Update to use the EventBuilder member.
25480
25481         (Event.Emit): Update accordingly.
25482
25483 2001-12-18  Ravi Pratap  <ravi@ximian.com>
25484
25485         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
25486         by calling the appropriate methods.
25487
25488         (GetCustomAttributes): Make stubs as they cannot possibly do anything
25489         useful.
25490
25491         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
25492
25493 2001-12-17  Ravi Pratap  <ravi@ximian.com>
25494
25495         * delegate.cs (Delegate.Populate): Check that the return type
25496         and various parameters types are indeed accessible.
25497
25498         * class.cs (Constructor.Define): Same here.
25499
25500         (Field.Define): Ditto.
25501
25502         (Event.Define): Ditto.
25503
25504         (Operator.Define): Check that the underlying Method defined itself
25505         correctly - so it's MethodBuilder should not be null.
25506
25507         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
25508         expression happens to be null.
25509
25510         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
25511         members but as of now we don't seem to be able to do anything really useful with it.
25512
25513         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
25514         not the EventBuilder.
25515
25516 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
25517
25518         * cs-tokenizer.cs: Add support for defines.
25519         Add support for #if, #elif, #else, #endif
25520
25521         (eval_var): evaluates a variable.
25522         (eval): stubbed for evaluating functions.
25523
25524         * cs-parser.jay: Pass the defines information
25525
25526         * driver.cs: Add --define command line option.
25527
25528         * decl.cs: Move MemberCore here.
25529
25530         Make it the base class for DeclSpace.  This allows us to catch and
25531         report 108 and 109 for everything now.
25532
25533         * class.cs (TypeContainer.Define): Extract all the members
25534         before populating and emit the warning 108 (new keyword required
25535         to override) instead of having each member implement this.
25536
25537         (MemberCore.Define): New abstract method, we will be using this in
25538         the warning reporting engine in Populate.
25539
25540         (Operator.Define): Adjust to new MemberCore protocol. 
25541
25542         * const.cs (Const): This does not derive from Expression, it is a
25543         temporary object we use to create fields, it is a MemberCore. 
25544
25545         * class.cs (Method.Define): Allow the entry point to be in a
25546         specific class.
25547
25548         * driver.cs: Rewrite the argument handler to clean it up a bit.
25549
25550         * rootcontext.cs: Made it just an auxiliary namespace feature by
25551         making everything static.
25552
25553         * driver.cs: Adapt code to use RootContext type name instead of
25554         instance variable.
25555
25556         * delegate.cs: Remove RootContext argument.
25557
25558         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
25559         argument. 
25560
25561         * class.cs (Event.Define): The lookup can fail.
25562
25563         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
25564
25565         * expression.cs: Resolve the this instance before invoking the code.
25566
25567 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
25568
25569         * cs-parser.jay: Add a production in element_access that allows
25570         the thing to become a "type" reference.  This way we can parse
25571         things like "(string [])" as a type.
25572
25573         Note that this still does not handle the more complex rules of
25574         casts. 
25575
25576
25577         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
25578
25579         * ecore.cs: (CopyNewMethods): new utility function used to
25580         assemble the list of methods from running FindMembers.
25581
25582         (MemberLookup): Rework FindMembers so that 
25583
25584 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
25585
25586         * class.cs (TypeContainer): Remove Delegates who fail to be
25587         defined.
25588
25589         * delegate.cs (Populate): Verify that we dont get null return
25590         values.   TODO: Check for AsAccessible.
25591
25592         * cs-parser.jay: Use basename to emit error 574 (destructor should
25593         have the same name as container class), not the full name.
25594
25595         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
25596         possible representation.  
25597
25598         Also implements integer type suffixes U and L.
25599
25600 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
25601
25602         * expression.cs (ArrayCreation.DoResolve): We need to do the
25603         argument resolution *always*.
25604
25605         * decl.cs: Make this hold the namespace.  Hold the root context as
25606         well.
25607         (LookupType): Move here.
25608
25609         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
25610
25611         * location.cs (Row, Name): Fixed the code, it was always returning
25612         references to the first file.
25613
25614         * interface.cs: Register properties defined through interfaces.
25615
25616         * driver.cs: Add support for globbing on the command line
25617
25618         * class.cs (Field): Make it derive from MemberCore as well.
25619         (Event): ditto.
25620
25621 2001-12-15  Ravi Pratap  <ravi@ximian.com>
25622
25623         * class.cs (Event::Define): Check that the type of the event is a delegate
25624         type else flag error #66.
25625
25626         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
25627         same.
25628
25629         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
25630         values of EntryPoint, CharSet etc etc.
25631
25632         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
25633
25634         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
25635         be null and we should ignore this. I am not sure if this is really clean. Apparently,
25636         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
25637         which needs this to do its work.
25638
25639         * ../errors/cs0066.cs : Add.
25640
25641 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
25642
25643         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
25644         helper functions.
25645
25646         * class.cs: (MethodSignature.MethodSignature): Removed hack that
25647         clears out the parameters field.
25648         (MemberSignatureCompare): Cleanup
25649
25650         (MemberCore): New base class used to share code between MethodCore
25651         and Property.
25652
25653         (RegisterRequiredImplementations) BindingFlags.Public requires
25654         either BindingFlags.Instace or Static.  Use instance here.
25655
25656         (Property): Refactored code to cope better with the full spec.
25657
25658         * parameter.cs (GetParameterInfo): Return an empty array instead
25659         of null on error.
25660
25661         * class.cs (Property): Abstract or extern properties have no bodies.
25662
25663         * parameter.cs (GetParameterInfo): return a zero-sized array.
25664
25665         * class.cs (TypeContainer.MethodModifiersValid): Move all the
25666         method modifier validation to the typecontainer so we can reuse
25667         this on properties.
25668
25669         (MethodCore.ParameterTypes): return an empty sized array of types.
25670
25671         (Property.Define): Test property modifier validity.
25672
25673         Add tests for sealed/override too.
25674
25675         (Method.Emit): abstract or extern methods have no bodies.
25676
25677 2001-12-14  Ravi Pratap  <ravi@ximian.com>
25678
25679         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
25680         thing.
25681
25682         (Method::Define, ::Emit): Modify accordingly.
25683
25684         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
25685
25686         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
25687
25688         * makefile: Pass in /unsafe.
25689
25690 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
25691
25692         * class.cs (MakeKey): Kill routine.
25693
25694         * class.cs (TypeContainer.Define): Correctly define explicit
25695         method implementations (they require the full interface name plus
25696         the method name).
25697
25698         * typemanager.cs: Deply the PtrHashtable here and stop using the
25699         lame keys.  Things work so much better.
25700
25701         This of course broke everyone who depended on `RegisterMethod' to
25702         do the `test for existance' test.  This has to be done elsewhere.
25703
25704         * support.cs (PtrHashtable): A hashtable that avoid comparing with
25705         the object stupid Equals method (because, that like fails all over
25706         the place).  We still do not use it.
25707
25708         * class.cs (TypeContainer.SetRequiredInterface,
25709         TypeContainer.RequireMethods): Killed these two routines and moved
25710         all the functionality to RegisterRequiredImplementations.
25711
25712         (TypeContainer.RegisterRequiredImplementations): This routine now
25713         registers all the implementations required in an array for the
25714         interfaces and abstract methods.  We use an array of structures
25715         which can be computed ahead of time to reduce memory usage and we
25716         also assume that lookups are cheap as most classes will not
25717         implement too many interfaces.
25718
25719         We also avoid creating too many MethodSignatures.
25720
25721         (TypeContainer.IsInterfaceMethod): Update and optionally does not
25722         clear the "pending" bit if we find that there are problems with
25723         the declaration.
25724
25725         (TypeContainer.VerifyPendingMethods): Update to report errors of
25726         methods that look like implementations but are not.
25727
25728         (TypeContainer.Define): Add support for explicit interface method
25729         implementation. 
25730
25731 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
25732
25733         * typemanager.cs: Keep track of the parameters here instead of
25734         being a feature of the TypeContainer.
25735
25736         * class.cs: Drop the registration of parameters here, as
25737         InterfaceMethods are also interface declarations.
25738
25739         * delegate.cs: Register methods with the TypeManager not only with
25740         the TypeContainer.  This code was buggy.
25741
25742         * interface.cs: Full registation here.
25743
25744 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
25745
25746         * expression.cs: Remove reducer for binary expressions, it can not
25747         be done this way.
25748
25749         * const.cs: Put here the code that used to go into constant.cs
25750
25751         * constant.cs: Put here the code for constants, this is a new base
25752         class for Literals.
25753
25754         * literal.cs: Make Literal derive from Constant.
25755
25756 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
25757
25758         * statement.cs (Return.Emit): Report error 157 if the user
25759         attempts to return from a finally block.
25760
25761         (Return.Emit): Instead of emitting a return, jump to the end of
25762         the function.
25763
25764         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
25765         LocalBuilder to store the result of the function.  ReturnLabel is
25766         the target where we jump.
25767
25768
25769 2001-12-09  Radek Doulik  <rodo@ximian.com>
25770
25771         * cs-parser.jay: remember alias in current namespace
25772
25773         * ecore.cs (SimpleName::DoResolve): use aliases for types or
25774         namespaces
25775
25776         * class.cs (LookupAlias): lookup alias in my_namespace
25777
25778         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
25779         aliases hashtable
25780         (LookupAlias): lookup alias in this and if needed in parent
25781         namespaces
25782
25783 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
25784
25785         * support.cs: 
25786
25787         * rootcontext.cs: (ModuleBuilder) Made static, first step into
25788         making things static.  I need this to avoid passing the
25789         TypeContainer when calling ParameterType.
25790
25791         * support.cs (InternalParameters.ParameterType): Remove ugly hack
25792         that did string manipulation to compute the type and then call
25793         GetType.  Use Parameter.ParameterType instead.
25794
25795         * cs-tokenizer.cs: Consume the suffix for floating values.
25796
25797         * expression.cs (ParameterReference): figure out whether this is a
25798         reference parameter or not.  Kill an extra variable by computing
25799         the arg_idx during emission.
25800
25801         * parameter.cs (Parameters.GetParameterInfo): New overloaded
25802         function that returns whether a parameter is an out/ref value or not.
25803
25804         (Parameter.ParameterType): The type of the parameter (base,
25805         without ref/out applied).
25806
25807         (Parameter.Resolve): Perform resolution here.
25808         (Parameter.ExternalType): The full type (with ref/out applied).
25809
25810         * statement.cs (Using.Emit, Using.EmitExpression): Implement
25811         support for expressions on the using statement.
25812
25813 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
25814
25815         * statement.cs (Using.EmitLocalVariableDecls): Split the
25816         localvariable handling of the using statement.
25817
25818         (Block.EmitMeta): Keep track of variable count across blocks.  We
25819         were reusing slots on separate branches of blocks.
25820
25821         (Try.Emit): Emit the general code block, we were not emitting it. 
25822
25823         Check the type of the declaration to be an IDisposable or
25824         something that can be implicity converted to it. 
25825
25826         Emit conversions if required.
25827
25828         * ecore.cs (EmptyExpression): New utility class.
25829         (Expression.ImplicitConversionExists): New utility function.
25830
25831 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
25832
25833         * statement.cs (Using): Implement.
25834
25835         * expression.cs (LocalVariableReference): Support read only variables.
25836
25837         * statement.cs: Remove the explicit emit for the Leave opcode.
25838         (VariableInfo): Add a readonly field.
25839
25840 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
25841
25842         * ecore.cs (ConvCast): new class used to encapsulate the various
25843         explicit integer conversions that works in both checked and
25844         unchecked contexts.
25845
25846         (Expression.ConvertNumericExplicit): Use new ConvCast class to
25847         properly generate the overflow opcodes.
25848
25849 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
25850
25851         * statement.cs: The correct type for the EmptyExpression is the
25852         element_type, not the variable type.  Ravi pointed this out.
25853
25854 2001-12-04  Ravi Pratap  <ravi@ximian.com>
25855
25856         * class.cs (Method::Define): Handle PInvoke methods specially
25857         by using DefinePInvokeMethod instead of the usual one.
25858
25859         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
25860         above to do the task of extracting information and defining the method.
25861
25862 2001-12-04  Ravi Pratap  <ravi@ximian.com>
25863
25864         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
25865         of the condition for string type.
25866
25867         (Emit): Move that here. 
25868
25869         (ArrayCreation::CheckIndices): Keep string literals in their expression
25870         form.
25871
25872         (EmitDynamicInitializers): Handle strings appropriately.
25873
25874 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
25875
25876         * codegen.cs (EmitContext): Replace multiple variables with a
25877         single pointer to the current Switch statement.
25878
25879         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
25880         EmitContext.
25881
25882 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
25883
25884         * statement.cs 
25885
25886         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
25887         default'.
25888
25889         (Foreach.Emit): Foreach on arrays was not setting
25890         up the loop variables (for break/continue).
25891
25892         (GotoCase): Semi-implented.
25893
25894 2001-12-03  Ravi Pratap  <ravi@ximian.com>
25895
25896         * attribute.cs (CheckAttribute): Handle system attributes by using
25897         Attribute.GetAttributes to examine information we need.
25898
25899         (GetValidPlaces): Same here.
25900
25901         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
25902
25903         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
25904
25905         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
25906
25907         (Method::Define): Set appropriate flags if we have a DllImport attribute.
25908
25909         (Method::Emit): Handle the case when we are a PInvoke method.
25910
25911 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
25912
25913         * expression.cs: Use ResolveWithSimpleName on compound names.
25914
25915 2001-12-02  Ravi Pratap  <ravi@ximian.com>
25916
25917         * constant.cs (EmitConstant): Make sure we resolve the associated expression
25918         before trying to reduce it.
25919
25920         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
25921
25922         * constant.cs (LookupConstantValue): Implement.
25923
25924         (EmitConstant): Use the above in emitting the constant.
25925
25926         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
25927         that are user-defined by doing a LookupConstantValue on them.
25928
25929         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
25930         too, like above.
25931
25932 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
25933
25934         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
25935
25936         (BaseAccess.DoResolve): Implement.
25937
25938         (MemberAccess.DoResolve): Split this routine into a
25939         ResolveMemberAccess routine that can be used independently
25940
25941 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
25942
25943         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
25944         As that share bits of the implementation.  Is returns a boolean,
25945         while As returns the Type that is being probed.
25946
25947 2001-12-01  Ravi Pratap  <ravi@ximian.com>
25948
25949         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
25950         instead of a Literal - much easier.
25951
25952         (EnumInTransit): Remove - utterly useless :-)
25953
25954         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
25955
25956         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
25957
25958         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
25959         chain when we have no associated expression.
25960
25961 2001-11-30  Ravi Pratap  <ravi@ximian.com>
25962
25963         * constant.cs (Define): Use Location while reporting the errror.
25964
25965         Also emit a warning when 'new' is used and there is no inherited
25966         member to hide.
25967
25968         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
25969         populated.
25970
25971         (LookupEnumValue): Implement to lookup an enum member's value and define it
25972         if necessary.
25973
25974         (Populate): Re-write accordingly to use the above routine.
25975
25976 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
25977
25978         * expression.cs (This): Fix prototype for DoResolveLValue to
25979         override the base class DoResolveLValue.
25980
25981         * cs-parser.cs: Report errors cs574 and cs575 (destructor
25982         declarations) 
25983
25984         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
25985         (we need to load the address of the field here).  This fixes
25986         test-22. 
25987
25988         (FieldExpr.DoResolveLValue): Call the DoResolve
25989         function to initialize the Instance expression.
25990
25991         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
25992         correctly the GetEnumerator operation on a value type.
25993
25994         * cs-parser.jay: Add more simple parsing error catches.
25995
25996         * statement.cs (Switch): Add support for string switches.
25997         Handle null specially.
25998
25999         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
26000
26001 2001-11-28  Ravi Pratap  <ravi@ximian.com>
26002
26003         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
26004
26005         (declare_local_constant): New helper function.
26006
26007         * statement.cs (AddConstant): Keep a separate record of constants
26008
26009         (IsConstant): Implement to determine if a variable is a constant.
26010
26011         (GetConstantExpression): Implement.
26012
26013         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
26014
26015         * statement.cs (IsVariableDefined): Re-write.
26016
26017 2001-11-27  Ravi Pratap  <ravi@ximian.com>
26018
26019         * class.cs (TypeContainer::FindMembers): Look for constants
26020         in the case when we are looking for MemberTypes.Field
26021
26022         * expression.cs (MemberAccess::DoResolve): Check that in the
26023         case we are a FieldExpr and a Literal, we are not being accessed
26024         by an instance reference.
26025
26026         * cs-parser.jay (local_constant_declaration): Implement.
26027
26028         (declaration_statement): Implement for constant declarations.
26029
26030 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
26031
26032         * statement.cs (Switch): Catch double defaults.
26033
26034         (Switch): More work on the switch() statement
26035         implementation.  It works for integral values now, need to finish
26036         string support.
26037
26038
26039 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
26040
26041         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
26042         integer literals into other integer literals.  To be used by
26043         switch. 
26044
26045 2001-11-24  Ravi Pratap  <ravi@ximian.com>
26046
26047         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
26048         some memory.
26049
26050         (EmitDynamicInitializers): Cope with the above since we extract data
26051         directly from ArrayData now.
26052
26053         (ExpectInitializers): Keep track of whether initializers are mandatory
26054         or not.
26055
26056         (Bounds): Make it a hashtable to prevent the same dimension being 
26057         recorded for every element in that dimension.
26058
26059         (EmitDynamicInitializers): Fix bug which prevented the Set array method
26060         from being found.
26061
26062         Also fix bug which was causing the indices to be emitted in the reverse
26063         order.
26064
26065 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
26066
26067         * expression.cs (ArrayCreation): Implement the bits that Ravi left
26068         unfinished.  They do not work, because the underlying code is
26069         sloppy.
26070
26071 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26072
26073         * cs-parser.jay: Remove bogus fixme.
26074
26075         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
26076         on Switch statement.
26077
26078 2001-11-23  Ravi Pratap  <ravi@ximian.com>
26079
26080         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
26081         the same. 
26082
26083         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
26084         parameter. Apparently, any expression is allowed. 
26085
26086         (ValidateInitializers): Update accordingly.
26087
26088         (CheckIndices): Fix some tricky bugs thanks to recursion.
26089
26090         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
26091         I was being completely brain-dead.
26092
26093         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
26094         and re-write acordingly.
26095
26096         (DelegateInvocation): Re-write accordingly.
26097
26098         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
26099
26100         (MakeByteBlob): Handle types more correctly.
26101
26102         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
26103         initialization from expressions but it is incomplete because I am a complete
26104         Dodo :-|
26105
26106 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26107
26108         * statement.cs (If.Emit): Fix a bug that generated incorrect code
26109         on If.  Basically, we have to return `true' (ie, we do return to
26110         our caller) only if both branches of the if return.
26111
26112         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
26113         short-circuit operators, handle them as short circuit operators. 
26114
26115         (Cast.DoResolve): Resolve type.
26116         (Cast.Cast): Take an expression as the target type.
26117
26118         * cs-parser.jay (cast_expression): Remove old hack that only
26119         allowed a limited set of types to be handled.  Now we take a
26120         unary_expression and we resolve to a type during semantic
26121         analysis.
26122
26123         Use the grammar productions from Rhys to handle casts (this is
26124         not complete like Rhys syntax yet, we fail to handle that corner
26125         case that C# has regarding (-x), but we will get there.
26126
26127 2001-11-22  Ravi Pratap  <ravi@ximian.com>
26128
26129         * class.cs (EmitFieldInitializer): Take care of the case when we have a
26130         field which is an array type.
26131
26132         * cs-parser.jay (declare_local_variables): Support array initialization too.
26133
26134         * typemanager.cs (MakeKey): Implement.
26135
26136         (everywhere): Use the above appropriately.
26137
26138         * cs-parser.jay (for_statement): Update for array initialization while
26139         declaring variables.
26140
26141         * ecore.cs : The error message was correct, it's the variable's names that
26142         were misleading ;-) Make the code more readable.
26143
26144         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
26145         the correct type etc.
26146
26147         (ConvertExplicit): Handle Enum types by examining the underlying type.
26148
26149 2001-11-21  Ravi Pratap  <ravi@ximian.com>
26150
26151         * parameter.cs (GetCallingConvention): Always return
26152         CallingConventions.Standard for now.
26153
26154 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
26155
26156         * expression.cs (Binary.ResolveOperator): Update the values of `l'
26157         and `r' after calling DoNumericPromotions.
26158
26159         * ecore.cs: Fix error message (the types were in the wrong order).
26160
26161         * statement.cs (Foreach.ProbeCollectionType): Need to pass
26162         BindingFlags.Instance as well 
26163
26164         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
26165         implicit int literal conversion in an empty cast so that we
26166         propagate the right type upstream.
26167
26168         (UnboxCast): new class used to unbox value types.
26169         (Expression.ConvertExplicit): Add explicit type conversions done
26170         by unboxing.
26171
26172         (Expression.ImplicitNumericConversion): Oops, forgot to test for
26173         the target type before applying the implicit LongLiterals to ULong
26174         literal cast.
26175
26176 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
26177
26178         * cs-parser.jay (for_statement): Reworked the way For works: now
26179         we declare manually any variables that are introduced in
26180         for_initializer to solve the problem of having out-of-band code
26181         emition (that is what got for broken).
26182
26183         (declaration_statement): Perform the actual variable declaration
26184         that used to be done in local_variable_declaration here.
26185
26186         (local_variable_declaration): Do not declare anything, just pass
26187         the information on a DictionaryEntry
26188
26189 2001-11-20  Ravi Pratap  <ravi@ximian.com>
26190
26191         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
26192         re-write of the logic to now make it recursive.
26193
26194         (UpdateIndices): Re-write accordingly.
26195
26196         Store element data in a separate ArrayData list in the above methods.
26197
26198         (MakeByteBlob): Implement to dump the array data into a byte array.
26199
26200 2001-11-19  Ravi Pratap  <ravi@ximian.com>
26201
26202         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
26203         into CheckIndices.
26204
26205         * constant.cs (Define): Implement.
26206
26207         (EmitConstant): Re-write fully.
26208
26209         Pass in location info.
26210
26211         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
26212         respectively.
26213
26214         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
26215         DictionaryEntry since we need location info too.
26216
26217         (constant_declaration): Update accordingly.
26218
26219         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
26220         code into another method : UpdateIndices.
26221
26222 2001-11-18  Ravi Pratap  <ravi@ximian.com>
26223
26224         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
26225         some type checking etc.
26226
26227 2001-11-17  Ravi Pratap  <ravi@ximian.com>
26228
26229         * expression.cs (ArrayCreation::ValidateInitializers): Implement
26230         bits to provide dimension info if the user skips doing that.
26231
26232         Update second constructor to store the rank correctly.
26233
26234 2001-11-16  Ravi Pratap  <ravi@ximian.com>
26235
26236         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
26237         and try to implement.
26238
26239         * ../errors/cs0150.cs : Add.
26240
26241         * ../errors/cs0178.cs : Add.
26242
26243 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
26244
26245         * statement.cs: Implement foreach on multi-dimensional arrays. 
26246
26247         * parameter.cs (Parameters.GetParameterByName): Also lookup the
26248         name of the params argument.
26249
26250         * expression.cs: Use EmitStoreOpcode to get the right opcode while
26251         initializing the array.
26252
26253         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
26254         we can use this elsewhere.
26255
26256         * statement.cs: Finish implementation of foreach for single
26257         dimension arrays.
26258
26259         * cs-parser.jay: Use an out-of-band stack to pass information
26260         around, I wonder why I need this.
26261
26262         foreach_block: Make the new foreach_block the current_block.
26263
26264         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
26265         function used to return a static Parameters structure.  Used for
26266         empty parameters, as those are created very frequently.
26267
26268         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
26269
26270 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26271
26272         * interface.cs : Default modifier is private, not public. The
26273         make verify test passes again.
26274
26275 2001-11-15  Ravi Pratap  <ravi@ximian.com>
26276
26277         * support.cs (ReflectionParameters): Fix logic to determine
26278         whether the last parameter is a params one. Test 9 passes again.
26279
26280         * delegate.cs (Populate): Register the builders we define with
26281         RegisterParameterForBuilder. Test 19 passes again.
26282
26283         * cs-parser.jay (property_declaration): Reference $6 instead
26284         of $$ to get at the location.
26285
26286         (indexer_declaration): Similar stuff.
26287
26288         (attribute): Ditto.
26289
26290         * class.cs (Property): Register parameters for the Get and Set methods
26291         if they exist. Test 23 passes again.
26292
26293         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
26294         call to EmitArguments as we are sure there aren't any params arguments. 
26295         Test 32 passes again.
26296
26297         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
26298         IndexOutOfRangeException. 
26299
26300         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
26301         Test 33 now passes again.
26302
26303 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
26304
26305         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
26306         broke a bunch of things.  Will have to come up with a better way
26307         of tracking locations.
26308
26309         * statement.cs: Implemented foreach for single dimension arrays.
26310
26311 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26312
26313         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
26314         an error.  This removes the lookup from the critical path.
26315
26316         * cs-parser.jay: Removed use of temporary_loc, which is completely
26317         broken. 
26318
26319 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
26320
26321         * support.cs (ReflectionParameters.ParameterModifier): Report
26322         whether the argument is a PARAMS argument or not.
26323
26324         * class.cs: Set the attribute `ParamArrayAttribute' on the
26325         parameter argument.
26326
26327         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
26328         and cons_param_array_attribute (ConstructorInfo for
26329         ParamArrayAttribute)., 
26330
26331         * codegen.cs: Emit the return using the `Return' statement, that
26332         way we can report the error correctly for missing return values. 
26333
26334         * class.cs (Method.Emit): Clean up.
26335
26336         * expression.cs (Argument.Resolve): Take another argument: the
26337         location where this argument is used.  Notice that this is not
26338         part of the "Argument" class as to reduce the size of the
26339         structure (we know the approximate location anyways).
26340
26341         Test if the argument is a variable-reference, if not, then
26342         complain with a 206.
26343
26344         (Argument.Emit): Emit addresses of variables.
26345
26346         (Argument.FullDesc): Simplify.
26347
26348         (Invocation.DoResolve): Update for Argument.Resolve.
26349
26350         (ElementAccess.DoResolve): ditto.
26351
26352         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
26353         method should be virtual, as this method is always virtual.
26354
26355         (NewDelegate.DoResolve): Update for Argument.Resolve.
26356
26357         * class.cs (ConstructorInitializer.DoResolve): ditto.
26358
26359         * attribute.cs (Attribute.Resolve): ditto.
26360
26361 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
26362
26363         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
26364
26365         * expression.cs (ParameterReference): Drop IStackStorage and implement
26366         IAssignMethod instead. 
26367
26368         (LocalVariableReference): ditto.
26369
26370         * ecore.cs (FieldExpr): Drop IStackStorage and implement
26371         IAssignMethod instead. 
26372
26373 2001-11-13  Miguel de Icaza <miguel@ximian.com>
26374
26375         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
26376         enumerations that are used in heavily used structures derive from
26377         byte in a laughable and pathetic attempt to reduce memory usage.
26378         This is the kind of pre-optimzations that you should not do at
26379         home without adult supervision.
26380
26381         * expression.cs (UnaryMutator): New class, used to handle ++ and
26382         -- separatedly from the other unary operators.  Cleans up the
26383         code, and kills the ExpressionStatement dependency in Unary.
26384
26385         (Unary): Removed `method' and `Arguments' from this class, making
26386         it smaller, and moving it all to SimpleCall, so I can reuse this
26387         code in other locations and avoid creating a lot of transient data
26388         strucutres when not required.
26389
26390         * cs-parser.jay: Adjust for new changes.
26391
26392 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
26393
26394         * enum.cs (Enum.Populate): If there is a failure during
26395         definition, return
26396
26397         * cs-parser.jay (opt_enum_base): we used to catch type errors
26398         here, but this is really incorrect.  The type error should be
26399         catched during semantic analysis.
26400
26401 2001-12-11  Ravi Pratap  <ravi@ximian.com>
26402
26403         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
26404         current_local_parameters as expected since I, in my stupidity, had forgotten
26405         to do this :-)
26406
26407         * attribute.cs (GetValidPlaces): Fix stupid bug.
26408
26409         * class.cs (Method::Emit): Perform check on applicability of attributes.
26410
26411         (Constructor::Emit): Ditto.
26412
26413         (Field::Emit): Ditto.
26414
26415         (Field.Location): Store location information.
26416
26417         (Property, Event, Indexer, Operator): Ditto.
26418
26419         * cs-parser.jay (field_declaration): Pass in location for each field.
26420
26421         * ../errors/cs0592.cs : Add.
26422
26423 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26424
26425         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
26426
26427         (InitCoreTypes): Update accordingly.
26428
26429         (RegisterAttrType, LookupAttr): Implement.
26430
26431         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
26432         info about the same.
26433
26434         (Resolve): Update to populate the above as necessary.
26435
26436         (Error592): Helper.
26437
26438         (GetValidPlaces): Helper to the above.
26439
26440         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
26441
26442         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
26443
26444 2001-11-12  Ravi Pratap  <ravi@ximian.com>
26445
26446         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
26447
26448         * ../errors/cs0617.cs : Add.
26449
26450 2001-11-11  Ravi Pratap  <ravi@ximian.com>
26451
26452         * enum.cs (Emit): Rename to Populate to be more consistent with what
26453         we expect it to do and when exactly it is called.
26454
26455         * class.cs, rootcontext.cs : Update accordingly.
26456
26457         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
26458         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
26459
26460         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
26461
26462         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
26463         of a fieldinfo using the above, when dealing with a FieldBuilder.
26464
26465 2001-11-10  Ravi Pratap  <ravi@ximian.com>
26466
26467         * ../errors/cs0031.cs : Add.
26468
26469         * ../errors/cs1008.cs : Add.
26470
26471         * ../errrors/cs0543.cs : Add.
26472
26473         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
26474         enum type.
26475
26476         (FindMembers): Implement.
26477
26478         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
26479         enums and delegates too.
26480
26481         (enum_types): Rename to builder_to_enum.
26482
26483         (delegate_types): Rename to builder_to_delegate.
26484
26485         * delegate.cs (FindMembers): Implement.
26486
26487 2001-11-09  Ravi Pratap  <ravi@ximian.com>
26488
26489         * typemanager.cs (IsEnumType): Implement.
26490
26491         * enum.cs (Emit): Re-write parts to account for the underlying type
26492         better and perform checking etc.
26493
26494         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
26495         of the underlying type.
26496
26497         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
26498         value
26499
26500         * enum.cs (error31): Helper to report error #31.
26501
26502         * cs-parser.jay (enum_declaration): Store location of each member too.
26503
26504         * enum.cs (member_to_location): New hashtable. 
26505
26506         (AddEnumMember): Update location hashtable.
26507
26508         (Emit): Use the location of each member while reporting errors.
26509
26510 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
26511
26512         * cs-parser.jay: A for_initializer if is a
26513         local_variable_declaration really ammount to have an implicit
26514         block with the variable declaration and no initializer for for.
26515
26516         * statement.cs (For.Emit): Cope with null initializers.
26517
26518         This fixes the infinite loop on for initializers.
26519
26520 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
26521
26522         * enum.cs: More cleanup.
26523
26524         * ecore.cs: Remove dead code.
26525
26526         * class.cs (Property.Emit): More simplification.
26527         (Event.Emit): ditto.
26528
26529         Reworked to have less levels of indentation.
26530
26531 2001-11-08  Ravi Pratap  <ravi@ximian.com>
26532
26533         * class.cs (Property): Emit attributes.
26534
26535         (Field): Ditto.
26536
26537         (Event): Ditto.
26538
26539         (Indexer): Ditto.
26540
26541         (Operator): Ditto.
26542
26543         * enum.cs (Emit): Ditto.
26544
26545         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
26546         Enums too.
26547
26548         * class.cs (Field, Event, etc.): Move attribute generation into the
26549         Emit method everywhere.
26550
26551         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
26552         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
26553         as we had no way of defining nested enums !
26554
26555         * rootcontext.cs : Adjust code accordingly.
26556
26557         * typemanager.cs (AddEnumType): To keep track of enum types separately.
26558
26559 2001-11-07  Ravi Pratap  <ravi@ximian.com>
26560
26561         * expression.cs (EvalConstantExpression): Move into ecore.cs
26562
26563         * enum.cs (Enum): Rename some members and make them public and readonly
26564         according to our convention.
26565
26566         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
26567         nothing else.
26568
26569         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
26570
26571         (Enum::Emit): Write a simple version for now which doesn't try to compute
26572         expressions. I shall modify this to be more robust in just a while.
26573
26574         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
26575
26576         (TypeContainer::CloseType): Create the Enum types too.
26577
26578         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
26579
26580         * expression.cs (EvalConstantExpression): Get rid of completely.
26581
26582         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
26583         user-defined values and other cases.
26584
26585         (IsValidEnumLiteral): Helper function.
26586
26587         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
26588         out there in the case we had a literal FieldExpr.
26589
26590         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
26591
26592         (Literalize): Revamp a bit to take two arguments.
26593
26594         (EnumLiteral): New class which derives from Literal to wrap enum literals.
26595
26596 2001-11-06  Ravi Pratap  <ravi@ximian.com>
26597
26598         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
26599
26600         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
26601
26602         (Resolve): Use the above to ensure we have proper initializers.
26603
26604 2001-11-05  Ravi Pratap  <ravi@ximian.com>
26605
26606         * expression.cs (Expression::EvalConstantExpression): New method to 
26607         evaluate constant expressions.
26608
26609         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
26610
26611 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
26612
26613         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
26614         in an array.
26615
26616         (Binary.ResolveOperator): Handle operator != (object a, object b)
26617         and operator == (object a, object b);
26618
26619         (Binary.DoNumericPromotions): Indicate whether the numeric
26620         promotion was possible.
26621
26622         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
26623         Implement.  
26624
26625         Made the ArrayAccess implement interface IAssignMethod instead of
26626         IStackStore as the order in which arguments are passed reflects
26627         this.
26628
26629         * assign.cs: Instead of using expr.ExprClass to select the way of
26630         assinging, probe for the IStackStore/IAssignMethod interfaces.
26631
26632         * typemanager.cs: Load InitializeArray definition.
26633
26634         * rootcontext.cs (RootContext.MakeStaticData): Used to define
26635         static data that can be used to initialize arrays. 
26636
26637 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
26638
26639         * expression.cs: Handle operator== and operator!= for booleans.
26640
26641         (Conditioal.Reduce): Implement reducer for the ?: operator.
26642
26643         (Conditional.Resolve): Implement dead code elimination.
26644
26645         (Binary.Resolve): Catch string literals and return a new
26646         concatenated string.
26647
26648         (Unary.Reduce): Implement reduction of unary expressions.
26649
26650         * ecore.cs: Split out the expression core handling here.
26651
26652         (Expression.Reduce): New method used to perform constant folding
26653         and CSE.  This is needed to support constant-expressions. 
26654
26655         * statement.cs (Statement.EmitBoolExpression): Pass true and false
26656         targets, and optimize for !x.
26657
26658 2001-11-04  Ravi Pratap  <ravi@ximian.com>
26659
26660         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
26661         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
26662         set custom atttributes.
26663
26664         * literal.cs (Literal::GetValue): New abstract method to return the actual
26665         value of the literal, cast as an object.
26666
26667         (*Literal): Implement GetValue method.
26668
26669         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
26670         expressions to the arraylist but objects of type Argument.
26671
26672         * class.cs (TypeContainer::Emit): Emit our attributes too.
26673
26674         (Method::Emit, Constructor::Emit): Ditto.
26675
26676         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
26677         to be ignoring earlier.
26678
26679 2001-11-03  Ravi Pratap  <ravi@ximian.com>
26680
26681         * attribute.cs (AttributeSection::Define): Implement to do the business
26682         of constructing a CustomAttributeBuilder.
26683
26684         (Attribute): New trivial class. Increases readability of code.  
26685
26686         * cs-parser.jay : Update accordingly.
26687
26688         (positional_argument_list, named_argument_list, named_argument): New rules
26689
26690         (attribute_arguments): Use the above so that we are more correct.
26691
26692 2001-11-02  Ravi Pratap  <ravi@ximian.com>
26693
26694         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
26695         to perform all checks for a method with a params parameter.
26696
26697         (Invocation::OverloadResolve): Update to use the above method and therefore
26698         cope correctly with params method invocations.
26699
26700         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
26701         params too.
26702
26703         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
26704         constructors in our parent too because we can't afford to miss out on 
26705         protected ones ;-)
26706
26707         * attribute.cs (AttributeSection): New name for the class Attribute
26708
26709         Other trivial changes to improve readability.
26710
26711         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
26712         use the new class names.
26713
26714 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26715
26716         * class.cs (Method::Define): Complete definition for params types too
26717
26718         (Indexer::Define): Ditto.
26719
26720         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
26721         Cope everywhere with a request for info about the array parameter.
26722
26723 2001-11-01  Ravi Pratap  <ravi@ximian.com>
26724
26725         * tree.cs (RecordNamespace): Fix up to check for the correct key.
26726
26727         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
26728         local_variable_type to extract the string corresponding to the type.
26729
26730         (local_variable_type): Fixup the action to use the new helper method.
26731
26732         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
26733         go.
26734
26735         * expression.cs : Clean out code which uses the above.
26736
26737 2001-10-31  Ravi Pratap  <ravi@ximian.com>
26738
26739         * typemanager.cs (RegisterMethod): Check if we already have an existing key
26740         and bale out if necessary by returning a false.
26741
26742         (RegisterProperty): Ditto.
26743
26744         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
26745         and print out appropriate error messages.
26746
26747         * interface.cs (everywhere): Ditto.
26748
26749         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
26750         location to constructor.
26751
26752         * class.cs (Property, Event, Indexer): Update accordingly.
26753
26754         * ../errors/cs111.cs : Added.
26755
26756         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
26757         of a method, as laid down by the spec.
26758
26759         (Invocation::OverloadResolve): Use the above method.
26760
26761 2001-10-31  Ravi Pratap  <ravi@ximian.com>
26762
26763         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
26764         now take a TypeContainer and a Parameters object.
26765
26766         (ParameterData): Modify return type of ParameterModifier method to be 
26767         Parameter.Modifier and not a string.
26768
26769         (ReflectionParameters, InternalParameters): Update accordingly.
26770
26771         * expression.cs (Argument::GetParameterModifier): Same here.
26772
26773         * support.cs (InternalParameters::ParameterType): Find a better way of determining
26774         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
26775         symbol in it at all so maybe this is only for now.
26776
26777 2001-10-30  Ravi Pratap  <ravi@ximian.com>
26778
26779         * support.cs (InternalParameters): Constructor now takes an extra argument 
26780         which is the actual Parameters class.
26781
26782         (ParameterDesc): Update to provide info on ref/out modifiers.
26783
26784         * class.cs (everywhere): Update call to InternalParameters to pass in
26785         the second argument too.
26786
26787         * support.cs (ParameterData): Add ParameterModifier, which is a method 
26788         to return the modifier info [ref/out etc]
26789
26790         (InternalParameters, ReflectionParameters): Implement the above.
26791
26792         * expression.cs (Argument::ParameterModifier): Similar function to return
26793         info about the argument's modifiers.
26794
26795         (Invocation::OverloadResolve): Update to take into account matching modifiers 
26796         too.
26797
26798         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
26799         a new SetFormalParameters object which we pass to InternalParameters.
26800
26801 2001-10-30  Ravi Pratap  <ravi@ximian.com>
26802
26803         * expression.cs (NewArray): Merge into the ArrayCreation class.
26804
26805 2001-10-29  Ravi Pratap  <ravi@ximian.com>
26806
26807         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
26808         NewUserdefinedArray into one as there wasn't much of a use in having
26809         two separate ones.
26810
26811         * expression.cs (Argument): Change field's name to ArgType from Type.
26812
26813         (Type): New readonly property which returns the proper type, taking into 
26814         account ref/out modifiers.
26815
26816         (everywhere): Adjust code accordingly for the above.
26817
26818         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
26819         whether we are emitting for a ref or out parameter.
26820
26821         * expression.cs (Argument::Emit): Use the above field to set the state.
26822
26823         (LocalVariableReference::Emit): Update to honour the flag and emit the
26824         right stuff.
26825
26826         * parameter.cs (Attributes): Set the correct flags for ref parameters.
26827
26828         * expression.cs (Argument::FullDesc): New function to provide a full desc.
26829
26830         * support.cs (ParameterData): Add method ParameterDesc to the interface.
26831
26832         (ReflectionParameters, InternalParameters): Implement the above method.
26833
26834         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
26835         reporting errors.
26836
26837         (Invocation::FullMethodDesc): Ditto. 
26838
26839 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
26840
26841         * cs-parser.jay: Add extra production for the second form of array
26842         creation. 
26843
26844         * expression.cs (ArrayCreation): Update to reflect the above
26845         change. 
26846
26847         * Small changes to prepare for Array initialization.
26848
26849 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
26850
26851         * typemanager.cs (ImplementsInterface): interface might be null;
26852         Deal with this problem;
26853
26854         Also, we do store negative hits on the cache (null values), so use
26855         this instead of calling t.GetInterfaces on the type everytime.
26856
26857 2001-10-28  Ravi Pratap  <ravi@ximian.com>
26858
26859         * typemanager.cs (IsBuiltinType): New method to help determine the same.
26860
26861         * expression.cs (New::DoResolve): Get rid of array creation code and instead
26862         split functionality out into different classes.
26863
26864         (New::FormArrayType): Move into NewBuiltinArray.
26865
26866         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
26867         quite useless.
26868
26869         (NewBuiltinArray): New class to handle creation of built-in arrays.
26870
26871         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
26872         account creation of one-dimensional arrays.
26873
26874         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
26875
26876         (NewUserdefinedArray::DoResolve): Implement.
26877
26878         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
26879
26880         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
26881         we maintain inside the TypeManager. This is necessary to perform lookups on the
26882         module builder.
26883
26884         (LookupType): Update to perform GetType on the module builders too.     
26885
26886         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
26887
26888         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
26889
26890 2001-10-23  Ravi Pratap  <ravi@ximian.com>
26891
26892         * expression.cs (New::DoResolve): Implement guts of array creation.
26893
26894         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
26895
26896 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
26897
26898         * expression.cs: Fix bug I introduced lsat night that broke
26899         Delegates. 
26900
26901         (Expression.Resolve): Report a 246 error (can not resolve name)
26902         if we find a SimpleName in the stream.
26903
26904         (Expression.ResolveLValue): Ditto.
26905
26906         (Expression.ResolveWithSimpleName): This function is a variant of
26907         ResolveName, this one allows SimpleNames to be returned without a
26908         warning.  The only consumer of SimpleNames is MemberAccess
26909
26910 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
26911
26912         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
26913         might arrive here.  I have my doubts that this is correct.
26914
26915         * statement.cs (Lock): Implement lock statement.
26916
26917         * cs-parser.jay: Small fixes to support `lock' and `using'
26918
26919         * cs-tokenizer.cs: Remove extra space
26920
26921         * driver.cs: New flag --checked, allows to turn on integer math
26922         checking. 
26923
26924         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
26925         Threading.Monitor.Exit 
26926
26927 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
26928
26929         * expression.cs (IndexerAccess::DoResolveLValue): Set the
26930         Expression Class to be IndexerAccess.
26931
26932         Notice that Indexer::DoResolve sets the eclass to Value.
26933
26934 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
26935
26936         * class.cs (TypeContainer::Emit): Emit code for indexers.
26937
26938         * assign.cs (IAssignMethod): New interface implemented by Indexers
26939         and Properties for handling assignment.
26940
26941         (Assign::Emit): Simplify and reuse code. 
26942
26943         * expression.cs (IndexerAccess, PropertyExpr): Implement
26944         IAssignMethod, clean up old code. 
26945
26946 2001-10-22  Ravi Pratap  <ravi@ximian.com>
26947
26948         * typemanager.cs (ImplementsInterface): New method to determine if a type
26949         implements a given interface. Provides a nice cache too.
26950
26951         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
26952         method.
26953
26954         (ConvertReferenceExplicit): Ditto.
26955
26956         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
26957         various methods, with correct names etc.
26958
26959         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
26960         Operator.UnaryNegation.
26961
26962         * cs-parser.jay (operator_declarator): Be a little clever in the case where
26963         we have a unary plus or minus operator.
26964
26965         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
26966         UnaryMinus.
26967
26968         * everywhere : update accordingly.
26969
26970         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
26971         respectively.
26972
26973         * class.cs (Method::Define): For the case where we are implementing a method
26974         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
26975         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
26976
26977 2001-10-21  Ravi Pratap  <ravi@ximian.com>
26978
26979         * interface.cs (FindMembers): Implement to work around S.R.E
26980         lameness.
26981
26982         * typemanager.cs (IsInterfaceType): Implement.
26983
26984         (FindMembers): Update to handle interface types too.
26985
26986         * expression.cs (ImplicitReferenceConversion): Re-write bits which
26987         use IsAssignableFrom as that is not correct - it doesn't work.
26988
26989         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
26990         and accordingly override EmitStatement.
26991
26992         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
26993         using the correct logic :-)
26994
26995 2001-10-19  Ravi Pratap  <ravi@ximian.com>
26996
26997         * ../errors/cs-11.cs : Add to demonstrate error -11 
26998
26999 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
27000
27001         * assign.cs (Assign::Resolve): Resolve right hand side first, and
27002         then pass this as a hint to ResolveLValue.
27003
27004         * expression.cs (FieldExpr): Add Location information
27005
27006         (FieldExpr::LValueResolve): Report assignment to readonly
27007         variable. 
27008
27009         (Expression::ExprClassFromMemberInfo): Pass location information.
27010
27011         (Expression::ResolveLValue): Add new method that resolves an
27012         LValue. 
27013
27014         (Expression::DoResolveLValue): Default invocation calls
27015         DoResolve. 
27016
27017         (Indexers): New class used to keep track of indexers in a given
27018         Type. 
27019
27020         (IStackStore): Renamed from LValue, as it did not really describe
27021         what this did.  Also ResolveLValue is gone from this interface and
27022         now is part of Expression.
27023
27024         (ElementAccess): Depending on the element access type
27025
27026         * typemanager.cs: Add `indexer_name_type' as a Core type
27027         (System.Runtime.CompilerServices.IndexerNameAttribute)
27028
27029         * statement.cs (Goto): Take a location.
27030
27031 2001-10-18  Ravi Pratap  <ravi@ximian.com>
27032
27033         * delegate.cs (Delegate::VerifyDelegate): New method to verify
27034         if two delegates are compatible.
27035
27036         (NewDelegate::DoResolve): Update to take care of the case when
27037         we instantiate a delegate from another delegate.
27038
27039         * typemanager.cs (FindMembers): Don't even try to look up members
27040         of Delegate types for now.
27041
27042 2001-10-18  Ravi Pratap  <ravi@ximian.com>
27043
27044         * delegate.cs (NewDelegate): New class to take care of delegate
27045         instantiation.
27046
27047         * expression.cs (New): Split the delegate related code out into 
27048         the NewDelegate class.
27049
27050         * delegate.cs (DelegateInvocation): New class to handle delegate 
27051         invocation.
27052
27053         * expression.cs (Invocation): Split out delegate related code into
27054         the DelegateInvocation class.
27055
27056 2001-10-17  Ravi Pratap  <ravi@ximian.com>
27057
27058         * expression.cs (New::DoResolve): Implement delegate creation fully
27059         and according to the spec.
27060
27061         (New::DoEmit): Update to handle delegates differently.
27062
27063         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
27064         because of which we were printing out arguments in reverse order !
27065
27066         * delegate.cs (VerifyMethod): Implement to check if the given method
27067         matches the delegate.
27068
27069         (FullDelegateDesc): Implement.
27070
27071         (VerifyApplicability): Implement.
27072
27073         * expression.cs (Invocation::DoResolve): Update to accordingly handle
27074         delegate invocations too.
27075
27076         (Invocation::Emit): Ditto.
27077
27078         * ../errors/cs1593.cs : Added.
27079
27080         * ../errors/cs1594.cs : Added.
27081
27082         * delegate.cs (InstanceExpression, TargetMethod): New properties.
27083
27084 2001-10-16  Ravi Pratap  <ravi@ximian.com>
27085
27086         * typemanager.cs (intptr_type): Core type for System.IntPtr
27087
27088         (InitCoreTypes): Update for the same.
27089
27090         (iasyncresult_type, asynccallback_type): Ditto.
27091
27092         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
27093         correct.
27094
27095         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
27096         too.
27097
27098         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
27099         the builders for the 4 members of a delegate type :-)
27100
27101         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
27102         type.
27103
27104         * expression.cs (New::DoResolve): Implement guts for delegate creation.
27105
27106         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
27107
27108 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
27109
27110         * statement.cs (Break::Emit): Implement.   
27111         (Continue::Emit): Implement.
27112
27113         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27114         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27115         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
27116         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
27117         end loop
27118
27119         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
27120         properties that track the label for the current loop (begin of the
27121         loop and end of the loop).
27122
27123 2001-10-15  Ravi Pratap  <ravi@ximian.com>
27124
27125         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
27126         use of emitting anything at all.
27127
27128         * class.cs, rootcontext.cs : Get rid of calls to the same.
27129
27130         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
27131
27132         (Populate): Define the constructor correctly and set the implementation
27133         attributes.
27134
27135         * typemanager.cs (delegate_types): New hashtable to hold delegates that
27136         have been defined.
27137
27138         (AddDelegateType): Implement.
27139
27140         (IsDelegateType): Implement helper method.
27141
27142         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
27143
27144         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
27145         and accordingly handle it.
27146
27147         * delegate.cs (Populate): Take TypeContainer argument.
27148         Implement bits to define the Invoke method. However, I still haven't figured out
27149         how to take care of the native int bit :-(
27150
27151         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
27152         Qualify the name of the delegate, not its return type !
27153
27154         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
27155         conversion.
27156
27157         (StandardConversionExists): Checking for array types turns out to be recursive.
27158
27159         (ConvertReferenceExplicit): Implement array conversion.
27160
27161         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
27162
27163 2001-10-12  Ravi Pratap  <ravi@ximian.com>
27164
27165         * cs-parser.jay (delegate_declaration): Store the fully qualified
27166         name as it is a type declaration.
27167
27168         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
27169         readonly.
27170
27171         (DefineDelegate): Renamed from Define. Does the same thing essentially,
27172         as TypeContainer::DefineType.
27173
27174         (Populate): Method in which all the definition of the various methods (Invoke)
27175         etc is done.
27176
27177         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
27178         see.
27179
27180         (CloseDelegate): Finally creates the delegate.
27181
27182         * class.cs (TypeContainer::DefineType): Update to define delegates.
27183         (Populate, Emit and CloseType): Do the same thing here too.
27184
27185         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
27186         delegates in all these operations.
27187
27188 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
27189
27190         * expression.cs: LocalTemporary: a new expression used to
27191         reference a temporary that has been created.
27192
27193         * assign.cs: Handle PropertyAccess back here, so that we can
27194         provide the proper semantic access to properties.
27195
27196         * expression.cs (Expression::ConvertReferenceExplicit): Implement
27197         a few more explicit conversions. 
27198
27199         * modifiers.cs: `NEW' modifier maps to HideBySig.
27200
27201         * expression.cs (PropertyExpr): Make this into an
27202         ExpressionStatement, and support the EmitStatement code path. 
27203
27204         Perform get/set error checking, clean up the interface.
27205
27206         * assign.cs: recognize PropertyExprs as targets, and if so, turn
27207         them into toplevel access objects.
27208
27209 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
27210
27211         * expression.cs: PropertyExpr::PropertyExpr: use work around the
27212         SRE.
27213
27214         * typemanager.cs: Keep track here of our PropertyBuilders again to
27215         work around lameness in SRE.
27216
27217 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
27218
27219         * expression.cs (LValue::LValueResolve): New method in the
27220         interface, used to perform a second resolution pass for LValues. 
27221
27222         (This::DoResolve): Catch the use of this in static methods.
27223
27224         (This::LValueResolve): Implement.
27225
27226         (This::Store): Remove warning, assigning to `this' in structures
27227         is 
27228
27229         (Invocation::Emit): Deal with invocation of
27230         methods on value types.  We need to pass the address to structure
27231         methods rather than the object itself.  (The equivalent code to
27232         emit "this" for structures leaves the entire structure on the
27233         stack instead of a pointer to it). 
27234
27235         (ParameterReference::DoResolve): Compute the real index for the
27236         argument based on whether the method takes or not a `this' pointer
27237         (ie, the method is static).
27238
27239         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
27240         value types returned from functions when we need to invoke a
27241         method on the sturcture.
27242
27243
27244 2001-10-11  Ravi Pratap  <ravi@ximian.com>
27245
27246         * class.cs (TypeContainer::DefineType): Method to actually do the business of
27247         defining the type in the Modulebuilder or Typebuilder. This is to take
27248         care of nested types which need to be defined on the TypeBuilder using
27249         DefineNestedMethod.
27250
27251         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
27252         methods in RootContext, only ported to be part of TypeContainer.
27253
27254         (TypeContainer::GetInterfaceOrClass): Ditto.
27255
27256         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
27257
27258         * interface.cs (Interface::DefineInterface): New method. Does exactly
27259         what RootContext.CreateInterface did earlier, only it takes care of nested types 
27260         too.
27261
27262         (Interface::GetInterfaces): Move from RootContext here and port.
27263
27264         (Interface::GetInterfaceByName): Same here.
27265
27266         * rootcontext.cs (ResolveTree): Re-write.
27267
27268         (PopulateTypes): Re-write.
27269
27270         * class.cs (TypeContainer::Populate): Populate nested types too.
27271         (TypeContainer::Emit): Emit nested members too.
27272
27273         * typemanager.cs (AddUserType): Do not make use of the FullName property,
27274         instead just use the name argument passed in as it is already fully
27275         qualified.
27276
27277         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
27278         to TypeContainer mapping to see if a type is user-defined.
27279
27280         * class.cs (TypeContainer::CloseType): Implement. 
27281
27282         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
27283         the default constructor.
27284
27285         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
27286         twice.
27287
27288         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
27289
27290         * interface.cs (CloseType): Create the type here.
27291
27292         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
27293         the hierarchy.
27294
27295         Remove all the methods which are now in TypeContainer.
27296
27297 2001-10-10  Ravi Pratap  <ravi@ximian.com>
27298
27299         * delegate.cs (Define): Re-write bits to define the delegate
27300         correctly.
27301
27302 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
27303
27304         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
27305
27306         * expression.cs (ImplicitReferenceConversion): handle null as well
27307         as a source to convert to any reference type.
27308
27309         * statement.cs (Return): Perform any implicit conversions to
27310         expected return type.  
27311
27312         Validate use of return statement.  
27313
27314         * codegen.cs (EmitContext): Pass the expected return type here.
27315
27316         * class.cs (Method, Constructor, Property): Pass expected return
27317         type to EmitContext.
27318
27319 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
27320
27321         * expression.cs: Make DoResolve take an EmitContext instead of a
27322         TypeContainer.
27323
27324         Replaced `l' and `location' for `loc', for consistency.
27325
27326         (Error, Warning): Remove unneeded Tc argument.
27327
27328         * assign.cs, literal.cs, constant.cs: Update to new calling
27329         convention. 
27330
27331         * codegen.cs: EmitContext now contains a flag indicating whether
27332         code is being generated in a static method or not.
27333
27334         * cs-parser.jay: DecomposeQI, new function that replaces the old
27335         QualifiedIdentifier.  Now we always decompose the assembled
27336         strings from qualified_identifier productions into a group of
27337         memberaccesses.
27338
27339 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
27340
27341         * rootcontext.cs: Deal with field-less struct types correctly now
27342         by passing the size option to Define Type.
27343
27344         * class.cs: Removed hack that created one static field. 
27345
27346 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27347
27348         * statement.cs: Moved most of the code generation here. 
27349
27350 2001-10-09  Ravi Pratap  <ravi@ximian.com>
27351
27352         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
27353         seem very right.
27354
27355         (ElementAccess): Remove useless bits for now - keep checks as the spec
27356         says.
27357
27358 2001-10-08  Ravi Pratap  <ravi@ximian.com>
27359
27360         * expression.cs (ElementAccess::DoResolve): Remove my crap code
27361         and start performing checks according to the spec.
27362
27363 2001-10-07  Ravi Pratap  <ravi@ximian.com>
27364
27365         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
27366         rank_specifiers instead.
27367
27368         (rank_specifiers): Change the order in which the rank specifiers are stored
27369
27370         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
27371
27372         * expression.cs (ElementAccess): Implement the LValue interface too.
27373
27374 2001-10-06  Ravi Pratap  <ravi@ximian.com>
27375
27376         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
27377         except that user defined conversions are not included.
27378
27379         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
27380         perform the conversion of the return type, if necessary.
27381
27382         (New::DoResolve): Check whether we are creating an array or an object
27383         and accordingly do the needful.
27384
27385         (New::Emit): Same here.
27386
27387         (New::DoResolve): Implement guts of array creation.
27388
27389         (New::FormLookupType): Helper function.
27390
27391 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
27392
27393         * codegen.cs: Removed most of the code generation here, and move the
27394         corresponding code generation bits to the statement classes. 
27395
27396         Added support for try/catch/finalize and throw.
27397
27398         * cs-parser.jay: Added support for try/catch/finalize.
27399
27400         * class.cs: Catch static methods having the flags override,
27401         virtual or abstract.
27402
27403         * expression.cs (UserCast): This user cast was not really doing
27404         what it was supposed to do.  Which is to be born in fully resolved
27405         state.  Parts of the resolution were being performed at Emit time! 
27406
27407         Fixed this code.
27408
27409 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27410
27411         * expression.cs: Implicity convert the result from UserCast.
27412
27413 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27414
27415         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
27416         prevented it from working correctly. 
27417
27418         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
27419         merely ConvertImplicit.
27420
27421 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
27422
27423         * typemanager.cs: Make the LookupTypeContainer function static,
27424         and not per-instance.  
27425
27426         * class.cs: Make static FindMembers (the one that takes a Type
27427         argument). 
27428
27429         * codegen.cs: Add EmitForeach here.
27430
27431         * cs-parser.jay: Make foreach a toplevel object instead of the
27432         inline expansion, as we need to perform semantic analysis on it. 
27433
27434 2001-10-05  Ravi Pratap  <ravi@ximian.com>
27435
27436         * expression.cs (Expression::ImplicitUserConversion): Rename to
27437         UserDefinedConversion.
27438
27439         (Expression::UserDefinedConversion): Take an extra argument specifying 
27440         whether we look for explicit user conversions too.
27441
27442         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
27443
27444         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
27445
27446         (ExplicitUserConversion): Make it a call to UserDefinedConversion
27447         with the appropriate arguments.
27448
27449         * cs-parser.jay (cast_expression): Record location too.
27450
27451         * expression.cs (Cast): Record location info.
27452
27453         (Expression::ConvertExplicit): Take location argument.
27454
27455         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
27456         to determine if we are doing explicit conversions.
27457
27458         (UserCast::Emit): Update accordingly.
27459
27460         (Expression::ConvertExplicit): Report an error if everything fails.
27461
27462         * ../errors/cs0030.cs : Add.
27463
27464 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
27465
27466         * modifiers.cs: If the ABSTRACT keyword is present, also set the
27467         virtual and newslot bits. 
27468
27469         * class.cs (TypeContainer::RegisterRequiredImplementations):
27470         Record methods we need.
27471
27472         (TypeContainer::MakeKey): Helper function to make keys for
27473         MethodBases, since the Methodbase key is useless.
27474
27475         (TypeContainer::Populate): Call RegisterRequiredImplementations
27476         before defining the methods.   
27477
27478         Create a mapping for method_builders_to_methods ahead of time
27479         instead of inside a tight loop.
27480
27481         (::RequireMethods):  Accept an object as the data to set into the
27482         hashtable so we can report interface vs abstract method mismatch.
27483
27484 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27485
27486         * report.cs: Make all of it static.
27487
27488         * rootcontext.cs: Drop object_type and value_type computations, as
27489         we have those in the TypeManager anyways.
27490
27491         Drop report instance variable too, now it is a global.
27492
27493         * driver.cs: Use try/catch on command line handling.
27494
27495         Add --probe option to debug the error reporting system with a test
27496         suite. 
27497
27498         * report.cs: Add support for exiting program when a probe
27499         condition is reached.
27500
27501 2001-10-03  Ravi Pratap  <ravi@ximian.com>
27502
27503         * expression.cs (Binary::DoNumericPromotions): Fix the case when
27504         we do a forcible conversion regardless of type, to check if 
27505         ForceConversion returns a null.
27506
27507         (Binary::error19): Use location to report error.
27508
27509         (Unary::error23): Use location here too.
27510
27511         * ../errors/cs0019.cs : Check in.
27512
27513         * ../errors/cs0023.cs : Check in.
27514
27515         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
27516         case of a non-null MethodInfo object with a length of 0 !
27517
27518         (Binary::ResolveOperator): Flag error if overload resolution fails to find
27519         an applicable member - according to the spec :-)
27520         Also fix logic to find members in base types.
27521
27522         (Unary::ResolveOperator): Same here.
27523
27524         (Unary::report23): Change name to error23 and make first argument a TypeContainer
27525         as I was getting thoroughly confused between this and error19 :-)
27526
27527         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
27528         (::FindMostEncompassedType): Implement.
27529         (::FindMostEncompassingType): Implement.
27530         (::StandardConversionExists): Implement.
27531
27532         (UserImplicitCast): Re-vamp. We now need info about most specific
27533         source and target types so that we can do the necessary conversions.
27534
27535         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
27536         mathematical union with no duplicates.
27537
27538 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
27539
27540         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
27541         in order from base classes to child classes, so that we can in
27542         child classes look up in our parent for method names and
27543         attributes (required for handling abstract, virtual, new, override
27544         constructs: we need to instrospect our base class, and if we dont
27545         populate the classes in order, the introspection might be
27546         incorrect.  For example, a method could query its parent before
27547         the parent has any methods and would determine that the parent has
27548         no abstract methods (while it could have had them)).
27549
27550         (RootContext::CreateType): Record the order in which we define the
27551         classes.
27552
27553 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
27554
27555         * class.cs (TypeContainer::Populate): Also method definitions can
27556         fail now, keep track of this.
27557
27558         (TypeContainer::FindMembers): Implement support for
27559         DeclaredOnly/noDeclaredOnly flag.
27560
27561         (Constructor::Emit) Return the ConstructorBuilder.
27562
27563         (Method::Emit) Return the MethodBuilder. 
27564         Check for abstract or virtual methods to be public.
27565
27566         * rootcontext.cs (RootContext::CreateType): Register all the
27567         abstract methods required for the class to be complete and the
27568         interface methods that must be implemented. 
27569
27570         * cs-parser.jay: Report error 501 (method requires body if it is
27571         not marked abstract or extern).
27572
27573         * expression.cs (TypeOf::Emit): Implement.
27574
27575         * typemanager.cs: runtime_handle_type, new global type.
27576
27577         * class.cs (Property::Emit): Generate code for properties.
27578
27579 2001-10-02  Ravi Pratap  <ravi@ximian.com>
27580
27581         * expression.cs (Unary::ResolveOperator): Find operators on base type
27582         too - we now conform exactly to the spec.
27583
27584         (Binary::ResolveOperator): Same here.
27585
27586         * class.cs (Operator::Define): Fix minor quirk in the tests.
27587
27588         * ../errors/cs0215.cs : Added.
27589
27590         * ../errors/cs0556.cs : Added.
27591
27592         * ../errors/cs0555.cs : Added.
27593
27594 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27595
27596         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
27597         single integer which is really efficient
27598
27599 2001-10-01  Ravi Pratap  <ravi@ximian.com>
27600
27601         *  expression.cs (Expression::ImplicitUserConversion): Use location
27602         even in the case when we are examining True operators.
27603  
27604         * class.cs (Operator::Define): Perform extensive checks to conform
27605         with the rules for operator overloading in the spec.
27606
27607         * expression.cs (Expression::ImplicitReferenceConversion): Implement
27608         some of the other conversions mentioned in the spec.
27609
27610         * typemanager.cs (array_type): New static member for the System.Array built-in
27611         type.
27612
27613         (cloneable_interface): For System.ICloneable interface.
27614
27615         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
27616         we start resolving the tree and populating types.
27617
27618         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
27619  
27620 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
27621
27622         * expression.cs (Expression::ExprClassFromMemberInfo,
27623         Expression::Literalize): Create literal expressions from
27624         FieldInfos which are literals.
27625
27626         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
27627         type casts, because they were wrong.  The test suite in tests
27628         caught these ones.
27629
27630         (ImplicitNumericConversion): ushort to ulong requires a widening
27631         cast. 
27632
27633         Int32 constant to long requires widening cast as well.
27634
27635         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
27636         for integers because the type on the stack is not i4.
27637
27638 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
27639
27640         * expression.cs (report118): require location argument. 
27641
27642         * parameter.cs: Do not dereference potential null value.
27643
27644         * class.cs: Catch methods that lack the `new' keyword when
27645         overriding a name.  Report warnings when `new' is used without
27646         anything being there to override.
27647
27648         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
27649
27650         * class.cs: Only add constructor to hashtable if it is non-null
27651         (as now constructors can fail on define).
27652
27653         (TypeManager, Class, Struct): Take location arguments.
27654
27655         Catch field instance initialization in structs as errors.
27656
27657         accepting_filter: a new filter for FindMembers that is static so
27658         that we dont create an instance per invocation.
27659
27660         (Constructor::Define): Catch errors where a struct constructor is
27661         parameterless 
27662
27663         * cs-parser.jay: Pass location information for various new
27664         constructs. 
27665
27666         * delegate.cs (Delegate): take a location argument.
27667
27668         * driver.cs: Do not call EmitCode if there were problesm in the
27669         Definition of the types, as many Builders wont be there. 
27670
27671         * decl.cs (Decl::Decl): Require a location argument.
27672
27673         * cs-tokenizer.cs: Handle properly hex constants that can not fit
27674         into integers, and find the most appropiate integer for it.
27675
27676         * literal.cs: Implement ULongLiteral.
27677
27678         * rootcontext.cs: Provide better information about the location of
27679         failure when CreateType fails.
27680
27681 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
27682
27683         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
27684         as well.
27685
27686         * expression.cs (Binary::CheckShiftArguments): Add missing type
27687         computation.
27688         (Binary::ResolveOperator): Add type to the logical and and logical
27689         or, Bitwise And/Or and Exclusive Or code paths, it was missing
27690         before.
27691
27692         (Binary::DoNumericPromotions): In the case where either argument
27693         is ulong (and most signed types combined with ulong cause an
27694         error) perform implicit integer constant conversions as well.
27695
27696 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
27697
27698         * expression.cs (UserImplicitCast): Method should always be
27699         non-null. 
27700         (Invocation::BetterConversion): Simplified test for IntLiteral.
27701
27702         (Expression::ImplicitNumericConversion): Split this routine out.
27703         Put the code that performs implicit constant integer conversions
27704         here. 
27705
27706         (Expression::Resolve): Become a wrapper around DoResolve so we can
27707         check eclass and type being set after resolve.
27708
27709         (Invocation::Badness): Remove this dead function
27710
27711         (Binary::ResolveOperator): Do not compute the expensive argumnets
27712         unless we have a union for it.
27713
27714         (Probe::Emit): Is needs to do an isinst and then
27715         compare against null.
27716
27717         (::CanConvert): Added Location argument.  If the Location argument
27718         is null (Location.Null), then we do not report errors.  This is
27719         used by the `probe' mechanism of the Explicit conversion.  We do
27720         not want to generate an error for something that the user
27721         explicitly requested to be casted.  But the pipeline for an
27722         explicit cast first tests for potential implicit casts.
27723
27724         So for now, if the Location is null, it means `Probe only' to
27725         avoid adding another argument.   Might have to revise this
27726         strategy later.
27727
27728         (ClassCast): New class used to type cast objects into arbitrary
27729         classes (used in Explicit Reference Conversions).
27730
27731         Implement `as' as well.
27732
27733         Reverted all the patches from Ravi below: they were broken:
27734
27735                 * The use of `level' as a mechanism to stop recursive
27736                   invocations is wrong.  That was there just to catch the
27737                   bug with a strack trace but not as a way of addressing
27738                   the problem.
27739
27740                   To fix the problem we have to *understand* what is going
27741                   on and the interactions and come up with a plan, not
27742                   just get things going.
27743
27744                 * The use of the type conversion cache that I proposed
27745                   last night had an open topic: How does this work across
27746                   protection domains.  A user defined conversion might not
27747                   be public in the location where we are applying the
27748                   conversion, a different conversion might be selected
27749                   (ie, private A->B (better) but public B->A (worse),
27750                   inside A, A->B applies, but outside it, B->A will
27751                   apply).
27752
27753                 * On top of that (ie, even if the above is solved),
27754                   conversions in a cache need to be abstract.  Ie, `To
27755                   convert from an Int to a Short use an OpcodeCast', not
27756                   `To convert from an Int to a Short use the OpcodeCast on
27757                   the variable 5' (which is what this patch was doing).
27758
27759 2001-09-28  Ravi Pratap  <ravi@ximian.com>
27760
27761         * expression.cs (Invocation::ConversionExists): Re-write to use
27762         the conversion cache
27763
27764         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
27765         cache all conversions done, not just user-defined ones.
27766
27767         (Invocation::BetterConversion): The real culprit. Use ConversionExists
27768         to determine if a conversion exists instead of acutually trying to 
27769         perform the conversion. It's faster too.
27770
27771         (Expression::ConvertExplicit): Modify to use ConversionExists to check
27772         and only then attempt the implicit conversion.
27773
27774 2001-09-28  Ravi Pratap  <ravi@ximian.com>
27775
27776         * expression.cs (ConvertImplicit): Use a cache for conversions
27777         already found. Check level of recursion and bail out if necessary.
27778
27779 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
27780
27781         * typemanager.cs (string_concat_string_string, string_concat_object_object):
27782         Export standard methods that we expect for string operations.
27783
27784         * statement.cs (Block::UsageWarning): Track usage of variables and
27785         report the errors for not used variables.
27786
27787         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
27788         operator. 
27789
27790 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
27791
27792         * codegen.cs: remove unnneded code 
27793
27794         * expression.cs: Removed BuiltinTypeAccess class
27795
27796         Fix the order in which implicit conversions are
27797         done.  
27798
27799         The previous fixed dropped support for boxed conversions (adding a
27800         test to the test suite now)
27801
27802         (UserImplicitCast::CanConvert): Remove test for source being null,
27803         that code is broken.  We should not feed a null to begin with, if
27804         we do, then we should track the bug where the problem originates
27805         and not try to cover it up here.
27806
27807         Return a resolved expression of type UserImplicitCast on success
27808         rather than true/false.  Ravi: this is what I was talking about,
27809         the pattern is to use a static method as a "constructor" for
27810         objects. 
27811
27812         Also, do not create arguments until the very last minute,
27813         otherwise we always create the arguments even for lookups that
27814         will never be performed. 
27815
27816         (UserImplicitCast::Resolve): Eliminate, objects of type
27817         UserImplicitCast are born in a fully resolved state. 
27818
27819         * typemanager.cs (InitCoreTypes): Init also value_type
27820         (System.ValueType). 
27821
27822         * expression.cs (Cast::Resolve): First resolve the child expression.
27823
27824         (LValue): Add new method AddressOf to be used by
27825         the `&' operator.  
27826
27827         Change the argument of Store to take an EmitContext instead of an
27828         ILGenerator, because things like FieldExpr need to be able to call
27829         their children expression to generate the instance code. 
27830
27831         (Expression::Error, Expression::Warning): Sugar functions for
27832         reporting errors.
27833
27834         (Expression::MemberLookup): Accept a TypeContainer instead of a
27835         Report as the first argument.
27836
27837         (Expression::ResolvePrimary): Killed.  I still want to improve
27838         this as currently the code is just not right.
27839
27840         (Expression::ResolveMemberAccess): Simplify, but it is still
27841         wrong. 
27842
27843         (Unary::Resolve): Catch errors in AddressOf operators.
27844
27845         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
27846         index to a byte for the short-version, or the compiler will choose
27847         the wrong Emit call, which generates the wrong data.
27848
27849         (ParameterReference::Emit, ::Store): same.
27850
27851         (FieldExpr::AddressOf): Implement.
27852
27853         * typemanager.cs: TypeManager: made public variable instead of
27854         property.
27855
27856         * driver.cs: document --fatal.
27857
27858         * report.cs (ErrorMessage, WarningMessage): new names for the old
27859         Error and Warning classes.
27860
27861         * cs-parser.jay (member_access): Turn built-in access to types
27862         into a normal simplename
27863
27864 2001-09-27  Ravi Pratap  <ravi@ximian.com>
27865
27866         * expression.cs (Invocation::BetterConversion): Fix to cope
27867         with q being null, since this was introducing a bug.
27868
27869         * expression.cs (ConvertImplicit): Do built-in conversions first.
27870
27871 2001-09-27  Ravi Pratap  <ravi@ximian.com>
27872
27873         * expression.cs (UserImplicitCast::Resolve): Fix bug.
27874
27875 2001-09-27  Ravi Pratap  <ravi@ximian.com>
27876
27877         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
27878         I had introduced long ago (what's new ?).
27879
27880         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
27881         the work of all the checking. 
27882         (ConvertImplicit): Call CanConvert and only then create object if necessary.
27883         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
27884
27885         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
27886         that is the right way. 
27887
27888         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
27889         overloading resolution. Use everywhere instead of cutting and pasting code.
27890
27891         (Binary::ResolveOperator): Use MakeUnionSet.
27892
27893         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
27894         we have to convert to bool types. Not complete yet.
27895
27896 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
27897
27898         * typemanager.cs (TypeManager::CSharpName): support ushort.
27899
27900         * expression.cs (Expression::TryImplicitIntConversion): Attempts
27901         to provide an expression that performsn an implicit constant int
27902         conversion (section 6.1.6).
27903         (Expression::ConvertImplicitRequired): Reworked to include
27904         implicit constant expression conversions.
27905
27906         (Expression::ConvertNumericExplicit): Finished.
27907
27908         (Invocation::Emit): If InstanceExpression is null, then it means
27909         that we perform a call on this.
27910
27911 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
27912
27913         * expression.cs (Unary::Emit): Remove some dead code.
27914         (Probe): Implement Resolve and Emit for `is'.
27915         (Expression::ConvertImplicitRequired): Attempt to do constant
27916         expression conversions here.  Maybe should be moved to
27917         ConvertImplicit, but I am not sure.
27918         (Expression::ImplicitLongConstantConversionPossible,
27919         Expression::ImplicitIntConstantConversionPossible): New functions
27920         that tell whether is it possible to apply an implicit constant
27921         expression conversion.
27922
27923         (ConvertNumericExplicit): Started work on explicit numeric
27924         conversions.
27925
27926         * cs-parser.jay: Update operator constants.
27927
27928         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
27929         (Parameters::GetSignature): Hook up VerifyArgs here.
27930         (Parameters::VerifyArgs): Verifies that no two arguments have the
27931         same name. 
27932
27933         * class.cs (Operator): Update the operator names to reflect the
27934         ones that the spec expects (as we are just stringizing the
27935         operator names).
27936
27937         * expression.cs (Unary::ResolveOperator): Fix bug: Use
27938         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
27939         previous usage did only work for our methods.
27940         (Expression::ConvertImplicit): Handle decimal implicit numeric
27941         conversions as well.
27942         (Expression::InternalTypeConstructor): Used to invoke constructors
27943         on internal types for default promotions.
27944
27945         (Unary::Emit): Implement special handling for the pre/post
27946         increment/decrement for overloaded operators, as they need to have
27947         the same semantics as the other operators.
27948
27949         (Binary::ResolveOperator): ditto.
27950         (Invocation::ConversionExists): ditto.
27951         (UserImplicitCast::Resolve): ditto.
27952
27953 2001-09-26  Ravi Pratap  <ravi@ximian.com>
27954
27955         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
27956         operator, return after emitting body. Regression tests pass again !
27957
27958         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
27959         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
27960         (Invocation::OverloadResolve): Ditto.
27961         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
27962
27963         * everywhere : update calls to the above methods accordingly.
27964
27965 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
27966
27967         * assign.cs (Assign): Make it inherit from ExpressionStatement.
27968
27969         * expression.cs (ExpressionStatement): New base class used for
27970         expressions that can appear in statements, so that we can provide
27971         an alternate path to generate expression that do not leave a value
27972         on the stack.
27973
27974         (Expression::Emit, and all the derivatives): We no longer return
27975         whether a value is left on the stack or not.  Every expression
27976         after being emitted leaves a single value on the stack.
27977
27978         * codegen.cs (EmitContext::EmitStatementExpression): Use the
27979         facilties of ExpressionStatement if possible.
27980
27981         * cs-parser.jay: Update statement_expression.
27982
27983 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
27984
27985         * driver.cs: Change the wording of message
27986
27987 2001-09-25  Ravi Pratap  <ravi@ximian.com>
27988
27989         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
27990         the type of the expression to the return type of the method if
27991         we have an overloaded operator match ! The regression tests pass again !
27992         (Unary::ResolveOperator): Ditto.
27993
27994         * expression.cs (Invocation::ConversionExists): Correct the member lookup
27995         to find "op_Implicit", not "implicit" ;-)
27996         (UserImplicitCast): New class to take care of user-defined implicit conversions.
27997         (ConvertImplicit, ForceConversion): Take TypeContainer argument
27998
27999         * everywhere : Correct calls to the above accordingly.
28000
28001         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
28002         (ConvertImplicit): Do user-defined conversion if it exists.
28003
28004 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
28005
28006         * assign.cs: track location.
28007         (Resolve): Use implicit conversions on assignment.
28008
28009         * literal.cs: Oops.  Not good, Emit of short access values should
28010         pass (Bytes) or the wrong argument will be selected.
28011
28012         * expression.cs (Unary::Emit): Emit code for -expr.
28013
28014         (Unary::ResolveOperator): Handle `Substract' for non-constants
28015         (substract from zero from the non-constants).
28016         Deal with Doubles as well. 
28017
28018         (Expression::ConvertImplicitRequired): New routine that reports an
28019         error if no implicit conversion exists. 
28020
28021         (Invocation::OverloadResolve): Store the converted implicit
28022         expressions if we make them
28023
28024 2001-09-24  Ravi Pratap  <ravi@ximian.com>
28025
28026         * class.cs (ConstructorInitializer): Take a Location argument.
28027         (ConstructorBaseInitializer): Same here.
28028         (ConstructorThisInitializer): Same here.
28029
28030         * cs-parser.jay : Update all calls accordingly.
28031
28032         * expression.cs (Unary, Binary, New): Take location argument.
28033         Update accordingly everywhere.
28034
28035         * cs-parser.jay : Update all calls to the above to take a location
28036         argument.
28037
28038         * class.cs : Ditto.
28039
28040 2001-09-24  Ravi Pratap  <ravi@ximian.com>
28041
28042         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
28043         (Invocation::BetterConversion): Same here
28044         (Invocation::ConversionExists): Ditto.
28045
28046         (Invocation::ConversionExists): Implement.
28047
28048 2001-09-22  Ravi Pratap  <ravi@ximian.com>
28049
28050         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
28051         Also take an additional TypeContainer argument.
28052
28053         * All over : Pass in TypeContainer as argument to OverloadResolve.
28054
28055         * typemanager.cs (CSharpName): Update to check for the string type and return
28056         that too.
28057
28058         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
28059         a given method.
28060
28061 2001-09-21  Ravi Pratap  <ravi@ximian.com>
28062
28063         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
28064         (Invocation::BetterFunction): Implement.
28065         (Invocation::BetterConversion): Implement.
28066         (Invocation::ConversionExists): Skeleton, no implementation yet.
28067
28068         Okay, things work fine !
28069
28070 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
28071
28072         * typemanager.cs: declare and load enum_type, delegate_type and
28073         void_type. 
28074
28075         * expression.cs (Expression::Emit): Now emit returns a value that
28076         tells whether a value is left on the stack or not.  This strategy
28077         might be reveted tomorrow with a mechanism that would address
28078         multiple assignments.
28079         (Expression::report118): Utility routine to report mismatches on
28080         the ExprClass.
28081
28082         (Unary::Report23): Report impossible type/operator combination
28083         utility function.
28084
28085         (Unary::IsIncrementableNumber): Whether the type can be
28086         incremented or decremented with add.
28087         (Unary::ResolveOperator): Also allow enumerations to be bitwise
28088         complemented. 
28089         (Unary::ResolveOperator): Implement ++, !, ~,
28090
28091         (Invocation::Emit): Deal with new Emit convetion.
28092
28093         * All Expression derivatives: Updated their Emit method to return
28094         whether they leave values on the stack or not.
28095
28096         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
28097         stack for expressions that are statements. 
28098
28099 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28100
28101         * expression.cs (LValue): New interface.  Must be implemented by
28102         LValue objects.
28103         (LocalVariableReference, ParameterReference, FieldExpr): Implement
28104         LValue interface.
28105
28106         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
28107         interface for generating code, simplifies the code.
28108
28109 2001-09-20  Ravi Pratap  <ravi@ximian.com>
28110
28111         * expression.cs (everywhere): Comment out return statements in ::Resolve
28112         methods to avoid the warnings.
28113
28114 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
28115
28116         * driver.cs (parse): Report error 2001 if we can not open the
28117         source file.
28118
28119         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
28120         not resolve it.
28121
28122         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
28123         object. 
28124
28125         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
28126         otherwise nested blocks end up with the same index.
28127
28128         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
28129
28130         * expression.cs:  Instead of having FIXMEs in the Resolve
28131         functions, throw exceptions so it is obvious that we are facing a
28132         bug. 
28133
28134         * cs-parser.jay (invocation_expression): Pass Location information.
28135
28136         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
28137         Use a basename for those routines because .NET does not like paths
28138         on them. 
28139
28140         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
28141         already defined.
28142
28143 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
28144
28145         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
28146         are loading the correct data types (throws an exception if not).
28147         (TypeManager::InitCoreTypes): Use CoreLookupType
28148
28149         * expression.cs (Unary::ResolveOperator): return the child
28150         expression for expressions which are just +expr.
28151         (Unary::ResolveOperator): Return negative literals for -LITERAL
28152         expressions (otherwise they are Unary {Literal}).
28153         (Invocation::Badness): Take into account `Implicit constant
28154         expression conversions'.
28155
28156         * literal.cs (LongLiteral): Implement long literal class.
28157         (IntLiteral): export the `Value' of the intliteral. 
28158
28159 2001-09-19  Ravi Pratap  <ravi@ximian.com>
28160
28161         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
28162
28163         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
28164         instead of 'Operator'
28165
28166         * expression.cs (Binary::ResolveOperator): Update accordingly.
28167         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
28168         and 'Minus'
28169
28170         * cs-parser.jay (unary_expression): Update to use the new names.
28171
28172         * gen-treedump.cs (GetUnary): Same here.
28173
28174         * expression.cs (Unary::Resolve): Implement.
28175         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
28176         operators are found instead of making noise ;-)
28177         (Unary::ResolveOperator): New method to do precisely the same thing which
28178         Binary::ResolveOperator does for Binary expressions.
28179         (Unary.method, .Arguments): Add.
28180         (Unary::OperName): Implement.   
28181         (Unary::ForceConversion): Copy and Paste !
28182
28183         * class.cs (Operator::Define): Fix a small bug for the case when we have 
28184         a unary operator.
28185
28186         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
28187         for the inbuilt operators. Only overloading works for now ;-)
28188
28189 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
28190
28191         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
28192         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
28193
28194         * expression.cs (This::Emit): Implement. 
28195         (This::Resolve): Implement.
28196         (TypeOf:Resolve): Implement.
28197         (Expression::ResolveSimpleName): Add an implicit this to instance
28198         field references. 
28199         (MemberAccess::Resolve): Deal with Parameters and Fields. 
28200         Bind instance variable to Field expressions.
28201         (FieldExpr::Instance): New field used to track the expression that
28202         represents the object instance.
28203         (FieldExpr::Resolve): Track potential errors from MemberLookup not
28204         binding 
28205         (FieldExpr::Emit): Implement.
28206
28207         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
28208         the last instruction contains a return opcode to avoid generating
28209         the last `ret' instruction (this generates correct code, and it is
28210         nice to pass the peverify output).
28211
28212         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
28213         initializer for static and instance variables.
28214         (Constructor::Emit): Allow initializer to be null in the case of
28215         static constructors.  Only emit initializer for instance
28216         constructors. 
28217
28218         (TypeContainer::FindMembers): Return a null array if there are no
28219         matches.
28220
28221         Also fix the code for the MemberTypes.Method branch, as it was not
28222         scanning that for operators (or tried to access null variables before).
28223
28224         * assign.cs (Assign::Emit): Handle instance and static fields. 
28225
28226         * TODO: Updated.
28227
28228         * driver.cs: Stop compilation if there are parse errors.
28229
28230         * cs-parser.jay (constructor_declaration): Provide default base
28231         initializer for non-static constructors.
28232         (constructor_declarator): Do not provide a default base
28233         initializers if none was specified.
28234         Catch the fact that constructors should not have parameters.
28235
28236         * class.cs: Do not emit parent class initializers for static
28237         constructors, that should be flagged as an error.
28238
28239 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28240
28241         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
28242         Move back code into TypeContainer::Populate.
28243
28244 2001-09-18  Ravi Pratap  <ravi@ximian.com>
28245
28246         * class.cs (TypeContainer::AddConstructor): Fix the check to
28247         compare against Name, not Basename. 
28248         (Operator::OpType): Change Plus and Minus to Add and Subtract.
28249
28250         * cs-parser.jay : Update accordingly.
28251
28252         * class.cs (TypeContainer::FindMembers): For the case where we are searching
28253         for methods, don't forget to look into the operators too.
28254         (RegisterMethodBuilder): Helper method to take care of this for
28255         methods, constructors and operators.
28256         (Operator::Define): Completely revamp.
28257         (Operator.OperatorMethod, MethodName): New fields.
28258         (TypeContainer::Populate): Move the registering of builders into
28259         RegisterMethodBuilder.
28260         (Operator::Emit): Re-write.
28261
28262         * expression.cs (Binary::Emit): Comment out code path to emit method
28263         invocation stuff for the case when we have a user defined operator. I am
28264         just not able to get it right !
28265
28266 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28267
28268         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
28269         argument. 
28270
28271         (Expression::MemberLookup): Provide a version that allows to
28272         specify the MemberTypes and BindingFlags. 
28273
28274         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
28275         so it was not fetching variable information from outer blocks.
28276
28277         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
28278         Beforefieldinit as it was buggy.
28279
28280         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
28281         that Ravi put here.  
28282
28283         * class.cs (Constructor::Emit): Only emit if block is not null.
28284         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
28285         deal with this by semantically definining it as if the user had
28286         done it.
28287
28288         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
28289         constructors as we now "emit" them at a higher level.
28290
28291         (TypeContainer::DefineDefaultConstructor): Used to define the
28292         default constructors if none was provided.
28293
28294         (ConstructorInitializer): Add methods Resolve and Emit. 
28295
28296         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
28297
28298 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28299
28300         * class.cs (TypeContainer::EmitDefaultConstructor): Register
28301         the default constructor builder with our hashtable for methodbuilders
28302         to methodcores.
28303
28304         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
28305         and argument_count is 0 in which case we have a match.
28306         (Binary::ResolveOperator): More null checking and miscellaneous coding
28307         style cleanup.
28308
28309 2001-09-17  Ravi Pratap  <ravi@ximian.com>
28310
28311         * rootcontext.cs (IsNameSpace): Compare against null.
28312
28313         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
28314
28315         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
28316         and Unary::Operator.
28317
28318         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
28319         accordingly.
28320
28321         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
28322         we have overloaded operators.
28323         (Binary::ResolveOperator): Implement the part which does the operator overload
28324         resolution.
28325
28326         * class.cs (Operator::Emit): Implement.
28327         (TypeContainer::Emit): Emit the operators we have too.
28328
28329         * expression.cs (Binary::Emit): Update to emit the appropriate code for
28330         the case when we have a user-defined operator.
28331
28332 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
28333
28334         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
28335
28336 2001-09-16  Ravi Pratap  <ravi@ximian.com>
28337
28338         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
28339         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
28340         (Constructor::Emit): Implement.
28341         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
28342         if we have no work to do. 
28343         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
28344         Emit method.
28345
28346         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
28347         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
28348
28349         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
28350         of parent.parent.
28351
28352 2001-09-15  Ravi Pratap  <ravi@ximian.com>
28353
28354         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
28355         in the source.
28356         (Tree::RecordNamespace): Method to do what the name says ;-)
28357         (Tree::Namespaces): Property to get at the namespaces hashtable.
28358
28359         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
28360         keep track.
28361
28362         * rootcontext.cs (IsNamespace): Fixed it :-)
28363
28364 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28365
28366         * class.cs (TypeContainer::FindMembers): Add support for
28367         constructors. 
28368         (MethodCore): New class that encapsulates both the shared aspects
28369         of a Constructor and a Method.  
28370         (Method, Constructor): Factored pieces into MethodCore.
28371
28372         * driver.cs: Added --fatal which makes errors throw exceptions.
28373         Load System assembly as well as part of the standard library.
28374
28375         * report.cs: Allow throwing exceptions on errors for debugging.
28376
28377         * modifiers.cs: Do not use `parent', instead use the real type
28378         container to evaluate permission settings.
28379
28380         * class.cs: Put Ravi's patch back in.  He is right, and we will
28381         have to cope with the
28382
28383 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28384
28385         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
28386         FamORAssem, not FamANDAssem.
28387
28388 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
28389
28390         * driver.cs: Added --parse option that only parses its input files
28391         and terminates.
28392
28393         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
28394         incorrect.  IsTopLevel is not used to tell whether an object is
28395         root_types or not (that can be achieved by testing this ==
28396         root_types).  But to see if this is a top-level *class* (not
28397         necessarly our "toplevel" container). 
28398
28399 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28400
28401         * enum.cs (Enum::Define): Modify to call the Lookup method on the
28402         parent instead of a direct call to GetType.
28403
28404 2001-09-14  Ravi Pratap  <ravi@ximian.com>
28405
28406         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
28407         Modifiers.TypeAttr. This should just be a call to that method.
28408
28409         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
28410         object so that we can determine if we are top-level or not.
28411
28412         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
28413         TypeContainer too.
28414
28415         * enum.cs (Enum::Define): Ditto.
28416
28417         * modifiers.cs (FieldAttr): Re-write.
28418
28419         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
28420         (TypeContainer::HaveStaticConstructor): New property to provide access
28421         to precisely that info.
28422
28423         * modifiers.cs (MethodAttr): Re-write.
28424         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
28425
28426         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
28427         of top-level types as claimed.
28428
28429 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28430
28431         * expression.cs (MemberLookup): Fruitless attempt to lookup
28432         constructors.  Maybe I need to emit default constructors?  That
28433         might be it (currently .NET emits this for me automatically).
28434         (Invocation::OverloadResolve): Cope with Arguments == null.
28435         (Invocation::EmitArguments): new function, shared by the new
28436         constructor and us.
28437         (Invocation::Emit): Handle static and instance methods.  Emit
28438         proper call instruction for virtual or non-virtual invocations.
28439         (New::Emit): Implement.
28440         (New::Resolve): Implement.
28441         (MemberAccess:Resolve): Implement.
28442         (MethodGroupExpr::InstanceExpression): used conforming to the spec
28443         to track instances.
28444         (FieldExpr::Resolve): Set type.
28445
28446         * support.cs: Handle empty arguments.
28447                 
28448         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
28449         SimpleLookup): Auxiliary routines to help parse a qualifier
28450         identifier.  
28451
28452         Update qualifier_identifier rule.
28453
28454         * codegen.cs: Removed debugging messages.
28455
28456         * class.cs: Make this a global thing, this acts just as a "key" to
28457         objects that we might have around.
28458
28459         (Populate): Only initialize method_builders_to_methods once.
28460
28461         * expression.cs (PropertyExpr): Initialize type from the
28462         PropertyType. 
28463
28464         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
28465         Resolve pattern.  Attempt to implicitly convert value to boolean.
28466         Emit code.
28467
28468         * expression.cs: Set the type for the int32/int32 argument case.
28469         (Binary::ResolveOperator): Set the return type to boolean for
28470         comparission operators
28471
28472         * typemanager.cs: Remove debugging print code.
28473
28474         (Invocation::Resolve): resolve type.
28475
28476         * class.cs: Allocate a MemberInfo of the correct size, as the code
28477         elsewhere depends on the test to reflect the correct contents.
28478
28479         (Method::) Keep track of parameters, due to System.Reflection holes
28480
28481         (TypeContainer::Populate): Keep track of MethodBuilders to Method
28482         mapping here.
28483
28484         (TypeContainer::FindMembers): Use ArrayList and then copy an array
28485         of the exact size and return that.
28486
28487         (Class::LookupMethodByBuilder): New function that maps
28488         MethodBuilders to its methods.  Required to locate the information
28489         on methods because System.Reflection bit us again.
28490
28491         * support.cs: New file, contains an interface ParameterData and
28492         two implementations: ReflectionParameters and InternalParameters
28493         used to access Parameter information.  We will need to grow this
28494         as required.
28495
28496         * expression.cs (Invocation::GetParameterData): implement a cache
28497         and a wrapper around the ParameterData creation for methods. 
28498         (Invocation::OverloadResolve): Use new code.
28499
28500 2001-09-13  Ravi Pratap  <ravi@ximian.com>
28501
28502         * class.cs (TypeContainer::EmitField): Remove and move into 
28503         (Field::Define): here and modify accordingly.
28504         (Field.FieldBuilder): New member.
28505         (TypeContainer::Populate): Update accordingly.
28506         (TypeContainer::FindMembers): Implement.
28507
28508 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
28509
28510         * statement.cs: (VariableInfo::VariableType): New field to be
28511         initialized with the full type once it is resolved. 
28512
28513 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
28514
28515         * parameter.cs (GetParameterInfo): Use a type cache to compute
28516         things only once, and to reuse this information
28517
28518         * expression.cs (LocalVariableReference::Emit): Implement.
28519         (OpcodeCast::Emit): fix.
28520
28521         (ParameterReference::Resolve): Implement.
28522         (ParameterReference::Emit): Implement.
28523
28524         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
28525         that are expressions need to stay as Expressions.
28526
28527         * typemanager.cs (CSharpName): Returns the C# name of a type if
28528         possible. 
28529
28530         * expression.cs (Expression::ConvertImplicit): New function that
28531         implements implicit type conversions.
28532
28533         (Expression::ImplicitReferenceConversion): Implements implicit
28534         reference conversions.
28535
28536         (EmptyCast): New type for transparent casts.
28537
28538         (OpcodeCast): New type for casts of types that are performed with
28539         a sequence of bytecodes.
28540
28541         (BoxedCast): New type used for casting value types into reference
28542         types.  Emits a box opcode.
28543
28544         (Binary::DoNumericPromotions): Implements numeric promotions of
28545         and computation of the Binary::Type.
28546
28547         (Binary::EmitBranchable): Optimization.
28548
28549         (Binary::Emit): Implement code emission for expressions.
28550
28551         * typemanager.cs (TypeManager): Added two new core types: sbyte
28552         and byte.
28553
28554 2001-09-12  Ravi Pratap  <ravi@ximian.com>
28555
28556         * class.cs (TypeContainer::FindMembers): Method which does exactly
28557         what Type.FindMembers does, only we don't have to use reflection. No
28558         implementation yet.
28559
28560         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
28561         typecontainer objects as we need to get at them.
28562         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
28563
28564         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
28565         typecontainer object.
28566
28567         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
28568         of just a Report object.
28569
28570 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28571
28572         * class.cs (Event::Define): Go back to using the prefixes "add_" and
28573         "remove_"
28574         (TypeContainer::Populate): Now define the delegates of the type too.
28575         (TypeContainer.Delegates): Property to access the list of delegates defined
28576         in the type.
28577
28578         * delegates.cs (Delegate::Define): Implement partially.
28579
28580         * modifiers.cs (TypeAttr): Handle more flags.
28581
28582 2001-09-11  Ravi Pratap  <ravi@ximian.com>
28583
28584         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
28585         and not <=
28586         (Operator::Define): Re-write logic to get types by using the LookupType method
28587         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
28588         (Indexer::Define): Ditto.
28589         (Event::Define): Ditto.
28590         (Property::Define): Ditto.
28591
28592 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28593
28594         * class.cs (TypeContainer::Populate): Now define operators too. 
28595         (TypeContainer.Operators): New property to access the list of operators
28596         in a type.
28597         (Operator.OperatorMethodBuilder): New member to hold the method builder
28598         for the operator we are defining.
28599         (Operator::Define): Implement.
28600
28601 2001-09-10  Ravi Pratap  <ravi@ximian.com>
28602
28603         * class.cs (Event::Define): Make the prefixes of the accessor methods
28604         addOn_ and removeOn_ 
28605
28606         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
28607         of the location being passed in too. Ideally, this should go later since all
28608         error reporting should be done through the Report object.
28609
28610         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
28611         (Populate): Iterate thru the indexers we have and define them too.
28612         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
28613         for the get and set accessors.
28614         (Indexer::Define): Implement.
28615
28616 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
28617
28618         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
28619         my previous implementation, did not work.
28620
28621         * typemanager.cs: Add a couple of missing types (the longs).
28622
28623         * literal.cs: Use TypeManager.bool_type instead of getting it.
28624
28625         * expression.cs (EventExpr): New kind of expressions.
28626         (Expressio::ExprClassFromMemberInfo): finish
28627
28628 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
28629
28630         * assign.cs: Emit stores to static fields differently.
28631
28632 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28633
28634         * Merge in changes and adjust code to tackle conflicts. Backed out my
28635         code in Assign::Resolve ;-) 
28636
28637 2001-09-08  Ravi Pratap  <ravi@ximian.com>
28638
28639         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
28640         instead Report.Error and also pass in the location.
28641         (CSharpParser::Lexer): New readonly property to return the reference
28642         to the Tokenizer object.
28643         (declare_local_variables): Use Report.Error with location instead of plain 
28644         old error.
28645         (CheckDef): Ditto.
28646
28647         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
28648         (Operator.CheckBinaryOperator): Ditto.
28649
28650         * cs-parser.jay (operator_declarator): Update accordingly.
28651
28652         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
28653         (CheckBinaryOperator): Same here.
28654
28655         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
28656         on the name without any prefixes of namespace names etc. This is because we
28657         already might have something already fully qualified like 
28658         'System.Console.WriteLine'
28659
28660         * assign.cs (Resolve): Begin implementation. Stuck ;-)
28661
28662 2001-09-07  Ravi Pratap  <ravi@ximian.com>
28663
28664         * cs-tokenizer.cs (location): Return a string which also contains
28665         the file name.
28666
28667         * expression.cs (ElementAccess): New class for expressions of the
28668         type 'element access.'
28669         (BaseAccess): New class for expressions of the type 'base access.'
28670         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
28671         respectively.
28672
28673         * cs-parser.jay (element_access): Implement action.
28674         (base_access): Implement actions.
28675         (checked_expression, unchecked_expression): Implement.
28676
28677         * cs-parser.jay (local_variable_type): Correct and implement.
28678         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
28679
28680         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
28681
28682         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
28683         name and the specifiers.
28684
28685         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
28686
28687         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
28688         making them all public ;-)
28689
28690         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
28691         class anyways.
28692
28693 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
28694
28695         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
28696         PropertyExprs.
28697         (FieldExpr, PropertyExprs): New resolved expressions.
28698         (SimpleName::MemberStaticCheck): Perform static checks for access
28699         to non-static fields on static methods. Maybe this should be
28700         generalized for MemberAccesses. 
28701         (SimpleName::ResolveSimpleName): More work on simple name
28702         resolution. 
28703
28704         * cs-parser.jay (primary_expression/qualified_identifier): track
28705         the parameter index.
28706
28707         * codegen.cs (CodeGen::Save): Catch save exception, report error.
28708         (EmitContext::EmitBoolExpression): Chain to expression generation
28709         instead of temporary hack.
28710         (::EmitStatementExpression): Put generic expression code generation.
28711
28712         * assign.cs (Assign::Emit): Implement variable assignments to
28713         local variables, parameters and fields.
28714
28715 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
28716
28717         * statement.cs (Block::GetVariableInfo): New method, returns the
28718         VariableInfo for a variable name in a block.
28719         (Block::GetVariableType): Implement in terms of GetVariableInfo
28720
28721         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
28722         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
28723
28724 2001-09-06  Ravi Pratap  <ravi@ximian.com>
28725
28726         * cs-parser.jay (operator_declaration): Continue on my quest : update
28727         to take attributes argument.
28728         (event_declaration): Ditto.
28729         (enum_declaration): Ditto.
28730         (indexer_declaration): Ditto.
28731
28732         * class.cs (Operator::Operator): Update constructor accordingly.
28733         (Event::Event): Ditto.
28734
28735         * delegate.cs (Delegate::Delegate): Same here.
28736
28737         * enum.cs (Enum::Enum): Same here.
28738
28739 2001-09-05  Ravi Pratap  <ravi@ximian.com>
28740
28741         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
28742
28743         * ../tests/cs0658.cs : New file to demonstrate error 0658.
28744
28745         * attribute.cs (Attributes): New class to encapsulate all attributes which were
28746         being passed around as an arraylist.
28747         (Attributes::AddAttribute): Method to add attribute sections.
28748
28749         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
28750         (struct_declaration): Update accordingly.
28751         (constant_declaration): Update.
28752         (field_declaration): Update.
28753         (method_header): Update.
28754         (fixed_parameter): Update.
28755         (parameter_array): Ditto.
28756         (property_declaration): Ditto.
28757         (destructor_declaration): Ditto.
28758
28759         * class.cs (Struct::Struct): Update constructors accordingly.
28760         (Class::Class): Ditto.
28761         (Field::Field): Ditto.
28762         (Method::Method): Ditto.
28763         (Property::Property): Ditto.
28764         (TypeContainer::OptAttribute): update property's return type.
28765
28766         * interface.cs (Interface.opt_attributes): New member.
28767         (Interface::Interface): Update to take the extra Attributes argument.
28768
28769         * parameter.cs (Parameter::Parameter): Ditto.
28770
28771         * constant.cs (Constant::Constant): Ditto.
28772
28773         * interface.cs (InterfaceMemberBase): New OptAttributes field.
28774         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
28775         the attributes as a parameter.
28776         (InterfaceProperty): Update constructor call.
28777         (InterfaceEvent): Ditto.
28778         (InterfaceMethod): Ditto.
28779         (InterfaceIndexer): Ditto.
28780
28781         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
28782         pass the attributes too.
28783         (interface_event_declaration): Ditto.
28784         (interface_property_declaration): Ditto.
28785         (interface_method_declaration): Ditto.
28786         (interface_declaration): Ditto.
28787
28788 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
28789
28790         * class.cs (Method::Define): Track the "static Main" definition to
28791         create an entry point. 
28792
28793         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
28794         EntryPoint if we find it. 
28795
28796         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
28797         (EmitContext::ig): Make this variable public.
28798
28799         * driver.cs: Make the default output file be the first file name
28800         with the .exe extension.  
28801
28802         Detect empty compilations
28803
28804         Handle various kinds of output targets.  Handle --target and
28805         rename -t to --dumper.
28806
28807         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
28808         methods inherited from Expression return now an Expression.  This
28809         will is used during the tree rewriting as we resolve them during
28810         semantic analysis.
28811
28812         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
28813         the spec.  Missing entirely is the information about
28814         accessability of elements of it.
28815
28816         (Expression::ExprClassFromMemberInfo): New constructor for
28817         Expressions that creates a fully initialized Expression based on
28818         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
28819         a Type.
28820
28821         (Invocation::Resolve): Begin implementing resolution of invocations.
28822
28823         * literal.cs (StringLiteral):  Implement Emit.
28824
28825 2001-09-05  Ravi Pratap  <ravi@ximian.com>
28826
28827         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
28828         member.
28829
28830 2001-09-04  Ravi Pratap  <ravi@ximian.com>
28831
28832         * cs-parser.jay (attribute_arguments): Implement actions.
28833         (attribute): Fix bug in production. Implement action.
28834         (attribute_list): Implement.
28835         (attribute_target): Implement.
28836         (attribute_target_specifier, opt_target_specifier): Implement
28837         (CheckAttributeTarget): New method to check if the attribute target
28838         is valid.
28839         (attribute_section): Implement.
28840         (opt_attributes): Implement.
28841
28842         * attribute.cs : New file to handle attributes.
28843         (Attribute): Class to hold attribute info.
28844
28845         * cs-parser.jay (opt_attribute_target_specifier): Remove production
28846         (attribute_section): Modify production to use 2 different rules to 
28847         achieve the same thing. 1 s/r conflict down !
28848         Clean out commented, useless, non-reducing dimension_separator rules.
28849
28850         * class.cs (TypeContainer.attributes): New member to hold list
28851         of attributes for a type.
28852         (Struct::Struct): Modify to take one more argument, the attribute list.
28853         (Class::Class): Ditto.
28854         (Field::Field): Ditto.
28855         (Method::Method): Ditto.
28856         (Property::Property): Ditto.
28857
28858         * cs-parser.jay (struct_declaration): Update constructor call to
28859         pass in the attributes too.
28860         (class_declaration): Ditto.
28861         (constant_declaration): Ditto.
28862         (field_declaration): Ditto.
28863         (method_header): Ditto.
28864         (fixed_parameter): Ditto.
28865         (parameter_array): Ditto.
28866         (property_declaration): Ditto.
28867
28868         * constant.cs (Constant::Constant): Update constructor similarly.
28869         Use System.Collections.
28870
28871         * parameter.cs (Parameter::Parameter): Update as above.
28872
28873 2001-09-02  Ravi Pratap  <ravi@ximian.com>
28874
28875         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
28876         (TypeContainer.delegates): New member to hold list of delegates.
28877
28878         * cs-parser.jay (delegate_declaration): Implement the action correctly 
28879         this time as I seem to be on crack ;-)
28880
28881 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
28882
28883         * rootcontext.cs (RootContext::IsNamespace): new function, used to
28884         tell whether an identifier represents a namespace.
28885
28886         * expression.cs (NamespaceExpr): A namespace expression, used only
28887         temporarly during expression resolution.
28888         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
28889         utility functions to resolve names on expressions.
28890
28891 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
28892
28893         * codegen.cs: Add hook for StatementExpressions. 
28894
28895         * class.cs: Fix inverted test for static flag in methods.
28896
28897 2001-09-02  Ravi Pratap  <ravi@ximian.com>
28898
28899         * class.cs (Operator::CheckUnaryOperator): Correct error number used
28900         to make it coincide with MS' number.
28901         (Operator::CheckBinaryOperator): Ditto.
28902
28903         * ../errors/errors.txt : Remove error numbers added earlier.
28904
28905         * ../errors/cs1019.cs : Test case for error # 1019
28906
28907         * ../errros/cs1020.cs : Test case for error # 1020
28908
28909         * cs-parser.jay : Clean out commented cruft.
28910         (dimension_separators, dimension_separator): Comment out. Ostensibly not
28911         used anywhere - non-reducing rule.
28912         (namespace_declarations): Non-reducing rule - comment out.
28913
28914         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
28915         with TypeContainer::AddEnum.
28916
28917         * delegate.cs : New file for delegate handling classes.
28918         (Delegate): Class for declaring delegates.
28919
28920         * makefile : Update.
28921
28922         * cs-parser.jay (delegate_declaration): Implement.
28923
28924 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
28925
28926         * class.cs (Event::Define): Implement.
28927         (Event.EventBuilder): New member.
28928
28929         * class.cs (TypeContainer::Populate): Update to define all enums and events
28930         we have.
28931         (Events): New property for the events arraylist we hold. Shouldn't we move to using
28932         readonly fields for all these cases ?
28933
28934 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
28935
28936         * class.cs (Property): Revamp to use the convention of making fields readonly.
28937         Accordingly modify code elsewhere.
28938
28939         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
28940         the Define method of the Property class.
28941
28942         * class.cs : Clean up applied patch and update references to variables etc. Fix 
28943         trivial bug.
28944         (TypeContainer::Populate): Update to define all the properties we have. Also
28945         define all enumerations.
28946
28947         * enum.cs (Define): Implement.
28948
28949 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
28950
28951         * cs-parser.jay (overloadable_operator): The semantic value is an
28952         enum of the Operator class.
28953         (operator_declarator): Implement actions.
28954         (operator_declaration): Implement.
28955
28956         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
28957         validity of definitions.
28958         (Operator::CheckBinaryOperator): Static method to check for binary operators
28959         (TypeContainer::AddOperator): New method to add an operator to a type.
28960
28961         * cs-parser.jay (indexer_declaration): Added line to actually call the
28962         AddIndexer method so it gets added ;-)
28963
28964         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
28965         already taken care of by the MS compiler ?  
28966
28967 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
28968
28969         * class.cs (Operator): New class for operator declarations.
28970         (Operator::OpType): Enum for the various operators.
28971
28972 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
28973
28974         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
28975         ostensibly handle this in semantic analysis.
28976
28977         * cs-parser.jay (general_catch_clause): Comment out
28978         (specific_catch_clauses, specific_catch_clause): Ditto.
28979         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
28980         (catch_args, opt_catch_args): New productions.
28981         (catch_clause): Rewrite to use the new productions above
28982         (catch_clauses): Modify accordingly.
28983         (opt_catch_clauses): New production to use in try_statement
28984         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
28985         and re-write the code in the actions to extract the specific and
28986         general catch clauses by being a little smart ;-)
28987
28988         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
28989         Hooray, try and catch statements parse fine !
28990
28991 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
28992
28993         * statement.cs (Block::GetVariableType): Fix logic to extract the type
28994         string from the hashtable of variables.
28995
28996         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
28997         I end up making that mistake ;-)
28998         (catch_clauses): Fixed gross error which made Key and Value of the 
28999         DictionaryEntry the same : $1 !!
29000
29001 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29002
29003         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
29004
29005         * cs-parser.jay (event_declaration): Correct to remove the semicolon
29006         when the add and remove accessors are specified. 
29007
29008 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
29009
29010         * cs-parser.jay (IndexerDeclaration): New helper class to hold
29011         information about indexer_declarator.
29012         (indexer_declarator): Implement actions.
29013         (parsing_indexer): New local boolean used to keep track of whether
29014         we are parsing indexers or properties. This is necessary because 
29015         implicit_parameters come into picture even for the get accessor in the 
29016         case of an indexer.
29017         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
29018
29019         * class.cs (Indexer): New class for indexer declarations.
29020         (TypeContainer::AddIndexer): New method to add an indexer to a type.
29021         (TypeContainer::indexers): New member to hold list of indexers for the
29022         type.
29023
29024 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
29025
29026         * cs-parser.jay (add_accessor_declaration): Implement action.
29027         (remove_accessor_declaration): Implement action.
29028         (event_accessors_declaration): Implement
29029         (variable_declarators): swap statements for first rule - trivial.
29030
29031         * class.cs (Event): New class to hold information about event
29032         declarations.
29033         (TypeContainer::AddEvent): New method to add an event to a type
29034         (TypeContainer::events): New member to hold list of events.
29035
29036         * cs-parser.jay (event_declaration): Implement actions.
29037
29038 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
29039
29040         * cs-parser.jay (dim_separators): Implement. Make it a string
29041         concatenating all the commas together, just as they appear.
29042         (opt_dim_separators): Modify accordingly
29043         (rank_specifiers): Update accordingly. Basically do the same
29044         thing - instead, collect the brackets here.
29045         (opt_rank_sepcifiers): Modify accordingly.
29046         (array_type): Modify to actually return the complete type string
29047         instead of ignoring the rank_specifiers.
29048         (expression_list): Implement to collect the expressions
29049         (variable_initializer): Implement. We make it a list of expressions
29050         essentially so that we can handle the array_initializer case neatly too.
29051         (variable_initializer_list): Implement.
29052         (array_initializer): Make it a list of variable_initializers
29053         (opt_array_initializer): Modify accordingly.
29054
29055         * expression.cs (New::NType): Add enumeration to help us
29056         keep track of whether we have an object/delegate creation
29057         or an array creation.
29058         (New:NewType, New::Rank, New::Indices, New::Initializers): New
29059         members to hold data about array creation.
29060         (New:New): Modify to update NewType
29061         (New:New): New Overloaded contructor for the array creation
29062         case.
29063
29064         * cs-parser.jay (array_creation_expression): Implement to call
29065         the overloaded New constructor.
29066
29067 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
29068
29069         * class.cs (TypeContainer::Constructors): Return member
29070         constructors instead of returning null.
29071
29072 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
29073
29074         * typemanager.cs (InitCoreTypes): Initialize the various core
29075         types after we have populated the type manager with the user
29076         defined types (this distinction will be important later while
29077         compiling corlib.dll)
29078
29079         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
29080         on Expression Classification.  Now all expressions have a method
29081         `Resolve' and a method `Emit'.
29082
29083         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
29084         generation from working.     Also add some temporary debugging
29085         code. 
29086
29087 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
29088
29089         * codegen.cs: Lots of code generation pieces.  This is only the
29090         beginning, will continue tomorrow with more touches of polish.  We
29091         handle the fundamentals of if, while, do, for, return.  Others are
29092         trickier and I need to start working on invocations soon.
29093
29094         * gen-treedump.cs: Bug fix, use s.Increment here instead of
29095         s.InitStatement. 
29096
29097         * codegen.cs (EmitContext): New struct, used during code
29098         emission to keep a context.   Most of the code generation will be
29099         here. 
29100
29101         * cs-parser.jay: Add embedded blocks to the list of statements of
29102         this block.  So code generation proceeds in a top down fashion.
29103
29104 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
29105
29106         * statement.cs: Add support for multiple child blocks.
29107
29108 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
29109
29110         * codegen.cs (EmitCode): New function, will emit the code for a
29111         Block of code given a TypeContainer and its ILGenerator. 
29112
29113         * statement.cs (Block): Standard public readonly optimization.
29114         (Block::Block constructors): Link children. 
29115         (Block::Child): Child Linker.
29116         (Block::EmitVariables): Emits IL variable declarations.
29117
29118         * class.cs: Drop support for MethodGroups here, delay until
29119         Semantic Analysis.
29120         (Method::): Applied the same simplification that I did before, and
29121         move from Properties to public readonly fields.
29122         (Method::ParameterTypes): Returns the parameter types for the
29123         function, and implements a cache that will be useful later when I
29124         do error checking and the semantic analysis on the methods is
29125         performed.
29126         (Constructor::GetCallingConvention): Renamed from CallingConvetion
29127         and made a method, optional argument tells whether this is a class
29128         or a structure to apply the `has-this' bit.
29129         (Method::GetCallingConvention): Implement, returns the calling
29130         convention. 
29131         (Method::Define): Defines the type, a second pass is performed
29132         later to populate the methods.
29133
29134         (Constructor::ParameterTypes): implement a cache similar to the
29135         one on Method::ParameterTypes, useful later when we do semantic
29136         analysis. 
29137
29138         (TypeContainer::EmitMethod):  New method.  Emits methods.
29139
29140         * expression.cs: Removed MethodGroup class from here.
29141
29142         * parameter.cs (Parameters::GetCallingConvention): new method.
29143
29144 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
29145
29146         * class.cs (TypeContainer::Populate): Drop RootContext from the
29147         argument. 
29148
29149         (Constructor::CallingConvention): Returns the calling convention.
29150         (Constructor::ParameterTypes): Returns the constructor parameter
29151         types. 
29152
29153         (TypeContainer::AddConstructor): Keep track of default constructor
29154         and the default static constructor.
29155
29156         (Constructor::) Another class that starts using `public readonly'
29157         instead of properties. 
29158
29159         (Constructor::IsDefault): Whether this is a default constructor. 
29160
29161         (Field::) use readonly public fields instead of properties also.
29162
29163         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
29164         track of static constructors;  If none is used, turn on
29165         BeforeFieldInit in the TypeAttributes. 
29166
29167         * cs-parser.jay (opt_argument_list): now the return can be null
29168         for the cases where there are no arguments. 
29169
29170         (constructor_declarator): If there is no implicit `base' or
29171         `this', then invoke the default parent constructor. 
29172
29173         * modifiers.cs (MethodAttr): New static function maps a set of
29174         modifiers flags into a MethodAttributes enum
29175         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
29176         MethodAttr, TypeAttr to represent the various mappings where the
29177         modifiers are used.
29178         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
29179
29180 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
29181
29182         * parameter.cs (GetParameterInfo): Fix bug where there would be no
29183         method arguments.
29184
29185         * interface.cs (PopulateIndexer): Implemented the code generator
29186         for interface indexers.
29187
29188 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
29189
29190         * interface.cs (InterfaceMemberBase): Now we track the new status
29191         here.  
29192
29193         (PopulateProperty): Implement property population.  Woohoo!  Got
29194         Methods and Properties going today. 
29195
29196         Removed all the properties for interfaces, and replaced them with
29197         `public readonly' fields. 
29198
29199 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
29200
29201         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
29202         initialize their hashtables/arraylists only when they are needed
29203         instead of doing this always.
29204
29205         * parameter.cs: Handle refs and out parameters.
29206
29207         * cs-parser.jay: Use an ArrayList to construct the arguments
29208         instead of the ParameterCollection, and then cast that to a
29209         Parameter[] array.
29210
29211         * parameter.cs: Drop the use of ParameterCollection and use
29212         instead arrays of Parameters.
29213
29214         (GetParameterInfo): Use the Type, not the Name when resolving
29215         types. 
29216
29217 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
29218
29219         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
29220         and instead use public readonly fields.
29221
29222         * class.cs: Put back walking code for type containers.
29223
29224 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
29225
29226         * class.cs (MakeConstant): Code to define constants.
29227
29228         * rootcontext.cs (LookupType): New function.  Used to locate types 
29229
29230
29231 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
29232
29233         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
29234         this System.Reflection code is.  Kudos to Microsoft
29235
29236         * typemanager.cs: Implement a type cache and avoid loading all
29237         types at boot time.  Wrap in LookupType the internals.  This made
29238         the compiler so much faster.  Wow.  I rule!
29239
29240         * driver.cs: Make sure we always load mscorlib first (for
29241         debugging purposes, nothing really important).
29242
29243         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
29244         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
29245
29246         * rootcontext.cs: Lookup types on their namespace;  Lookup types
29247         on namespaces that have been imported using the `using' keyword.
29248
29249         * class.cs (TypeContainer::TypeAttr): Virtualize.
29250         (Class::TypeAttr): Return attributes suitable for this bad boy.
29251         (Struct::TypeAttr): ditto.
29252         Handle nested classes.
29253         (TypeContainer::) Remove all the type visiting code, it is now
29254         replaced with the rootcontext.cs code
29255
29256         * rootcontext.cs (GetClassBases): Added support for structs. 
29257
29258 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
29259
29260         * interface.cs, statement.cs, class.cs, parameter.cs,
29261         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
29262         Drop use of TypeRefs, and use strings instead.
29263
29264 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
29265
29266         * rootcontext.cs: 
29267
29268         * class.cs (Struct::Struct): set the SEALED flags after
29269         checking the modifiers.
29270         (TypeContainer::TypeAttr): new property, returns the
29271         TypeAttributes for a class.  
29272
29273         * cs-parser.jay (type_list): Oops, list production was creating a
29274         new list of base types.
29275
29276         * rootcontext.cs (StdLib): New property.
29277         (GetInterfaceTypeByName): returns an interface by type name, and
29278         encapsulates error handling here.
29279         (GetInterfaces): simplified.
29280         (ResolveTree): Encapsulated all the tree resolution here.
29281         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
29282         types. 
29283
29284         * driver.cs: Add support for --nostdlib, to avoid loading the
29285         default assemblies.
29286         (Main): Do not put tree resolution here. 
29287
29288         * rootcontext.cs: Beginning of the class resolution.
29289
29290 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
29291
29292         * rootcontext.cs: Provide better error reporting. 
29293
29294         * cs-parser.jay (interface_base): set our $$ to be interfaces.
29295
29296         * rootcontext.cs (CreateInterface): Handle the case where there
29297         are no parent interfaces.
29298
29299         (CloseTypes): Routine to flush types at the end.
29300         (CreateInterface): Track types.
29301         (GetInterfaces): Returns an array of Types from the list of
29302         defined interfaces.
29303
29304         * typemanager.c (AddUserType): Mechanism to track user types (puts
29305         the type on the global type hash, and allows us to close it at the
29306         end). 
29307
29308 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
29309
29310         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
29311         RecordInterface instead.
29312
29313         * cs-parser.jay: Updated to reflect changes above.
29314
29315         * decl.cs (Definition): Keep track of the TypeBuilder type that
29316         represents this type here.  Not sure we will use it in the long
29317         run, but wont hurt for now.
29318
29319         * driver.cs: Smaller changes to accomodate the new code.
29320
29321         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
29322         when done. 
29323
29324         * rootcontext.cs (CreateInterface):  New method, used to create
29325         the System.TypeBuilder type for interfaces.
29326         (ResolveInterfaces): new entry point to resolve the interface
29327         hierarchy. 
29328         (CodeGen): Property, used to keep track of the code generator.
29329
29330 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
29331
29332         * cs-parser.jay: Add a second production for delegate_declaration
29333         with `VOID'.
29334
29335         (enum_body): Put an opt_comma here instead of putting it on
29336         enum_body or enum_member_declarations so we can handle trailing
29337         commas on enumeration members.  Gets rid of a shift/reduce.
29338
29339         (type_list): Need a COMMA in the middle.
29340
29341         (indexer_declaration): Tell tokenizer to recognize get/set
29342
29343         * Remove old targets.
29344
29345         * Re-add the parser target.
29346
29347 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29348
29349         * cs-parser.jay: Add precendence rules for a number of operators
29350         ot reduce the number of shift/reduce conflicts in the grammar.
29351
29352 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
29353
29354         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
29355         and put it here.
29356
29357         Get rid of old crufty code.
29358
29359         * rootcontext.cs: Use this to keep track of the parsed
29360         representation and the defined types available to the program. 
29361
29362         * gen-treedump.cs: adjust for new convention.
29363
29364         * type.cs: Split out the type manager, and the assembly builder
29365         from here. 
29366
29367         * typemanager.cs: the type manager will live here now.
29368
29369         * cil-codegen.cs: And the code generator here. 
29370
29371 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
29372
29373         * makefile: Fixed up for easy making.
29374
29375 2001-07-13  Simon Cozens <simon@simon-cozens.org>
29376
29377         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
29378         the 
29379
29380         (unary_expression): Expand pre_increment_expression and
29381         post_decrement_expression to reduce a shift/reduce.
29382
29383 2001-07-11  Simon Cozens
29384
29385         * cs-tokenizer.cs: Hex numbers should begin with a 0.
29386
29387         Improve allow_keyword_as_indent name.
29388
29389 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
29390
29391         * Adjustments for Beta2. 
29392
29393 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
29394
29395         * decl.cs: Added `Define' abstract method.
29396         (InTransit): new property, used to catch recursive definitions. 
29397
29398         * interface.cs: Implement `Define'. 
29399
29400         * modifiers.cs: Map Modifiers.constants to
29401         System.Reflection.TypeAttribute flags.
29402
29403         * class.cs: Keep track of types and user-defined types.
29404         (BuilderInit): New method for creating an assembly
29405         (ResolveType): New function to launch the resolution process, only
29406         used by interfaces for now.
29407
29408         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
29409         that are inserted into the name space. 
29410
29411 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
29412
29413         * ARGH.  I have screwed up my tree so many times due to the use of
29414         rsync rather than using CVS.  Going to fix this at once. 
29415
29416         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
29417         load types.
29418
29419 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
29420
29421         * Experiment successful: Use System.Type rather that our own
29422         version of Type.  
29423
29424 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
29425
29426         * cs-parser.jay: Removed nsAliases from here.
29427
29428         Use new namespaces, handle `using XXX;' 
29429
29430         * namespace.cs: Reimplemented namespace handling, use a recursive
29431         definition of the class.  Now we can keep track of using clauses
29432         and catch invalid using clauses.
29433
29434 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
29435
29436         * gen-treedump.cs: Adapted for all the renaming.
29437
29438         * expression.cs (Expression): this class now has a Type property
29439         which returns an expression Type.
29440
29441         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
29442         `Type', as this has a different meaning now in the base
29443
29444 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
29445
29446         * interface.cs, class.cs: Removed from all the sources the
29447         references to signature computation, as we can not do method
29448         signature computation during the parsing time, as we are not
29449         trying to solve at that point distinguishing:
29450
29451         class X {
29452                 void a (Blah x) {}
29453                 void a (NS.Blah x) {}
29454         }
29455
29456         Which depending on the context might be valid or not, as we do not
29457         know if Blah is the same thing as NS.Blah at that point.
29458
29459         * Redid everything so the code uses TypeRefs now instead of
29460         Types.  TypeRefs are just temporary type placeholders, that need
29461         to be resolved.  They initially have a pointer to a string and the
29462         current scope in which they are used.  This is used later by the
29463         compiler to resolve the reference to an actual Type. 
29464
29465         * DeclSpace is no longer a CIR.Type, and neither are
29466         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
29467         are all DeclSpaces, but no Types. 
29468
29469         * type.cs (TypeRefManager): This implements the TypeRef manager,
29470         which keeps track of all the types that need to be resolved after
29471         the parsing has finished. 
29472
29473 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
29474
29475         * ARGH.  We are going to have to store `foreach' as a class rather
29476         than resolving it, as we need to verify error 1579 after name
29477         resolution.   *OR* we could keep a flag that says `This request to
29478         IEnumerator comes from a foreach statement' which we can then use
29479         to generate the error.
29480
29481 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
29482
29483         * class.cs (TypeContainer.AddMethod): we now add methods to the
29484         MethodGroup instead of the method hashtable.  
29485
29486         * expression.cs: Add MethodGroup abstraction, which gets us one
29487         step closer to the specification in the way we handle method
29488         declarations.  
29489
29490         * cs-parser.jay (primary_expression): qualified_identifier now
29491         tried to match up an identifier to a local variable reference or
29492         to a parameter reference.
29493
29494         current_local_parameters is now a parser global variable that
29495         points to the current parameters for the block, used during name
29496         lookup.
29497
29498         (property_declaration): Now creates an implicit `value' argument to
29499         the set accessor.
29500
29501 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
29502
29503         * parameter.cs: Do not use `param' arguments as part of the
29504         signature, per the spec.
29505
29506 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
29507
29508         * decl.cs: Base class for classes, structs and interfaces.  This
29509         is the "Declaration Space" 
29510
29511         * cs-parser.jay: Use CheckDef for checking declaration errors
29512         instead of having one on each function.
29513
29514         * class.cs: Factor out some code for handling error handling in
29515         accordance to the "Declarations" section in the "Basic Concepts"
29516         chapter in the ECMA C# spec.
29517
29518         * interface.cs: Make all interface member classes derive from
29519         InterfaceMemberBase.
29520
29521 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
29522
29523         * Many things: all interfaces are parsed and generated in
29524         gen-treedump.  Support for member variables, constructors,
29525         destructors, properties, constants is there.
29526
29527         Beginning of the IL backend, but very little done, just there for
29528         testing purposes. 
29529
29530 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
29531
29532         * cs-parser.jay: Fix labeled statement.
29533
29534         * cs-tokenizer.cs (escape): Escape " and ' always.
29535         ref_line, ref_name: keep track of the line/filename as instructed
29536         by #line by the compiler.
29537         Parse #line.
29538
29539 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
29540
29541         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
29542         to match the values in System.CodeDOM.
29543
29544         Divid renamed to Divide.
29545
29546         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
29547         statements. 
29548         (Statements.set): remove.
29549
29550         * System.CodeDOM/CodeCatchClause.cs: always have a valid
29551         statements. 
29552
29553         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
29554         falseStatements always have valid values. 
29555
29556         * cs-parser.jay: Use System.CodeDOM now.
29557